PDA

View Full Version : Link Repeated Motion (Morph)

devin
05-15-2018, 11:11 AM
Is there any means to link a morph to the motion of another object and have the morph repeat while the driving object is in motion? I'm not a script/expression writer so I'm looking for a script/plug/modifier.

I have a device where one item moves axially while rotating. A second item with small teeth rides over teeth located on the first. I'm using a morph to drive the "riding" motion of the second part and want to link it to the axial or rotational movement of the first.

Just FYI... these teeth prevent the parts from rotating in the opposite direction and also create a clicking sound as they pass over each other.

Thanks.

...I'd also settle for a means to repeat a motion a set number of times. Pretty much like a post behavior but not infinite.

Ztreem
05-15-2018, 12:38 PM
The node editor is perfect for things like this. As it is a morph you want to drive, you should use the deform/displacement node editor.

Ztreem
05-15-2018, 01:07 PM
You should also be able to do this from the graph editor as well.

devin
05-15-2018, 01:13 PM
Nodes are still something with which I need to become far more familiar. Once I move over to 2018, my hand will be forced, I guess.

Thanks for the suggestion. I'll check it out.

Ztreem
05-15-2018, 01:22 PM
I can post a screenshot or a scene file later of a possible setup.
Quesrion: do you really need to use a morph? Is it deforming/ changing shape or do you just use a moroh for translating?

Kryslin
05-15-2018, 01:33 PM
I would use nodal motion on the sliding part. You'll need an item info node, a gradient node, an add vector node, a vector to scalar node, a multiply node and a make vector node.

Take the item info node, and set its item to the item you want to drive the sliding item. Take its rotation, and connect it to the vector scalar node. Chose which rotation(h is x, p is y, b is z)axis you want the value from. This gives you a value of 0..6.28, which is the angle of rotation in radians. You'll take that output and connect to the gradient input. Set your minimum value to 0, the max to 6.28. Your first key should be set to black(0,0,0), and your second key @ 1.0 should bet set to white(1,1,1).

Take the color output of the gradient, and connect it to one input of the multiply node, set the other input to the distance you want the driven object to move. Take that output, connect it to the make vector node, using the input for what ever axis you want to slide the item on. Set the other inputs to 0.

From the input node, take the objects position, and connect it to one input of the vector add node. Connect the output of the make vector node to the other. And finally, connect that output to the position input.

Your tweaking is done at 2 places : the gradient cotrols the angle the sliding motion works in, and the multiply controls the distance it moves along an axis.

If anyone tries this, and I forgot something, please correct it. I don't have access to my workstation( healing from back surgery), and the above is probably littered with errors...

Ztreem
05-15-2018, 03:48 PM
Here is an example using cyclist which is a super motion modifier for linking motions together. The best part is that you link animation frames not just math motions, this way you can do very complex movements that can be driven by simple controllers.

Not knowing exactly what you're after I did this simple setup for you to look at. I hope it helps.

141717

dwburman
05-15-2018, 04:57 PM
...

dwburman
05-15-2018, 05:36 PM
I thought about Cyclist too, then I saw your pic of your guess of what the OP was asking and I remembered RayCast.

Hmm... If that's what he's after, perhaps a Ray Cast Geometry node set up could work.

Yes. Yes it does.141719

If he wants a recipricating motion (back and forth), then I think cyclist would work well.

Incidently, Cyclist was missing from LW2018.1 when I tried loading Ztreem's scene. Luckily, it came back after I scanned the plugin folder.

Ztreem
05-16-2018, 12:01 AM
I have no idea if that motion is what he wants, it’s my guess from reading his post. Raycast works as well, I chose cyclist as he said he was not that into nodes. He also asked to work with morphs and that I skipped, but should work as well with both cyclist and raycast.

devin
05-17-2018, 09:53 PM
Wow. Thanks for the posts and assistance everyone. I've had my head buried in this big project and haven't thought to check back. Evidently I forgot to subscribe to the thread as well. I really appreciate the input and look forward to exploring your suggestions.