Automatic Texture Animation- from the manual

Hi, I’m using the Automatic Texture Animation talked about in the manual http://www.panda3d.org/manual/index.php/Automatic_Texture_Animation

The egg-texture-cards program works fine and the resultant egg works fine in my program with two issues:

  1. the Y-axis of the egg is backward. Employing lookAt(camera) on the node orients the Y-axis in exactly the wrong direction so that nothing is seen. I have corrected this with the following code:
self.model.setP(-self.model.getP())
self.model.setH(self.model.getH()+180)

where

self.model

is the loaded egg.

  1. The real problem I have and the reason for the post is that the manual talks about setting the start frame with the following code
flip.find('**/+SequenceNode').node().setVisibleChild(startFrame)

I get a libpanda error when I put the corresponding code.

self.model.find('**/+SequenceNode').node().setVisibleChild(0001)

where 0001 is the first frame.

The reason I want this is that I have observed that as this model is introduced repeatedly at different points in my overall program that the animation actually begins at different places in the total animation.

Any help would be great.

I experienced other funny thing, the wildcards doesn’t work, I had to type every filename to get it to work.

  1. that’s the nature of lookAt, the Y+ looks at the point. There is billboard effect to fit your need :
flip.setBillboardPointEye()
  1. looks like it’s not available anymore, but it’s doable. Though I don’t experience the random start frame on multiple copies.
flip.find('**/+SequenceNode').node().pose(startFrame)
flip.find('**/+SequenceNode').node().loop(0)  # begin from current frame

(1) egg-texture-cards creates a model that is designed to be facing the camera when you parent it to render2d. That is to say, it is oriented to face down the -y axis, instead of down the +y axis. This means that if you use card.lookAt(camera), it will turn its backside to face the camera.

But you probably really want to use card.doBillboardAxis(camera, 0) instead. This is very like lookAt(), but it rotates the -y axis to face the indicated node.

(2) The manual is a bit stale. The interface to SequenceNode has changed. Now you can call sequenceNode.pose(), loop(), play(), stop(), etc., very much like an Actor. In particular, to start the sequence looping from the beginning, do:

flip.find('**/+SequenceNode').node().loop(1)

David

Thanks for your swift responses.

The switch to

 
flip.find('**/+SequenceNode').node().loop(1) 

did the trick. I tried the BillBoard thing but I’m doing something wrong. The lookAt() then reversing hack thingy works fine though.

This is for an explosion and they are shortlived enough that if they are oriented correctly in the beginning there isn’t a an appreciable need to have the node continue to look at the camera.