[Closed] Newbie Question 1: From Max's "How to" tuts
All right, So am ready to dive into MaxScript at last. So expect a lot of questions from me. Hope somebody will find time to respond. All right, here goes:
In How to … develop a Transform Lock Script,
I have understood the use of setTransformLockFlags.
However, I am unable to understand the use of getTransformLockFlags.
ie, How to use it in an ‘if’ statement?
Not exactly able to find in the manual also.
Thanks!
Saurabh.
getTransformLockFlags() returns a bit array. There’s no way you can use it directly as the clause in an if statement.
What you could do is use the index of the element in the array you want to check in an if statement.
local MyNode = getNodeByName <nodename as string>
local MyArray = getTransformLockFlags MyNode
if MyArray[n] then
(
– do code if the bit is on
)
else
(
– do code if the bit is off
)
The order of the bits in the returned bitarray from getTransformLockFlags() are Pos_X, Pos_Y, Pos_Z, Rot_X, Rot_Y, Rot_Z, Scale_X, Scale_Y, Scale_Z
The best place to find out how the various MAXScript operators and methods work is the MAXScript Reference help file. Make sure you have the latest version and get comfortable with it. It is very very useful.
Hi Jeff,
Thanks for responding. Yup, that’s the way one should go about it. Actually I had looked up in the Maxscript Reference and had found the info about it. But I was confused as to how to use a bit array in an if statment. Thanks for the clarification.
Regards,
sa