home *** CD-ROM | disk | FTP | other *** search
- -- Easy Constraint Assignment MacroScript File
- --
- -- Created: April 7 2000
- -- Last Updated: January 2 2001
- --
- -- Author : Frank DeLise
- -- Version: 3ds max 4
- --
- -- Constraint tools
- -- This script increases workflow on assigning constraints by adding a list controller automatically.
- --***********************************************************************************************
- -- MODIFY THIS AT YOUR OWN RISK
-
- -- Aug 15 added prompting
- -- Aug 20 added LinkConstraint
- -- Nov 6 added "H" key support ForceListenerFocus
- -- Dec 14 Added Biped Support
- -- Dec 18 Fixed LookAt, Orientation and Noise Rotation constraints - passing wrong channel to AddConstraint
- -- Jan 4 Added support for HI IK and HD IK objects; Added group support
-
- MacroScript Path
-
- ButtonText:"Path Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Path Constraint"
- SilentErrors:(Debug != false)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
-
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[1].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn ShapeFilt o = superClassOf o == Shape and o != EC_OBJ
-
- -------------------------------------------------------------------------------------------
-
- --Format "%\n" ("Pick Shape to Constrain " + EC_OBJ.name + " to:") to:Listener
-
- EC_TargetOBJ = PickObject count:1 select:true filter:ShapeFilt message:"Pick Shape to Constrain to.." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Pos" Position_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- -------------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Path then constraint = AddConstraint EC_OBJ "Pos" Path true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Add Position Constraint Objects
- -------------------------------------------------------------------------------------------
-
- constraint.AppendTarget EC_TargetOBJ 50
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- --Format "%\n" (EC_OBJ.name + " is Path Constrained to " + EC_TargetOBJ.name) to:Listener
-
- -------------------------------------------------------------------------------------------
- Select EC_OBJ
- )
- )
- Catch (MessageBox "Path Constraint Not Completed" Title:"Constraints")
- )
- )
-
-
- MacroScript LinkConstraint
-
- ButtonText:"Link Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Link Constraint"
- SilentErrors:(Debug != True)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
-
- -- Check to see if something is selected
-
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn SameFilt o = o != EC_OBJ
- -------------------------------------------------------------------------------------------
-
- --Format "%\n" ("Pick Object to Link " + EC_OBJ.name + " to:") to:Listener
-
- -------------------------------------------------------------------------------------------
- -- Pick Target Object
- -------------------------------------------------------------------------------------------
-
- EC_TargetOBJ = PickObject count:1 select:true Filter:SameFilt message:"Pick Object to Link to.." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
- ---------------------------------------------------------------------------------------
- -- Add Constraint
- -- If it's not a link constraint already, check for IK object and IK goal object
- ---------------------------------------------------------------------------------------
- local constraint
- if Classof EC_OBJ.controller == IKControl then (constraint = EC_OBJ.Transform.controller.fk_sub_control.controller)
- else if Classof EC_OBJ.controller == IKChainControl then (constraint = EC_OBJ.Transform.controller.ik_goal.controller)
- else (constraint = EC_OBJ.Transform.controller)
- If Classof constraint != Link_Constraint do
- (
- constraint = Link_Constraint ()
- if Classof EC_OBJ.controller == IKControl then (EC_OBJ.Transform.controller.fk_sub_control.controller = constraint)
- else if Classof EC_OBJ.controller == IKChainControl then (EC_OBJ.Transform.controller.ik_goal.controller = constraint)
- else (EC_OBJ.Transform.controller = constraint)
- )
-
- ---------------------------------------------------------------------------------------
- -- Add Links to Link Constraint
- ---------------------------------------------------------------------------------------
-
- if Classof EC_OBJ.controller == IKControl then EC_OBJ.controller.fk_sub_control.controller.AddTarget EC_TargetOBJ SliderTime
- else if Classof EC_OBJ.controller == IKChainControl then EC_OBJ.controller.ik_goal.controller.AddTarget EC_TargetOBJ SliderTime
- else EC_OBJ.Transform.controller.AddTarget EC_TargetOBJ SliderTime
-
- Select EC_OBJ
- )
- )
- Catch (MessageBox "Link Constraint Not Completed" Title:"Constraints")
- )
- )
-
-
- MacroScript Position_Constraint
-
- ButtonText:"Position Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Position Constraint"
- SilentErrors:(Debug != True)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
-
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[1].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn SameFilt o = o != EC_OBJ
-
- -------------------------------------------------------------------------------------------
-
- --Format "%\n" ("Pick Object to Constrain " + EC_OBJ.name + " to:") to:Listener
-
- -------------------------------------------------------------------------------------------
- -- Pick Target Object
- -------------------------------------------------------------------------------------------
-
- EC_TargetOBJ = PickObject count:1 select:true Filter:SameFilt message:"Pick Object to Constraint to..." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Pos" Position_List
- print cont
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Position_Constraint then constraint = AddConstraint EC_OBJ "Pos" Position_Constraint true
- else constraint = cont[listCtrl.GetActive cont].object
- -------------------------------------------------------------------------------------------
- -- Add Position Constraint Objects
- -------------------------------------------------------------------------------------------
- constraint.AppendTarget EC_TargetOBJ 50
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- --Format "%\n" (EC_OBJ.name + " is Constrained to " + EC_TargetOBJ.name) to:Listener
-
- -------------------------------------------------------------------------------------------
- Select EC_OBJ
- )
- )
- Catch messagebox "Position Constraint Not Completed!"
- )
- )
-
-
- MacroScript Orientation_Constraint
-
- ButtonText:"Orientation Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Orientation Constraint"
- SilentErrors:(Debug != True)
- -- Icon Needed Icon:#("NURBScurve",1)
-
- (
- Local ConstraintCompleted = False
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
-
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[2].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
-
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn SameFilt o = o != EC_OBJ
-
- -------------------------------------------------------------------------------------------
-
- --Format "%\n" ("Pick Object to Constrain " + EC_OBJ.name + " to:") to:Listener
-
- EC_TargetOBJ = PickObject count:1 select:true filter:SameFilt message:"Pick Object to Constrain to..." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Rotation" Rotation_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Orientation_Constraint then constraint = AddConstraint EC_OBJ "Rotation" Orientation_Constraint true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Add Position Constraint Objects
- -------------------------------------------------------------------------------------------
-
- constraint.AppendTarget EC_TargetOBJ 50
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- --Format "%\n" (EC_OBJ.name + " is Constrained to " + EC_TargetOBJ.name) to:Listener
-
- -------------------------------------------------------------------------------------------
- Select EC_OBJ
- )
- )
- Catch (MessageBox "Orientation Constraint Not Completed" Title:"Constraints")
- )
- )
-
-
- MacroScript Look_At
-
- ButtonText:"Look-At Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Look-At Constraint"
- SilentErrors:(Debug != True)
- -- Icon Needed Icon:#("NURBScurve",1)
-
- (
- Local ConstraintCompleted = False
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
-
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[2].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
-
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn SameFilt o = o != EC_OBJ
-
- -------------------------------------------------------------------------------------------
-
- -- Format "%\n" ("Pick Object to Constrain " + EC_OBJ.name + " to:") to:Listener
-
- -------------------------------------------------------------------------------------------
- -- Pick Target Object
- -------------------------------------------------------------------------------------------
-
- EC_TargetOBJ = PickObject count:1 select:true filter:SameFilt Message:"Pick Object to Look At.." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Rotation" Rotation_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
-
- If classof cont[listCtrl.GetActive cont].object != LookAt_Constraint then constraint = AddConstraint EC_OBJ "Rotation" LookAt_Constraint true
- else constraint = cont[listCtrl.GetActive cont].object
- -------------------------------------------------------------------------------------------
- -- Add Look At Constraint Objects
- -------------------------------------------------------------------------------------------
-
- constraint.AppendTarget EC_TargetOBJ 50
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- -- Format "%\n" (EC_OBJ.name + " is Constrained to " + EC_TargetOBJ.name) to:Listener
-
- -------------------------------------------------------------------------------------------
- Select EC_OBJ
- )
- )
- Catch (MessageBox "LookAt Constraint Not Completed" Title:"Constraints")
- )
- )
-
-
- MacroScript Attachment
-
- ButtonText:"Attachment Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Attachment Constraint"
- SilentErrors:(Debug != True)
- -- Icon Needed Icon:#("NURBScurve",1)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[1].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn GeomFilt o = superClassOf o == GeometryClass and o != EC_OBJ
-
- -------------------------------------------------------------------------------------------
-
- --Format "%\n" ("Pick Object to Attach " + EC_OBJ.name + " to:") to:Listener
-
- EC_TargetOBJ = PickObject count:1 select:true filter:GeomFilt message:"Pick Object to Attach to.." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
-
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Pos" Position_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- -------------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Attachment then constraint = AddConstraint EC_OBJ "Pos" Attachment true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Set Node Attached To, initial key
- -------------------------------------------------------------------------------------------
-
- constraint.Node = EC_TargetOBJ
- local key = AttachCtrl.addnewkey constraint 0
- key.face=1
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- --Format "%\n" (EC_OBJ.name + " is Attached to " + EC_TargetOBJ.name) to:Listener
-
- -------------------------------------------------------------------------------------------
-
- Select EC_OBJ
-
- )
- )
- Catch (MessageBox "Attachment Constraint Not Completed" Title:"Constraints")
- )
- )
-
-
- MacroScript Surface
-
- ButtonText:"Surface Constraint"
- Category:"Constraints"
- internalCategory:"Constraints"
- Tooltip:"Surface Constraint"
- SilentErrors:(Debug != True)
- -- Icon Needed Icon:#("NURBScurve",1)
-
- (
- Local ConstraintCompleted = False
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[1].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Undo on
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Define Filter Function for PickObject Selection
- -------------------------------------------------------------------------------------------
-
- fn GeomFilt o = (o != EC_OBJ and
- ( oclass = ClassOf o
- oclass == NURBSSurf or
- oclass == Editable_Patch or
- oclass == Sphere or
- oclass == Cone or
- oclass == Cylinder or
- oclass == Torus or
- oclass == Loft
- )
- )
-
- -------------------------------------------------------------------------------------------
-
- --Format "%\n" ("Pick NURBS Surface to Attach " + EC_OBJ.name + " to:") to:Listener
-
- EC_TargetOBJ = PickObject count:1 select:true filter:GeomFilt message:"Pick Surface to Attach to.." Rubberband:EC_OBJ.transform.pos ForceListenerFocus:False
-
- If EC_TargetOBJ != undefined and EC_TargetOBJ != "None" then
- (
-
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Pos" Position_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Surface_Position then constraint = AddConstraint EC_OBJ "Pos" Surface_Position true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Add Object
- -------------------------------------------------------------------------------------------
-
- constraint.Surface = EC_TargetOBJ
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- Select EC_OBJ
-
- )
- )
- Catch (MessageBox "Surface Constraint Not Completed" Title:"Constraints")
- )
- )
- )
-
-
- MacroScript Noise_P
-
- ButtonText:"Noise Position"
- Category:"Controllers"
- internalCategory:"Controllers"
- Tooltip:"Noise Position Controller"
- SilentErrors:(Debug != True)
- -- Icon Needed Icon:#("NURBScurve",1)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[1].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Pos" Position_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Noise_Position then constraint = AddConstraint EC_OBJ "Pos" Noise_Position true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- -------------------------------------------------------------------------------------------
-
- Select EC_OBJ
-
- )
- Catch (MessageBox "Noise Constraint Not Completed" Title:"Constraints")
-
- )
- )
-
-
- MacroScript Noise_R
-
- ButtonText:"Noise Rotation"
- Category:"Controllers"
- internalCategory:"Controllers"
- Tooltip:"Noise Rotation Controller"
- SilentErrors:(Debug != True)
- -- Icon Needed Icon:#("NURBScurve",1)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller or selection[1].controller[2].controller != undefined) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
-
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Rotation" Rotation_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Noise_Rotation then constraint = AddConstraint EC_OBJ "Rotation" Noise_Rotation true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- -------------------------------------------------------------------------------------------
-
- select EC_OBJ
-
- )
- Catch (MessageBox "Noise Constraint Not Completed" Title:"Constraints")
-
- )
- )
-
-
- MacroScript Noise_S
-
- ButtonText:"Noise Scale"
- Category:"Controllers"
- internalCategory:"Controllers"
- Tooltip:"Noise Scale Controller"
- SilentErrors:(Debug != True)
- -- Icon needed Icon:#("NURBScurve",1)
-
- (
- Global EC_OBJ, EC_TargetOBJ = "None"
-
- -- Check to see if something is selected
- on isEnabled return (selection.count != 0 and
- classof selection[1].controller != BipSlave_Control and
- (classof selection[1].controller != IK_ControllerMatrix3Controller) and
- ( selection.count == 1 or
- selection.count > 1 and
- (
- local h = selection[1].parent
- h != undefined and h.isSelected and isGroupHead h
- )
- )
- )
-
- on execute do
- (
- Try
- (
- -------------------------------------------------------------------------------------------
- -- Switch to Motion Panel
- -------------------------------------------------------------------------------------------
-
- IF getCommandPanelTaskMode() != #motion then SetCommandPanelTaskMode Mode:#Motion
-
- -------------------------------------------------------------------------------------------
- -- Check for Groups and act accordingly
- -------------------------------------------------------------------------------------------
-
- EC_OBJ = selection[1]
- if selection.count > 1 do
- (
- local h = EC_OBJ.parent
- if (h != undefined and h.isSelected and isGroupHead h) do EC_OBJ = h
- )
-
- -------------------------------------------------------------------------------------------
- -- Add List Controller
- -------------------------------------------------------------------------------------------
-
- local cont = AddListController EC_OBJ "Scale" Scale_List
-
- -------------------------------------------------------------------------------------------
- -- Add Constraint
- ---------------------------------------------------------------------------------------
- If classof cont[listCtrl.GetActive cont].object != Noise_Scale then constraint = AddConstraint EC_OBJ "Scale" Noise_Scale true
- else constraint = cont[listCtrl.GetActive cont].object
-
- -------------------------------------------------------------------------------------------
- -- Set Active Controller
- -------------------------------------------------------------------------------------------
-
- SetActiveController cont constraint
-
- -------------------------------------------------------------------------------------------
-
- Select EC_OBJ
-
- )
- Catch (MessageBox "Noise Constraint Not Completed" Title:"Constraints")
- )
- )
-
-
-
-
-
-
-