PDA

View Full Version : Ratcheting animation?



squarewulf
09-17-2016, 05:34 PM
How would one go about animating a socket wrench nodally or otherwise? Basically, I want an object to accumulate anothers positive rotation. So as the wrench body rotates forward the socket rotates, then as the wrench rotates back to center I want the socket to counter-act that rotation and stay 'stationary'. I can't find a way besides hand keying it and I need this to be a rig for several scenes.

ernpchan
09-17-2016, 05:59 PM
You could have one null that is the parent for the body and the socket and then rotate the body on its own for the counter rotation. It's not an automatic rig setup but it would work.

Prince Charming
09-17-2016, 06:07 PM
Use Houdini... it has proper tools for this type of thing, LW does not. Hopefully we get a trigger or accumulate node of some sort in LW 20??. I can only think of one way to do it in LW now (without coding and automatically) and that is with dp speed/time node. I would be very interested if someones else knows another way to set this up automatically with current tools.

ernpchan
09-17-2016, 06:13 PM
One way to control all this with a single null would be to tie the rotation of everything to one channel of an item and then the other rotation to a different channel of the same item. So you could use bank to rotate the entire object and then pitch to rotate just the handle item. This way you're only animating with one object versus switching between objects. It would make editing timing easier in the GE too since you're just working with one object.

Prince Charming
09-17-2016, 06:19 PM
One way to control all this with a single null would be to tie the rotation of everything to one channel of an item and then the other rotation to a different channel of the same item. So you could use bank to rotate the entire object and then pitch to rotate just the handle item. This way you're only animating with one object versus switching between objects. It would make editing timing easier in the GE too since you're just working with one object.

That is a good alternative... And probably to most simple to deal with with current tools.
If you really want to get creative you may be able to use the rotation of you control to effect the power of a wind that is blowing a particle. Then use the particle position to drive your ratchet. You will most likely have to do some remapping of values to get exact results. I think it could work, it is a hack though, and we should have tools for this... HINT HINT!

Prince Charming
09-17-2016, 06:39 PM
Also, a ratcheting mechanism is not very complex... You may be able to do this with bullet.

squarewulf
09-17-2016, 07:30 PM
I just used motion mixer and animated it so that when it looks back it appears like its in the same position... works well enough but I really wish there were a way to add absolute value over time or something.

Prince Charming
09-17-2016, 07:39 PM
I just used motion mixer and animated it so that when it looks back it appears like its in the same position... works well enough but I really wish there were a way to add absolute value over time or something.

I cant believe it, but I just set up the particle/wind version, and it works surprisingly well, and is not very complex at all. I will post a quick vid. Even if you dont use it... This type of thing comes up very often, so someone else may find it useful. I really am surprised that this works as well as it does. Ill post the vid in a min.

Prince Charming
09-17-2016, 08:48 PM
Here is the set up...

https://youtu.be/RRncWuSl8bk

squarewulf
09-17-2016, 09:37 PM
Here is the set up...

https://youtu.be/RRncWuSl8bk

Ha! That's brilliant. I will definitely use this, very cool!

Prince Charming
09-17-2016, 09:53 PM
Just so you know, in case you didnt already. You will also need to use "dp particle info" to get the particle z pos.

This old program amazes me every day... You can teach an old dog new tricks ;)

js33
09-18-2016, 12:36 AM
I just used motion mixer and animated it so that when it looks back it appears like its in the same position... works well enough but I really wish there were a way to add absolute value over time or something.

This is so simple it's not worth scripting. Just animate the ratchet handle rotating heading, in my example, from 0 to 90 in 30 frames then back to 0 on frame 60. In the graph editor set Post Behavior for the heading to Repeat. Then animate the socket with the same heading rotation from 0 to 90 degrees at frame 30 then hold at 90 degrees on frame 60 then set Post Behavior in the bottom of the Graph editor to Offset Repeat as in the image below. It acts as an accumulator of the previous rotation and keeps adding to it.


134502

Prince Charming
09-18-2016, 12:51 AM
This is so simple it's not worth scripting. Just animate the ratchet handle rotating heading, in my example, from 0 to 90 in 30 frames then back to 0 on frame 60. In the graph editor set Post Behavior for the heading to Repeat. Then animate the socket with the same heading rotation from 0 to 90 degrees at frame 30 then hold at 90 degrees on frame 60 then set Post Behavior in the bottom of the Graph editor to Offset Repeat as in the image below. It acts as an accumulator of the previous rotation and keeps adding to it.


134502


The problem with that method is that if you dont use the exact same rotation every time it does not work. You cant use that method to accumulate many different values, only the same one over and over. Other apps have tools for this type of thing.

js33
09-18-2016, 12:57 AM
That's true but it is dead simple to setup. I guess it just depends on what you need.

Prince Charming
09-18-2016, 01:11 AM
That's true but it is dead simple to setup. I guess it just depends on what you need.

That is the easiest way, I assumed there was a reason he could not use that method. If he only has to repeat the exact same motion that is the best way. I still would like some tools for this type of thing though. Is is one area that LW is lacking. Basically, LWs curve/envelope processing is a weak spot. These type of tools would also help a lot with dealing with audio.

js33
09-18-2016, 01:18 AM
It seemed like the OP wasn't aware of the method I pointed out but maybe he was and needed more control like you posted.

Seems like this could easily be done in the graph editor with an Expression or Relativity if you are skilled with those.

Prince Charming
09-18-2016, 01:25 AM
It seemed like the OP wasn't aware of the method I pointed out but maybe he was and needed more control like you posted.

Seems like this could easily be done in the graph editor with an Expression or Relativity if you are skilled with those.

