[Closed] PuppetShop Linker script – help needed
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.
If I understand the problem correctly you are trying to connect the weight controller to a scripted UI?
In that case the ‘controller’ function of a spinner is the only way that I know and you would have to rebuild that connection each time.
A better alternative to the scripted UI may be to create custom attributes instead since they can remain connected after saving/loading.
Yes, that’s what i want to do. I was afraid that scripted ca will be better way to go – another thing to learn
Actually those ca will be also more practical solution. Modify panel holds animation tools for PS similar way as motion panel for Biped, so it’s logical to have these “link controls” together with default PS tools.
But now I have another problem to solve. My initial idea was that i COULD have “link controlls” on every animation layer and on every “sub-layer”, but now if i will have ca on a hand ctr, and change to other layer or animation, i will have to check if there are constrainsts already and if not, assign them (if i want to constraint at all) and rewire the controls. Figure out how to do this will take me some good amount of time, so if someone reads this, pls let me know if this is possible with maxscript at all
Okaj, slow progress, now I’m using scripted CA’s but i have this problem. I want to wire spinner from CA to “first weight of position list”. After i had problems figuring out how to do this, i have used macroreroder and used paramater wire dialog and got this:
paramWire.connect2way $.modifiers[#Attribute_Holder].Linker[#targetglobal] $.pos.controller[#Weight__Position_Constraint] “Weight__Position_Constraint” “targetglobal”
Now when i run the script above, i get this error: “– Runtime error: connect requires subAnims”
Problem is probably in “$.pos.controller[#Weight__Position_Constraint]” which returns “undefined”.
I tried some things, but had no luck.
Help please 🙁