[Sidefx-houdini-list] Push to undo Stack

Alvaro Castaneda varomix at gmail.com
Wed May 28 15:55:15 EDT 2014


I Really need help here

ok so, I gave more memory to the undos and is still not working I can get
other stuff there but not setting the keyframes, here's some code so you
guys can see what I'm doing

Steps to reproduce this

1.- create a new houdini file
2.- create a toon_character, leave the default name
3.- switch to the Animation > Spine Tab, some keyframes would be created
there
4.- paste the bottom code in the Python source editor
5.- now open the python shell and the undo history windows
6.- in the python shell type *hou.session.resetAll()*
       in the undo History window you should see a label "Reset All
Controls" , so that works
       is pushing it to the undo stack
7.- in the python shell now type *hou.session.keyframeAll()*
         nothing appears now in the undo history window but you can see
that it did set some keyframes
       in the Animation > Spine parameters.

So, what's wrong? why is that not been pushed to the undo stack

already tried on Windows and linux, same behavior.

Please Help, THANK YOU!


def keyframeAll():
    char = hou.node('/obj/toon_character1')
    keyableParms = char.parmsInFolder(['Animation', 'Spine'])
    #print keyableParms

    curFrame = hou.frame()
    key = hou.Keyframe()
    key.setFrame(curFrame)


    with hou.undos.group("Key All Controls"):
        for parm in keyableParms:
            key.setValue(parm.eval())
            char.parm(parm.name()).setKeyframe(key)

def resetAll():
    char = hou.node('/obj/toon_character1')
    keyableParms = char.parmsInFolder(['Animation', 'Spine'])

    with hou.undos.group("Reset All Controls"):
        for parm in keyableParms:
            char.parm(parm.name()).set(0)


On Sun, May 25, 2014 at 12:37 AM, Edward Lam <edward at sidefx.com> wrote:

> I would suspect that your undo stack probably reached its memory limit and
> got thrown away. Try multiplying your undo stack limit by 10 or 100.
>
> -Edward
>
> On Sat, May 24, 2014 11:54, Alvaro Castaneda wrote:
> > I'm setting a bunch of keyframes on all parameters of an object
> > and some how that is not been passed to the undo stack, I guess is
> because
> > been done inside a function maybe
> >
> >
> > On Sat, May 24, 2014 at 3:18 AM, Pavel Kovalenko
> > <pavel at oneanimation.com>wrote:
> >
> >> What does your script do? I ask because actions of scriot like appear in
> >> Undo history list.
> >>
> >>
> >> > *n = hou.node("/obj").createNode("geo")n.parm("tx").set(42)*
> >> >
> >>
> >> Anyway, take a look at *hou.undos* module:
> >> http://www.sidefx.com/docs/houdini13.0/hom/hou/undos
> >>
> >>
> >> On 24 May 2014 05:36, Alvaro Castaneda <varomix at gmail.com> wrote:
> >>
> >> > Hey guys
> >> > I'm doing a few python scripts and I found out that when I execute
> >> some
> >> > actions I can't undo them
> >> >
> >> > so, is there a way to push that stuff to the undo stack manually?
> >> >
> >> > thanks
> >> > _______________________________________________
> >> > Sidefx-houdini-list mailing list
> >> > Sidefx-houdini-list at sidefx.com
> >> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> >> >
> >> _______________________________________________
> >> Sidefx-houdini-list mailing list
> >> Sidefx-houdini-list at sidefx.com
> >> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> >>
> > _______________________________________________
> > Sidefx-houdini-list mailing list
> > Sidefx-houdini-list at sidefx.com
> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> >
>
>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



More information about the Sidefx-houdini-list mailing list