Offset animation (curve value) in time

1,157 views
Skip to first unread message

johan Borgström

unread,
Oct 4, 2014, 7:07:27 AM10/4/14
to python_in...@googlegroups.com
Hi !

Does anyone know if there is a built in node(s) that can offset a value driven by an animation curve in time? i.e. get the value of the animation curve at a different time then the global time?

I have attached an image of a simple setup. There is an attribute called anim on the curve node that drives the translation of the poly cubes. Is there a node that I could place between the output from the driver and before the input of the driven?

The effect I want is one animation curves that drives a number of other nodes with the ability to offset the value in time.

Best Regards,
Johan
offset_time_node.gif

Ricardo Viana

unread,
Oct 4, 2014, 7:20:56 AM10/4/14
to python_in...@googlegroups.com
Maybe with expressions ??

Like ie: polyCube.translateX = polyCube2.translateX + offset
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d286e962-9051-44c8-8f83-6ab2bfa6320a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Sent from Mobile

johan Borgström

unread,
Oct 4, 2014, 7:39:13 AM10/4/14
to python_in...@googlegroups.com
Hi Ricardo,

It is not the destination value (translate x) in itself that I wish to offset. What I want to do is to sample the value driven by the animation curve at a specified time, to offset the value in time. That value can then drive various other nodes.

I would like to do this without the use of expressions and with "native" nodes if possible.

Cheers,
Johan


On Saturday, October 4, 2014 1:20:56 PM UTC+2, Ricardo Viana wrote:
Maybe with expressions ??

Like ie: polyCube.translateX = polyCube2.translateX + offset

On Saturday, October 4, 2014, johan Borgström <jo...@petfactory.se> wrote:
Hi !

Does anyone know if there is a built in node(s) that can offset a value driven by an animation curve in time? i.e. get the value of the animation curve at a different time then the global time?

I have attached an image of a simple setup. There is an attribute called anim on the curve node that drives the translation of the poly cubes. Is there a node that I could place between the output from the driver and before the input of the driven?

The effect I want is one animation curves that drives a number of other nodes with the ability to offset the value in time.

Best Regards,
Johan

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.


--
Sent from Mobile

Anthony Tan

unread,
Oct 4, 2014, 7:49:02 AM10/4/14
to python_in...@googlegroups.com
At a guess, the node itself might do what you want? You just want to plug in something into the input slot of the animation curve.
 
The AnimCurveXYZ node an input value which controls the time at which you want to evaluate the curve so you can do simple offsets thusly (relevant doc page: http://download.autodesk.com/global/docs/maya2013/en_us/Nodes/animCurve.html ): This is just me translating a cube around and re timing things by 2x for the heck of it.  
 
 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Email had 1 attachment:

  • offset_time_node.gif
      76k (image/gif)
 
Untitled-1.jpg

Marcus Ottosson

unread,
Oct 4, 2014, 7:51:49 AM10/4/14
to python_in...@googlegroups.com

Does anyone know if there is a built in node(s) that can offset a value driven by an animation curve in time?



For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

johan Borgström

unread,
Oct 4, 2014, 8:54:58 AM10/4/14
to python_in...@googlegroups.com
Thanks for pointing me in the right direction Marcus :)

Test snippet, with a node name ctrl with an animated float attr named anim, and 3 poly cubes.

import pymel.core as pm

cache = pm.createNode('frameCache')
ctrl = pm.PyNode('ctrl')
time = pm.PyNode('time1')
cube_1 = pm.PyNode('pCube1')
cube_2 = pm.PyNode('pCube2')
cube_3 = pm.PyNode('pCube3')

time.outTime >> cache.varyTime
ctrl.anim >> cache.stream
 
cache.past[5] >> cube_1.ty
cache.past[10] >> cube_2.ty
cache.past[15] >> cube_3.ty



On Saturday, October 4, 2014 1:51:49 PM UTC+2, Marcus Ottosson wrote:

Does anyone know if there is a built in node(s) that can offset a value driven by an animation curve in time?

Yes there is, it’s called frameCache.

On 4 October 2014 12:48, Anthony Tan <antho...@greenworm.net> wrote:
At a guess, the node itself might do what you want? You just want to plug in something into the input slot of the animation curve.
 
