string $array[] = `ls -sl`;
polySelectConstraint -m 3 -t 0x8000 -sm 1;
polyCrease -v 10.0;
polyCleanupArgList 4 { "0","1","1","0","1","0","0","0","1","1.5e-05","1","1e-05","0","1e-05","0","1","1","0" };
select -r $array;
setAttr ($array[0] + ".smoothLevel")(1);
displaySmoothness -divisionsU 3 -divisionsV 3 -pointsWire 16 -pointsShaded 4 -polygonObject 3;
CreatePolyFromPreview;
If I do these steps manually. It works fine.
Replies
Same here. 2018. I debugged line by line and apparently there is a problem with
displaySmoothness -divisionsU 3 -divisionsV 3 -pointsWire 16 -pointsShaded 4 -polygonObject 3;
Edit: I found the problem. It wasn't script but my damn mesh.
This is what I got when I manually applied (Pressing 3):
// Warning: OpenSubdiv gets different edge topology to Maya poly. //
// Warning: Fail to create OpenSubdiv TopologyRefiner. //
// Warning: The OpenSubdiv Catmull-Clark subdivision method cannot be applied to non-manifold geometry. upper_receiver2Shape will use "Maya Catmull-Clark" subdivision method for Smooth Mesh Preview. //
So basically when you do it manually Maya will try to apply OSubDiv method but if it fails it will fall back to Maya subdiv method(Which apparently works on Non-Manifold geometry). But if you do it via script it will try to apply OSubDiv but if it fails it goes most likely into panic mode and crashes the program. I managed to fix this by switching global subdivison preference to Maya.