Functions_Puppet.ms
|
puppet.getPuppetNodes riggedOnly:true =
|
# Description : gets all puppet nodes in the scene
# Parameters : <boolean> riggedOnly : if true, returns only puppet that have been rigged
# Returns : array of puppet nodes
|
|
puppet.getRoot puppetNode includeGOD:true =
|
# Description : Finds the root node of a (rigged) puppet
# Parameters : <node> puppetNode : puppet Node
<boolean> includeGOD : if true, the GOD node (if exists) will be returned as root node,
if false, then the first child of the GOD node is considered the root and returned.
# Returns : node
|
|
puppet.getHierarchyNodes puppetNode =
|
# Description : Gets all nodes of a puppet that where in the original hierarchy (nodes that should be exported)
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
# Returns : Array of nodes (unsorted)
# Note : You generally do not need this function. You should get the root of a puppet and then gets it's children and so on to
get all the nodes of a hierarchy. That way you get them in correct hierarchical order.
This function will return_ all to-be-exported nodes, but not in hierarchical order.
This function is also pretty slow, so use it only once to grab all nodes in your SDK plugin
|
|
puppet.getAnimationNodes puppetNode =
|
# Description : Gets all animation nodes
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
# Returns : Array of nodes
# Note : Animation nodes are the control nodes in the skeleton the animators uses to animate the character.
These nodes may or may not get exported, it depends on how the rig is setup.
For example, the footCtrl that drives the IK on a leg, is not exported, because the game engine usually only requires the
leg bones themselves to be exported. (However you are free to export the IK nodes if you need them)
|
|
puppet.getPuppetParent puppetNode anode =
|
# Description : Gets parent of a puppetshop node
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> anode : Node to find parent of.
# Returns : parent node or undefined
|
|
puppet.getPuppetChildren puppetNode anode =
|
# Description : Gets children of a puppetshop node
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> anode : Node to find children of.
# Returns : array of children
|
|
puppet.setHierarchyLevel puppetNode num =
|
# Description : Set the hierarchy to a certain level
# Parameters : <node> puppetNode : puppet Node
<integer> num : set the hierarchy level
# Returns : true if succesful, false if not (which likely means the hierarchyLevel provided does not exist)
|
|
puppet.getNodeByClass puppetNode anode nodeClass =
|
# Description : Gets all nodes of a certain class
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> anode : Node where to start search (usually root).
<class> nodeClass : class of ndoe you are trying to find, for example: puppetShop_head
# Returns : array of nodes of the specified class
|
|
puppet.setClipEditMode puppetNode bool setRange:true =
|
# Description : Switches puppet into cutscene mode or out of cutscene mode (clip edit mode)
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<boolean> bool : true or false
<boolean> setRange : if true, we also update the max animationrange
# Returns : ok
# Note : If modify panel is open, it will not redraw the UI...
|
|
puppet.setCacheMode puppetNode bool =
|
# Description : Switches puppet into cache mode or out of cache mode
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<boolean> bool : true or false
# Returns : ok
|
|
puppet.getMode puppetNode =
|
# Description : gets current 'mode' of puppet (timeline/animation or clip editting or cache or graph)
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
# Returns : integer
|
|
puppet.setActiveAnimation puppetNode ind animName:undefined =
|
# Description : Switches to the correct timeline (automatically detects if timeline exists.
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<integer> ind : index of the animation you wish to switch to
<string> animName : you may also provide an animation instead of an index.
# Returns : ok
# Example : puppet.setActiveAnimation $'Bob_World' 2
|
|
puppet.setActiveAnimationByName puppetNode animName =
|
# Description : Switches to the correct timeline by name (automatically detects if timeline exists.
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<string> animName : animation name
# Returns : ok
# Example : puppet.setActiveAnimationByName $'Bob_World' "MyAnim"
|
|
puppet.createNewAttributeModifier puppetNode targetNode blockString rolloutString strName =
|
# Description : Creates a new modifiers that hold animatable (timeline compatible) parameters.
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> targetNode : the node that will get the modifier applied
<string> blockString : Additional parameter block items you want to insert
<string> rolloutString: Additional rollout items you want to insert
<string> strName : Name of rollout
# Returns : ok
# Note : You would use this function to add a puppet attribute modifier to a custom animation node that you want to give
timeline compatible custom attributes.
Make sure (!) the targetNode was added to the custom anim list before running this function on it
|
|
puppet.getActiveAnimationName puppetNode =
|
# Description : returns the active animation name
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
# Returns : string, (or false if no active animation could be found for PS 1.x characters)
|
|
puppet.addAnimation puppetNode animName sFrame eFrame =
|
# Description : Adds new timeline/animation clip
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<string> animName : name of animation you want to add
<integer> sFrame : Start frame of new animation
<integer> eFrame : End frame of new animation
# Returns : true
|
|
puppet.setBasePose puppetNode frm animOn:on setSlider:true =
|
# Description : resets the basePose of the character at frm
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<integer> frm : frame number at which to set the basePose.
<on/off> animOn : animate on or off.
# Returns : ok
|
|
puppet.getAnimInfo puppetNode ind =
|
# Description : get animation info
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<integer> ind : frame number at which to set the basePose.
# Returns : array #(active, name, startTime, endTime, params, checked)
|
|
puppet.getAnimCount puppetNode =
|
# Description : returns number of animations
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
# Returns : integer
|
|
puppet.getAnimIndex puppetNode animName =
|
# Description : returns index of animation
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<string> animName : name of animation
# Returns : integer
|
|
puppet.getClipData pNode animName animIndex =
|
# Description : Returns the Data for a single clip on a puppet
# Parameters :
<node> pNode : puppetNode
<string> animName : name of animation we want info of
<integer> animIndex : index of animation in the animation list
# Returns : array #( #(track, start, end, #(time, blendval, time, blendval, ...)), #(...) )
# Note : This is used to be able to get the information where and how often a clip is used on a puppet, and what its blend values are
Useful for cutscenes.
|
|
puppet.getNodeExposure aNode =
|
# Description : returns wheter a node should be shown in UI or not
# Parameters : <node> anode : anode (only garantueed for puppetShop nodes)
# Returns : true if node should be visible, false if it should be hidden from custom UI's
|
|
puppet.addAnimNode puppetNode node quiet:false =
|
# Description : Adds new node to custom anim node list
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> node : node you want to add to custom anim list
<boolean> quiet : if true, don't pop up warning messages.
# Returns : true or false
|
|
puppet.addHierarchyNode puppetNode node parent:undefined =
|
# Description : Adds new node to custom hierarchy node list
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> node : node you want to add to custom hierarchy list
<node> parent : hierarchy parent node
# Returns : true or false
|
|
puppet.delAnimNode puppetNode node =
|
# Description : deletes node from custom anim node list
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> node : node you want to delete from the list
# Returns : ok
|
|
puppet.delHierarchyNode puppetNode node =
|
# Description : deletes node from custom hierarchy node list
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> node : node you want to delete from the list
# Returns : ok
|
|
puppet.linkPuppetNode puppetNode parent =
|
# Description : allows you to link the puppetNode to another node
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> parent : node that you want to be the new parent of the puppetNode
# Returns : true
|
|
puppet.deleteNode anode =
|
# Description : delete nodes (from a puppet) without getting the 'deleted part of rig' message
# Parameters : <node> anode : node to delete (can be a puppetshop class node or any other max node)
# Returns : true
|
|
puppet.renameNode anode newName =
|
# Description : renames a node in the puppet rig without geting the rename warning
# Parameters : <node> anode : node to rename (can be a puppetshop class node or any other max node)
# Parameters : <string> newName : new name for node
# Returns : true
|
|
puppet.getPuppetName puppetNode =
|
# Description : returns name of character
# Parameters : <node> puppetNode : puppetNode
# Returns : string
# Note : This basically strips off the "_World" from the puppetNode name
|
|
puppet.getAllNodesOfPuppet puppetNode includeHierarchy:false =
|
# Description : returns all ndoes belonging to the puppet
# Parameters : <node> puppetNode : puppetNode
<boolean> includeHierarchy : if true, includes custom hierarchy nodes too (caution, this might include things like skinned mesh that you might not want to delete)
# Returns : ok
|
|
puppet.extractPuppet puppetNode extractProxy:true transferTwist:true transferUserProps:true =
|
# Description : extracts a new un-rigged puppet from a rigged one
# Parameters : <node> puppetNode : puppetNode
# Returns : new created puppetNode (unrigged)
|
|
puppet.deletePuppet puppetNode =
|
# Description : deletes entire puppet, node that custom added hierarchy nodes will be left in the scene as they could be skins.
# Parameters : <node> puppetNode : puppetNode
# Returns : ok
|
|
puppet.isActivePart anode animIndex =
|
# Description : checks if a node is set to be exported or not (animator can decide this per animation clip)
# Parameters : <node> anode : a node you are about to export (hierarchy node)
<integer> animIndex : the index of the animation you are exporting
# Returns : true or false
# Note : If a node does not have the ability to be switched on or off (for example some sort of custom node) the default return_ value will be true
|
|
puppet.batchAnimSave puppetNode dir all:true=
|
# Description : Saves animations of puppet to disk
# Parameters : <node> puppetNode : puppetNode
<string> dir : path name of directory to save to
<boolean> all : if true, save all animations, if false, saves only the 'checked' animations
# Returns : ok
|
|
puppet.batchAnimLoad puppetNode dir sframe:1 zeroLayers:true =
|
# Description : load animations from disk onto puppet
# Parameters : <node> puppetNode : puppetNode
<string> dir : path name of directory to save to
<integer> sframe : start frame for all animations
<boolean> zeroLayers : wheter to zero and bracket existing layers or not, Usually you won't have any and true is fine.
# Returns : ok
# NOTE : See the function "saveAnimNodeList" below for details on batch loading only certain nodes
|
|
puppet.saveAnimNodeList puppetNode file =
|
# Description : saves animation node list to disk. This can be useful in-combination with batch saving and loading
Two files can be provided for batch saving and loading: to.pnl and from.pnl
The lists should contain the animation nodes of the source puppet (from) and the target puppet (to) in the right order
These two lists allow you to only batch-load certain nodes that were saved (in case of rig changes)
The name and extension must be as mentioned above.
# Parameters : <node> puppetNode : puppetNode
<string> file : path name of file to save node list to
# Returns : ok
|
|
puppet.batchExportToBVH puppetNode folder human:true all:true =
|
# Description : export human mocap
# Parameters : <node> puppetNode : puppetNode
<string> folder : path name of folder to export to. I.e.: "c:\\myfolder"
<boolean> human : if true, uses the specialised human exporter. If false uses the creature exporter
<boolean> all : if false uses checked animations only
# Returns : ok
# Note : Be sure to reset any custom added constraint at base frame
I.e.: with animate on at time -1 leftHandCtrl.modifiers["Puppet Attributes"].custom_attributes.constrain_ = 0.0
|
|
puppet.batchImportHumanBVH puppetNode folder config:4 =
|
# Description : export human mocap
# Parameters : <node> puppetNode : puppetNode
<string> folder : path name of folder to export to. I.e.: "c:\\myfolder"
<integer> config : how to import mocap, for example default 4 means: fk-blend arms and IK legs (see dropdownlist in UI)
# Returns : ok
# Note : Must be HUMAN!
|
|
puppet.renamePuppet puppetNode newName =
|
# Description : sets a new name for a puppet
# Parameters : <node> puppetNode : puppetNode
<string> newName : new name for puppet
# Returns : ok
|
|
puppet.setLocalRotation anode x y z =
|
# Description : sets local rotation on a node with euler values specified
# Parameters : <node> anode : node to set TM of
<integer> x : wanted local x rotation
<integer> y : wanted local y rotation
<integer> z : wanted local z rotation
# Returns : local rotation (this values goes into $.rotation.controller.value)
|
|
puppet.printSkeleton puppetNode puppetRoot =
|
# Description : Example code of how to export hierarchy of a puppet
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<node> puppetRoot : root of a puppet (first node of a puppet's skeleton)
# Returns : ok (prints stuff to listener)
|
|
puppet.printAllPuppets =
|
# Description : Example code of how to export hierarchy of a puppet
# Parameters :
# Returns : ok (prints stuff to listener)
|
Functions_.ms
|
ps_func.controllerLocked state =
|
# Description : locks / unlocks controller from being overwritable
# Parameters :
<boolean> state : true if controllers should NOT be over-writeable, false if they should be
# Returns : the previous state, this is returned so that functions that change the state can restore the state when done
# Note : see also 'return_' which always switches this flag back to true
|
|
ps_func.isPuppetProperty obj propStr =
|
# Description : checks if a property exists on an object. Unlike isProperty for max, this does not cause exceptions in 3dsmax debug
# Parameters :
<node> obj : node to check property of (can be modifier, structure, maxobject etc.)
<string> propStr : property we are looking for
# Returns : true or false
|
|
ps_func.roundto val n =
|
# Description : Rounds of values
# Parameters :
float val : float we wish to round
integer n : how many digits past the dot we want
# Returns : rounded float
|
|
ps_func.isUnEven num =
|
# Description : checks wheter a number is even of uneven
# Parameters :
integer num : integer we wish to check
# Returns : ok
# Note : copied from mocap
|
|
ps_func.easeInOut val t1:3.0 t2:2.0 =
|
# Description : hermite function for ease-in and out
# Parameters : float val : value to convert
float t2 : in-tangent, to adjust curve
float t2 : out-tangent
# Returns : float
# Note : val needs to be 0 to 1
|
|
ps_func.replaceString str src trg =
|
# Description : returns the characters name
# Parameters :
<string> str : entire string
<string> src : piece of string we are going to replace
<string> trg : piece of string we are replacing src with
# Returns : ok
# NOTE :
|
|
ps_func.getBaseClass anode super:false =
|
# Description : returns base class of objects, and respects xrefs
# Parameters :
<node> anode : node to get baseclass of
<boolean> super : if true, we get the superclassof instead
# Returns : class
# Note : ISPROPERTY should NEVER be run on controllers, it will eventually crash max.
|
|
ps_func.posRotCloseEnough p1 p2 limit:0.01 useW:false =
|
# Description : checks to see if 2 point3's or two quats are 'close enough' to being the same
# Parameters : <Point3 / Quat> p1
<Point3 / Quat> p2
<float> limit : threshhold
# Returns : ok
|
|
ps_func.resetStretchTM childArray =
|
# Description : resets stretch in bones and compensates by changing the length value for the bone
# Parameters :
# Returns : ok
|
|
ps_func.getCharName puppetNode =
|
# Description : returns the characters name
# Parameters :
# Returns : ok
# NOTE :
|
|
ps_func.keyStripper cont range keyArray:undefined keyValuesArray:undefined keyTimesArray:undefined closeEnough:false =
|
# Description : Just a quick and dirty key stripper to strip out very obvious keys with the same values
# Parameters :
<controller> cont : the controller you want to strip
<interval> range : the time range you want to strip for
<array> keyArray : optional, you may feed it an array directly instead of using a controller (you can leave controller undefined)
<array> keyValuesArray : optional, feed it the array of values and times directly instead of the key array
<boolean> closeEnough : if true, do a 'close enough comparision'. Currently only work on floats!
# Returns : array that is stripped of key values
# Note : 1. If your controller is XYZ, make sure you feed it the seperate X, Y and Z controllers
2. This may not strip 100% of the keys that could be stripped
3. When feeding keyValuesArray we sue to make keyArray not undefined, make it #() instead so that doDelete is set to false
|
|
ps_func.canSetKeys cont =
|
# Description : checks if a controller is keyable
# Parameters :
<controller> cont : controller to add key to
# Returns : true or false
|
|
ps_func.addKey cont t tangentFix:false =
|
# Description : adds a key to a controller if the key doesn't already exist.
# Parameters :
<controller> cont : controller to add key to
<integer> t : time
<boolean> tangentFix : if true and we added a first or last key, then fix the tangent so that the curve stays the same
# Returns : ok
# NOTE :
|
|
ps_func.convKey cont t type:#custom ignore:#(#step) =
|
# Description : converts a key (if exists) to a differen tangent type
# Parameters :
<controller> cont : controller to convert keys of
<integer> t : time to convert keys at
<name> type : type of tangent you want to convert to
<array> ignore : types of tangents NOT to convert. #step is default because of animatable pivot.
# Returns : ok
|
|
ps_func.unParent aNodes =
|
# Description : unParents the animation Nodes provided and returns the original parents.
# Parameters :
# Returns : ok
|
|
ps_func.reParent aNodes parentArray =
|
# Description : restores Parents the animation Nodes provided
# Parameters :
# Returns : ok
|
|
ps_func.setTimelineControllerNames puppetNode tInd:undefined =
|
# Description : Sets the timeline name on all controllers
# Parameters :
# Returns : ok
|
|
ps_func.getLayerName puppetNode ind tInd:undefined =
|
# Description : gets the name of a layer
# Parameters :
# Returns : string
|
|
ps_func.setLayerName puppetNode txt ind tInd:undefined =
|
# Description : sets the name of a layer
# Parameters :
# Returns : ok
|
|
ps_func.getSubanimName subanim =
|
# Description : returns name of subAnim
# Parameters :
# Returns : return_ string
|
|
ps_func.getLayerCont puppetNode returnList:false type:1 thisLayer:undefined instance:false tInd:undefined =
|
# Description : returns the active layer controller
# Parameters : <node> puppetNode : puppetNode (or any animatable node)
<boolean> returnList : if false, we return_ the active layer controller. If true, we return_ the layers-list controller itself
<integer> type : 1 == position, 2 == rotation
<integer> thisLayer : if specified, we use this layer indexd to find the controller and not look for active controller ourself
<boolean> instance : if false, we make a copy of the controller. If true, means we are working directly on the controller, thus no need for using setLayerCont. This can be slower in complex rigs.
<integer> tInd : index of timeline
# Returns : (copy of) a controller
# NOTE : puppetNode can really be any animatable node
|
|
ps_func.setLayerCont puppetNode cont type:1 subType:0 thisLayer:undefined setList:false instance:true tInd:undefined =
|
# Description : set the active layer controller
# Parameters : <node> puppetNode : puppetNode (or any animatable node)
<controller> Cont : the controller to set
<integer> type : 1 == position, 2 == rotation
<integer> subtype : if not 0, means we are dealing with a float list
<integer> thisLayer : if specified, we use this layer indexd to find the controller and not look for active controller ourself
<boolean> setList : if true, we set the layer controller itself, instead of one of it's sub controllers
<boolean> instance : if false, we make a copy of the controller.
<integer> tInd : index of timeline
# Returns : ok
# NOTE : puppetNode can really be any animatable node
|
|
ps_func.getAttributeTimeLineCont ca returnList:false instance:false =
|
# Description : returns the active attribute timeline controller
# Parameters : <attribute_controller> ca : attribute that holds the controller we are after. I.e.: puppetCa.syncPivX_.controller
<boolean> returnList : If true, we return_ the timeline-list controller itself
<boolean> instance : if false, we make a copy of the controller. If true, we are working directly on the controller, thus no need to use 'setAttributeTimeLineCont'. This can be slower.
# Returns : (copy of) a controller
# NOTE :
|
|
ps_func.setAttributeTimeLineCont ca cont setList:false instance:true =
|
# Description : set the active layer controller
# Parameters : <attribute> ca : attribute to set
<controller> Cont : the controller to set
<boolean> setList : if true, we set the list controller itself, instead of one of it's sub controllers
<boolean> instance : if false, we make a copy of the controller.
# Returns : ok
# NOTE :
|
|
ps_func.setMulCurveActive puppetNode layer =
|
# Description : sets multiplier curve to active
# Parameters :
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_func.addMulCurve puppetNode layer =
|
# Description : adds multiplier curve to layer
# Parameters :
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_func.delMulCurve puppetNode layer =
|
# Description : removed multiplier curve from layer
# Parameters :
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_func.fixWindups anode layer s_frame e_frame =
|
# Description : Fixed 'windup' rotations. (Rotations bigger then 360)
# Parameters :
<node> anode : node to work on
<integer> layer : which layer to work on
<integer> s_frame : start frame
<integer> e_frame : end frame
# Returns : ok
|
|
ps_func.tcbFlipFix inCont =
|
# Description : Makes quat2 take the closest route to quat1
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.makeClosest quat1 quat2 =
|
# Description : Makes quat2 take the closest route to quat1
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.makeLinearClosest anode thetime theLayer:undefined cont:undefined setCont:true instance:false =
|
# Description : Makes quat2 take the closest route to quat1, for linear controllers
# Parameters :
<node> anode : node to work on
<integer> thetime : time to fix rotation at
<integer> theLayer : force it to use this layer instead of active one
<controller> cont : force it to use this controller isntead of finding it
<boolean> setCont : if true, we set the controller, if false we do not (might be set later by other function)
<boolean> instance : wheter to copy or instance the rotation controller
# Returns : ok
# Note : Max's default linear controller does not have a build in fix for quat closest values, thus we have to do it ourselves
|
|
ps_func.getPuppetNodes riggedOnly:true =
|
# Description : gets all puppet nodes in the scene
# Parameters :
# Returns : array of puppet nodes
|
|
ps_func.getSkinnedMeshes =
|
# Description : gets all skinned meshes in the scene
# Parameters :
# Returns : array of meshes with skin modifier
|
|
ps_func.delayedGC cnt light:false =
|
# Description : Makes quat2 take the closest route to quat1
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.customNodePreDelete n =
|
# Description : Gets called during the deletion of a custom added node. Custom nodes are nodes added by the user after the rig was complete.
# Parameters :
# Returns : ok
# NOTE :
|
|
ps_func.PuppetRigPostDeleteCallback =
|
# Description : deletes nodes of a rig
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.PuppetRigPreDeleteCallback =
|
# Description : checks if the deleted node belongs to a puppetshop rig,
if so, then it adds the rig nodes to a list of nodes to be deleted
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.cleanUpRig Nodes =
|
# Description : Checks if bones have been deleted and cleans up any children and parents
# Parameters : <array> Nodes : search through these objects
# Returns : ok
# NOTE :
This is the heart of the beast. It's relatively delicate system (so be careful if you change anything in here)
It is 'delicate' because maxscript was never really designed to deal with these types of situations, so we had to jump
though a few hoops to get it to work properly and stable.
When an object gets deleted, we get some information send to us by the callback on the puppetnode.
We then search though all objects in (usually all objects in the max scene) to check if they are involved in the deletion.
An object is 'involved' when either itself or any of it's parents got deleted.
We then proceed to delete the rest of it's chain.
I.e. If the lower leg gets deleted, we delete the upperleg, and all children of the lower leg, so that no nodes of this leg
stay behind in the max scene.
|
|
ps_func.delayFunction delayTime fString =
|
# Description : opens up a rollout with a timer that launches commands
# Parameters :
<integer> delayTimer : time in miliseconds
<string> fString : function string to execute
# Returns : ok
# Note : Right now you can only have one rollout open at once, but we can change this if we need to...
|
|
ps_func.nodePostDelete resetDeleteInProgress:false =
|
# Description : Gets called when a node has been deleted
# Parameters :
# Returns : ok
# NOTE :
|
|
ps_func.nodePreDelete =
|
# Description : Gets called during the deletion of a node
# Parameters :
# Returns : ok
# NOTE :
If the cleanUpRig function is the heart of the beast, then this must be the brains (equally important and delicate).
During the deletion of a node we store some vital information that the cleanUpRig function needs to have to function properly
We figure out which node it was that got deleted, and track down it's chain parent.
This information is stored in a few global parameters that get used by the cleanUpRig function.
|
|
ps_func.resize_puppet puppetNode scaleAmount theChildren:undefined =
|
# Description : changes the size of a puppet by changing the length etc of all nodes
# Parameters :
<node> puppetNode : Puppet node that we are resizing
# Returns : ok
# NOTE :
|
|
ps_func.mirrorMatrix axis flip tm:(matrix3 1) pivotTm:(matrix3 1) =
|
# Description : Mirror transform Matrix
# Parameters :
<string> axis : axis to mirror over
<string> flip : axis to flip
<matrix3> tm : transform matrix to mirror
<matrix3> pivotTM : transform matrix to mirror around
# Returns : ok
# NOTE : For axis and flip pick one of the following:
[-1,1,1] -- reflect in YZ plane (x)
[1,-1,1] -- reflect in ZX plane (y)
[1,1,-1] -- reflect in XY plane (z)
|
|
ps_func.mirror_pose_fn sourceTransform sourceNode targetNode centerNode theMap:undefined =
|
# Description : Mirrors a node
# Parameters : <matrix3> sourceTransform : transform we copied from source node
<node> sourceNode : source node
<node> targetNode : node we are going to paste the mirrored transform to
<node> centerNode : Node we are mirroring around
<point3> theMap : this vector tells our mirror function how it is suppose to mirror the object # Returns : ok
|
|
ps_func.scale_limb whichLimb =
|
# Description : changes the length of a limb and moves it's children
# Parameters :
<node> whichLimb : The limb we are changing the length of
# Returns : ok
# NOTE :
|
|
ps_func.insertBone whichLimb =
|
# Description : Inserts an extra bone
# Parameters :
<node> whichLimb : any node in a chain (we will find the chain parent in this function)
# Returns : ok
# NOTE : new bones always get inserted at the end of the chain of same class bones as whichlimb.
|
|
ps_func.removeBone whichLimb =
|
# Description : Removes a bone
# Parameters :
<node> whichLimb : any node in a chain (we will find the chain parent in this function)
# Returns : ok
# NOTE : We always remove the last bone in the chain of same class bones as whichlimb
|
|
ps_func.createControlLine puppetNode objFrom objTo useFromCenter:true col:undefined =
|
# Description : Creates a Line going from one object to another
# Parameters : <obj> objFrom : Control Cube
<obj> objTo : Target Node
<boolean> useFromCenter : if true, use the center for the objFrom object. If false, use transform.pos
<color> col : specifies a specific color to use for the spline, if undefined color will be the frozen color
# Returns : spline node
|
|
ps_func.Swivel_dif vec1_Pre vec2_Pre vec1_Post vec2_Post vec3 =
|
# Description : calculates swivel difference
# Parameters : <point3> vec1_Pre : Shoulder - hand
<point3> vec2_Pre : elbow - shoulder
<point3> vec1_Post : Shoulder - hand
<point3> vec2_Post : elbow - shoulder
<point3> vec3 : elbow - hand
# Returns : angle in degrees
# Note : To calculate the difference in swivel angle after relinking the ik chain, you store two vectors before you make any changes,
then store the two vectors after all changes have been made and this fuction will return_ the difference in swivelangle,
which you can then add to the existing swivelangle to correct any problems.
I've seen some fairly minor differences still, so don't think this is completely accurate, but haven't seen any big problems.
Might need to find a more accurate way to calculate the swivel angle.
|
|
ps_func.Callback_SortDuplicateNodeArrayByHandles v1 v2 =
|
# Description : callback for PickDuplicateNode and GetDuplicateNodeIndex
# Parameters : <entry>
# Returns :
|
|
ps_func.PickDuplicateNode strNodeName index:1 puppetCnt:1 =
|
# Description : Picks node by ascending handle order.
# Parameters : node name,
<index> default is 1
# Returns : array of nodes
|
|
ps_func.GetDuplicateNodeIndex objNode =
|
# Description : Returns node index by ascending handle
# Parameters : <node> object to test
# Returns : index
|
|
ps_func.GetPuppetsByNameCount puppetNode =
|
# Description : Returns number of puppets of a certain name in scene
# Parameters : <node> puppetNode : puppetNode
# Returns : integer
|
|
ps_func.applyFilter puppetNode filter nodeArray filter_options whichLayer s_frame e_frame =
|
# Description : applies a filter to nodes
# Parameters :
<node> puppetNode : puppet node
<string> filter : which filter we are going to apply
<array> nodeArray : Array of nodes to apply filter to.
<array> filter_options : Array of filter options, since each filter could need different options, this is a array that changes from filter to filter
<integer> whichLayer : the layer we are applying the filter too
<integer> s_frame : start frame to start applying filter
<integer> e_frame : last frame to apply filter to.
# Returns : ok
|
|
ps_func.setConstraintFilters puppetNode src targ filt agentRoot barRol:undefined =
|
# Description : Creates all constraints specified. Src are the animatable nodes in the rig, targ are the mocap bones.
# Parameters :
<node> puppetNode : puppet node
<array> src : Array of src nodes names (strings) -- nodes to be constraint
<array> targ : Array of target nodes names (strings) -- nodes we are constraining to
<array> filt : list of filters to apply (strings)
<node> agentRoot : root node of mocap agent (as there can be multiple)
<progressbar> barRol : rollout that holds the progressbar
# Returns : ok
|
|
ps_func.setPivotTangents ca frm:currenttime tType:"step" =
|
# Description : reset pivot keys to step tangents
# Parameters :
<integer> frm : time to reset pivot at
<custom attribute> ca : custom attribute that holds the pivot keys.
<name> tType : tangent type
# Returns : ok
|
|
ps_func.initFoot ca frm:currenttime =
|
# Description : initialises foot settings
# Parameters :
<attribute> ca : attribute that holds the pivot
# Returns : ok
|
|
ps_func.movePivot ca minPos:undefined frm:undefined setTangents:true =
|
# Description : moves pivot
# Parameters :
<attribute> ca : attribute that holds the pivot
<boolean> setTangents : if true, we set the tangents to step. This only needs to happen the last time move pivot is called, nto while interactively placing the pivot
# Returns : ok
|
|
ps_func.snapPiv ca acceptHold:true frm:currenttime =
|
# Description : snap pivot to a location (i.e. ankle)
# Parameters :
<attribute> ca : attribute that holds the pivot
# Returns : ok
|
|
ps_func.pivStateChange ca state =
|
# Description : when user clicks the pivot checkbox
# Parameters :
<attribute> ca : attribute that holds the pivot
<boolean> state : state of the pivot checkbox
# Returns : ok
|
|
ps_func.pivTick ca =
|
# Description : timer ticking while changing pivot
# Parameters :
<attribute> ca : attribute that holds the pivot
# Returns : ok
|
|
ps_func.reset_pivot ca frm:currenttime =
|
# Description : reset pivot attributes to 0
# Parameters :
<integer> frm : time to reset pivot at
<custom attribute> ca : custom attribute that holds the pivot keys.
# Returns : ok
|
|
ps_func.keyPivot ca frm:currenttime =
|
# Description : reset pivot attributes to 0
# Parameters :
<integer> frm : time to reset pivot at
<custom attribute> ca : custom attribute that holds the pivot keys.
# Returns : ok
|
|
ps_func.snapToIK ca partID askToes:true firstNodeIndex:2 snapPos:false doRange:keyboard.SHIFTPressed quiet:false =
|
# Description : snaps FK legs to IK legs / spline (tail)
# Parameters :
<attribute> ca : custom attribute
<integer> partID : number that identifies what bodypart we are working on
<boolean> askToes : if true ask to snap toes as well, useful since this function is also used by spline
<integer> firstNodeIndex : default is 2 because first fk node for legs is break-off node, but not for spline
<boolean> snapPos : if true, also snap position
<boolean> doRange : if true, convert for entire animation range
<boolean> quiet : if true, no messageboxes
# Returns : ok
|
|
ps_func.snapToFK ca partID useSwivelTarget:true doRange:keyboard.SHIFTPressed quiet:false =
|
# Description : snaps IK legs to FK legs
# Parameters :
<attribute> ca : custom attribute
<integer> partID : number that identifies what bodypart we are working on
<boolean> useSwivelTarget: true, uses swivel target, false uses angle spinner
<boolean> doRange : if true, convert for entire animation range
<boolean> quiet : if true, no messageboxes
# Returns : ok
# Note : There are two options. A leg with swivel target and one with swivel spinner.
For the one with target we find 3 fk nodes and figure out which direction the swivel node should go.
For the one with the swivel spinner we do almost the same thing accept we set an angle instead.
|
|
ps_func.getKeysInInterval kAr timeInterval =
|
# Description : Gets keys within a certain interval range
# Parameters : <array> kAr : Array of keys
<interval> timeInterval : time Interval to get keys of
# Returns : Array of key times
|
|
ps_func.getMultiplierCurve puppetNode layer:1 =
|
# Description : Finds the multiplier curve on a controller
# Parameters : <node> puppetnode : puppetNode
# Returns : Multiplier_curve.controller
|
|
ps_func.getEaseCurve puppetNode returnSubAnim:false acTimeLine:undefined =
|
# Description : Finds the ease curve on a controller
# Parameters : <node> puppetnode : puppetNode
<boolean> returnSubAnim : if true, return_ subAnim instead of controller. This is sometimes needed because the controller returns values in ticks or sometime (when curve editor has been opened)
<integer> acTimeLine : what timeline to get the easeCurve from
# Returns : ease_curve.controller
|
|
ps_func.checkForEaseCurve cont =
|
# Description : checks to see if an ease curve exists on a controller
# Parameters : <controller> cont : controller that had the keys and that has a ease_curve applied
# Returns : 0 if no curves are found, 1 or higher if curves are found
|
|
ps_func.adjustKeyTimesForEase puppetNode keyTimes =
|
# Description : adjusts key times to compensate for ease_curve (so that they ease_curve effect is baked into key-times)
# Parameters :
<array> keyTimes : Array of keys times
# Returns : new Array of key times
# Example: myKeys = ps_func.adjustKeyTimesForEase puppetNode kCont myKeys
|
|
ps_func.setORT cont type:#constant =
|
# Description : Sets out of ranges curves (important before resetting basePose , or create keys anywhere outside of the current animator loop)
# Parameters : <controller> cont : controller to reset
<name> type : what to set the curves too
# Returns : ok
|
|
ps_func.collapseTime puppetNode nodeArray ca keyToKey:true bakeCA:false bakeWeight:true bakeMul:true toggleOnly:false =
|
# Description : collapses ease_curve effect into keys
# Parameters : <array> nodeArray : Nodes to bake
<array> ca : attribute controllers
<boolean> keyToKey : if true, we only collapse where keys in either layer exist, if false, we key-per-frame
<boolean> bakeCA : if true, we also bake the custom attributes.
<boolean> toggleOnly : if true, we do not bake, but only toggle the easeCurve on/off
# Returns : ok
# Note : We also need to bake attributes and weight/mul curves.
We also hijack this function to endable/disable timecurves
|
|
ps_func.resetPose nodeArray frm:0 noWarnings:false dontResetPuppetnode:false forceAbsoluteZero:false resetPos:true resetRot:true keyOnly:false resetORT:true resetScale:true activeLayerOnly:false addKey:true =
|
# Description : Resets transforms for certain nodes
# Parameters : <array> nodeArray : Array of nodes
<integer> frm : time at which to reset the transform
<boolean> noWarnings : true will suspend any warnings
<boolean> dontResetPuppetnode : if true, we do not reset any objects of class puppetNode
<boolean> forceAbsoluteZero : if true, make sure the values inside the xyz floats are zero.
<boolean> resetPos : if true, reset position
<boolean> resetRot : if true, reset rotation
<boolean> keyOnly : if true, we don't put a value of zero, instead we put the existing value (is more like bracket but then all layers).
<boolean> activeLayerOnly : if true, only zeros the active layer
<boolean> addKey : if true, use 'addKey' (which always sets a key, no matter if animate button is on or not)
# Returns : ok
|
|
ps_func.reSyncEaseCurve puppetNode =
|
# Description : reSync easeCurve_ to puppet for older characters (bugfix)
# Parameters :
# Returns : ok
|
|
ps_func.debugCollapseLayer puppetNode nodeArray activeLayer bstart:animationrange.start.frame bend:animationrange.end.frame =
|
# Description : debug collapse
# Parameters : <array> nodeArray : Nodes to bake
<integer> activeLayer : Layer to collapse
# Returns : ok
|
|
ps_func.collapseLayer puppetNode nodeArray activeLayer targetLayer:undefined bstart:animationrange.start.frame bend:animationrange.end.frame bakeTM:#() bFrame:undefined dontResetPuppetnode:false keyToKey:true respectLocks:true subtractPreviousLayers:false skipInstanceCurve:false TCBFlipFix:false wipePnode:false counterScalePos:false =
|
# Description : collapses one layer onto another
# Parameters : <array> nodeArray : Nodes to bake
<integer> activeLayer : Layer to collapse
<integer> targetLayer : layer to collapse to
<bstart> float : start time to bake
<bend> float : end time
<string> bakeTM : which controllers to bake (PR - pos and rot, R - rot only etc.)
<integer> bFrame : baseFrame, to reset basePose
<boolean> subtractPreviousLayers : if true, we subtract the values of the all layers when pasting back, if false then we only subtract the base pose values. Used to import mocap relative to previous layer
<boolean> dontResetPuppetnode : if true, we do not reset the pose on puppetnodes
<boolean> keyToKey : if true, we only collapse where keys in either layer exist, if false, we key-per-frame
<boolean> respectLocks : if true, we respect the transform locks
<boolean> skipInstanceCurve : if true, we do not re-instance ease and mul curves. This useful when the layer that is collapsed is going to be deleted right away, i.e. mocap import and collapse layer.
<boolean> TCBFlipFix : if true, use TCB rotation flip fix, good for mocap, not good for collapsing bezier curves.
<boolean> wipePnode : if true, wipes the keys of the puppetNode, used for baking 'in-place' animation
<boolean> counterScalePos : if true, adjust position to counter scaling on puppetNode (this allows IK and Root to stay in the same position as it was before scaling)
# Returns : ok
|
|
ps_func.SetRelativeTM puppetNode nodes sTime eTime =
|
# Description : not really used, but this is example code how to set transform value relative to parent, even if constraints are used
# Parameters :
<array> nodes : Nodes to be copied
<integer> sTime : Frame to copy
<integer> eTime : Frame to copy too
# Returns : ok
|
|
ps_func.pasteRelativePose centerNode nodes sTime eTime respectLocks:true =
|
# Description : pastes relative pose
# Parameters : <node> centerNode : Node the is the center of the pose (generally first child of puppetNode)
<array> nodes : Nodes to be copied
<integer> sTime : Frame to copy
<integer> eTime : Frame to copy too
<boolean> respectLocks : if true, it uses the transform locks to determine what to copy/paste
# Returns : ok
# Note : Not sure if rotation constraints also need to use the exception code, for now it appears they do not...
We have to paste the pose a few times (pastePoseAmount) because unfortunatly our hierarchy can be so custom, that parents, children and constraints not always get copied in the right order
|
|
ps_func.setRigCallbacks nodeWithID setLayerDraw:true =
|
# Description : sets the proper callbacks for a rigged puppet
# Parameters : <node> : nodeWithID : Node that has the HUBID, ususally puppetTool modifier
<boolean> : setLayerDraw : wheter to set the callbacks for layer info drawing (should NOT be set during rigging a new puppet!)
# Returns : ok
|
|
ps_func.changeEvalToAddLayer puppetNode aNodes setBool =
|
# Description : enables/disables controller evaluation when animations are used in clip editor and we add a layer
# Parameters :
# Returns : ok
|
|
ps_func.instanceWeightControllers puppetNode aNodes layer forceUpdate:false tInd:undefined =
|
# Description : instances all weight controllers to the puppetNode
# Parameters : <boolean> forceUpdate : if true, we refresh the puppet_controller no matter if it already existed (used by addAnimNodes)
<integer> tInd : index of timeline
# Returns :
|
|
ps_func.reFreshEaseControllerCurve theCurve sFrame:0 eFrame:100 centerKey:false =
|
# Description : reFreshes keys on ease curve
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.reFreshMultiplierControllerCurve theCurve sFrame:0 eFrame:100 =
|
# Description : reFreshes keys on multiplier curve
# Parameters :
# Returns : ok
# Note :
|
|
ps_func.deleteEaseControllers puppetNode aNodes layer tm:true weightMul:true ca:true =
|
# Description : removes all Ease controllers
# Parameters :
<boolean> tm : remove ease_curve of pos and rot -- these options exist so that collapseLayer can delete the ease_curve only of the weight and mul curve
<boolean> weightMul : remove ease_curve of weight and mul_curve
<boolean> ca : remove ease_curve of attributes
# Returns : ok
|
|
ps_func.delEaseCurves puppetNode delFromAnimNodes:true =
|
# Description : removes ease curves from all layers
# Parameters :
<node> puppetNode : puppet node
<boolean> deleteFromAnimNodes : if true, we delete the ease from anim Nodes, this should always happen, unless layer count is zero.
# Returns : ok
|
|
ps_func.reSyncCAEaseCurves puppetNode cas =
|
# Description : fixes a bug in the attribute timelines and resyncs proper ease curve per timeline
# Parameters :
<node> puppetNode : puppet node
<attribute> cas : attribute controllers
# Returns : ok
|
|
ps_func.instanceEaseControllers puppetNode aNodes layer refreshCurve:false tm:true weightMul:true ca:true =
|
# Description : instances Ease controllers on all nodes and layers of puppet
# Parameters :
<boolean> tm : remove ease_curve of pos and rot -- these options exist so that collapseLayer can delete the ease_curve only of the weight and mul curve
<boolean> weightMul : remove ease_curve of weight and mul_curve
<boolean> ca : remove ease_curve of attributes
<boolean> refreshCurve: if true, we refresh the ease_curve to sync with timeline framerange.
# Returns : ok
# Note : position and rotation curves are also instanced, so the same curve applies to rotation and position
Also, we need to apply the same curve on the custom attributes
|
|
ps_func.deleteMultiplierControllers puppetNode aNodes layer =
|
# Description : removes all Multiplier controllers of a layer
# Parameters :
<integer> layer : which layer to work on
# Returns : ok
|
|
ps_func.instanceMultiplierControllers puppetNode aNodes layer refreshCurve:false =
|
# Description : instances all Multiplier controllers to the puppetNode
# Parameters :
<integer> layer : which layer to work on
<boolean> refreshCurve: if true, we refresh the mul_curve to sync with timeline framerange.
# Returns : ok
# Note : we do not apply multiplier curves onto attributes or weight controllers, however each layer can have a new multiplier curve
|
|
ps_func.instanceManager puppetNode aNodes layer iw:true ie:true im:true refreshMul:false refreshEase:false =
|
# Description : Handles instancing for controllers. I.e. when animation is loaded, instanced controllers need to be restored.
# Parameters : refreshMul/ease : if true, refresh the curve to match timeline frameRange.
# Returns : ok
# Note : if clips are used, having the ps_changeEvaluating off for the clip controller would crash because updates would not happen correctly.
So, we have to temporarly enable the evaluating of the clip controller here and disable it when we are done.
|
|
ps_func.ps_updateTimeRange =
|
# Description : Updates the value in the time spinners, controlled by timechangecallback
# Parameters :
# Returns :
|
|
ps_func.getPoseNodes myNodes puppetRoot:undefined =
|
# Description : gets Nodes used in poses
# Parameters : <array> myNodes : nodes to search, usually hierarchyNodes
<node> puppetRoot : if supplied, we check to see if any of the nodes is the puppetRoot and make sure we add it too.
# Returns : array of nodes
|
|
ps_func.getAnimNodesOfPoseNode pNode c =
|
# Description : gets the animatable nodes that belong to a poseNode
# Parameters : pNode : puppetNode
<node> c : node to search, usually a HUB, but can also be a digitHolder
# Returns : array of nodes
|
Functions_02.ms
|
ps_func2.isContInstanced cont layer =
|
# Description : Checks if a animation controller is instanced.
# Parameters :
<controller> cont : must be list controller
# Returns : true if instanced, false if not
|
|
ps_func2.isLocked puppetNode layer =
|
# Description : Checks if a layer is locked
# Parameters :
# Returns : true if locked
|
|
ps_func2.getPNodeFromMod mod =
|
# Description : finds node that is dependent on puppet tools modifier (used for floating rollouts)
# Parameters :
<modifier> mod : puppet tools modifier (this)
# Returns : node
# Note : We asume that only one puppetNode is a dependent node on the modifier, which should be true
|
|
ps_func2.renamePuppet puppetNode newName =
|
# Description : Renames a puppet
# Parameters :
<node> puppetNode : puppet to rename
<string> newName : new name for puppet
# Returns : ok
|
|
ps_func2.makeLayerUnique puppetNode animNodes tInd layIndex =
|
# Description : makes layer unique if it's instanced
# Parameters : <node> puppetNode : puppet node
<array> animNodes : all animation nodes in puppet
<integer> tInd : which timeline (index)
<integer> layIndex : index of layer to change
# Returns : ok
|
|
ps_func2.addNullToPuppet puppetNode anode =
|
# Description : add nulls to puppet, so it can get deleted when the puppet does
# Parameters :
<node> puppetNode : puppet node
<node> anode : node to add
# Returns : ok
|
|
ps_func2.delKeysTime cont range =
|
# Description : delete keys of a controller for time range
# Parameters : <controller> cont : must be list controller
# Returns : ok
|
|
ps_func2.swapKeys source target range =
|
# Description : swap keys within a time range
# Parameters :
<controller> source : source controller
<controller> target : target controller
<interval> range : time to swap keys for, keys otuside of range are left alone
# Returns : ok
# Note : Both controllers must be the same class and must support keys directly (so XYZ controller must provide the indivual float controllers)
|
|
ps_func2.getDigitNodes aNodes ca rotMethod flip =
|
# Description : gathers the proper digit nodes for rotateDigit function
# Parameters :
<array> aNodes : array of nodes (current selection of nodes)
<attribute> ca : custom attribute
<integer> rotMethod : 1==bend, 2==splay
<boolean> flip : if true, splay and bend are flipped
# Returns : array of nodes
|
|
ps_func2.rotateDigits digitNodes rotMethod val PrevVal flip =
|
# Description : Rotates a selection of digits around certain axis
# Parameters :
<array> digitNodes : array of nodes to be rotated
<integer> rotMethod : 1==bend, 2==splay
<float> val : slider value
<float> PrevVal : previous slider value
<boolean> flip : if true, splay and bend are flipped
# Returns :
|
|
ps_func2.faceNormal P1 P2 P3 =
|
# Description : gets normal from face.
# Parameters :
<node> p1,p2,p3 : 3 nodes that make up the face
# Returns : matrix3
|
|
ps_func2.setMarkerFilters puppetNode pupNames markerNames filt offsets agentRoot AdjustBoneLength:false =
|
# Description : Creates all constraints specified for attacking rig to markers.
# Parameters :
<node> puppetNode : puppet node
<array> pupNames : Array of puppet node names -- nodes to be constraint
<array> markerNames : Array of marker node names (strings) -- nodes we are constraining to
<array> filt : list of filters to apply (strings)
<array> offsets : Array of rotation offset (difference between bone and plane in default pose)
<node> agentRoot : root node of marker agent (as there can be multiple)
<boolean> AdjustBoneLength: if true, adjust bone lengths to markers
# Returns : ok
|
|
ps_func2.setClipEditMode puppetNode bool setRange:true =
|
# Description : Switches puppet into cutscene mode or out of cutscene mode (clip edit mode)
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<boolean> bool : true or false
<boolean> setRange : if true, we also update the max animationrange
# Returns : ok
# Note : If modify panel is open, it will not redraw the UI...
|
|
ps_func2.getClipcount puppetNode =
|
# Description : returns number of clips used in clipEditor (all tracks combined)
# Parameters :
# Returns : integer
|
|
ps_func2.addAnimLayerPostRig puppetNode each quiet:false =
|
# Description : adds animation layers to a node after the rig was done (used by add custom anim nodes)
# Parameters :
# Returns : ok
|
|
ps_func2.addnodeToCustomAnimList puppetNode nodesToReallyAdd linkToPnode:true =
|
# Description : adds node to custom anim node list (used by add custom anim nodes)
# Parameters :
# Returns : ok
|
|
ps_func2.addnodeToCustomHierarchyList puppetNode nodeToAdd linkToNode:undefined =
|
# Description : adds node to custom hierarchy node list
# Parameters :
# Returns : true or false
|
|
ps_func2.delNodeFromCustomAnimList puppetNode node index:unsupplied =
|
# Description : deletes a node from custom anim node list
# Parameters : <node> puppetNode : puppetNode that holds the node in the custom animation node list
<node> node : node to remove from the list
<integer> index : if you don't know the node, but you know the index in the list, you may supply the index instead
puppetNode must be selected and modify panel must be open to use index
# Returns : ok
|
|
ps_func2.delNodeFromCustomHierList puppetNode node index:unsupplied =
|
# Description : deletes a node from custom hier node list
# Parameters : <node> puppetNode : puppetNode that holds the node in the custom hierarchy node list
<node> node : node to remove from the list
<integer> index : if you don't know the node, but you know the index in the list, you may supply the index instead
puppetNode must be selected and modify panel must be open to use index
# Returns : ok
|
|
ps_func2.sortNodesForPose nodes =
|
# Description : sort nodes (semi hierarchical) for copying/ pasting / mirroring a pose
# Parameters :
# Returns : sorted array
# NOTE : This may also re-organize the puppetnode (and root node) so they are no longer garantueed to be at element 1 and 2
Keep that in mind for functions that need them at those elements!
|
|
ps_func2.copyRelativePose puppetNode centerNode nodes sTime buffer:undefined copyAttributes:true doSort:true doGC:true =
|
# Description : pastes relative pose
# Parameters : <node> centerNode : Node the is the center of the pose (generally first child of puppetNode)
<array> nodes : Nodes to be copied
<integer> sTime : Frame to copy
<modifier> buffer : location of buffer (arrays) to store pose in
<boolean> copyAttributes : copy attributes, which should always be true, except when doing the subtract pose.
<boolean> doSort : if true, make an attempt to sort nodes by constraints
<boolean> doGC : if false, don't do GC
# Returns : ok
# Note : Not sure if rotation constraints also need to use the exception code, for now it appears they do not...
We have to paste the pose a few times (pastePoseAmount) because unfortunatly our hierarchy can be so custom, that parents, children and constraints not always get copied in the right order
|
|
ps_func2.pasteRelativePose puppetNode nodes eTime respectLocks:true absolute:false pasteCA:true buffer:undefined dontSetPNodeRoot:false pastePoseAmount:5 dontSetPNode:false doGC:true useCopiedNodes:false =
|
# Description : pastes relative pose
# Parameters :
<array> nodes : Nodes to be copied, don't think this is used, but left in the function. It grab the nodes from buffer
<integer> eTime : Frame to paste too
<boolean> respectLocks : if true, it uses the transform locks to determine what to copy/paste
<boolean> absolute : if true, we copy a pose absolute, meaning we match the puppetNode and root to the pose before pasting.
<boolean> pasteCA : if true, paste attribute values
<modifier> buffer : location of buffer (arrays) to store pose in
<boolean> dontSetPNodeRoot: if true, we do not set the puppetNode and Root transform. Used by In-place reset position of puppetNode
<integer> pastePoseAmount : paste threshold, because we cannot garantuee that the parents are always set before children, due to constraints.
<boolean> dontSetPNode : see above, rootRotOnly
<boolean> doGC : if false, don't do GC
<boolean> useCopiedNodes : if true, use the nodes as copied into the buffer, if false, use the provided 'nodes' array. This options is used by puppet_pose copy/paste
# Returns : ok
# Note : Not sure if rotation constraints also need to use the exception code, for now it appears they do not...
We have to paste the pose a few times (pastePoseAmount) because unfortunatly our hierarchy can be so custom, that parents, children and constraints not always get copied in the right order
|
|
ps_func2.mirrorPose puppetNode iNodes eTime respectLocks:true pasteCA:true buffer:undefined quiet:false doSort:true pastePoseAmount:2 rotOnly:false doGC:true =
|
# Description : mirrors a pose
# Parameters :
<array> iNodes : Nodes to mirror to
<integer> eTime : Frame to paste too
<boolean> respectLocks : if true, it uses the transform locks to determine what to copy/paste
<boolean> pasteCA : if true, paste attribute values
<modifier> buffer : location of buffer (arrays) to store pose in
<boolean> quiet : if true, no messageboxes
<boolean> doSort : if true, attempts to sort nodes by hierarchy
<integer> pastePoseAmount : paste threshold, because we cannot garantuee that the parents are always set before children, due to constraints.
<boolean> rotOnly : if true, only mirror rotation no matter what the locks say. This can be useful to mirror fingers where you first want to mirror the rotation of the hand with 'rotOnly:true'
<boolean> doGC : if false, don't do GC
# Returns : ok
# Note : Puppetshop_Helpers classes are ignored from mirroring at this time due to break-nodes moving the leg (see code below)
|
|
ps_func2.subtractPose puppetNode root_node nodes eTime respectLocks:true buffer:undefined subBasePose:true range:undefined =
|
# Description : substract a pose from a layer
# Parameters :
<array> nodes : Nodes to be copied
<integer> eTime : Frame to substract too
<boolean> respectLocks : if true, it uses the transform locks to determine what to copy/paste
<modifier> buffer : location of buffer (arrays) to store pose in
<boolean> subBasePose : if true, substract basePose
# Returns : ok
|
|
ps_func2.deletePuppet pNode =
|
# Description : substract a pose from a layer
# Parameters :
<node> pNode : puppetNode
# Returns : ok
|
|
ps_func2.checkForPuppetTrackview ignoreOpen:false =
|
# Description : Checks if the puppet trackview is open or not
# Parameters :
# Returns : true if found, false if not
|
|
ps_func2.bakeSpineBones pNode spineNode puppetCont =
|
# Description : Bakes bend into spine bones and resets bend Ctrl
# Parameters :
# Returns : ok
|
|
ps_func2.delLayerName puppetNode ind =
|
# Description : deletes the name of a layer
# Parameters :
# Returns : ok
|
|
ps_func2.getActiveListController cont =
|
# Description : gets the active list controller out of nested list controllers
# Parameters : <controller> cont : controller to start search with (position, rotation or scale)
# Returns : active list controller
# Note :
1. Does not search puppet_float_lists (XYZ controller with lists on individual floats)
2. is used to replace some code in controllerFunctions.ms in stdPlugs
|
|
ps_func2.getNestedPuppetControllers cont pConts:undefined =
|
# Description : gets all nested puppet controller from a controller (list)
# Parameters :
# Returns : array of puppet_controllers
|
|
ps_func2.setActiveAnimation puppetNode ind animName:undefined setRange:true suspendRefresh:false gbc:true =
|
# Description : Switches to the correct timeline (automatically detects if timeline exists).
# Parameters : <node> puppetNode : PuppetNode of the character we are working on
<integer> ind : index of the animation you wish to switch to
<string> animName : you may also provide an animation instead of an index.
<boolean> setRange : if true, update max timerange
<boolean> suspendRefresh: if true, UI is not updated in setTimeLine function
<boolean> gbc : if true, setTimeline will do a garbage collection
# Returns : true is succesful, false if not
|
|
ps_func2.addClipLayersCAs clipCAs isClip:true =
|
# Description : Adds proper clip/track layer setup to rig attributes
# Parameters : <boolean> isClip : if true the attributes are fed as clip controller, if false, they are fed as lists
# Returns : ok
|
|
ps_func2.addClipLayers puppetNode =
|
# Description : Adds proper clip/track layer setup to rig
# Parameters :
# Returns : ok
|
|
ps_func2.addClip puppetNode row tInd =
|
# Description : adds clip to rig
# Parameters :
<integer> row : which row (we have 1-3 controllers in the list controller which act as different tracks or rows)
<integer> tInd : index of timeline clip we are adding
# Returns : ok
|
|
ps_func2.delClip puppetNode row clipInd =
|
# Description : delete clip from rig
# Parameters :
<integer> row : which row (we have 1-3 controllers in the list controller which act as different tracks or rows)
<integer> clipInd : index of clip we are deleting
# Returns : ok
|
|
ps_func2.clipDataToControllers puppetNode row offset scale clipIndex keepEnd sliceStart sliceEnd animIndex clipColor aNodes:undefined clipCas:undefined nodesToDisable:#() nodesToEnable:#() =
|
# Description : takes the existing clipArray and dumps the info back into all controllers.
# Parameters :
Most parameters are indentified in the code below
# Returns : ok
|
|
ps_func2.bakeClipSolution puppetNode sframe eframe quiet:false =
|
# Description : bake clip edit solution back to a keyed animation
# Parameters :
<node> puppetNode : puppetNode of the character you want to bake
<integer> sframe : first frame of baking region
<integer> eframe : last frame to bake
<boolean> quiet : if true, no messageboxes will pop-up
# Returns : ok
|
|
ps_func2.getSelectedClipIndices clipArray t =
|
# Description : returns the selected clips indices
# Parameters : <array> clipArray : array that has the clipEditor data
<integer> t : track ID (1 or 2)
# Returns : array: #( #(row, clipIndex), #(row, clipIndex), ... )
|
|
ps_func2.fixToe toe quiet:false =
|
# Description : Fixes old toes to stop instancing scale controller to prevent some save lock-ups
# Parameters :
<node> toe : toe node
# Returns : ok
|
|
ps_func2.PuppetPostFileOpen =
|
# Description : post file open callback function
# Parameters :
# Returns : ok
|
|
ps_func2.distancePoint3 vec vec2 =
|
# Description : distance between 2 point3s
# Parameters : <point3> vec : position A
<point3> vec2 : position B
# Returns : float
# Note : This is slower then calling the MXS 'distance' function
|
|
ps_func2.pointInSphere posSphere radius posPoint =
|
# Description : test if a point is in a sphere
# Parameters : <point3> posSphere : position of sphere
<float> radius : radius of sphere
<point3> posPoint : position of point
# Returns : true or false
|
|
ps_func2.closestPointOnSphere posSphere radius posPoint sphereTM =
|
# Description : closestPointOnSphere
# Parameters : <point3> posSphere : position of sphere
<float> radius : radius of sphere
<point3> posPoint : position of point
<Matrix3> sphereTM : transform of sphere
# Returns : point3
|
|
ps_func2.capsuleStartAndEnd capsule parTM:(matrix3 1)=
|
# Description : get start and end position from max geometry capsule
# Parameters : <node> capsule : max geometry capsule
<matrix3> parTM : relative to TM
# Returns : #(start, end)
|
|
ps_func2.distancePointToLine A B C =
|
# Description : measure distance between a point and a line
# Parameters : <point3> A : Line start
<point3> B : Line end
<point3> C : position of point
# Returns : float
|
|
ps_func2.pointInCapsule A B radius C =
|
# Description : is a point inside a capsule
# Parameters : <point3> A : Line start
<point3> B : Line end
<point3> C : position of point
<float> radius : radius of capsule
# Returns : true or false
|
|
ps_func2.closestPointOnCapsule A B radius C =
|
# Description : closestPointOnCapsule
# Parameters : <point3> A : Line start
<point3> B : Line end
<point3> C : position of point
<float> radius : radius of capsule
# Returns : point3
|
|
ps_func2.closeFloatingRollouts pNode:undefined =
|
# Description : closes floating rollouts of puppet tools
# Parameters :
# Returns : ok
|
|
ps_func2.PuppetPreFileOpen_reset =
|
# Description : pre file open callback function for resetting max before opening a new file, this seems to have positive effects on stability
# Parameters :
# Returns : ok
# Note : This function is no longer used as it made some computers unstable (Austin)
|
|
ps_func2.PuppetNodeNameSet =
|
# Description : rename callbacks. Since puppets should be rename via the puppet rollout, we pop a warning here
# Parameters :
# Returns : ok
# Note : This is a attempt to warn animators when the accidently rename a node in the rig. It's not bulletProof. Renaming through maxscript is still allow.
|
|
ps_func2.PuppetPreFileOpen =
|
# Description : pre file open callback function
# Parameters :
# Returns : ok
|
|
ps_func2.floatRollout pNode id =
|
# Description : makes a rollout floatable (used with puppet tools)
# Parameters :
# Returns : ok
|
|
ps_func2.loadAnimationToNewTimeline pNode animFile sframe:1.0 fromList:undefined toList:undefined loadAnim:true animS:1 animE:100 zeroLayers:true =
|
# Description : loads an animation from disk while automatically creating a new timeline (can also only create a new timeline)
# Parameters : <bool> loadAnim : if false, we do not load animation, this is used to create a new timeline via mxs (puppet struct)
# Returns : ok
|
|
ps_func2.refreshPuppetTrackview =
|
# Description : refreshes puppet trackview
# Parameters :
# Returns : ok
|
|
ps_func2.genMuscleGeo length bWidth bHeight bTaperEnd =
|
# Description : Generate Muscle Geometry
# Parameters :
# Returns : ok
|
|
ps_func2.initPuppetTrackview puppetNode:undefined =
|
# Description : Finds all controllers to be used in the puppetTrackview
# Parameters : <node> puppetNode : if undefined, this function will search all puppetNodes in the scene (slow), if supplied, only finds controllers for the supplied puppetNode
# Returns : ok
|
|
ps_func2.puppetToMax puppetNode =
|
# Description : converts most of a puppet to max compatible nodes, layers are simplified, puppet_tools removed, puppet_controller is kept.
# Parameters : <node> puppetNode : the puppet node
# Returns : ok
|
|
ps_func2.checkAnimationControllerActive puppetNode aNodes =
|
# Description : sets the animation controller to active (in case of a bug where the puppet_pose controller is active)
# Parameters :
<node> puppetNode : puppet node
<array> nodes : nodes to set pose of
<integer> frm : frame that has new pose
# Returns : ok
# Note : this is just to be sure we catch bugs in case the puppet_pose is active instead of the animation controller
|
|
ps_func2.refreshHierarchyPartID_ puppetNode =
|
# Description : sets partID_ on hierarchynodes. This fixes a bug in older puppetshop version where partID_ did not reflect the HUB ID.
# Parameters :
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_func2.matchListByName source_list target_list sourceSkip:"" targetSkip:"" appendNotFound:true =
|
# Description : re-organises a list to match with the names in the other list
# Parameters : <array> source_list, target_list : Array of strings (names)
<string> sourceSkip, targetSkip : string to skip in search (usually puppet name)
<boolean> appendNotFound : if true, append any names that we did not find a match for at the end of the list
# Returns : array if strings
|
|
ps_func2.activeFilter =
|
# Description : checks if active layer filter is on.
# Parameters :
# Returns : true or false
|
|
ps_func2.get2dfrom3d objPos screen_width screen_height =
|
# Description : gets a 2d coordinate from a 3d one
# Parameters :
# Returns : point2
# Note : this function is not working correctly yet
|
|
ps_func2.drawSpline ca partID drawX_ drawY_ snapZ_ snapFK_ =
|
# Description : allows the animator to draw the shape of a tail in a traditional way by drawing on screen
# Parameters :
# Returns : ok
|
|
ps_func2.storeBaseTM puppetNode =
|
# Description : Stores base Transform on node
# Parameters :
<node> puppetNode : puppetNode
# Returns : ok
|
|
ps_func2.replaceMaxListWithPuppetList subAnm newPuppetListController =
|
# Description : Takes the contents of the max list controller and weight controllers and puts them in a puppet list controller
# Parameters :
<SubAnim> subAnm : subAnim that has the max list controller assigned to it
<controller> newPuppetListController : the new controller to be used, i.e. puppet_puppet_rotation_list
# Returns : ok
|
|
ps_func2.convertToPuppetTMandLISTcontrollers subAnm setTM:true =
|
# Description : converts all max list and TM controller into puppetshop ones
# Parameters :
<SubAnim> subAnm : usually you'd feed it all animNodes of the puppetNode here, anything that support .numSubs
# Returns : ok
|
|
ps_func2.convertToPuppetControllers puppetNode =
|
# Description : convert puppet to puppet list and tm controllers
# Parameters :
<node> puppetNode : puppetNode to convert
# Returns : ok
# example : ps_func2.convertToPuppetControllers $
ps_func2.convertToPuppetControllers $'HMM_EX_RifleMain_World'
gc(); gc(); gc()
aNodes = $.modifiers["Puppet Tools"].getAnimNodes()
-- insertItem $ aNodes 1
for each in aNodes do (if classof each.controller == prs then each.controller = puppetTMController() )
|
|
ps_func2.rig_puppet puppetNode twoTimelines:false =
|
# Description : Rigs the puppet
# Parameters : <node> puppetNode : the puppet node
<boolean> twoTimelines : if true, create 2 timelines when puppet is rigged
# Returns : ok
|
|
ps_func2.getPuppetControllerLockState =
|
# Description : used by c++ controller to check 'writability' of controllers
# Parameters :
# Returns : true or false
|
Functions_Build.ms
|
ps_build.ver =
|
# Description : Prints version number
# Parameters : none
# Returns : integer
|
|
ps_build.cleanMem cnt:3 sd:false L:false =
|
# Description : Tries to clean up the maxscript memory
# Parameters :
<integer> cnt : how often to gc
<boolean> sd : if true, remove sceneDefs
<boolean> L : light gc or not
# Returns : ok
|
|
ps_build.nodePostDelete =
|
# Description : Relays preDelete to new location
# Parameters : none
# Returns : ok
# Note : This is added to stay compatible with puppets made in the first beta.
|
|
ps_build.addUnriggedCallbacks puppetNode =
|
# Description : Generates HUBID and delete callbacks for newly created unrigged puppetNodes
# Parameters : <node> puppetNode : unrigged puppetNode
# Returns : ok
|
|
ps_build.nodePreDelete =
|
# Description : Relays preDelete to new location
# Parameters : none
# Returns : ok
# Note : This is added to stay compatible with puppets made in the first beta.
|
|
ps_build.blendColors colA colB blend =
|
# Description : Blends 2 colors
# Parameters : <color> colA : first color
<color> colB : second color
<float> blend : amount to blend (0.0 - 1.0)
# Returns : color
|
|
ps_build.gradientWireColor lstNodes vStartColor:undefined fromTo:false =
|
# Description : Gradient colors the wires of nodes
# Parameters : <Array> lstNodes : array of nodes.
<point3> vStartColor : Color of first node
<boolean> fromTo : if true, we gradient from the first selected color to the last selected color
# Returns : ok
# Note : This is not a function without flaws when fromTo is false, but it'll do for now.
It doesn't do well when your start color is light
|
|
ps_build.find_characterHUB node =
|
# Description : Find the puppetNode that belongs to any selected node
# Parameters : <node> node : node to find hub of
# Returns : a node or undefined
# NOTE :
|
|
ps_build.findPuppetNode node =
|
# Description : Find the puppetNode that belongs to any selected node, but also supports rigged puppets
# Parameters : <node> node : node to find hub of
# Returns : a node or undefined
# NOTE :
|
|
ps_build.find_all_parents node parentArray:undefined =
|
# Description : Finds alls parents below a specified node
# Parameters : <node> node : node to find parents of
<array> parentArray : all nodes that where found
# Returns : an array of nodes
# NOTE :
|
|
ps_build.find_all_parents_rigged pNode node parentArray:undefined =
|
# Description : Finds alls parents below a specified node for RIGGED
# Parameters : <node> node : node to find parents of
<array> parentArray : all nodes that where found
# Returns : an array of nodes
|
|
ps_build.find_common_ancestor node1 node2 =
|
# Description : Finds the first common ancestor of two nodes
# Parameters : <node> node1 : first node
<node> node2 : second node
# Returns : a node
# NOTE :
|
|
ps_build.find_common_ancestor_rigged pNode node1 node2 =
|
# Description : Finds the first common ancestor of two nodes, for rigged puppets
# Parameters :
<node> pNode : puppetNode
<node> node1 : first node, has to be an animation node
node2 : second node, has to be an animation node
# Returns : a node
|
|
ps_build.addPoseLayers node =
|
# Description : Adds default pose layers to the object
# Parameters : <node> node : node to add layers to
# Returns : ok
# Note : We do not allow for different poses during bone building anymore
So really we do not need to add layers, however, we kept it
as we might want to allow for this again in the future
If you change this function, you might also need to change
the function that adds layers to toes (special case)
|
|
ps_build.addToeLayers node floor =
|
# Description : Adds special layers to toes
# Parameters : <node> node : the toe
<node> floor : floor the toe belongs to
# Returns : ok
# Note : Toes are an exception to other objects as they inherit the rotation
of the floor the belong too.
(they can still have rotation of themselves on top of that)
|
|
ps_build.getChainParent node =
|
# Description : Finds the last parent until a HUB is found (used for deleting a chain of objects)
HUBS are the first nodes of a certain chain. (I.e. the Upper Leg)
# Parameters : <node> node : node to find chain parent of
# Returns :
# NOTE :
|
|
ps_build.getChainPuppetParent puppetNode node fkIsHUB:false =
|
# Description : Finds the last parent until a HUB is found (used for deleting a chain of objects)
HUBS are the first nodes of a certain chain. (I.e. the Upper Leg)
This uses the 'getPuppetParent' function, so only works on 'rigged' puppets
# Parameters : <node> node : node to find chain parent of
<boolean> fkIsHUB : if true, we also consider fkNodes to be HUBs
# Returns :
# NOTE :
|
|
ps_build.getParentOfClass node theClass =
|
# Description : Finds the last parent of a certain class
# Parameters : <node> node : node to find parent of
<string> theClass : class to find
# Returns :
# NOTE :
|
|
ps_build.getMyChildren parent objArray:undefined toClass:#("undefined") ignoreClass:#("undefined") includeToClass:false checkForPuppetShop:true =
|
# Description : Finds all children in the hierarchy starting with the current selected object
# Parameters : <node> parent : node to find children of
<array> objArray : holds all objects that where found
<stringtab> toClass : keep searching until you hit any of these classes
<stringtab> ingnoreClass : ignore any objects with the class in this array (skip them, but keep on searching)
<boolean> includeToClass : adds the object with class toClass into objArray
<boolean> checkForPuppetShop : if true, only adds nodes that are of the puppetshop group
# Returns : array of nodes
# NOTE :
|
|
ps_build.getSameClassChildren parent theClass objArray:undefined =
|
# Description : Get children of the same class as the node
# Parameters : <node> parent : node to find children of
<string> theClass : class of objects to search for
<array> objArray : holds all nodes found
# Returns : array of objects
# NOTE :
|
|
ps_build.getChildrenOfClass parent theClassesArray objArray:undefined alwaysSearchChildren:true =
|
# Description : Goes through a hierarchy and finds all children of certain classes
# Parameters : <node> parent : node to find children of
<stringtab> theClassesArray : classes to look for
<array> objArray : holds all objects found
# Returns : array of objects
# NOTE :
|
|
ps_build.getNodeByClassRigged puppetNode obj nodeClass fNodes:undefined =
|
# Description : Goes through a hierarchy and finds all nodes of a certain class, for rigged puppets
# Parameters : <node> puppetNode : puppet Node
<node> obj : node where to start search, usually the root
<class> nodeClass : class of object to search for, for example: puppetShop_head
# Returns : array of objects
# NOTE :
|
|
ps_build.refreshCharacterGlobals whichLimb =
|
# Description : Updates the global ps_puppetSize
# Parameters : <node> whichLimb : node we are working on (usually the selected object)
# Returns : ok
# NOTE : Proper update of the global ps_puppetSize is very important if there are more then
one puppet being build in the scene. We run this function before every creation of new nodes
as nodes get created relative to the puppet's size.
|
|
ps_build.getNodeByNumber anode num =
|
# Description : gets a node of the puppet by number (used by several rig options such as muscle bones)
# Parameters :
<node> anode : give it any node in a puppet and it will find the puppetNode itself
<integer> num : number of which we want the node
# Returns : node
|
|
ps_build.getIndexOfNode anode =
|
# Description : opposite of above, finds a index number for a node in the puppet
# Parameters :
<node> anode : give it any node in a puppet and it will find the puppetNode itself
<integer> num : number of which we want the node
# Returns : integer
|
|
ps_build.getNodeByNumberRigged puppetNode num =
|
# Description : gets a node of the puppet by number (used by several rig options such as muscle bones) but then when puppet is rigged
# Parameters :
<node> anode : give it any node in a puppet and it will find the puppetNode itself
<integer> num : number of which we want the node
# Returns : node
|
|
ps_build.createLegNode parent:undefined isRoot:false =
|
# Description : Creates a new leg node
# Parameters :
<node> parent : parent
<boolean> isRoot : wheter it is the first node of the chain (upper leg) or not
# Returns : node
# NOTE :
|
|
ps_build.createFootNode side parent:undefined =
|
# Description : Creates a new foot node
# Parameters :
<string> side : "R" or "L" which side of the character
<node> parent : parent
# Returns : node
# NOTE :
|
|
ps_build.default_leg whichHUB side col =
|
# Description : Creates a new leg
# Parameters :
<node> whichHUB : Which parent. No longer has to be a HUB, can be any node
<string> side : "R" or "L" which side of the character
<color> col : Color of the upperleg
# Returns : ok
# NOTE :
|
|
ps_build.add_new_leg whichHUB =
|
# Description : Creates a new leg
# Parameters :
<node> whichHUB : Which parent node. No longer has to be a HUB, can be any node.
# Returns : ok
# NOTE :
|
|
ps_build.createArmNode parent:undefined isRoot:false =
|
# Description : Creates a new Arm node
# Parameters :
<node> parent : parent
<boolean> isRoot : wheter it is the first node in the chain (clavicle) or not
# Returns : node
# NOTE :
|
|
ps_build.createHandNode side parent:undefined =
|
# Description : Creates a new Hand node
# Parameters :
<node> parent : parent
<string> side : "R" or "L" which side of the character
# Returns : node
# NOTE :
|
|
ps_build.default_arm whichHUB side col =
|
# Description : Creates a new arm
# Parameters :
<node> whichHUB : Which parent. No longer has to be a HUB, can be any node
<string> side : "R" or "L" which side of the character
<color> col : Color of the clavicle
# Returns : ok
# NOTE :
|
|
ps_build.add_new_arm whichHUB =
|
# Description : Creates a new arm
# Parameters :
<node> whichHUB : Which parent node. No longer has to be a HUB, can be any node.
# Returns : ok
# NOTE :
|
|
ps_build.setChildrenOffset whichLimb =
|
# Description : child Offsets are stored when the user changes the length of a bone (buttondown)
# Parameters :
<node> whichLimb : The limb we are changing the length of
# Returns : ok
# NOTE :
|
|
ps_build.scale_limb whichLimb =
|
# Description : changes the length of a limb and moves it's children
# Parameters :
<node> whichLimb : The limb we are changing the length of
# Returns : ok
# NOTE :
|
|
ps_build.add_digit whichLimb =
|
# Description : Adds a digit to a digitHUB
# Parameters :
<node> whichLimb : Foot or hand
# Returns : ok
# NOTE :
|
|
ps_build.add_face whichLimb =
|
# Description : Adds a face bone to a head
# Parameters :
<node> whichLimb : head
# Returns : ok
# NOTE :
|
|
ps_build.spawnFKnode whichLimb =
|
# Description : Spawns a fk node
# Parameters :
<node> whichLimb : node we are attaching the FK bone to
# Returns : ok
# NOTE :
|
|
ps_build.createRootNode puppetNode =
|
# Description : Creates a new root node
# Parameters :
<node> puppetNode : puppet node
# Returns : node
|
|
ps_build.add_spine whichLimb =
|
# Description : Spawns a spine node
# Parameters :
<node> whichLimb : node to attached first spine node to
# Returns : first spine node
# NOTE :
|
|
ps_build.add_tail whichLimb =
|
# Description : Spawns a tail node
# Parameters :
<node> whichLimb : node to attached first spine node to
# Returns : first tail node
# NOTE :
|
|
ps_build.add_head whichLimb =
|
# Description : Spawns a neck node
# Parameters :
<node> whichLimb : node to attached first neck node to
# Returns :
# NOTE :
|
|
ps_build.insertBone whichLimb =
|
# Description : Inserts an extra bone
# Parameters :
<node> whichLimb : any node in a chain (we will find the chain parent in this function)
# Returns : ok
# NOTE : new bones always get inserted at the end of the chain of same class bones as whichlimb.
|
|
ps_build.removeBone whichLimb =
|
# Description : Removes a bone
# Parameters :
<node> whichLimb : any node in a chain (we will find the chain parent in this function)
# Returns : ok
# NOTE : We always remove the last bone in the chain of same class bones as whichlimb
|
|
ps_build.copyPose theNode copyChildren:false =
|
# Description : Copies a pose
# Parameters : <node> theNode : node we are copying properties of
<boolean> copyChildren : wheter to also copy the hierarchy past the current node.
# Returns : ok
# NOTE :
Warning! : If you are going to allow to copy and paste properties between any bone,
be sure to not allow for pasting of nodetabs. I.e. If you allow one hub's settings
to be pasted to another, you'd really break things.
Follow-up: Currently we don't store any nodetabs, so this warning no longer applies.
However, you never know exactly what the user is going to store on a node.
|
|
ps_build.pastePose theNode pasteChildren:false keepthePos:false copyBoneSet:true BoneMeshOnly:false =
|
# Description : Pastes a pose
# Parameters : <node> theNode : node we are working on
<boolean> pasteChildren : wheter to also paste to rest of hierarchy (past theNode)
<boolean> keepthePos : keep position of first bone even after pasting
<boolean> copyBoneSet : wheter to also copy bone settings like length, width, taper etc.
<boolean> BoneMeshOnly : wheter to only copy the bonesettings (like length, width, taper etc)
# Returns : ok
# NOTE :
|
|
ps_build.mirrorPose theNode mirrorAround mirrorChildren:false keepthePos:false copyBoneSet:true BoneMeshOnly:false =
|
# Description : mirrors a pose
# Parameters : <node> theNode : node we are working on
<node> mirrorAround : which node we are mirroring around (i.e. hips)
<boolean> mirrorChildren : wheter to also mirror-paste to rest of hierarchy (past theNode)
<boolean> keepthePos : keep position of first bone even after pasting
<boolean> copyBoneSet : wheter to also copy bone settings like length, width, taper etc.
<boolean> BoneMeshOnly : wheter to only copy the bonesettings (like length, width, taper etc)
# Returns : ok
# NOTE :
|
|
ps_build.adjustTwistBone whichLimb theInt =
|
# Description : Inserts and adjusts Twist bones
# Parameters :
<node> whichLimb : node that has the twist bones
<integer> theInt : 1 adds a twist bone, -1 removes a twist bone
# Returns : ok
# NOTE :
|
|
ps_build.spread_length whichLimb =
|
# Description : equalizes the length of a bunch of bones.
# Parameters :
<node> whichLimb : start spreading the length starting from this node until we hit a node of a different class
# Returns : ok
# NOTE :
|
|
ps_build.cloneChain theNode useOffset:true ToBeMirrored:false =
|
# Description : Matches the number of nodes and their properties from one chain (source) to another (target)
# Parameters : <node> theNode : chain parent (first node in a chain)
<boolean> useOffset : wheter to offset the new created nodes or not
<boolean> toBeMirrored : if the nodes are going to be mirrored after cloning them, we need to re-color them
# Returns : array of nodes
# NOTE :
|
Functions_Constraints.ms
|
ps_constraints.Rot_filter puppetNode sNode tNode relative:false =
|
# Description : Rotation constraints one object to another
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
<boolean> relative : wheter to make the constraint relative or not
# Returns : ok
|
|
ps_constraints.RotRel_filter puppetNode sNode tNode =
|
# Description : Rotation relative
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.Pos_filter puppetNode sNode tNode relative:false =
|
# Description : Position constraints one object to another
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
<boolean> relative : wheter to make the constraint relative or not
# Returns : ok
|
|
ps_constraints.PosRel_filter puppetNode sNode tNode =
|
# Description : Position constraints one object to another, keeping the original offset
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.Pos_Rot_filter puppetNode sNode tNode rot_relative:false pos_relative:false =
|
# Description : Position and Rotation constraints one object to another
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
<boolean> relative : wheter to make the constraint relative or not
# Returns : ok
|
|
ps_constraints.PosRel_Rot_filter puppetNode sNode tNode =
|
# Description : Position and rotation constraints one object to another, keeping the original offset on position
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.Pos_RotRel_filter puppetNode sNode tNode =
|
# Description : Position and rotation constraints one object to another, keeping the original offset on position
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.PosRel_RotRel_filter puppetNode sNode tNode =
|
# Description : Position and rotation constraints one object to another, keeping the original offset on position
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.Limb_Swivel_filter puppetNode sNode tNode =
|
# Description : Sets up a script controller that simulates the position of the swivel angle ctrl.
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
# NOTE : The tNode should be the lower leg (knee) or lower arm (elbow).
This filter only works well if the lower leg and upper leg only rotate on 1 axis away from each other.
If more angles are used, another filter should be used.
sample code: ps_constraints.Leg_SwivelNode_filter $'Puppet01_World' $'Puppet01_RightHip-Swivel01' $'RightKnee'
|
|
ps_constraints.PosAIM_RotRel_filter puppetNode sNode tNode posrel:false rotrel:true =
|
# Description : Position and rotation constraints one object to another, Adding ReTargeting option to constraint, keeping rotation relative
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.PosRelAIM_RotRel_filter puppetNode sNode tNode =
|
# Description : Position and rotation constraints one object to another, Adding ReTargeting option to constraint, keeping position and rotation relative
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.FootPivot_filter puppetNode sNode tNode =
|
# Description : Allows the foot pivot to stay where it is while importing mocap (instead of snapping the foot pivot to the ankle)
# Parameters :
<node> puppetNode : puppet node
<node> sNode : Node to be constraint
<node> tNode : Target node
# Returns : ok
|
|
ps_constraints.AdjustLength aNode lengthNodes =
|
# Description : adjust length
# Parameters :
<node> aNode : node to adjust length of
<array> lengthNodes : array of 2 nodes that determine new lenght of bone.
# Returns : ok
|
|
ps_constraints.rotScriptConstraint puppetNode anode tNode oQuat timeLines:true =
|
# Description : Rotation constrain (local controller value)
# Parameters :
<node> puppetNode : puppet node
<node> anode : node that needs to get the constraint
<node> tNode : target node
<quat> oQuat : quaternion offset
# Returns : ok
|
|
ps_constraints.FaceRot_filter puppetNode sNodes tNodes offsets agentRoot AdjustBoneLength:false timeLines:true relToBone:undefined addPos:false =
|
# Description : Rotation constrain to face (triangle)
# Parameters :
<node> puppetNode : puppet node
<Array> sNodes : array of Nodes to be constraint
<Array> tNodes : Target nodes
<Array> offsets : Array of rotation offsets (difference between bone and plane in default pose)
<node> agentRoot : root node of markers
<boolean> AdjustBoneLength: if true, adjust bone lengths to markers
<boolean> timeLines : if true, make sure constraint is set on correct timeline controller, if false, we asume there is no timeline.
<node> relToBone : if supplied, relTobone specifies a bone that the matrix is relative to (parent).
<boolean> addPos : add position constaint to stay position wise inbetween the 3 markers (useful for rigid body solves)
-- rigid body solver:
-- make helpers called point01
-- run below script:
-- ps_constraints.FaceRot_filter $'Puppet01_World' #($'Point01') #($'Puppet01_C7', $'Puppet01_T10', $'Puppet01_RSHO') #() undefined timeLines:false addPos:true
-- create another helper, point02
-- align it with target marker (CLAV) at basePose where this marker is in the right spot
-- link point02 to point01, you should now have a stable chest marker
# Returns : ok
|
|
ps_constraints.PosBlend_FaceRot_filter puppetNode sNodes tNodes offsets agentRoot AdjustBoneLength:false =
|
# Description : position blend to multiple markers and rotation constraint to face
# Parameters :
<node> puppetNode : puppet node
<Array> sNodes : array of Nodes to be constraint
<Array> tNodes : Target nodes
<Array> offsets : Array of rotation offsets (difference between bone and plane in default pose)
<node> agentRoot : root node of markers
<boolean> AdjustBoneLength: if true, adjust bone lengths to markers
# Returns : ok
|
|
ps_constraints.TwoFaceBlend_filter puppetNode sNodes tNodes offsets agentRoot AdjustBoneLength:false =
|
# Description : Blend rotation between two faces (spine)
# Parameters :
<node> puppetNode : puppet node
<Array> sNodes : array of Nodes to be constraint
<Array> tNodes : Target nodes
<Array> offsets : Array of rotation offsets (difference between bone and plane in default pose)
<node> agentRoot : root node of markers
<boolean> AdjustBoneLength: if true, adjust bone lengths to markers
# Returns : ok
|
|
ps_constraints.OneFaceBlend_filter puppetNode sNodes tNodes offsets agentRoot AdjustBoneLength:false =
|
# Description : Blend rotation to face rotation (neck)
# Parameters :
<node> puppetNode : puppet node
<Array> sNodes : array of Nodes to be constraint
<Array> tNodes : Target nodes
<Array> offsets : Array of rotation offsets (difference between bone and plane in default pose)
<node> agentRoot : root node of markers
<boolean> AdjustBoneLength: if true, adjust bone lengths to markers
# Returns : ok
|
|
ps_constraints.FaceIKSwivel_filter puppetNode sNodes tNodes offsets agentRoot AdjustBoneLength:false =
|
# Description : Setup IK and use face to determine swivel
# Parameters :
<node> puppetNode : puppet node
<Array> sNodes : array of Nodes to be constraint
<Array> tNodes : Target nodes
<Array> offsets : Array of rotation offsets (difference between bone and plane in default pose)
<node> agentRoot : root node of markers
<boolean> AdjustBoneLength: if true, adjust bone lengths to markers
# Returns : ok
|
|
ps_constraints.setConstraintFilters puppetNode src targ filt agentRoot barRol:undefined =
|
# Description : Creates all constraints specified. Src are the animatable nodes in the rig, targ are the mocap bones.
# Parameters :
<node> puppetNode : puppet node
<array> src : Array of src nodes names (strings) -- nodes to be constraint
<array> targ : Array of target nodes names (strings) -- nodes we are constraining to
<array> filt : list of filters to apply (strings)
<node> agentRoot : root node of mocap agent (as there can be multiple)
<progressbar> barRol : rollout that holds the progressbar
# Returns : ok
|
Functions_Mocap.ms
|
ps_mocap.skipSpaces istream =
|
# Description : Skips Spaces in a stream
# Parameters :
<stringStream> istream : file
# Returns : string
|
|
ps_mocap.isUnEven num =
|
# Description : checks wheter a number is even of uneven
# Parameters :
integer num : integer we wish to check
# Returns : ok
|
|
ps_mocap.swapRightWithLeft ar =
|
# Description : swap two strings in an array of strings, useful for mirroring
# Parameters :
array ar : array of strings
# Returns : array of strings
|
|
ps_mocap.swapProps puppetNode nodes bframe thold:2.0 =
|
# Description : swaps prop nodes left and right, if they are within threshold
# Parameters :
array nodes : array of nodes
<float> thold : search threshold
# Returns : ok
|
|
ps_mocap.setDataChannel cData =
|
# Description : Adds a data channel to dataChannels array
# Parameters :
<string> cData : channel data for a node
# Returns : ok
|
|
ps_mocap.newJoint nodeName:#() pos:[0,0,0] addParentName:false bFrame:undefined asf:false =
|
# Description : Creates a new joint null in max scene
# Parameters :
<array> nodeName : array of strings for name of node. This is an array because we used filterstring " " on readline
<point3> pos : position of node (relative to parent)
<boolean> addParentName : wheter to add parent name to nod ename or not (useful for end nodes)
<integer> bFrame : base frame. If specified, we key the position and rotation of the joint. (useful to SET base_pose)
<boolean> asf : if true, we skip setting the parent and a few other things, we use this for our asf importer
# Returns : node created
|
|
ps_mocap.visualizeBone startNode endNode =
|
# Description : Builds visual bones for the BVH skeleton
# Parameters :
# Returns : mocapBone
|
|
ps_mocap.closeJoint =
|
# Description : closes a joint, which means it get removed as potential parent for other nodes
# Parameters :
# Returns : ok
|
|
ps_mocap.readBVH puppetNode str s_frame:1.0 center:false rotate:true skipAgentCheck:false readMotion:true visualize:true noWarnings:false ypositive:false localcopy:true bFrame:0 scaleFactor:1.0 keyAtFrames:true =
|
# Description : read in a BVH skeleton and animation
# Parameters :
<node> puppetNode : puppet node
<string> str : path to BVH file to load
<integer> s_frame : Start frame of animation
<boolean> center : wheter to center the imported mocap in the scene
<boolean> rotate : wheter to rotate the mocap default values to match max's world (depends on which source this BVH comes from)
<boolean> skipAgentCheck : skips the check for mocap agents
<boolean> readMotion : wheter to read in the motion
<boolean> visualize : wheter to create the visualisation bones or not (they srve no purpose other then visualizing the rig for the animator)
<boolean> noWarnings : When true, it will not pop up any warning messages.
<boolean> ypositive : when true, Y will point in the positive direction (front will be back). Lots of game engines have this, but max doesn't.
<boolean> localcopy : if true, then we copy the bvh to local disk first (faster)
<integer> bFrame : base frame
<float> scaleFactor : scales incoming mocap rig by this much
<boolean> keyAtFrames : if true, places keys only at whole frames, not inbetween frames
# Returns : root node of mocap agent
|
|
ps_mocap.getIndent =
|
# Description : Determines how much to indend the hierarchy
# Parameters :
# Returns : string
|
|
ps_mocap.writeJoints puppetNode root_node ostream base_frame:0 exportPos:false nodeList:#() parList:#() stripName:false nameToStrip:"" useHeight:false tmList:undefined =
|
# Description : writes a hierarchy of joints to a file stream
# Parameters :
<node> puppetNode : puppet node
<node> root_node : first node, usually hips or first spine bone.
<stream> ostream : file we are writting to
<integer> base_frame : first frame of mocap
<boolean> exportPos : Wheter to export position keys or not
<array> nodeList : array of Nodes to use for export. If empty, all nodes in puppet will be used.
<array> parList : array of parent nodes.
<boolean> stripName : wheter to strip of puppetnode name from each node's name
<string> nameToStrip : If you do not want to use the puppetNode name, provide a name here, to strip this string of each node's name
<boolean> useHeight : allows you to use the height, instead of length to position end bones (used for ASF conversion to BVH)
<stringArray> tmList : if supplied, we use this list to determine wheter to export position and rotation or just rotation.
# Returns : ok
|
|
ps_mocap.writeMotionData puppetNode root_node childNodes s_frame e_frame ostream base_frame:-1 writeFrame0:false exportPos:false forceParents:#() tmList:undefined =
|
# Description : write motion data
# Parameters :
<node> puppetNode : puppet node
<node> root_node : first node, usually hips or first spine bone.
<array> childNodes : all other nodes that need their motion saved.
<integer> s_frame : start frame to save
<integer> e_frame : end frame to save
<stream> ostream : file we are writting to
<integer> base_frame : First frame, frame 0, skin pose etc.
<boolean> exportPos : Wheter to export position or not
<array> forceParents : If you want to force certain parents, you can use this array. (Mostly just useful for CS BVH export)
<stringArray> tmList : if supplied, we use this list to determine wheter to export position and rotation or just rotation.
# Returns : ok
|
|
ps_mocap.writeBVH puppetNode str s_frame e_frame center:false rotate:true addFrame_0:false exportPos:false base_frame:-1 root_node:undefined nodeList:#() skipReset:false stripName:false tmList:undefined =
|
# Description : write out a BVH skeleton and animation
# Parameters :
<node> puppetNode : puppet node
<string> str : path to BVH file
<integer> s_frame : Start frame of animation
<integer> e_frame : End frame of animation
<boolean> center : wheter to center the imported mocap in the scene
<boolean> rotate : wheter to rotate the mocap default values to match default BVH world
<boolean> addFrame_0 : wheter to export frame 0 to the mocap file as well (makes constraining easier)
<boolean> exportPos : wheter to export position for all bones (in case position was animated)
<integer> base_frame : frame that holds the skin-pose
<node> root_node : Force a root_node to be used
<array> nodeList : list of nodes to export to BVH (only useful for default human export)
<boolean> skipReset : wheter or not to reset the pose (set to false for default human export)
<boolean> stripName : wheter to strip of the puppetNode name from each node's name or not
<stringArray> tmList : if supplied, we use this list to determine wheter to export position and rotation or just rotation.
# Returns : ok
|
|
ps_mocap.openConstraint_rol =
|
# Description : Opens the constraint rollout
# Parameters :
# Returns : ok
|
|
ps_mocap.refresh_filterList =
|
# Description : updates the to and from lists
# Parameters : from_lst : string array with all FROM animation node names
<array> to_lst : string array with all TO animation node names
# Returns : ok
|
|
ps_mocap.refresh_lists from_list to_list =
|
# Description : updates the to and from lists
# Parameters : from_lst : string array with all FROM animation node names
<array> to_lst : string array with all TO animation node names
# Returns : ok
|
|
ps_mocap.cs_offset aNode aParent bFrame:0 endJoint:false =
|
# Description : returns offset value of a node
# Parameters :
<node> anode : Node we are grabbing offset from
<node> aParent : Parent node of anode
<integer> bFrame : base_frame
# Returns : point3
|
|
ps_mocap.cs_hierarchy hierarchyNodes ostream bFrame:0 =
|
# Description : Outputs the default Character Studio Hierarchy
# Parameters :
<array> hierarchyNodes : scene nodes that corrispond with the biped nodes.
<stringstream> ostream : output stream
<integer> bFrame : base_frame
# Returns : ok
|
|
ps_mocap.collectNodes puppetNode nodeList getFromHierarchy:false searchInThisList:undefined prefixName:"" =
|
# Description : returns nodes to use for cs BVH
# Parameters :
<node> puppetnode : puppetNode
<array> nodeList : List of node names that we are going to use to make CS BVH out of
<boolean> getFromHierarchy : if true, collect nodes from hierarchyNodes instead of animNodes
<array> searchInThisList : provide a list of nodes to search in instead
<string> preFixName : this string gets added to thenames in the provides nodeList
# Returns : Array of nodes
|
|
ps_mocap.save_cs_bvh puppetNode srcList =
|
# Description : Saves a BVH file compatible with Character Studio to disk
# Parameters :
<node> puppetnode : puppetNode
<array> srcList : Item list
# Returns : Array of nodes
|
|
ps_mocap.CharacterStudioFilter =
|
# Description : Opens the Character Studio filter rollout
# Parameters :
# Returns : ok
|
|
ps_mocap.refresh_lists puppetSize =
|
# Description : updates the to and from lists
# Parameters : from_lst : string array with all FROM animation node names
<array> to_lst : string array with all TO animation node names
<float> puppetSize : size of puppet loaded
# Returns : ok
|
|
ps_mocap.exportBVH_CS puppetnode myfile =
|
# Description : Converts BVH to character studio compatible BVH
# Parameters :
# Returns : ok
|
|
ps_mocap.duplicateToWorld node parent bFrame:-1 =
|
# Description : Duplicates a node (with animation) to a new parent but keeps the transform the same (for mocap nodes world retargeting)
# Parameters : <node> node : original mocap bone
<node> parent : parent for new bone (usually mocap world)
# Returns : new node
|
|
ps_mocap.getBoundingBox setOfNodes =
|
# Description : return_ bounding box of objects
# Parameters :
# Returns : ok
|
|
ps_mocap.getWristTwist pw pf1 pf2 mw mf1 mf2 =
|
# Description : measure rotation between mocap wrist and puppet wrist
# Parameters :
<node> pw : puppet wrist node
<node> pf1 : puppet finger 1 (usually PinkFinger)
<node> pf2 : puppet finger 2 (usually IndexFinger)
<node> mw : mocap wrist node
<node> mf1 : mocap finger 1 (same as pf1 but for mocap)
<node> mf2 : mocap finger 2 (same as pf2 but for mocap)
# Returns : quat (rotation difference between the two)
# Note : nodes MUST be given in the correct order
to apply to mocap wrist, use:
in coordsys (transmatrix mw.transform.pos) mw.rotation
|
|
ps_mocap.mocapReMap mocapNode difTM:undefined axis:undefined =
|
# Description : remaps mocap nodes to an puppet rig
# Parameters :
<node> mocapNode : node in mocap, this is the parent, we are also using it's children
<matrix3> difTM : difference bewteen the default matrix of the parent node looking at the child, and where the parent is really 'looking'.
<point3> axis : axis to use for z normal
# Returns : ok
# Note : You always have to run this function twice, first to find the difTM (see above), then you move the child node,
and run this function again, to get the new TM for the parent.
|
|
ps_mocap.remapHierarchy pNodeName parentNode nodesInPuppet bFrame skip:undefined skipEnds:false retargetFingers:true retargetSpine:true retargetFeet:true preserveLength:false =
|
# Description : remaps mocap nodes to an puppet rig
# Parameters : <string> pNodeName : name of puppetNode
<node> parentNode : root of mocap, usually
<array> nodesInPuppet : nodes in puppet to align too
<integer> bFrame : base frame time (usually frame 0)
<node> skip : Skip node is usually the rootnode of the mocap (agentRoot). You do not want to re-orient the mocap root, but you do want to move it's children into place.
<boolean> skipEnds : if true, we do not remap end of site bones, useful for certain mocap files
<boolean> retargetFingers : if false, do not retarget fingers
<boolean> retargetSpine : if false, do not retarget spine bones (i.e. with lookat spine)
<boolean> retargetFeet : if false, do not retarget ankle and toes
<boolean> preserveLength : if true, preserve the length of certain bodyparts (arms and legs)
# Returns : ok
|
|
ps_mocap.mocapMapperImp puppetnode myfile mapConfig remap:true retargetPos:true delKeys:true localcopy:true stopAtConstraint:false mirrorMocap:false bFrame:-1 skipEnds:false skipReset:false scaleFactor:1.0 mirrorProps:true mRootToPRoot:false retargetFingers:true keyAtFrames:true mocapToPNode:true retargetSpine:true retargetFeet:true preserveLength:false removeTwist:false noWarnings:false collapseRelative:false =
|
# Description : Loads in mocap to a default human setup
# Parameters :
<node> puppetNode : puppetNode
<string> myFile : mocap file to import
<string> mapConfig : what mapping to apply, i.e. "all fk" or "ik legs" etc., this will determine pre-rotating of the rig.
<boolean> remap : if true, the mocap rig will be 'fit' to the puppet
<boolean> retargetPos : if true, we use the difference in leg length before and afer remapping, to adjust position of the hips
<boolean> delKeys : if true, then delete all keys of puppet for range of mocap
<boolean> localcopy : if true, then we copy the bvh file locally first (faster)
<boolean> stopAtConstraint: if true, we don't bake the layers, but stop at constraining (useful for flipping anims)
<boolean> mirrorMocap : if true, we mirror mocap agent and swap right names with left.
<integer> bFrame : base frame
<boolean> skipEnds : if ture, we do not remap end of site bones (useful for some mocap formats)
<boolean> skipReset : if true, we do not reset the pose at baseframe.
<float> scaleFactor : scales incoming mocap rig by this much
<boolean> mirrorProps : if true, mirror props
<boolean> mRootToPRoot : if true, we center the mocap root to the original location of the puppet root
<boolean> retargetFingers : if false, do not retarget fingers
<boolean> keyAtFrames : if true, only places keys at whole frames, not inbetween frames
<boolean> mocapToPNode : if true, center the mocap world to puppetNode (used for cutscenes, but can cause problems with seperate props)
<boolean> retargetSpine : if false, do not retarget spine (i.e. for lookat spine)
<boolean> retargetFeet : if false, do not retarget ankle and toes
<boolean> preserveLength : if true, preserve the length of certain bodyparts (arms and legs)
<boolean> removeTwist : if true, removes 'twist' from mocap wrist bones (relative to puppet wrists) to prevent twisted fingers
<boolean> noWarnings : if true, no messageboxes
<boolean> collapseRelative: if true, collapse the data relative to the previous layer. The result is that we have the new motion stored additive to the previous.
# Returns : ok
# Note : I had to mess around with 'redraw off' because the constraints being set would not update properly and funky stuff would happen
|
|
ps_mocap.mocapMapperExp puppetnode myfile skipReset:false =
|
# Description : Saves mocap to a default human setup
# Parameters :
# Returns : ok
# Note :
|
Functions_Rig.ms
|
ps_rig.setName nameString =
|
# Description : finds the ID of a node
# Parameters : <string> nameString : name of node
# Returns : string
# Note : although we currently don't so anything to the name, we feed it through this function anyway, for future changes
Do not use 'uniquename' as that will cause the mocap importer to not find nodes
I.e. when you make two characters, one would have footCtrl03 and 04. The mocap importer finds nodes in a puppet
by name, thus wouldn't find them. It's not neccesairy anyway, since puppetshop is name independent everywhere else.
|
|
ps_rig.getID puppetNode anode nodeArray =
|
# Description : finds the ID of a node
# Parameters : <node> puppetNode : puppet node
<node> anode : node to find ID of
<array> nodeArray : array of nodes to search in
# Returns : integer
|
|
ps_rig.checkPuppetDuplicateNames puppetnode =
|
# Description : checks if there are duplicate names in an unreigged puppet
# Parameters : <node> puppetNode : puppet node
# Returns : integer
|
|
ps_rig.prep_puppet puppetNode childArray =
|
# Description : Preps the puppet hierarchy for rigging
# Parameters : <node> puppetNode : the puppet we are going to rig
# Returns : ok
|
|
ps_rig.setPNodeAndID puppetNode pupCA partID =
|
# Description : Sets the puppetNode and bodyPart ID
# Parameters : <node> puppetNode : The puppet Node
<CA> pupCA : Puppet custom attribute
<integer> partID : The unique ID for this part
# Returns : ok
|
|
ps_rig.pupCaHolder puppetNode =
|
# Description : creates a new instance of the puppet CA holder
# Parameters : <node> puppetNode : puppetNode
# Returns : ok
|
|
ps_rig.pupMod puppetNode anode mod =
|
# Description : determines wheter a modifier should instanced or not
# Parameters : <node> puppetNode : puppetNode
<node> anode : node that will get a modifier applied to it
<modifier> mod : modifier that might be instanced
# Returns : ok
|
|
ps_rig.assignControllersToAttribute PA CAHolder:undefined =
|
# Description : Assigns default controllers to a custom attribute so that we can use those controller as input
# Parameters : <modifier> PA : Modifier that holds the PuppetCA Custom Attribute
<attribute> CAHolder: optional, you may feed it a attribute holder, for example Custom_Attributes, the default max attribute holder name.
# Returns : ok
|
|
ps_rig.puppet_null puppetNode key_able:false exposeNull:false frozenHidden:true debug:false =
|
# Description : creates a puppet NULL
# Parameters : <node> puppetNode : puppet node
<boolean> key_able : if false, controllers are not keyable
<boolean> exposeNull : if false, node is hidden from various UI's
<boolean> debug : if true, show nulls.
# Returns : node
|
|
ps_rig.insertHelper puppetNode curNode showHelper:true quiet:false =
|
# Description : code to insert a new helper node into a puppets hierarchy
# Parameters : <node> curNode : node where we wish to insert the null
<boolean> showHelper : if false, the helper is hidden
# Returns : ok
# NOTE : Does NOT add animation layers to the null, plus null is NOT added to any custom lists.
|
|
ps_rig.puppet_ctrl puppetNode size:2.5 pNodeSize:PS_puppetSize =
|
# Description : creates a puppet Control object
# Parameters : <node> puppetNode : puppet node
<float> pNodeSize : size of puppetNode (or can be anything)
# Returns : node
|
|
ps_rig.puppet_fkCtrl puppetNode size:2.5 =
|
# Description : creates a puppet FK Control object (half sphere)
# Parameters : <node> puppetNode : puppet node
# Returns : node
|
|
ps_rig.puppetConstraint puppetNode anode input listVal:1 divBy:1.0 =
|
# Description : applies a puppet position constraint to all 3 axis of a node
# Parameters : <node> puppetNode : puppet node
<node> anode : node we are applying the constraints to
<node> input : input node (node we are constraining to)
<integer> listVal : which controller inside a list to convert to constraint.
<float> divBy : divider. usefull if you want some sort of offset, like half the position, or a third etc.
# Returns : ok
# Note : See source code of the puppet controller for further explanation on how this controller works
|
|
ps_rig.puppetOrientConstraint puppetNode anode input listVal:1 parentInput:undefined =
|
# Description : applies a puppet orientation constraint to all 3 axis of a node
# Parameters : <node> puppetNode : puppet node
<node> anode : node we are applying the constraints to
<node> input : input node (node we are constraining to)
<integer> listVal : which controller inside a list to convert to constraint.
<node> parentInput : If you want to use a parent node
# Returns : ok
# Note : See source code of the puppet controller for further explanation on how this controller works
|
|
ps_rig.puppetOrientationBlend puppetNode anode node1 node2 cont usePuppetController:false setRelative:false cType:2 =
|
# Description : Blend rotation between two nodes.
# Parameters : <node> puppetNode : puppet node
<node> anode : node we are applying the constraints to
<node> node1 : node 1 (generally ik)
<node> node2 : node 2 (generally fk)
<contrllr> cont : controller that controls the blend between the two rotations
<boolean> usePuppetController: if true, we use the puppet controller to constrain, this is not recommend as it is slow.
<boolean> setRelative : if true, we set the relative flag to true
<integer> cType : if 2 we use orientation constraint, if 1 we use position constraint. (only for default max constraints)
# Returns : ok
# Note : See source code of the puppet controller for further explanation on how this controller works
|
|
ps_rig.addAnimLayers puppetNode anode doNotCheckController:false =
|
# Description : Add Animation Layers to node
# Parameters : <node> puppetNode : puppet node
<node> anode : node we are applying animation layers to
<boolean> doNotCheckController : If you do not want this function to check for the proper default configuration
# Returns : ok
# Note : We only apply layers to objects that vollow the default configuration.
If they have another controller on position or rotation, we do not apply layers to that controller
|
|
ps_rig.addStretchNull puppetNode anode forceLength:undefined noBone:false noLayer:false =
|
# Description : adds a node at the end of another node used for stretching
# Parameters : <node> anode : node that will have stretch applied to it
<node> puppetNode : puppet node
<integer> forceLength : Instead of the function grabbing the length of the anode, you can force it.
<boolean> noBone : if true, does not enable maxbone setting
<boolean> noLayer : if true, does not add layers
# Returns : node
|
|
ps_rig.findCAControllerFromString puppetNode nameString returnCont:true modString:"Puppet Tools" =
|
# Description : finds controller from string
# Parameters : <node> puppetNode : puppet node
<string> nameString : Name of the custom attribute controller to look for
# Returns : controller or undefined
-- NOTE: for this function, the puppetNode can be any node that holds the puppet tools or attributes modifier.
|
|
ps_rig.apply_stretch puppetNode anode nameString cont:undefined forceUpdate:false divBy:1.0 mul:1.0 listVal:1 modString:"Puppet Tools" =
|
# Description : adds default stretch to a node
# Parameters : <node> anode : node that will have stretch applied to it
<node> puppetNode : puppet node
<string> nameString : Name of the custom attribute property to look for
<controller> cont : input controller
<boolean> forceUpdate : Works around a bug in max and forces the mesh to update when stretchTM changes
<integer> divBy : Devide by integer.
<integer> mul : multiply by integer. Used for things like twist bones to spread the stretch
<integer> listVal : List controller index
# Returns : ok
-- NOTE: for this function, the puppetNode can be any node that holds the puppet tools modifier.
|
|
ps_rig.insert_breakoff puppetNode anode =
|
# Description : inserts a 'break-off' node
# Parameters : <node> anode : the node before which we are inserting a break-off node
<node> puppetNode : puppet node
# Returns : node
# Note : a break-off node allows the animator to 'tear' off the joint during animation.
If the limb would not have this not, you could not do this because of boneEnable = true on the parent (default max behaviour).
|
|
ps_rig.setupStoreNodes puppetNode anode contID =
|
# Description : All important nodes need to be stored on the puppetNode, this function creates the structure to do so.
# Parameters : <node> anode : the node. Usually this would be a root node, like upperleg, first spine bone, etc.
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : bodyparts set to 'custom' (ps_config == 1) don't get a structure. We leave it up to the user to add it.
We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.getPuppetParts puppetNode =
|
# Description : Finds all puppet parts controllers of a puppet
# Parameters : <node> puppetNode : puppet node
# Returns : array of subAnims
|
|
ps_rig.createAttributeString puppetNode anode nodeArray strName =
|
# Description : creates custom attribute string for a node (hub)
# Parameters : <node> anode : Spine (hub)
<node> puppetNode : puppet node
<array> nodeArray : all nodes in bodypart
<string> strName : name of attribute string to create
# Returns : #(parameter string, rollout string)
|
|
ps_rig.closeAttributeString puppetNode anode nodeArray strName strArray noExecute:false dontAddOpen:false =
|
# Description : closes custom attribute string for a node (hub)
# Parameters : <node> anode : Spine (hub)
<node> puppetNode : puppet node
<array> nodeArray : all nodes in bodypart
<string> strName : name of attribute string to create
<array> strArray : array of the two strings we need to close (parameter, rollout)
<boolean> noExecute : if true, this attribute is not automatically executed and is not added to the global PA_array.
This useful when creating the attributes after rigging was done. (i.e. custscene cameras)
dontAddOpen : if true, don't add the 'on open' part to the string, the attribute function will control this
# Returns : #(parameter string, rollout string)
|
|
ps_rig.puppetShop_addTwistStretch puppetNode anode stretchController =
|
# Description : Adds stretching capability to twist nodes
# Parameters : <node> anode : twist node
<node> puppetNode : puppet node
<controller> stretchController : stretch custom attribute controller
# Returns : ok
|
|
ps_rig.puppetShop_GODHUB_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a GOD node
# Parameters : <node> anode : GOD node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_GODHUB_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : GOD (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_GODHUB_Rig puppetNode godnode nodeArray =
|
# Description : Rigs a Face node
# Parameters : <node> facenode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_Default_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a fk node
# Parameters : <node> anode : fk node
<node> puppetNode : puppet node
# Returns : ok
# Note : we only add stretch to fk nodes if the user speficially configurtwistnodeHUBed the fk node to get stretch
by default fk nodes do not get stretch
Users might want to have a chain of fk bones change length by adjusting only 1 spinner.
Instead of using seperate fk bones, they should use a spine, and force it to FK.
|
|
ps_rig.puppetShop_FKnode_Default_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : fk (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_FKnode_Default_Rig puppetNode fknode nodeArray forceCon:false alreadyOwned:false stretchCtrl:undefined stretchAtrib:"undefined" =
|
# Description : Rigs a FK node
# Parameters : <node> fknode : fk node
<node> puppetNode : puppet node
<boolean> forceCon : force this node to be position constraint only
<boolean> alreadyOwned: wheter to store the node or not, if true, this means that i.e. the leg has already taken ownership of this bone.
<node> stretchCtrl : if supplied, use this node to get stretch attribute from (used by leg setup which setups of toes and fingers)
<string> stretchAtrib: stretch string
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_MuscleBone_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a fk node
# Parameters : <node> anode : fk node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_MuscleBone_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : fk (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_FKnode_MuscleBone_Rig puppetNode fknode nodeArray stretch:true axis:0 storeNode:true targetNodeNum:undefined targetNode:undefined upAxis:undefined upVNode:undefined =
|
# Description : Rigs a FK node
# Parameters : <node> fknode : fk node
<node> puppetNode : puppet node
<boolean> stretch : if true, we enable stretch
<integer> axis : lookat axis to use
<boolean> storeNode : wheter to store this node or not (another function might be taking care of storing)
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_Lookat_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a fk lookat node
# Parameters : <node> anode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_Lookat_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : fk (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_FKnode_Lookat_Rig puppetNode FKnode nodeArray =
|
# Description : Rigs a FK Lookat node
# Parameters : <node> facenode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_childOfGOD_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a fk node
# Parameters : <node> anode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_FKnode_childOfGOD_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : fk (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_FKnode_childOfGOD_Rig puppetNode fknode nodeArray =
|
# Description : Rigs a node that will be the direct child of the GOD node (useful for camera hooks)
# Parameters : <node> facenode : fk node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_Facenode_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a face node
# Parameters : <node> anode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_Facenode_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : fk (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_Facenode_Rig puppetNode facenode nodeArray =
|
# Description : Rigs a Face node
# Parameters : <node> facenode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_LegHUB_Default_Attribute puppetNode anode nodeArray legNodes:undefined =
|
# Description : creates custom attribute string for a leg
# Parameters : <node> anode : Upper Leg node (leg HUB)
<node> puppetNode : puppet node
<array> legNodes : use this to force these nodes to be used instead of finding the nodes in the function
# Returns : ok
|
|
ps_rig.puppetShop_LegHUB_Default_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : leg (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_LegHUB_Default_Rig puppetNode UpLeg nodeArray legNodes:undefined setupClav:false partName:"Foot" =
|
# Description : creates the rig for a leg
# Parameters : <node> UpLeg : Upper Leg node (leg HUB)
<node> puppetNode : puppet node
<array> nodeArray : array of all nodes in the puppet
<array> legNodes : use this to force these nodes to be used instead of finding the nodes in the function
<boolean> setupClav : In case an arm is rigged with this function, we can specify wheter we are constraining to the clavicle.
<string> partName : Since the arm can use the same function, we allow the names to be overwritten with this string.
# Returns : ok
|
|
ps_rig.puppetShop_LegHUB_FK_Attribute puppetNode anode nodeArray legNodes:undefined =
|
# Description : creates custom attribute string for a leg
# Parameters : <node> anode : Upper Leg node (leg HUB)
<node> puppetNode : puppet node
<array> legNodes : use this to force these nodes to be used instead of finding the nodes in the function
# Returns : ok
|
|
ps_rig.puppetShop_LegHUB_FK_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : leg (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_LegHUB_FK_Rig puppetNode UpLeg nodeArray legNodes:undefined setupClav:false partName:"Foot" =
|
# Description : creates the rig for a leg
# Parameters : <node> UpLeg : Upper Leg node (leg HUB)
<node> puppetNode : puppet node
<array> nodeArray : array of all nodes in the puppet
<array> legNodes : use this to force these nodes to be used instead of finding the nodes in the function
<boolean> setupClav : In case an arm is rigged with this function, we can specify wheter we are constraining to the clavicle.
<string> partName : Since the arm can use the same function, we allow the names to be overwritten with this string.
# Returns : ok
|
|
ps_rig.puppetShop_ArmHUB_Default_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for an arm
# Parameters : <node> anode : Clavicle (arm hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_ArmHUB_FK_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for an arm
# Parameters : <node> anode : Clavicle (arm hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_ArmHUB_Default_Rig puppetNode Clav nodeArray =
|
# Description : creates the rig for a leg
# Parameters : <node> Clav : Clavicle (arm hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.puppetShop_ArmHUB_Default_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : leg (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_ArmHUB_FK_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : leg (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
ps_rig.puppetShop_ArmHUB_FK_Rig puppetNode Clav nodeArray =
|
# Description : creates the rig for a leg
# Parameters : <node> Clav : Clavicle (arm hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
ps_rig.setAnimNodeClipLayer puppetNode nodeList setCurves:true =
|
# Description : sets up proper layers for the clip editor
# Parameters : <node> puppetNode : the puppet node
<array> nodeList : array of nodes to add layers to
<boolean> setCurves : if true, we setup the mul/ease curve spots, when adding customAnimNodes, we don't want this, so we allow this to be disabled.
# Returns : ok
# NOTE : do NOT instance any of these controllers or the rig will get very slow.
specially the attributes.
|
|
ps_rig.setAttributeClipLayer puppetNode nodeList caControllers:undefined =
|
# Description : sets up proper layers for the clip editor on attributes
# Parameters : <node> puppetNode : the puppet node
<array> nodeList : array of nodes to add layers to
<array> caControllers : array of attribute controllers, useful to provide when adding custom_attributes after the puppet has been rigged.
# Returns : ok
|
|
ps_rig.rig_puppet puppetNode twoTimelines:false =
|
# Description : Rigs the puppet
# Parameters : <node> puppetNode : the puppet node
<boolean> twoTimelines : if true, create 2 timelines when puppet is rigged
# Returns : ok
|
Functions_Rig_02.ms
|
.puppetShop_twistnodeHUB_Default_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a twist node
# Parameters : <node> anode : twist node
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_twistnodeHUB_Default_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : twist (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_twistnodeHUB_Default_Rig puppetNode twistnode nodeArray =
|
# Description : Rigs a Twist node
# Parameters : <node> twistnode : twist node
<node> puppetNode : puppet node
# Returns : ok
# NOTE : We use children[1] to find the target node (hand). This is not perfect, but generally the hand should be the first one linked.
We might need to make a better search method for this in the future. (see twNULL.parent)
|
|
.puppetShop_twistnodeHUB_FK_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a twist node
# Parameters : <node> anode : twist node
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_twistnodeHUB_FK_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : twist (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_twistnodeHUB_FK_Rig puppetNode twistnode nodeArray =
|
# Description : Rigs a twist node
# Parameters : <node> tiwstnode : face node
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_SpineHUB_FK_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a spine
# Parameters : <node> anode : Spine (hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_SpineHUB_FK_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : Spine (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_SpineHUB_FK_Rig puppetNode Spine nodeArray classString:#("puppetShop_Spine") storeNodes:true =
|
# Description : creates the rig for a Spine
# Parameters : <node> Spine : Spine (hub)
<node> puppetNode : puppet node
<boolean> storeNodes : if true, we store the nodes, if false, we don't and asume another function will take care of this (spine default i.e.)
# Returns : ok
# Note : Why does the spine have an option for stretch, while the leg and neck i.e. always get stretch?
This is because the stretch on the spine actually affects the hierarchy (a node gets inserted at the end),
while for the neck, legs and arms this does not happen.
Adding this extra node 'could' cause problems with certain game exporters who need to be able to walk through the hierarchy.
|
|
.puppetShop_SpineHUB_Default_Attribute puppetNode anode nodeArray classString:#("puppetShop_Spine") =
|
# Description : creates custom attribute string for a spine
# Parameters : <node> anode : Spine (hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_SpineHUB_Default_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : Spine (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_SpineHUB_Default_Rig puppetNode Spine nodeArray classString:#("puppetShop_Spine") =
|
# Description : creates the rig for a Spine
# Parameters : <node> Spine : Spine (hub)
<node> puppetNode : puppet node
<array> classString : string of classes to look for. Since this function can also be used for necks, this had to be customizable.
# Returns : ok
# Note : Why does the spine have an option for stretch, while the leg and neck i.e. always get stretch?
This is because the stretch on the spine actually affects the hierarchy (a node gets inserted at the end),
while for the neck, legs and arms this does not happen.
Adding this extra node 'could' cause problems with certain game exporters who need to be able to walk through the hierarchy.
|
|
.puppetShop_TailHUB_FK_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a Tail
# Parameters : <node> anode : Tail (hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_TailHUB_FK_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : tail (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_TailHUB_FK_Rig puppetNode Tail nodeArray =
|
# Description : creates the rig for a Tail
# Parameters : <node> Tail : Tail (hub)
<node> puppetNode : puppet node
# Returns : ok
|
|
.puppetShop_NeckHUB_FK_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a neck
# Parameters : <node> neck : Neck (hub)
<node> puppetNode : puppet node
# Returns : ok
# Note : Also includes Head Bone
|
|
.puppetShop_NeckHUB_FK_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : neck (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_NeckHUB_FK_Rig puppetNode Neck nodeArray =
|
# Description : creates the rig for a Neck
# Parameters : <node> neck : Neck (hub)
<node> puppetNode : puppet node
# Returns : ok
# Note : Also includes Head Bone
|
|
.puppetShop_NeckHUB_Default_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a neck
# Parameters : <node> neck : Neck (hub)
<node> puppetNode : puppet node
# Returns : ok
# Note : Also includes Head Bone
|
|
.puppetShop_NeckHUB_Default_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : neck (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_NeckHUB_Default_Rig puppetNode Neck nodeArray =
|
# Description : creates the rig for a Neck
# Parameters : <node> neck : Neck (hub)
<node> puppetNode : puppet node
# Returns : ok
# Note : Also includes Head Bone
|
|
.puppetShop_LegHUB_SpiderLeg_Attribute puppetNode anode nodeArray =
|
# Description : creates custom attribute string for a leg
# Parameters : <node> anode : Upper Leg node (leg HUB)
<node> puppetNode : puppet node
<array> legNodes : use this to force these nodes to be used instead of finding the nodes in the function
# Returns : ok
|
|
.puppetShop_LegHUB_SpiderLeg_StoreNodes puppetNode anode contID =
|
# Description : stores (important) nodes belonging to this bodypart on the puppetnode
# Parameters : <node> anode : leg (hub)
<node> puppetNode : puppet node
<integer> contID : number of the controller on the modifier
# Returns : ok
# Note : We store a value of 0.0 or 1.0 for each set to tell the save function wheter this node is suppose to be saved (animated) or not.
|
|
.puppetShop_LegHUB_SpiderLeg_Rig puppetNode UpLeg nodeArray =
|
# Description : creates the rig for a leg
# Parameters : <node> UpLeg : Upper Leg node (leg HUB)
<node> puppetNode : puppet node
<array> nodeArray : array of all nodes in the puppet
# Returns : ok
# Note : This is a leg setup that allows the IK to control more then 2 bones.
Generally this causes a range of problems, so this should only be applied on request of the animator.
Problems with this setup:
- start angles between all bones in the chain should be about the same, otherwise the ik behaves more on certain bones then others.
because of this, you will not be able to put the legs in any position you like, the IK won't allow it.
this then means that IK-to-FK snapping cannot really be implemented, because it is very likely the IK will not be able to match the FK angles.
# Specs : Last 3 legs get the IK (last 2 leg bones + foot) the rest are fk (if exist), any toes get ik assigned also.
Pivot is always at the end of the foot and the toes can bend independent from the whole leg.
|
Functions_Save_Load.ms
|
ps_XML.Init_activeX_XML hideDialog:false =
|
# Description : Initialises XML document creation
# Parameters :
# Returns : ok
|
|
ps_XML.Create strRoot attrib:undefined =
|
# Description : Creates start of XML doc
# Parameters :
# Returns : true
|
|
ps_XML.NewElem strName text:undefined attrib:undefined =
|
# Description : Adds new element
# Parameters :
# Returns :
|
|
ps_XML.EndElem =
|
# Description :
# Parameters :
# Returns : ok
|
|
ps_XML.CData data =
|
# Description :
# Parameters :
# Returns :
|
|
ps_XML.Attrib id value =
|
# Description :
# Parameters :
# Returns :
|
|
ps_XML.Save strFilename =
|
# Description : Saves XML file to disk
# Parameters :
<string> strFilename : file to save to
# Returns :
|
|
ps_XML.convToUpper str toLower:false =
|
# Description : Converts a string to upper case
# Parameters :
<string> str : text to convert
<boolean> toLower : if true, convert from Upper to Lower instead
# Returns :
|
|
ps_XML.spaceToUnderscore str =
|
# Description : Converts spaces to underscores
# Parameters :
<string> str : text to convert
# Returns :
|
|
ps_XML.arrayToString my_array sep:true arrayString:undefined =
|
# Description : Converts an array of more then 20 elements into a proper string
# Parameters :
<array> my_array : array
<boolean> sep : wheter to add an seperator or not (function sets this, so you can ignore this)
<string> arrayString : Holds the new string (set by function itself, so ignore)
# Returns : string
# Note : Arrays that are longer then 20 elements don't work well with "as string". They get cut off.
|
|
ps_XML.arrayToStringQuick my_array =
|
# Description : Converts an array of more then 20 elements into a proper string, but does it more quickly then the previous function.
# Parameters :
<array> my_array : array
# Returns : string
# Note : This functions asumes that the array elements contain no arrays of more then 20, otherwise use arrayToString function
|
|
ps_XML.getContData fCont timeInterval propsToSave valueTimeOffset:false sFrame:undefined =
|
# Description : gathers key data out of a controller
# Parameters :
<controller> fCont : controller
<Interval> timeInterval : range to save
<array> propsToSave : array of strings that are the properties of the keys that are to be get
<boolean> valueTimeOffset : if true, values are also compensated for timeOffset (used by timeCurves)
<integer> sFrame : if supplied, use this value as the startframe to compensate time with (useful for ease_curves)
# Returns : array #( #("time", val, "value", val, "intangentType", val, etc.), #(...) )
# Note : time is stored relative to first frame of interval
|
|
ps_XML.setContData fCont keyData sTime propsToSet mul:1.0 isSubAnim:false relative:false valueTimeOffset:false =
|
# Description : puts key data into a controller
# Parameters :
<controller> fCont : controller
<array> keyData : key data that needs to go into the controller
<integer> sTime : start time (first frame of where animation is suppose to go)
<array> propsToSet : array of strings that are the properties of the keys that are to be set
<float> mul : optional multiplier
<boolean> isSubAnim : if true, fCont is the subAnim instead of the controller (used i.e. for weight controllers)
<boolean> relative : if true, load values relative to previous key
<boolean> valueTimeOffset : if true, values are also compensated for timeOffset (used by timeCurves)
# Returns : ok
|
|
ps_XML.getFloatData fCont timeInterval valueTimeOffset:false sFrame:undefined =
|
# Description : gathers data out of a float controller
# Parameters :
<controller> fCont : float controller
<Interval> timeInterval : range to save
# Returns : array #( #("time", val, "value", val, "intangentType", val, etc.), #(...) )
# Note : time is stored relative to first frame of interval
!! tangent types need to be set last, because setting the inTangent value afterwards converts it to a type #auto !!
|
|
ps_XML.setFloatData fCont keyData sTime mul:1.0 isSubAnim:false relative:false valueTimeOffset:false =
|
# Description : puts data into a float controller
# Parameters :
<controller> fCont : float controller
<array> keyData : key data that needs to go into the float controller
<integer> sTime : start time (first frame of where animation is suppose to go)
<float> mul : optional multiplier
# Returns : ok
# Note : !! tangent types need to be set last, because setting the inTangent value afterwards converts it to a type #auto !!
|
|
ps_XML.getTCBData fCont timeInterval =
|
# Description : gathers data out of a TCB controller
# Parameters :
<controller> fCont : TCB controller
<Interval> timeInterval : range to save
# Returns : array #( #("time", val, "value", val, "intangentType", val, etc.), #(...) )
# Note : time is stored relative to first frame of interval
|
|
ps_XML.setTCBData fCont keyData sTime mul:1.0 isSubAnim:false relative:false =
|
# Description : puts data into a TCB controller
# Parameters :
<controller> fCont : TCB controller
<array> keyData : key data that needs to go into the TCB controller
<integer> sTime : start time (first frame of where animation is suppose to go)
<float> mul : optional multiplier
# Returns : ok
|
|
ps_XML.getLinearData fCont timeInterval =
|
# Description : gathers data out of a Linear controller
# Parameters :
<controller> fCont : Linear controller
<Interval> timeInterval : range to save
# Returns : array #( #("time", val, "value", val, "intangentType", val, etc.), #(...) )
# Note : time is stored relative to first frame of interval
|
|
ps_XML.setLinearData fCont keyData sTime mul:1.0 isSubAnim:false relative:false =
|
# Description : puts data into a linear controller
# Parameters :
<controller> fCont : Linear controller
<array> keyData : key data that needs to go into the Linear controller
<integer> sTime : start time (first frame of where animation is suppose to go)
<float> mul : optional multiplier
# Returns : ok
|
|
ps_XML.save_list_fn puppetNode lst stripName:false outfile:undefined =
|
# Description : Save mapping list to disk
# Parameters : lst : which itemlist to save
<boolean> stripName : Wheter to strip off the puppetNode name from each node or not
<string> outfile : optional, you can provide a file to save to (useful for batching)
# Returns : ok
|
|
ps_XML.load_list_fn puppetNode lst stripName:false infile:undefined =
|
# Description : load mapping list from disk
# Parameters : lst : which itemlist to load
<boolean> stripName : if stripName is true, the puppetNode name will be added
# Returns : list
|
|
ps_XML.loadXML xmlDopstr hideDialog:false =
|
# Description : loads XML document
# Parameters :
# Returns : xml in-stream
|
|
ps_XML.getNodes nodeType xDoc:undefined fromNode:undefined onlyReturnFirst:true = -- You need to supply either the document, or the node
|
# Description : get nodes
# Parameters :
<boolean> onlyReturnFirst : true returns only the first found node. False will return_ all found.
# Returns : array of nodes or a single node
|
|
ps_XML.getNodeProps node props:undefined =
|
# Description : Gets properties of a node
# Parameters :
# Returns : array for properties
|
|
ps_XML.getAttributes node =
|
# Description : Gets all attributes of a node (out of XML file)
# Parameters :
# Returns : array for attributes
|
|
ps_XML.getAttributeByName node attrib =
|
# Description : Gets an attributes of a node by name
# Parameters :
# Returns : attribute value (string)
|
|
ps_XML.getClipNames puppetNode strFilename returnLists:false =
|
# Description : extracts names from a clip
# Parameters :
<node> puppetNode : puppet node
<string> strFilename : XML file that holds the animation we are loading
<boolean> returnLists : if true, we return_ the lists
# Returns : ok, or #(from_list, to_list, fromPNodeName, toPNodeName)
|
|
ps_XML.nodeFromStrings animNodes nodeName srcList trgList checkSrcWithAnimNodes:false =
|
# Description : finds a node from 2 strings
# Parameters :
<array> animNodes : array of Nodes
<array> srcList : List of source names
<array> trgList : list of target names
<string> nodeName : Name of node we are looking for
# Returns : node (or undefined)
|
|
ps_XML.load_anim puppetNode strFilename startFrame srcList trgList buildLayers matchLayers loadCA posMul:1.0 delKeys:true layerOffset:0 zeroLayers:true loadBasePos:false loadBaseRot:false onlyLayer:0 toLayer:0 puppetAnimNodes:undefined restoreInstance:true loadEMCurves:false loadWeights:true loadRelative:#() quietMode:false =
|
# Description : Load animation from disk
# Parameters :
<node> puppetNode : puppet node
<string> strFilename : XML file that holds the animation we are loading
<integer> startFrame : frame where we want the loaded animation to start
<array> srcList : List of source names
<array> trgList : list of target names
<boolean> buildLayers : Wheter to build missing layers on target node or not
<boolean> matchLayers : Wheter to match the class of the target layer to the source layer or not, and also matches the axisOrder for euler
<boolean> loadCA : If true, then load custom attribute animation
<float> posMul : multiplier for position (for characters of different sizes)
<boolean> delKeys : if true, then delete keys of anim nodes before loading animation
<integer> layerOffset : loads animations from XMC onto: (layer-in-XMC + layerOffset)
<boolean> zeroLayers : if true, we first set a value of 0 in all layers. This is great when incoming animations have less layers.
<boolean> loadBasePos : if true, we load the basePose Position from the animation file (useful when transfering anim from female to male when basePose is slightly off). Same for rotation
<integer> onlyLayer : any value other then 0, and we only load that layer.
<integer> toLayer : if onlyLayer != 0 then we load the specified layer onto this one.
<array> puppetAnimNodes : allows you to specify which nodes to use for loading animation onto, normally, this is grabbed from the puppetNode
<boolean> restoreInstance : restores the instancing of weight and ease/mul curves. Normally this should be on, but can be skipped for 'special' rigs.
<boolean> loadEMCurves : if true, load ease and multiplier curves
<boolean> loadWeights : if true, load weight curves
<array> loadRelative : array of nodes that should be loaded relative to their current values.
<boolean> quietMode : if true, no dialogs will pop-up
# Returns : ok
|
|
ps_XML.openAnim_rol =
|
# Description : Opens the load animation rollout
# Parameters :
# Returns : ok
|
|
ps_XML.refresh_lists from_list to_list puppetSize layerCount =
|
# Description : updates the to and from lists
# Parameters : from_lst : string array with all FROM animation node names
<array> to_lst : string array with all TO animation node names
<float> puppetSize : size of puppet loaded
<integer> layerCount : number of layers in animation file
# Returns : ok
|
|
ps_saveLoad.find_ID inItem Arr =
|
# Description : Finds the index of a node in an array
# Parameters :
# Returns : integer
|
|
ps_saveLoad.save_puppet puppetNode strFilename =
|
# Description : Save a puppet to disk
# Parameters :
# Returns : ok
|
|
ps_saveLoad.load_puppet puppetNode strFilename =
|
# Description : Load a puppet from disk
# Parameters :
# Returns : ok
|
|
ps_saveLoad.save_clip puppetNode animNodes layerCount strFilename timeInt keyStartEnd storeClipData =
|
# Description : Saves an animation to disk
# Parameters :
<node> puppetNode : puppet node
<array> animNodes : Array of Nodes
<integer> layerCount : number of layers in use on puppet
<string> strFilename : path of file to save to
<Interval> timeInt : Time range to save
<boolean> keyStartEnd : wheter to key the first and last frame automatically or not. Also when true, first and last frame are converted to custom tangents to prevent the curve from changing on load
<boolean> storeClipData : wheter to save clip data or not. (If not, then this anim cannot be used as a clip) -- no longer used
# Returns : ok
|
|
ps_saveLoad.batchAnimSave pNode myDir all:true =
|
# Description : substract a pose from a layer
# Parameters :
<node> pNode : puppetNode
<string> myDir : folder path name of where you want to save the animations to
<boolean> all : if true saves all, if false saves only checked animations
# Returns : ok
|
|
ps_saveLoad.batchAnimLoad pNode myDir sframe:undefined zeroLayers:true =
|
# Description : substract a pose from a layer
# Parameters :
<node> pNode : puppetNode
<string> myDir : folder path name of where you want to save the animations to
<integer> sframe : start frame to load animation too
<boolean> zeroLayers : zero layers or not
# Returns : ok
|
|
ps_saveLoad.load_anim puppetNode strFilename =
|
# Description : Load animation from disk
# Parameters :
# Returns : ok
|
|
ps_HTML.openHTML htmlStream =
|
# Description : open HTML
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.closeHTML htmlStream =
|
# Description : close HTML
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.openTable htmlStream width:"100\%" =
|
# Description : Add new table to html
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.closeTable htmlStream =
|
# Description : close table
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.openTD htmlStream col:"#EEEEEE" =
|
# Description : open new TD
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.closeTD htmlStream =
|
# Description : close TD
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.openTR htmlStream =
|
# Description : open new TR
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.closeTR htmlStream =
|
# Description : close TR
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.openP htmlStream =
|
# Description : open P (preformatted text)
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.closeP htmlStream =
|
# Description : close P (preformatted text)
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.addText txt htmlStream newline:true url:undefined =
|
# Description : add Text
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
|
ps_HTML.addImage image htmlStream url:undefined border:1 newline:true width:undefined height:undefined =
|
# Description : add Image
# Parameters : <stringStream> htmlStream : stream to write too
# Returns : ok
|
Modifier_PuppetTools.ms
|
.subrol_refresh rol rolID =
|
# Description : refreshes a rollout when it has a 'sub rollout'
# Parameters : <rollout> rol : rollout in question
<integer> rolID : number of the rollout
# Returns : ok
|
|
.subrol_changeState rol rolID =
|
# Description : stores changes in 'state' of sub rollouts
# Parameters : <rollout> rol : rollout in question
<integer> rolID : number of the rollout
# Returns : ok
|
|
.getAnimNodes id:"" puppetNode:undefined =
|
# Description : Returns all animatable nodes in a rig
# Parameters : <string> id : You can specify an ID number if you only wish to search for a particular bodypart.
<node> puppetNode : if supplied, we use this puppetNode to grab animNodes of, however usually, this would be called in the modifier so it uses 'this'.
# Returns : Array of nodes
|
|
.getPuppetpartController id =
|
# Description : returns a 'storeNode' controller on the puppetNode for a certain bodypart (puppetPart_)
# Parameters : <integer> id : id of the bodypart controller we are looking for
# Returns : controller
|
|
.getClipAttributes nodes returnClipControllers:true returnSubAnim:false skip:#() only:undefined nodeIsMod:false =
|
# Description : returns an array of all attributes that support clips
# Parameters :
<array> nodes : array of nodes to search
<boolean> returnClipControllers : wheter to return_ the clip controllers, or the first controller of the attribute that supports clips
<boolean> returnSubAnim : return_ subAnim (useful for save/load animation)
<array> skip : Skips any attributes with the same name as found in this array (i.e. to skip animatable pivot attributes)
<array> only : if supplied, return_ only the attributes with names found in this array. Used by resetAttributes to reset defaults of certain attributes.
<boolean> nodeIsMod : if true, the 'nodes' argument are already the attribute modifiers
# Returns : array of controllers
# Note : This is not a perfect check, it relies on attributes being setup a certain way.
|
|
.resetPose nodeArray frm:0 noWarnings:false dontResetPuppetnode:false forceAbsoluteZero:false resetPos:true resetRot:true keyOnly:false activeLayerOnly:false addKey:true =
|
# Description : Resets transforms for certain nodes
# Parameters : <array> nodeArray : Array of nodes
<integer> frm : time at which to reset the transform
<boolean> noWarnings : true will suspend any warnings
<boolean> dontResetPuppetnode : if true, we do not reset any objects of class puppetNode
<boolean> forceAbsoluteZero : if true, make sure the values inside the xyz floats are zero.
<boolean> resetPos : if true, reset position
<boolean> resetRot : if true, reset rotation
<boolean> keyOnly : if true, we don't put a value of zero, instead we put the existing value (is more like bracket but then all layers).
<boolean> activeLayerOnly : if true, only zeros the active layer
<boolean> addKey : if true, use 'addKey' (which always sets a key, no matter if animate button is on or not)
# Returns : ok
|
|
.ps_replaceAttribute ad strAtr strOldVal strNewVal =
|
# Description : searches through an attribute string to replace one line with a new line, in order to change the default value of an attribute
# Parameters : <CA_DEF> ad : attribute definition
<string> strAtr : the name of the attribute we wish to change the default of, i.e.: "Stretch_"
<string> strOldVal : the old default value, i.e.: "0.0"
<string> strNewVal : the new default value, i.e.: "5.0"
# Returns : ok
# Note : Yes this is really ugly, but max leaves me no choice.
Attributes are stored as big strings and to change anything in them, means rebuilding the string and putting it back.
|
|
.resetAttribute aloc frm:0 noWarnings:false copyFrom:undefined setDefaults:false =
|
# Description : Resets default values of attributes by looking for the 'default' string
# Parameters : <mod> aloc : Location of attribute (usualy a modifier, but could be baseObject)
<integer> frm : time at which to reset the transform
<boolean> noWarnings : true will suspend any warnings
<integer> copyFrom : if supplied, we copy the attributes value from this frame instead (making this effectively the copy attribute function)
<boolean> setDefaults : if true, set the current attribute value as the new default value (like our set-0-pose option)
# Returns : ok
# Note : Why is this function so complicated? well we can't just 'zero' custom attribute controllers because the default value might not be 0, like it is with pos and rot layers.
So we have to extract the default value out of the attribute definition instead.
Luckily max makes this really easy....not.
|
|
.getKeysInInterval kAr timeInterval =
|
# Description : Gets keys within a certain interval range
# Parameters : <array> kAr : Array of keys
<interval> timeInterval : time Interval to get keys of
# Returns : Array of key times
|
|
.getHierarchyNodes id:"" mod:undefined =
|
# Description : Gets all Nodes in the original Hierarchy
# Parameters :
<string> id : add an ID number if you only want to get the skin nodes of a certain bodypart
<modifier> mod : modifiers that holds the puppetCA attribute
# Returns : Array of arrays #( #(node, parentID), #(node, parentID) )
# NOTE : hierarchyNodes is NOT an array of nodes, but an array of arrays instead.
|
|
.setHierarchyNode nodeToSet newParent mod:undefined =
|
# Description : changes a nodes spot in the hierarchy
# Parameters :
<string> id : add an ID number if you only want to get the skin nodes of a certain bodypart
<modifier> mod : modifiers that holds the puppetCA attribute
# Returns : Array of arrays #( #(node, parentID), #(node, parentID) )
# NOTE : hierarchyNodes is NOT an array of nodes, but an array of arrays instead.
|
|
.getPuppetParent anode =
|
# Description : Gets parent node of a node
# Parameters : <node> anode : Node to find parent of.
# Returns : parent node or undefined
|
|
.getPuppetChildren anode =
|
# Description : Gets children of a node
# Parameters : <node> anode : Node to find children of.
# Returns : array of children
|
|
.pasteRelativePose centerNode nodes sTime eTime respectLocks:true =
|
# Description : pastes relative pose
# Parameters : <node> centerNode : Node the is the center of the pose (generally first child of puppetNode)
<array> nodes : Nodes to be copied
<integer> sTime : Frame to copy
<integer> eTime : Frame to copy too
<boolean> respectLocks : if true, it uses the transform locks to determine what to copy/paste
# Returns : ok
|
|
.extract_rootNode puppetNode includeGOD:false =
|
# Description : Finds the root node of a puppet that has been rigged (root node that was in the puppet)
# Parameters : <node> puppetNode : puppet Node
<boolean> includeGOD : if true, the GOD node (if exists) will be returned as root node, if false, then the first child of the GOD node is considered the root
# Returns : ok
|
|
.extractPuppet puppetNode newPuppetNode root_node rootNodeOnly:false extractProxy:true transferTwist:true transferUserProps:true tarParent:undefined =
|
# Description : Builds a new puppet out of a rigged puppet
# Parameters :
<node> puppetNode : Original puppet node
<node> newPuppetNode : Target puppetNode (this is where our extracted puppet will be build upon)
<node> root_node : first node, usually hips or first spine bone.
<boolean> rootNodeOnly : If true, it will only process the root_node and NONE of it's children
<boolean> extractProxy : some nodes might have custom meshes attached as modifiers (proxy meshes), if true, we copy this mesh over to the extracted puppet
<boolean> transferTwist : if true, we copy the twist bones settings of the rig to the unrigged puppet
<boolean> transferUserProps: if true, we copy the user property buffer
<node> tarParent : if provided, we use this node as the new parent, isntead of detecting it. (useful for children of GOD node)
# Returns : ok
|
|
.initExtractPuppet puppetNode extractProxy:true transferTwist:true transferUserProps:true =
|
# Description : Initialises extracting a puppet
# Parameters :
<node> puppetNode : Original puppet node
<boolean> extractProxy : some nodes might have custom meshes attached as modifiers (proxy meshes), if true, we copy this mesh over to the extracted puppet
<boolean> transferTwist : if true, we copy the twist bones settings of the rig to the unrigged puppet
<boolean> transferUserProps: if true, we copy the user property buffer
# Returns : newly created puppetNode
|
|
.bracketLay puppetNode aNodes bstart bend bca:true forceZero:false bracketNodes:true =
|
# Description : Sets keys at start and end frame for all provided nodes
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to bracket
<integer> bstart : start frame (keep in mind that the key is set one frame before this frame)
<integer> bend : end frame (keep in mind that the key is set one frame behind this frame)
<boolean> bca : wheter to bracket custom attributes of the node as well
<boolean> forceZero : if true, we not just set a key, we force the value to be set to be 0.0
<boolean> bracketNodes : if false, we do not set pos and rot keys on nodes.
# Returns : ok
|
|
.getPnodeColor puppetNode activeLayer =
|
# Description : returns proper color for certain layer
# Parameters :
# Returns : color
|
|
.changePnodeColor puppetNode activeLayer =
|
# Description : changes the color of the puppetNode depending on which layer is active
# Parameters :
# Returns : ok
|
|
.refreshLay puppetNode activeLayer =
|
# Description : Refreshes the dropdownlist for layers
# Parameters :
# Returns : ok
|
|
.detectTimeLine puppetNode returnOnly:false =
|
# Description : adds a new timeline
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to add layer too
<boolean> returnOnly : if true, only return_ the value, do not update ps_prefs.timeline (useful for redraw callback)
# Returns : ok
|
|
.setActiveLayer puppetNode LayCnt acLay =
|
# Description : sets the active layer.
# Parameters :
<node> puppetNode : puppet node
# Returns : ok
|
|
.resetLayerData puppetNode =
|
# Description : refreshes the layer data (i.e. when you switch timeslines)
# Parameters : <node> puppetNode : Original puppet node
# Returns : ok
|
|
.addLay puppetNode aNodes rotCont posCont activeLayer duplicatePrevious:false scaleCont:undefined=
|
# Description : adds a new layer to nodes
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to add layer too
<integer> rotCont : what controller to add
<integer> posCont : what controller to add
<integer> activeLayer : which layer to set to active
<boolean> duplicatePrevious: if true, we duplicate the previous layer (fake additive blending)
# Returns : ok
|
|
.delLay puppetNode aNodes Layer =
|
# Description : delete layer of nodes
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to delete layer of
<integer> Layer : which layer to delete
# Returns : ok
|
|
.deletePuppetLayer puppetNode Layer suspendRefresh:false =
|
# Description : delete a layer of entire puppet
# Parameters :
<node> puppetNode : Original puppet node
<integer> Layer : which layer to delete
# Returns : ok
|
|
.addPuppetLayer puppetNode pcont:undefined rcont:undefined suspendSetActive:false suspendRefresh:false scont:undefined duplicatePrevious:false =
|
# Description : add a layer to entire puppet
# Parameters :
<node> puppetNode : Original puppet node
<boolean> suspendSetActive: if true, we do not set the layer to active, useful for adding new timelines.
<integer> pcont : type of controller to create (i.e. linear)
<boolean> suspendRefresh : if true, we do not update layer info.
<boolean> duplicatePrevious: if true, make a copy of the previous layer
# Returns : ok
|
|
.addNewLayer puppetNode anodes pcont:undefined rcont:undefined scont:undefined duplicatePrevious:false =
|
# Description : add a layer to entire puppet
# Parameters :
<node> puppetNode : Original puppet node
<boolean> duplicatePrevious: if true, make a copy of the previous layer
# Returns : ok
# Note : 27-08-05 This was added to support clip-editor clips getting additional layers and
also animation with no layers could break the spine and neck rotation controls in animations below it
This is probably a bug in max's list controller, but an animation with no layers is not useful anyway, so it's ok.
|
|
.verifyPsEval timeCont tInd:undefined =
|
# Description : verifies that only euler, tcb or linear controllers are used so that we can safely use ps_evaluating, if we don't recognize the class of the controller, we don't use psEval
# Parameters :
<controller> timeCont : timeline controller
<integer> tInd : controller in timeline to check (if not provided, active is used)
# Returns : true if its ok to use ps_eval, false if not
# Note : Is not meant for attribute timeline controller, since they do not have lists inside them
|
|
.setTimeLine puppetNode aNodes cas ind suspendRefresh:false gbc:true switchAll:false currentActive:undefined =
|
# Description : set timeLine active
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to add layer too
<array> attributeControllers : attributes controllers (list controllers)
<index> ind : number of the timeline to switched too
<boolean> suspendRefresh : if true, we do not update layer info.
<boolean> gbc : if true, do a garbage collection
<boolean> switchAll : if true, switch all timelines to proper state, if false, only switch the previous and current
<integer> currentActive : if you wish to force a certain clip to be currentActive, used when deleting a timeline before switching
# Returns : ok
|
|
.addTimeLine puppetNode aNodes cas =
|
# Description : adds a new timeline
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to add layer too
<array> attributeControllers : attributes controllers (list controllers)
# Returns : ok
|
|
.deleteTimeLine puppetNode aNodes cas ind =
|
# Description : deletes a timeline
# Parameters :
<node> puppetNode : Original puppet node
<array> aNodes : Array of nodes to add layer too
<array> attributeControllers : attributes controllers (list controllers)
<index> ind : number of the timeline to delete
# Returns : ok
|
|
.updateChecked puppetNode tv =
|
# Description : Sets all the text and values in treeview.
# Parameters :
# Returns :
|
|
.customNodeAttribute puppetNode anode =
|
# Description : adds a attribute to custom nodes added, so we can find the puppetNode once this nodes gets deleted.
# Parameters : <node> anode : the node to add attribute to
<node> puppetNode : puppet node
# Returns : ok
|
|
.updateFromNetwork puppetNode =
|
# Description : checks the network for updates for this rig and runs the update
# Parameters :
<node> puppetNode : puppet node
# Returns : ok
|
|
.deletePuppetKeys nodes attribs activeLayer timeInterval =
|
# Description : deletes keys of a controller for a certain framerange
# Parameters :
<node> puppetNode : puppet node
<controllers> attribs : attribute controllers
# Returns : ok
|
|
.getAllNodesOfPuppet puppetNode includeHierarchy:false =
|
# Description : return_ ALL nodes of a puppet
# Parameters :
<node> puppetNode : puppet node
<boolean> includeHierarchy: if true, includes custom hierarchy nodes too (caution, this might include things like skinned mesh that you might not want to delete)
# Returns : array of nodes
# NOTE : this only works if all nodes in a puppet have unique names and start with the puppetNode name
or at least if there exist duplicate names in one puppet, each puppet with the same name in the scene, should have the
same amount of duplicate nodes
|
|
.parentPuppetNode puppetNode newParent:undefined =
|
# Description : parents the puppetNode to another node in the scene
# Parameters :
<node> puppetNode : puppet node
<node> newParent : parent node, or undefined to unlink
# Returns : ok
|
|
.rp_combinePictures inpic1 inpic2 inpic3:undefined inpic4:undefined =
|
# Description : Combines multiple bitmaps into 1.
# Parameters : inpic:(input pictures)
# Returns : a bitmap
|
|
.rp_dothatgrab_fn s range views:4 offset:0 =
|
# Description : Grabs viewport bitmaps and calls combine function
# Parameters : s (add to startframe, usefull for looping to skip first frame)
range frames to render
offset used when you render twice (looping)
# Returns :
|
|
.rp_getRange_fn rangeString s_frame e_frame =
|
# Description : Builds the list of frames to render
# Parameters : rangeString List of frames to render
# Returns : (array of frames)
|
|
.setPuppetPose puppetNode nodes frm:0 =
|
# Description : sets the puppet_pose to the current pose for certain nodes.
# Parameters :
<node> puppetNode : puppet node
<array> nodes : nodes to set pose of
<integer> frm : frame that has new pose
# Returns : ok
|
|
.getCodecs =
|
# Description : gets the codecs currently registered to puppetshop
# Parameters :
# Returns : array of codecs (name of codec file as string)
|
|
.setCodec codecName type:1 =
|
# Description : sets the selected codec
# Parameters : <string> codecName : string of codec name (not pathname)
<integer> type : 1 = quicktime, 2 == avi
# Returns : ok
|
|
.restoreCodecs type:1 =
|
# Description : restores the original codec
# Parameters :
# Returns : ok
|
|
.renderPreviewVideo puppetNode outfile codecSelection s_frame e_frame r_width r_height pr_views loopRender autoPlay toCritiqueFolder hideAnimCtrls customRangesText:"" =
|
# Description : makes a preview render
# Parameters :
# Returns : ok
|
|
.batchRenderPreviewVideo puppetNode outDir codecSelection r_width r_height pr_views loopRender autoPlay toCritiqueFolder hideAnimCtrls customRangesText:"" all:false =
|
# Description : Batch render previews
# Parameters :
# Returns : ok
|
|
.ps_getRetargetCont node =
|
# Description : grabs controllers for retargeting
# Parameters :
# Returns : controller (list)
|
|
.cachePuppet puppetNode aNodes cas range:animationrange =
|
# Description : calculates cache information and puts it onto puppet
# Parameters :
# Returns : ok
|
|
.switchPuppetMode puppetNode timelineState clipEditorState cacheState graphState updateCache:false =
|
# Description : switches between timeline, clip and cache state
# Parameters :
# Returns : ok
|