[Closed] setTransformLockFlags not worcking properlly
I plaied a bit with setTransformLockFlags function and noticed some problems. In the folowing code node stands for my node. Wile this worcks well:
setTransformLockFlags node #all
also this:
setTransformLockFlags node #{1}
or this:
setTransformLockFlags node #{2}
Other bitArray walues not worcking properlly or even not worck at all. For example if I use this code:
setTransformLockFlags node #{6}
and after that try to set value for Z rotation of the node, the value is used for X rotation istead. If I use this code:
setTransformLockFlags node #{7}
or this:
setTransformLockFlags node #{8}
it has no effect at all.
i copied this function from my old tool… it worked for years:
mapped fn setLinkInfo node lockType:#none lockFlags: inheritType:#all inheritFlags: keepPos:off =
(
if lockFlags == unsupplied do lockFlags =
(
case lockType of
(
#all: #all
#none: #none
#all_p: #{1..3}
#all_r: #{4..6}
#all_s: #{7..9}
#non_p: #{4..9}
#non_px: #{2..9}
#non_r: #{1..3, 7..9}
#non_rz: #{1..5, 7..9}
#non_s: #{1..6}
)
)
if (lockFlags != undefined) do setTransformLockFlags node lockFlags
if inheritFlags == unsupplied do inheritFlags =
(
case inheritType of
(
#all: #all
#none: #none
#all_p: #{1..3}
#all_r: #{4..6}
#all_s: #{7..9}
#non_p: #{4..9}
#non_r: #{1..3, 7..9}
#non_s: #{1..6}
)
)
if (inheritFlags != undefined) do setInheritanceFlags node inheritFlags keepPos:keepPos
)
But when I use:
setTransformLockFlags node #{7..9}
it doesn´t worck. Am I doing something wrong?
Like mentioned in the very first post node is just a placeholder for the real variable name of the node. My code is exactlly that 1 line, as I just want to disable scale for my node.
“node” has to be a pointer to real node not a name of node. Try to use selection (selection[1] or $).
I said name of variable, not name of node. For example:
b=box()
where b is the name of variable. I already tried $ while the node was selected, but no result for scale, some other flags worck. Posibly a bug of the old max version?