PDA

View Full Version : Counter with expressions



techmotion
10-17-2016, 05:31 AM
I want to create a counter with expressions, but I don't know where to start.

I have a counter with three rolls.
Every time that the third roll has rotated 360 degrees on pitch, I want the second roll to rotate 36 degrees on pitch (within one frame), and when the second roll had rotated 360 degrees in total then I want the first roll to rotate 36 degrees on pitch (within one frame), and so on.

I've include a screenshot and also the scene that I created and animated manually to show you what I mean.

The reason that I would like to be able to do this with expressions is because I will be needing different values on the counter at different speeds.

Thank you! :)

pinkmouse
10-17-2016, 06:10 AM
You'd be much better off with nodes for this, use a null to set the value, then Item Info it to use to drive the rotation. Just remember nodes work in radians rather than degrees. ;)

I'm about to go out for the rest of the day, but if you haven't got anywhere by tomorrow morning I'll show you the rough idea.

Otterman
10-17-2016, 06:47 AM
Cant you just use Follower for that and divide by 10? It's pretty easy to get to grips with.

Prince Charming
10-17-2016, 07:04 AM
Here is nodal set up... Needs dp item info. Use the speed control to control the speed of the counter.

techmotion
10-17-2016, 07:30 AM
Here is nodal set up... Needs dp item info. Use the speed control to control the speed of the counter.

Thank you! This works great.
One question: How can I view/edit the nodes to view how you've created this setup?

Prince Charming
10-17-2016, 07:49 AM
Thank you! This works great.
One question: How can I view/edit the nodes to view how you've created this setup?

The spinning null has the rotations on each rotation channel... Just like your original set up basically, but on each rotation channel of the spinning null instead.

Then all three wheels have a node motion modifier that takes the rotating null with "dp item info" set to "absolute". Then uses the speed null to control the time of the spinning null.

When you have the item info set to "absolute" it uses the input as the absolute time, as opposed to an offset form its own time. Basically, you are using the speed control to play through the other curves at whatever rate you want.

Hope that made sense, if you poke around for a bit you will be able to figure it out.

techmotion
10-17-2016, 08:10 AM
Found it! Thank you all for your help.
I will poke around to figure it out.