PDA

View Full Version : Maya: want to keep position of constraind object


pigbelly
03-10-2003, 10:26 PM
Hi.
When I constrain an object between two locators the object moves to a 50/50 position in-between the locators. Is there a way or a script that keeps the object in position????

/Tommie

wrend
03-10-2003, 10:43 PM
look at the weighting for your targets? its on the constrain node. perhaps you find use in my animStreamBlender script, its on my site, or highend3d.

pigbelly
03-10-2003, 10:45 PM
cool

but where is your site?


/Tommie

mark_wilkins
03-10-2003, 10:58 PM
Hey!

As he suggested, constraint weights are the solution.

What you do is constrain the object to BOTH locators. Then, look under Extra Attributes for the constrained object. You'll see two constraint weight attributes. Set each of these to 0.5 and you're done!

There are some examples that make use of this in the expressions chapter of our MEL scripting book. You can download the sample scripts at www.melscripting.com and maybe find some ideas in the Chapter 4 scripts, although I'm not sure whether it will be much use without the book handy.

-- Mark

pigbelly
03-10-2003, 11:03 PM
hmm..
no it didn't help much!

but I tried to change the offset value on the constraint node and that kind of worked :-)))
Kind of cool thing, haven’t really notice that before:-))


Thanks
/Tommie

mark_wilkins
03-10-2003, 11:11 PM
Oh, I get it.

There's another way to do it, which I think is better than using the constraint offset. Group the object then constrain the group.

Then after you've constrained the group, you can move the object wherever you want and it will follow the group around. You can also animate the object with relation to the group if you're not getting exactly what you want.

-- Mark

pigbelly
03-10-2003, 11:15 PM
Yes!!!

Thanks!!

And also thank you for a GREAT book!!!!

/Tommie

mark_wilkins
03-10-2003, 11:21 PM
Thanks for the kind words! :D

Incidentally, the group-then-constrain trick is great for constraining cameras to things, because it permits you to continue to aim the camera by mousing around in the camera's panel after you've constrained the parent group.

-- Mark

wrend
03-11-2003, 01:15 AM
looks like you figured it.

in the event you do find you want to be animating between two locations (animated or not), the wwighted constraint might be the approach, or as i mention my script that does a very similar thing, but keeps you animating on your orinal transform, rather than locators floating about the place. site is this (http://www.users.on.net/neilandbron) , or just find it on highend3d's script respositry, in animation.

pigbelly
03-11-2003, 07:49 AM
Mark:
It's easy to find kind word for your book.. you succeeded where everyone else failed you manage to get me interested in MEL.

So thank you for all the sleepless night thinking of script problem that lay ahead me:-))

Wrend:
Your script is really cool!!


Thanks
/Tommie

mark_wilkins
03-11-2003, 07:52 AM
aww, pigbelly you just like my Swedish avatar! :D

-- Mark

pigbelly
03-11-2003, 08:16 AM
hahaha....I will be this weekend:-)))

Why do you have a crazy swede as an avatar Mark?? :-)

/Tommie

lildragon
06-21-2003, 01:34 PM
Digging up this old thread, I'm in need of some help, here's the thing, ok I have a character that'll be fighting with a staff (well two) and I was playing all night with point and orient constraints and got it working with one arm, but having a nitemare with two hands. Basically I would like the two hands to always have a grasp on the staff without me having to key one of them, so basically I can animate the staff and have the arms follow along. Any advice would be great!

-lild

pigbelly
06-23-2003, 07:26 PM
can you maybe parent two locators to the staff and then constrain the hands to the locators??

/Tommie

lildragon
06-23-2003, 08:24 PM
Originally posted by pigbelly
can you maybe parent two locators to the staff and then constrain the hands to the locators??

/Tommie

Yup exactly what I did, I actually had to throw in an orient constraint also here's a test http://www.cgchallenge.com/tmp/blast_hit.avi

salud!

pigbelly
06-23-2003, 08:33 PM
damn...got to get faster on the keyboard .-))

/Tommie

MasonDoran
06-23-2003, 11:08 PM
lildragon...i am in the same boat...i also discovered if u use 2 locators on the opposing ends of the staff that are both aim constrained to each other.....and the staff is parented to one of the locators.....and then you just animate the locators as u want... it gives a more natural feel then to animate the staff itself...

Dudeman
06-24-2003, 02:54 AM
I have a question regarding this topic.
If it hasn't already been explained.

Is it possible to create a point constrain on a node and keep its offset that it had before it was constrained?

-Dudeman:thumbsup:

misterdi
06-24-2003, 04:59 AM
This new feature in Maya 5, maintain offset.

With 4.5 backward, you can achieve this by moving pivot to location of the constraint first (if it is a single point constraint)

Or you will need to constraint another dummy to several constraint object and move your pivot to this dummy and point constraint your object to this dummy.

Best regards,

CGTalk Moderation
01-14-2006, 02:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.