Created
February 18, 2018 01:19
-
-
Save tpoveda/fd49f0adfec846b790e7a0f3673083e0 to your computer and use it in GitHub Desktop.
FreezeTransforms programatically in 3ds Max - MaxScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn FreezeTransforms obj = | |
( | |
local curObj = obj | |
if classOf curObj.rotation.controller != Rotation_Layer do | |
( | |
-- Freeze rotation | |
curObj.rotation.controller = Euler_Xyz() | |
curObj.rotation.controller = Rotation_List() | |
curObj.rotation.controller.available.controller = Euler_Xyz() | |
-- Rename rotation controllers | |
curObj.rotation.controller.SetName 1 "Frozen Rotation" | |
curObj.rotation.controller.SetName 2 "Zero Euler XYZ" | |
-- Set the new rotation controller as the active controller | |
curObj.rotation.controller.SetActive 2 | |
) | |
if classOf curObj.position.controller != Position_Layer do | |
( | |
-- Freeze position | |
curObj.position.controller = Bezier_Position() | |
curObj.position.controller = Position_List() | |
curObj.position.controller.available.controller = Position_XYZ() | |
-- Rename rotation controllers | |
curObj.position.controller.SetName 1 "Frozen Position" | |
curObj.position.controller.SetName 2 "Zero Pos XYZ" | |
-- Set the new position controller as the active controller actual | |
curObj.position.controller.SetActive 2 | |
-- Reset the position of the actual position controller to zero | |
curObj.position.controller[2].x_Position = 0 | |
curObj.position.controller[2].y_Position = 0 | |
curObj.position.controller[2].z_Position = 0 | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment