Notifications
Clear all

[Closed] Freeze transform

hi! my cuestion is…
You can freeze transform of an object in maxscript?
for example: $. freezeTransform or similar

5 Replies

you can do it like that yes,

but it’s definitely a good idea to look at what’s inside the macroscript, it’ll keep things much more flexible…

for example when you’re just running that macro from within your own scripts, you always need to select stuff first (manually or using maxscript), this really isn’t the optimum way of doing stuff though

in reply to your first post, you could write your own function to do this, just take the meat of the macroscript and wrap a function definition around it. that will allow you to run the script on a bunch of objects without having to select them first

setTransformLockFlags $ #all

This turns on all the locks under Link Info (found on the Hierarchy panel).

Hopefully that is what you needed. You can find more about that in the Maxscript reference as well.

Sorry, but it is not to block the changes. I try to apply freeze transform into alt + right click on an object
I find nothing in maxscript helper

Freeze transform is just a macroscript, you can access the source code here:

\ui\macroscripts\Macro_FreezeTransform.mcr

If you wanna use those functions in your script, you’ll have to copy them somewhere since they only exist in the scope of their macroscript.

Thanks, I finally used this…


fn FreezeTransform item = 	
		( 		
			local CurObj = item	

			if classof CurObj.rotation.controller != Rotation_Layer do
			(
				CurObj.rotation.controller = Euler_Xyz() 		
				CurObj.rotation.controller = Rotation_list() 			
				CurObj.rotation.controller.available.controller = Euler_xyz() 		
				CurObj.rotation.controller.setname 1 "Frozen Rotation" 		
				CurObj.rotation.controller.setname 2 "Zero Euler XYZ" 		
				CurObj.rotation.controller.SetActive 2 		
			)
			if classof CurObj.position.controller != Position_Layer do
			(
				CurObj.position.controller = Bezier_Position() 			
				CurObj.position.controller = position_list() 			
				CurObj.position.controller.available.controller = Position_XYZ() 	
				CurObj.position.controller.setname 1 "Frozen Position" 	
				CurObj.position.controller.setname 2 "Zero Pos XYZ" 			
				CurObj.position.controller.SetActive 2 		
				CurObj.Position.controller[2].x_Position = 0
				CurObj.Position.controller[2].y_Position = 0
				CurObj.Position.controller[2].z_Position = 0
			)

		)

but, i have another question…
If I change the name object, how I can call to apply frozen?
I used this…


nameNew = baseName.text --- text input to edittext
$obj.name = nameNew + "_" + $obj.name