Jump to content
Sign in to follow this  
dotcommer

Xpresso rig question

Recommended Posts

I have a rig I've set up that triggers pose morphs based on position in Y, but I noticed if I moved the object down in Y, the pose morphs would trigger in reverse. Is there some way I can keep it always triggering the pose morph the same way regardless of positive or negative y movement?

 

My node setup is basically a null object that contains the character with the null's position values piped into range-mapper nodes, which pipe out to different poses of a pose morph tag. The range-mapper nodes overlap each other to blend between the different poses.

 

Any suggestions? Is this something I should be looking into velocity for instead of just position?

Share this post


Link to post
Share on other sites

Add a distance node between the Y output of the moving object and the morph percentage input to start. Rather than looking at the absolute value of Y it will see the distance of Y to wherever value is in the input 2 slot (this can be left open at zero or input the vectors of another object to relative distance.

 

If you don't want it to go any higher than 100% then include a range mapper after the distance node and make sure to activate "clamp upper" and "clamp lower".

 

With more work you can make it oscillate if the Y value goes beyond the limit.

 

Use a math:add node just before the distance node and set it to multiply or divide to slow down/speed up the morph relative to the Y movement.

Share this post


Link to post
Share on other sites

Thanks for the reply sb. I gave this a shot, but I'm still seeing this weird thing happening. The character is a jellyfish, so I'm animating it along a spline which goes up, over, and down, in an upside down "U" shape. As it reaches the peak of the spline, the pose morph slows down to a halt, then starts animating in reverse as the jelly goes down the other side. Same as my setup before trying out your suggestion. Any ideas? Here's my project file so you can dig around it a little. Might be easier than trying to explain it in words:

 

https://drive.google.com/file/d/0B9wWFBnMitXKZnpUMDlWZDEtNmc/view?usp=sharing

Share this post


Link to post
Share on other sites

This took some time. The node graph is dirty but should almost do it. You'll need to re-adjust the timing of the jellyfish deformers or the dividing factor for that motion.

 

I realized after opening the file what the problem was - it's animated along a spline and the Y value is being used to factor the frequency of the morphs.

 

To get the morphs to not animate in reverse order as the jellyfish goes back down on the Y axis we have to accumulate the distance traveled. I thought from your post that the Y value was going into the negative range which would be an easy fix.

 

This is a quick and dirty way. The whole thing can be done in a C.O.F.F.E.E node. To accumulate the Y distance traveled we first use the distance node, then using the memory node we get the distance traveled in the previous frame, subtract the first from the second and then use the absolute node to make sure that result is always positive.

 

A trick to accumulate that difference traveled between frames is to store a value in a custom user data field and use the default script in a C.O.F.F.E.E node to add the distance traveled with the current value in the custom user data field, then feed the result back into the custom user data field.

 

Finally, since that custom user data field will just keep accumulating with each frame I created a separate node tree to test for frame zero and reset if and only if on frame zero - so treat it just like a particle simulation.

 

Here's the link. Please let me know when you download it:

 

https://www.dropbox.com/s/w3cvq0xdt676jtn/jelly_v08-help.c4d?dl=0

Share this post


Link to post
Share on other sites

"Holy shit" was the first thing I said when I opened up that xpresso tag. Thats an awesome and robust setup. I learned a couple things as well just by digging through what you had added. Thank you for going through the trouble of setting that up. I knew there had to be some kind of "memory" node or some way to take previous and current values and manipulate them, but I didn't know what nodes to look for.

 

Since my last post, I came up with an alternate solution which uses the align to spline tag's position value as the distance parameter and then piped that into my pose morphs. Both solve the issue, but yours seems like it would work even if the jelly wasn't animating on a spline, where as mine would require an align to spline tag. Here's my solution:

https://drive.google.com/file/d/0B9wWFBnMitXKR1FlOHppM2g4b0E/view?usp=sharing

 

Either way, there's still one strange issue I can't figure out: As the jelly reaches the apex of the spline, it starts wobbling around in its controller circle. I just noticed this and can't figure out whats going on. It almost seems like the jelly is oriented along the spline, but the "bobbing" animation is still oriented along the Y. <_<

 

Thanks again for your help so far sb. I've learned so much from this little side-project.

Share this post


Link to post
Share on other sites

Hah! figures half an hour later I would figure it out. I wasn't paying attention to what was actually being transformed; the Parent null? Or the Jelly body? I ended up pruning my node tree and found the solution while cleaning it up. I was trying to move the Parent null, but really, I should be focusing on the jelly body as its the one being deformed. The parent null is containing everything. So, here is my finished xpresso setup for my jellyfish:

https://drive.google.com/file/d/0B9wWFBnMitXKVGFwUUNlN2NJbUE/view?usp=sharing

Share this post


Link to post
Share on other sites

Yeah...like I said, mine was a quick and dirty solution based on what you already had...if I'd taken the time and started from scratch it would probably have been totally different setup. I did try just using the align to spline tags's percentage as the driver but reverted as I thought you might want the local movements of the jellyfish to work independently of the global movement.

 

I checked out your latest. Looks nice and fluid but there is no variation in the movement which I thought made it feel more alive before (despite the jittery movement caused by the parent child offset).

 

Maybe you could add a range mapper with a curve that effects the "input upper" ports on the morph nodes to add some variation over the full timeline. Just a thought. Looks great!

Share this post


Link to post
Share on other sites

Maybe you could add a range mapper with a curve that effects the "input upper" ports on the morph nodes to add some variation over the full timeline. Just a thought. Looks great!

 

Thanks for the suggestions sb. I'll keep them in mind as I move forward with this. For now, its a good PoC.

 

One more question for you since you've been so helpful and knowledgable about this: If I wanted to set up a particle emitter with this jellyfish rig as the particle, whats the best way to go about doing that? I vaguely remember that I can grab TP particle positions or something like that, so maybe I can use that in my jellyfish rig so each instance of the jelly moves and pulses correctly related to how fast the emitted particle is? What would you recommend?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...