02 February 2013 | |
![]() |
|
Know-it-All
Tomas Landberg
Huddinge,
Sweden
|
An animation loop toggled on/off by a control?
Hello!
I'm making an automated turret, and it needs to be able to fire it's cannons. As it is quite a fast and repetitive action, one would imagine that it would be best to do one fire cycle, then repeat it and hook it up to an on/off controller, right? But how do I do that, exactly? |
02 February 2013 | |
![]() |
|
Expert
portfolio
Prem Anand Earnest Dhass
Team Lead Rigging
Technicolor India
Bangalore,
India
|
Hi,
SDK the turret rotation and connon firing for one cycle. Then grab the SDK DAG node open the attribute editor and make it cyclic. Now as you play the timeline your turret will rotate and fire. Rgds, |
02 February 2013 | |
![]() |
|
Lurking
portfolio
A. D.
Vertex Slinger
Munich,
Germany
|
Here's how I would do it, though that's not to say it's the best method; merely the one I could think of right now:
This way, the choice node acts as a 'router' or 'inhibitor'. Only when the on/off attribute is set to 1 do the cycled animated animCurves get connected to the gun, at which point it begins firing. When set to off (0) the static animCurve gets connected and the gun doesn't fire. An alternative, with less setup hassle, might be to simply connect some on/off attribute to each animated animCurve's Node State attribute, switching it from Normal to HasNoEffect (though I haven't tested this) __________________
aweControlPicker (GUI Picker for Maya) |
02 February 2013 | |
![]() |
|
Know-it-All
Tomas Landberg
Huddinge,
Sweden
|
Originally Posted by Nyro:
Here's how I would do it, though that's not to say it's the best method; merely the one I could think of right now:
An alternative, with less setup hassle, might be to simply connect some on/off attribute to each animated animCurve's Node State attribute, switching it from Normal to HasNoEffect (though I haven't tested this) It works as far as I have tested (haven't animated my character yet, still testing and working out the kinds of the rig). One question though: When I turn the animation on, will it begin at frame 1 of the animation curve, or wherever in the looping animation it happens to be at the time? It's not such a big deal with this specific animation since it's such a short repetition, but when it comes to longer animation cycles, it would be good to be able to have it offset to the frame(s) where the animation is set to on, rather than jumping into it at some random place in the middle of the cycle. |
02 February 2013 | |
![]() |
|
Lurking
portfolio
A. D.
Vertex Slinger
Munich,
Germany
|
No, it will play at whatever frame the scene time currently is; animation curves are a function of value over time, and time is the global time.
If you want it to start at frame 1, then you'll have to write a script(job) to do the work, though perhaps it could be done with an expression. __________________
aweControlPicker (GUI Picker for Maya) |
02 February 2013 | |
![]() |
|
Expert
|
Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. |
Thread Closed share thread |
«
Previous Thread
|
Next Thread
»
|
|
|