The AnimCurveXYZ node an input value which controls the time at which you want to evaluate the curve so you can do simple offsets thusly (relevant doc page: http://download.autodesk.com/global/docs/maya2013/en_us/Nodes/animCurve.html ): This is just me translating a cube around and re timing things by 2x for the heck of it.  
 
 

 
On Sat, Oct 4, 2014, at 09:07 PM, johan Borgström wrote:
Hi !
 
Does anyone know if there is a built in node(s) that can offset a value driven by an animation curve in time? i.e. get the value of the animation curve at a different time then the global time?
 
I have attached an image of a simple setup. There is an attribute called anim on the curve node that drives the translation of the poly cubes. Is there a node that I could place between the output from the driver and before the input of the driven?
 
The effect I want is one animation curves that drives a number of other nodes with the ability to offset the value in time.
 
Best Regards,
Johan


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Email had 1 attachment:

  • offset_time_node.gif
      76k (image/gif)

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.



--
Marcus Ottosson
konstr...@gmail.com

johan Borgström

unread,
Oct 4, 2014, 9:00:28 AM10/4/14
to python_in...@googlegroups.com, antho...@greenworm.net
Thanks for the info Anthony, it will come in handy sometime :)
But what I wanted to do was to let one anim curve drive multiple attributes (various offset in time), this setup will not do that, right?

Cheers,
Johan


On Saturday, October 4, 2014 1:49:02 PM UTC+2, Anthony Tan wrote:
At a guess, the node itself might do what you want? You just want to plug in something into the input slot of the animation curve.
 
The AnimCurveXYZ node an input value which controls the time at which you want to evaluate the curve so you can do simple offsets thusly (relevant doc page: http://download.autodesk.com/global/docs/maya2013/en_us/Nodes/animCurve.html ): This is just me translating a cube around and re timing things by 2x for the heck of it.  
 
 

 
On Sat, Oct 4, 2014, at 09:07 PM, johan Borgström wrote:
Hi !
 
Does anyone know if there is a built in node(s) that can offset a value driven by an animation curve in time? i.e. get the value of the animation curve at a different time then the global time?
 
I have attached an image of a simple setup. There is an attribute called anim on the curve node that drives the translation of the poly cubes. Is there a node that I could place between the output from the driver and before the input of the driven?
 
The effect I want is one animation curves that drives a number of other nodes with the ability to offset the value in time.
 
Best Regards,
Johan


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

johan Borgström

unread,
Oct 4, 2014, 9:13:29 AM10/4/14
to python_in...@googlegroups.com
One more thing...

One drawback with this node is that it might be inflexible. What if I want to animat the time offset? The only way to change the offset is to reconnect the future or past connections, right?

Is there a node that would allow me to specify the time offset (past and futare )as a float ranging from -n to n, and that is keyable.

/ Johan
cache.gif

Marcus Ottosson

unread,
Oct 4, 2014, 12:11:50 PM10/4/14
to python_in...@googlegroups.com
Sure, you can create any number of outputs you'd like on the frameCache, and manage which output to use with a choice node, which you could animate.
But you're right in that it's a tad inflexible. I think the more outputs you create, the more juice it'll take to calculate. The only other efficient way I can think of would be to put a scriptJob on attribute creation and only create what is actually used. Quite inelegant still.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b0e77f8b-0694-4e98-91a2-3ba130880287%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Anthony Tan

unread,
Oct 4, 2014, 9:16:27 PM10/4/14
to johan Borgström, python_in...@googlegroups.com
Ah, righto, sorry I don't think i had quite gotten what you were after. If you want a master curve that you could apply to a whole bunch of attributes, with each one firing at some kind of time offset then yep, this isn't going to help so much since you still need to work out a way to select the appropriate offset per-geo. 

Nicolas Combecave

unread,
Oct 5, 2014, 11:37:52 PM10/5/14
to python_in...@googlegroups.com
Did you try the varytime and varying attributes?
We actually used those nodes for the exact same use case as yours...

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b0e77f8b-0694-4e98-91a2-3ba130880287%40googlegroups.com.

johan Borgström

unread,
Oct 6, 2014, 2:05:22 AM10/6/14
to python_in...@googlegroups.com
Thank you so much!

Works perfectly, exactly what I wanted to do. It was staring at me from the docs but I was to busy noticing it... :)

Thanks again,
Johan
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.

Email had 1 attachment:

  • offset_time_node.gif
      76k (image/gif)

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.



--
Marcus Ottosson
konstr...@gmail.com

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages