doCHtor
11-10-2007, 02:04 PM
Hi,
I'm trying to create a script for PuppetShop that would allow me to quickly link IKTargets (hand controllers, foot controllers...) to other scene objects. Something that would work like "SelectIK Object" in Biped's palm and foot. In Biped you can link to only one object for the whole animation. In my script it should work for more objects.
My idea is that script will setup new pos/rot lists for the current animation and current animation layer for the selected PS controller, assign position and orientation constraints to the first controller in list and place the original controllers to the second list controller. Than it will assign object to which i want to constraint. I will than be animating weight of the pos/rot constraint to manage linking and unlinking. Later i would like to add baking functions so one could remove the constraints and list controller.
Because I don't have much programing experience (maxscript or other coding language), I have already run into a problem. I have managed to create functions for detecting if selected object is a PS Controller object, if it already has "my" list controller with constraints, functions for assigning and removing list constraint with preservation of original animation, callback function which will refresh info about the presence of "my" list controller when viewport selection changes and ui design.
My current problem is that i can't figure out how to "link" the spinners in UI with the weight controller in position/rotation list and weights in position and orientation constraints and how to "relink" them if i select other PS controller in viewport which already may have these constraints and animation on them.
First I thought that I will use the "controller:" property of spinner when creating it in rollout, but it seems that it can only link to alrady defined controller, but problem is that selected object may not have those constraints yet, they will be created from UI when i click on a button. Also I don't know if it's possible to change the controller binding on selection change. Than I was thinking to use scripted custom atributes, but can't figure out if this is what i actually need and again how to bind those with weights in constraints and than with ui spinners on selection change.
Any help would be appreciated, thanks.
I'm trying to create a script for PuppetShop that would allow me to quickly link IKTargets (hand controllers, foot controllers...) to other scene objects. Something that would work like "SelectIK Object" in Biped's palm and foot. In Biped you can link to only one object for the whole animation. In my script it should work for more objects.
My idea is that script will setup new pos/rot lists for the current animation and current animation layer for the selected PS controller, assign position and orientation constraints to the first controller in list and place the original controllers to the second list controller. Than it will assign object to which i want to constraint. I will than be animating weight of the pos/rot constraint to manage linking and unlinking. Later i would like to add baking functions so one could remove the constraints and list controller.
Because I don't have much programing experience (maxscript or other coding language), I have already run into a problem. I have managed to create functions for detecting if selected object is a PS Controller object, if it already has "my" list controller with constraints, functions for assigning and removing list constraint with preservation of original animation, callback function which will refresh info about the presence of "my" list controller when viewport selection changes and ui design.
My current problem is that i can't figure out how to "link" the spinners in UI with the weight controller in position/rotation list and weights in position and orientation constraints and how to "relink" them if i select other PS controller in viewport which already may have these constraints and animation on them.
First I thought that I will use the "controller:" property of spinner when creating it in rollout, but it seems that it can only link to alrady defined controller, but problem is that selected object may not have those constraints yet, they will be created from UI when i click on a button. Also I don't know if it's possible to change the controller binding on selection change. Than I was thinking to use scripted custom atributes, but can't figure out if this is what i actually need and again how to bind those with weights in constraints and than with ui spinners on selection change.
Any help would be appreciated, thanks.
