Frame to Frame on egg texture

Example:

to start at a particular frame

flip = loader.loadModel(‘flip.egg’)
flip.find(’**/+SequenceNode’).node().setVisibleChild(startFrame)
flip.reparentTo(render)

Can I apply a startFrame and endFrame on a sequenceNode, so that my animation starts and ends on specific frames I choose. Like the one used on an actor?

Example:
actor.pose(‘Animation Name’, 30)
actor.loop(‘Animation Name’, restart = 0, fromFrame = 24, toFrame = 36)

I checked SequenceNode in the API ref, but didn’t see any method for this. Can it be done?

Yes, since SequenceNode inherits from AnimInterface, which defines both pose and loop, you can call these methods on SequenceNode.

David

How?
I tried play(fromFrame,toFrame) and got an error about arguments.

Did you do:

flip.find('**/+SequenceNode').node().play(fromFrame, toFrame)

? It’s all there in the API docs. Or you can type:

help(SequenceNode)

within Python to get the same list.

David

No, I am sorry. I didn’t mean I actually typed

flip.find('**/+SequenceNode').node().play(fromFrame, toFrame)

. I typed

flip.find('**/+SequenceNode').node().play(0, 10)

, and got the error.
Are you refering to this part of the API ref?

This is where I looked. I even tried

flip.find('**/+SequenceNode').node().play(0, getNumFrames() * 2)

and got an error about getNumFrames.
I am sorry for what ever mistakes I am making or for failing to see what should be clear. I may be a bit slow, but with some patients I can be helped. Could you show me which part I have wrong and explain a bit of what I am missing. Thank you.

The API reference documentation has a bug: it only shows the first variant of play(), which accepts no parameters. It does not show the second variant, which accents a from and to range. But the function exists. You can see the correct description with:

help(SequenceNode.play)

Exactly what error message did you get? That’s very important information, you know. It’s nearly impossible to diagnose a problem where all we know about it is “I got an error.”

As to the second case, it is clearly an error with getNumFrames() because you did not specify an object to call getNumFrames() on.

David

Sorry, once again. I tried it again and it worked. obviously I typed something wrong. Thanks for the help and the code.