Notifications
Clear all

[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.

8 Replies

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
)

So if you woud do:

setLinkInfo node lockType:#all_s

is it worcking?

yes. it works. it sets all scale locks ON

But when I use:

setTransformLockFlags node #{7..9}

it doesn´t worck. Am I doing something wrong?

@gtafan All of your code examples work for me. Maybe try not using the word “node” as your variable since it’s a reserved word in global scope. Without seeing the rest of your code that’s the only guess I have.

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 $).

1 Reply
(@gtafan)
Joined: 1 year ago

Posts: 0

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?