mcjRepeatAction: repeat actions over a range of frames

mCasualmCasual Posts: 4,607
edited November 2014 in Freebies

https://sites.google.com/site/mcasualsdazscripts4/mcjrepeataction


this script will perform actions repeatedly over a specified time range

ex: you select a ball, you specify that the action is "Drop to Floor" ( CTRL-D ),
you specify you want this to be applied over the playRange ( which happens to be frames 0 to 30 )

and the script goes frame by frame and activates the drop to floor action


the following standard Daz Studio built-in actions are supported

DzRestoreFigureAction
DzRestoreFigurePoseAction
DzRestoreFigureMorphsAction
DzRestoreSelectedItemsAction
DzRestoreTransformsAction
DzMoveToFloorAction
DzAddKeysAction
DzDeleteKeysAction

when 2 nodes are selected
You can specify which of the nodes to treat as the 'Target'
and the following actions ( by me ) are available

Move Below Target
Move Above Target
World Pos Like Target
World Rot Like Target
World Scale Like Target
Local Pos Like Target
Local Rot Like Target
Local Scale Like Target

Lets say you want a figure to pick a sword then later leave it somewhere

you animate the part of the movie where the figure wields the sword - the sword is parented to the figure's hand

you create a null node and use the script to have the Null node follow the position and orientation of the sword
for the frames where the wielding occurs

then you unparent the sword from the figure's hand

and you use the script to make the sword follow the position and orientation of the Null node for the frames where the wielding occurs

i once used that method to get an Alice to pick up a bottle of "Drink Me" , and ... well it can still be tricky but it can be done !

howto.jpg
1187 x 641 - 256K
pushdo.gif
429 x 323 - 461K
Post edited by Cris Palomino on

Comments

  • patience55patience55 Posts: 7,006
    edited December 1969

    Oh looking forward to this one. You never cease to amaze ;-)

  • mCasualmCasual Posts: 4,607
    edited September 2014

    when only 1 node is selected

    the unusable actions ( which require 2 nodes ) are hidden

    -------

    while i'm at it i'll add an action to delete only the morph keyframes and one to delete only the transform keyframes

    because sometimes when animating head movements
    you want to clear all animated head movement keyframes
    but you don't want to destroy all the face morph settings/animations

    also sometimes you want to keyframe ( i call this pinning down )
    the head movements ) without disturbing the lipsync and blinkings

    maybe i could use Daz Studio's DzAddKeysAction and DzDeleteKeysAction but lock or unlock the transforms before activating them?

    ( morphs got complicated with DS4.5 they are dangling off the root of the figure )

    quirk: for now, the script works for frame-exact keyframes but not for inter-frame keyframes .. which are often created by MiMic

    i often use mcjDecimate for the "pinning down" tasks

    onenode.jpg
    496 x 311 - 54K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited September 2014

    soon !

    i just want to make sure it works for DS1, DS2

    did tests with DS3, DS4.6 and it all seems to work

    ---

    Fig 1 - Amy breaking the 4th wall, in DS4.6
    Fig 2 - Logos for the 2 versions
    Fig 3 - DS 2.3, deleting and setting keyframes on morphs without disturbing motion animation
    Fig 4 - DS 2.3 the animation
    Fig 5 - DS 1.8 compatibility ( did require a little tweak action,activate() instead of action.toggle() )

    dropitt.gif
    375 x 311 - 192K
    momo.gif
    287 x 155 - 126K
    meanwhileinds2.jpg
    1920 x 900 - 383K
    mra.jpg
    914 x 506 - 115K
    breakthewall.gif
    487 x 306 - 614K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    doing a few tests helps get you a better script
    for instance this test revealed the need to display figure names
    else we had no way of differentiating/selecting the "Target"

    inds23.jpg
    1316 x 618 - 273K
  • mCasualmCasual Posts: 4,607
    edited December 1969
  • patience55patience55 Posts: 7,006
    edited December 1969

    Downloaded :-)

    off to play now and see if I can make it work too :-)

  • patience55patience55 Posts: 7,006
    edited December 1969

    Okay ... waiting for the more complete manual. Drop to floor works real good. Never comes back up, but it sure it sure fell down .... presumably I missed in the steps.

  • mCasualmCasual Posts: 4,607
    edited September 2014

    Okay ... waiting for the more complete manual. Drop to floor works real good. Never comes back up, but it sure it sure fell down .... presumably I missed in the steps.

    i

    say you specify you want frames 10 to 20 to get the "drop to floor " action
    it's the same as if you
    moved the timeline to frame 10, clicked cttl-d (drop to floor )
    moved the timeline to frame 11, clicked cttl-d (drop to floor )
    .
    .
    .
    moved the timeline to frame 20, clicked cttl-d (drop to floor )

    so if there was no key-frame to keep the object up in the air past frame 20, there isn't one now either and the object remains of the floor til the end of time(line)s

    so you could apply the "add transform keys" action on frame 0 to 30, to "pin down" the current animation, then use the "drop to floor" action on frames 10 to 20

    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    improved the manual a little

    learn to do this stupid puck trick !

    https://sites.google.com/site/mcasualsdazscripts4/mcjrepeataction

    stupidpucktrick.gif
    450 x 253 - 548K
  • patience55patience55 Posts: 7,006
    edited December 1969

    Thank you, downloaded will have some more fun later ;-)

Sign In or Register to comment.