def shirt_to_nCloth(): # convert shirt to nCloth cmds.select(clear=True) cmds.select("shirt") mel.eval("doCreateNCloth 0;") mel.eval('setAttr "nClothShape1.thickness" 0.001;') mel.eval('setAttr "nClothShape1.selfCollideWidthScale" 0.001;') # Different material presets presets.custom_shirt_cloth()
def shirt_to_nCloth(): cmds.loadPlugin("objExport") mel.eval('file -f -options "mo=1" -ignoreVersion -typ "OBJ" -o "%s";' \ % sys.argv[1]) # scale shirt to fit bbx = cmds.xform("shirt", q=True, bb=True, ws=True) s_x_len = bbx[3] - bbx[0] s_y_len = bbx[4] - bbx[1] if (s_x_len >= s_y_len): scale = 0.8 * TABLE_SIZE / s_x_len else: scale = 0.8 * TABLE_SIZE / s_y_len cmds.scale(scale, scale, scale, "shirt", centerPivot=True) # convert shirt to nCloth cmds.select(clear=True) cmds.select("shirt") mel.eval("doCreateNCloth 0;") mel.eval('setAttr "nClothShape1.thickness" 0.001;') mel.eval('setAttr "nClothShape1.selfCollideWidthScale" 0.001;') # Different material presets presets.custom_shirt_cloth()
def shirt_to_nCloth(): cmds.loadPlugin("objExport") mel.eval('file -f -options "mo=1" -ignoreVersion -typ "OBJ" -o "%s";' \ % sys.argv[1]) # scale shirt to fit bbx = cmds.xform("shirt", q=True, bb=True, ws=True) s_x_len = bbx[3] - bbx[0] s_y_len = bbx[4] - bbx[1] if (s_x_len >= s_y_len): scale = 0.8 * TABLE_SIZE/s_x_len else: scale = 0.8 * TABLE_SIZE/s_y_len cmds.scale(scale, scale, scale, "shirt", centerPivot = True) # convert shirt to nCloth cmds.select(clear=True) cmds.select("shirt") mel.eval("doCreateNCloth 0;") mel.eval('setAttr "nClothShape1.thickness" 0.001;') mel.eval('setAttr "nClothShape1.selfCollideWidthScale" 0.001;') # Different material presets presets.custom_shirt_cloth()