PDA

View Full Version : Constrain Orientation to 2 Point and...


adib
08-19-2008, 04:53 AM
Hi friends I have problem with constraining object orientation with 2 or more target at the same time, like the one we have for position in XSI (Constrain to 2 Points or 3 or more)
I have a scene that I try to make feather simulation there I wrote script that make feathers between three base feather (like birds tail) I make constrain orientation for middle feathers ( between base feathers) based on angle I assign blend weight for constrains orientation between them, when I open and close the tail there is no problem and everything is OK (video (http://www.vimeo.com/1556810)) but when I rotate the root on for example X axis the middle created feathers doesn't rotate exactly as the bases and they got offset in rotation angles.(video (http://www.vimeo.com/1556827))
in 3ds max with the same formula used in script and same work flow there is no problem and every thing working well because in 3ds max I can easily constrain object rotation to multiple targets.
I also tried SIApplyConstrain command that work with constraining collection but it only constrain collection to first object in collection.
any one can help me to do the same I did in 3ds max in XSI.
I attach the script and the scene (http://rapidshare.com/files/138431530/Feather_Scenes_and_Script.rar.html) with this post.
thank you all.

supjj
08-21-2008, 07:07 PM
I toyed with this a little and came up with the attached. Look into the constraint values on your rig. By leaving one of the constraint values at 1 will help, it looks like XSI automatically normalizes the constraint when you have multiple.

ThE_JacO
08-21-2008, 07:46 PM
xsi doesn't normalize the constraints when you have multiple, it applies them on top of each other.
normalized constraints means that if you had two, each with a weight of one, the result would be half way inbetween.
XSI will evaluate constraints sequentially, which means if the last applied is 1, everything before gets ignored, and if you want something mixed and normalized, you need every further constraint applied to be half the weight of the previous one.
IE: first constraint = 1, second constraint = 0.5 will average between the two.

adib
08-22-2008, 02:36 AM
Thank you my friends I found the problem.
1. I knew that I should left first weight to 1 look again to my script there is a constant variable called (var blendWeightOne = 1)
2. the actual problem was the offset that cause the undesired effect and its because of the last parameter of the SIApplyCns command was "true" it should be "false", these causes the the feather get offset.
wrong -> SIApplyCns("Orientation", "feather_mid_L"+i, "feather_mid", true);
correct -> SIApplyCns("Orientation", "feather_mid_L"+i, "feather_mid", false);
here I attached both new scene and script (http://rapidshare.com/files/139182138/feather_program_test_06_ad.rar.html). (I attached the file but it doesn't work so I put rapidshare link for file)
thank you all for guiding me your ideas was so helpful.