[Closed] different result when scripting
nevermind, found it!
Hiya,
probably a simple question
suppose there’s a box at position [5,0,0]
when applying an xform modifier via scripting ( addmodifier $ (xform ()) )
then $.transform equals (matrix3 [1,0,0] [0,1,0] [0,0,1] [5,0,0])
when applying an xform modifier manually
then (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])
Why does this difference in row4 of the transform matrix occur? And how can I get the same result in scripting?
thnx,
Obi
What do you have your reference coordinate system set to on the main toolbar? I have mine set to the default “view” and I get the same transform results (matrix3 [1,0,0] [0,1,0] [0,0,1] [5,0,0]) regardless of whether I apply an XForm modifier via the modifier panel or via MaxScript.
From your results it looks like the modifier is being applied in worldspace when you use MaxScript and in localspace when use use the modifier panel. Read the MaxScript docs under the topic of “coordsys” to learn how to change the coordinate system context in MaxScript as necessary.