Also, if you really want to make this easier then you can add an attribute to 
the cone as a keyable integer.



Call it “StickTo” for example.



Then create a MEL expression as follows:





string $stick_to = pCone1.StickTo;

if ( $stick_to == 1 ) {
pCone1_pointConstraint1.pSphere1W0=1;
pCone1_pointConstraint1.pSphere2W1=0;
pCone1_pointConstraint1.pSphere3W2=0;
} else if ( $stick_to == 2 ) {
pCone1_pointConstraint1.pSphere1W0=0;
pCone1_pointConstraint1.pSphere2W1=1;
pCone1_pointConstraint1.pSphere3W2=0;
} else if ( $stick_to == 3 ) {
pCone1_pointConstraint1.pSphere1W0=0;
pCone1_pointConstraint1.pSphere2W1=0;
pCone1_pointConstraint1.pSphere3W2=1;
} else
print ("No constraint assigned!\n");



Keyframe “StickTo” in the cone attributes to 1 for pSphere 1, 2 for pSphere2, 
and so on.


By doing this, all you have to do is keyframe the new StickTo attribute in the 
Cone from 1, to 2, to 3 at the appropriate time to use the relevant constraint 
to change who “owns” the cone as it moves from one item to the next.


This is probably closer to what you are wanting anyway since I suspect you will 
only want the weights to go from 0 directly to 1 at the same frame rather 
transition over time. You can do it without the expression but this just 
manages it down to one attribute and may also reduce the number of keyframes 
you’ll have to create.


Joey







From: [email protected] 
[mailto:[email protected]] On Behalf Of Ponthieux, Joseph 
G. (LARC-E1A)[LITES II]
Sent: Sunday, September 10, 2017 11:07 AM
To: [email protected]
Subject: RE: maya constrain from SI perspective

Mirko,

Create 3 spheres and randomly place them in an empty scene

Create a cone

Select the objects in the following order via ctrl->left click select
                1.pSphere1
                2.pSphere2
                3.pSphere3
                4.pCone1

Execute ANIMATION->Constrain->Point  (make sure you are using the  defaults for 
this constraint)

You will find that a pCone1_pointConstraint1 operator has been placed under the 
pCone1 object and the cone should take a position central in space to the 
position all three spheres. If so, it is now position constrained to those 
spheres.

Select pCone1

In the Channel Editor you will see the constraint operator in the shape list 
and it will possess 3 weight parameters for the constraint
(W0,W1, and W2 for sphere 1, 2 & 3 respectively)

At frame 1 keyframe the following:
w0 = 1, w1 = 0, w2 = 0

At frame 15 keyframe the following:
w0 = 0, w1 = 1, w2 = 0

At frame 30 keyframe the following:
w0 = 0, w1 = 0, w2 = 1


When you play it back the cone will transition via constraint from sphere 1 to 
2 to 3  over the 30 frame period

Now animate all the sphere positions in whatever way you choose over that 30 
frame period. The cone will still follow the spheres according to the weights  
previously keyframed.

Does that help?



If you need more control than this make a copy of the cone. Constrain cone 1 to 
sphere 1 & 2. Constrain cone 2 to sphere 2&3. Animate the weights to control 
each. Write an expression to set visibility for each cone when the constraint 
weight is less than 1 or greater than 0 for example so that the cones hide 
automatically. In other words when the first cone arrives at sphere 2 cone 1 
should hide and the cone 2 should unhide. You can write one expression to 
evaluate all objects and weights simultaneously.

Joey



From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Mirko Jankovic
Sent: Sunday, September 10, 2017 3:39 AM
To: [email protected]<mailto:[email protected]>
Subject: maya constrain from SI perspective

Ok, please,, how the F you live in maya with it's constrains and worse more 
animating them??

Am I so stuck in SI workflow that I simply can;t go down the rabbit hole in 
maya on this or are they really taht retarded and complicxated for simple 
animation?
Constraing object A on object B,m then translate it to object C and then on to 
object D...

Something as simple as for exmaple pick up hat from the head, and give it to 
another guy and he puts it in his head.... The F!!! the HORROR!

Any tips and advice please?
Also I did try like zv parent script which is kinda good but it doesn;t really 
work with referenced objects so. no go..
[https://mailfoogae.appspot.com/t?sender=abWlya29qLmFuaW1hdG9yQGdtYWlsLmNvbQ%3D%3D&type=zerocontent&guid=8fabcf63-42b4-4212-a7b0-d54921aaef61]ᐧ
------
Softimage Mailing List.
To unsubscribe, send a mail to [email protected] with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to