|
oh yeah maybe I understand your problem I got the same when doing a manipulator tools.
First important point is to replace the parent function and to do that in this way if you want to positionnate an object on another one :
(NOTE : It will create and delete the constraint at the same time)
delete `pointConstraint -offset 0 0 0 -weight 1 $objectA $objectB`; delete `orientConstraint -offset 0 0 0 -weight 1 $objectA $objectB`;
About getting the {0,0,0} coordinate for a manipulator (for a skeleton setup ^_^).
Hmmm I also got some problem with that…
To tell the truth you cannot freeze your manipulator and then constraint a bone to this same manipulator because you are “reseting” the transform of your object!…
.... And thsi is very bad in the hiearchy of a skeleton setup.
---> The solution is to add a simple “group” before your manipulator. <---
1 - You create an empty group and positionnate it on your bone with the command I gave on the top.
And you !!! KEEP !!! the right coordinate, do not do a freeze on it.
string $grp = `group -em -n ($shortName + "new group")`;
=======
2 - You create your Head manipulator.
3 - you launch the same previous function to positionnate your manipulator on your bone (delete it at the same time).
4 - you parent the manipulator to the group
5 - you freeze the manipulator and it will resent the component translation, rotationm and scale of your object to ZERO.
=======
6 - you launch a 3rd time the same function I gave but you will constraint the BONE to the CONTROLLER!
(but ou DO NOT delete the constraints this time :D )
======
Conclusion :
Your bones wil not change of position.
Because the controler constraint the bone…
BUT!!!
The controler is child of the group with the right transform....
My english is not very well, but I hope you will understand the technical explanation… o_<
Here is the code fro creating a right manipulator with your curve.
Please note you need to select your bones before to launch the script :
string $selection [] = `ls -sl -l`;
BipedHeadManipulator ($selection[0])
global proc string BipedHeadManipulator (string $bone)
{
// To get the shortname :
string $temp[] = stringToStringArray ($bone, "|")
string $shortName = $temp[`size $temp` -1];
// Create FK Controller
string $ctrl = `curve -n "Head_CTRL" -d 3
-p 0 .1 -1.4
-p 1.488862 .2 0
-p 0 0 1.3
-p 1.488862 -.1 0
-p 0 -.1 -1.4
-p -1.488862 -.1 0
-p 0 0 1.3
-p -1.488862 .2 0
-k 0 -k 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 5 -k 5`;
closeCurve -ch 1 -ps 0 -rpo 1 -bb 0.5 -bki 0 -p 0.1 $ctrl;
// TO create the Rigging :
delete `pointConstraint -offset 0 0 0 -weight 1 $bone $ctrl`;
delete `orientConstraint -offset 0 0 0 -weight 1 $bone $ctrl`;
string $grp = `group -em -n ($shortName + "_Grp")`;
delete `pointConstraint -offset 0 0 0 -weight 1 $bone $grp`;
delete `orientConstraint -offset 0 0 0 -weight 1 $bone $grp`;
string $ctrlBis[] = `parent $ctrl $grp`;
pointConstraint -offset 0 0 0 -weight 1 $ctrlBis[0] $bone;
orientConstraint -offset 0 0 0 -weight 1 $ctrlBis[0] $bone;
return $ctrl; }
At the end you will get a warning but this is about you curve… Then good luck ^_^
// Warning: line 27: History will be off for the command since Keep Originals is off and a selected item has no history. //

|