Return the time of a round trip in Math.sin?
Posted: February 7th, 2012, 7:57 am
I am working on an expression that has me up against the wall. What I am trying to do is dynamically offset some number of layers who are traveling in a circle. The circle is based on Math.sin/cos (x and y) oscillation. I have a slider in a master control null that I am using to define the number of layers. As I add layers, I just adjust the slider to that number of layers in the circle. I am trying to offset by time so that I can still keyframe a 'speed' expression control.
I have this working if I predefine the offset by time - (index * .5). The problem is that I have to have a exact number of layers for a specific speed. I want to be able to change this at will and not have to calculate the offset timing for every iteration.
So my question is... Is there some magical word I am missing that will return the amount of time, or the number of frames that the math.sin / math.cos circle takes to do one full oscillation? This way I can just divide by the number objects.
Does this make sense? Thanks for your time.
>> EDIT Sorry, I have been bouncing between the scripts board and the expression board. This was meant for the expressions board (although this is going into a script).
I have this working if I predefine the offset by time - (index * .5). The problem is that I have to have a exact number of layers for a specific speed. I want to be able to change this at will and not have to calculate the offset timing for every iteration.
So my question is... Is there some magical word I am missing that will return the amount of time, or the number of frames that the math.sin / math.cos circle takes to do one full oscillation? This way I can just divide by the number objects.
Does this make sense? Thanks for your time.
>> EDIT Sorry, I have been bouncing between the scripts board and the expression board. This was meant for the expressions board (although this is going into a script).