Access to Modifier Methods Requires the
modifier to be open in the Modify Panel: Many modifier methods return incorrect values unless that
modifier is the active modifier in the modify panel. This is a reall
problem, and these methods should return correct results, even if not
the active modifier. Here are some examples...
Try the following steps
1) Open a new max file. Create a Plane with 1 face. Collapse it to
Editable poly. Add a Unwrap UVW modifier on it.
2) Select Plane01
3) Go to modify panel, open up the unwrap, click edit, you should see
the object's uvs.
4) Run the following maxscript code...
obj1 = $Plane01 sourceverts = polyop.getMapFace obj1 1 1 for v in sourceverts do ( print (obj1.modifiers.unwrap.getVertexPosition currenttime v) )
You should see results
These are the results you expect.
5) Close the UV Window.
6) Click on the modifier to get out of subobject mode
7) Deselect the object
8) Run the code a second time
You should see results like this...
which are totally wrong. This is because of a limitation that exists in
the Unwrap UVW modifier. From the maxscript help...
"The following methods require that the Unwrap UVW modifier be
the displayed modifier in the Modify panel, and that the Modify panel
This is a pretty major limitation, especially when dealing with a
number of objects. Say you want to perform a script operation on a
selection of 1000 objects. Rather than just giving commands such as
getVertexPosition to an object, you have to have the script select the
object first, then change to the modify panel, then open up the
interface. This slows down the running time of any script by a large
factor, since it needs to perform a bunch of ui manipulation just to
modify some parameters to an object.
I would like to see these methods work properly even if you don't have
the object selected, and without the need for the modifier panel to be
open, or the Edit UV window open.
Make an object, say a cube, collapse to editablepoly, then run this