Relativity maybe, but much of that is a really bad workflow, and in some cases is broken. Relativity is yet another dead undeveloped tool with a poor workflow IMO. If there is a way to do it with relativity or expression I would like learn it.

If you watch this vid from about 11 min you will see the type of tools I wish we had.

https://vimeo.com/133310380

js33
09-18-2016, 02:25 AM
Seems like you could do that with LWs nodes. I know LW is more of a general use program rather than uber granular control that Houdini has but you have shown that LWs nodes are powerful but maybe not as straightforward as Houdini.

Prince Charming
09-18-2016, 02:52 AM
Seems like you could do that with LWs nodes. I know LW is more of a general use program rather than uber granular control that Houdini has but you have shown that LWs nodes are powerful but maybe not as straightforward as Houdini.

I could replicate that effect in LW, or at least get pretty close, but there are a few tools that we are missing that would make the process more streamlined... Especially when it comes to processing curves like that. For his example its easy to replicate because its just a repeating curve... so repeat and offset repeat would work to replicate his effect. I am just envious of those curve processing tools ;). They would have saved me many hours of work in the past. They would also work well for this type of thing if he wanted to have different rotations with each turn.

I do have a feeling this can be done with relativity. I remember buying some training a long time ago that had a motorcycle rig that did something similar to this, but I have fought many battles with that tool in the past, and it has rarely ever turned out to be good, so I gave up on it. If someone does know how please do post.

pinkmouse
09-18-2016, 03:04 AM
Sorry js, you can't! I've run up against the same problems as Brian has, and come up with equally as convoluted workflows to try and get 'round them, some that work, some that don't. I used to think it was down to the limitations of Screamernet requiring each frame to be completely "stand alone" with no linked data from past or future frames, but now I'm not so sure, it might be that, or it might be something different. Whatever the root cause, it needs sorting out.

Prince Charming
09-18-2016, 03:10 AM
and come up with equally as convoluted workflows to try and get 'round them
LOL... Spoken like a true LWer! :D

pinkmouse
09-18-2016, 03:18 AM
Yup! :D

js33
09-18-2016, 05:42 AM
Yeah there are limitations. You can bake out the keys from a LW generated repeating curve but then you have a key on each frame. It would be better if LW only generated the keys needed to create the envelope.

RebelHill
09-18-2016, 06:02 AM
It would be better if LW only generated the keys needed to create the envelope.

You can use the motion baker and key reducers on my animation toolbox for this.

js33
09-18-2016, 06:14 AM
What I would really like is some in depth training on expressions and Lscript. I guess there is some info in the manuals but who reads manuals when we have the intertubes. Off to yt to look. Lscript does not seem to be as accessible in LW like MEL is in Maya.

Prince Charming
09-18-2016, 12:44 PM
You can use the motion baker and key reducers on my animation toolbox for this.

I don't mean to take this off topic, but I was looking for a vid you posted the other day and could not find it. It had to do with parenting many objects recursively in the scene editor. You did make a vid like that didn't you? I couldn't find it anywhere. If you don't mind, could you share the link again.

squarewulf
09-19-2016, 05:43 PM
I don't mean to take this off topic, but I was looking for a vid you posted the other day and could not find it. It had to do with parenting many objects recursively in the scene editor. You did make a vid like that didn't you? I couldn't find it anywhere. If you don't mind, could you share the link again.

Same for your videos, did you remove them? I used them often, very useful information. Any chance theyre still online somewhere?

jeric_synergy
09-19-2016, 10:39 PM
If you really want to get creative you may be able to use the rotation of you control to effect the power of a wind that is blowing a particle. Then use the particle position to drive your ratchet. You will most likely have to do some remapping of values to get exact results. I think it could work, it is a hack though, and we should have tools for this... HINT HINT!
Damn, that IS clever.

:stumped: Doesn't sensei have something that will accumulate over time? :confused:

+++++

I don't mean to take this off topic, but I was looking for a vid you posted the other day and could not find it. It had to do with parenting many objects recursively in the scene editor. You did make a vid like that didn't you? I couldn't find it anywhere. If you don't mind, could you share the link again.
That might have been one by Ryan Roye, covering the neglected "Assign" tools. If you literally watched it just the other day, it may be findable in your browser history.

+++++
I rewatched the ratcheting animation, and although Bryphii says there's a slight error, if the driving null is moving 1 meter before repeating, the driven particles seemed to be spot on, certainly close enough for 99% of animation purposes.

And of course, the network can be saved to disk and re-used, a point nobody seems to ever make (too obvious?): you don't have to set this up over and over, just make the parts and load the network.

squarewulf
09-23-2016, 10:06 PM
I was able to get it to work, but for some reason DP's motion info node is unresponsive. I had to add a second null to follow the first null .0001 seconds behind, then divide the distance between them by .0001 to calculate velocity. But why wouldn't the motion info null work? I must be missing something.

134576

jeric_synergy
09-24-2016, 12:30 AM
I was able to get it to work, but for some reason DP's motion info node is unresponsive. I had to add a second null to follow the first null .0001 seconds behind, then divide the distance between them by .0001 to calculate velocity. But why wouldn't the motion info null work? I must be missing something.

134576

Package/send the scene to Denis, I'm sure he'll be interested.

Also, re your math: huhhhh??

Prince Charming
10-14-2016, 03:47 PM
Package/send the scene to Denis, I'm sure he'll be interested.

Also, re your math: huhhhh??

I dont think it was a problem with the node, or he may have to update to the latest version. It was broken in the past, but was fixed a long time ago. It works fine here.
Could also be a setting... If he stored path data before there was data, or other issue. I did this test back then, but never posted it, files attached as well.

https://www.youtube.com/watch?v=iHZ_jRe1Zrw