Page 1 of 1

Camera IPO

PostPosted: Mon Jun 29, 2009 7:48 am
by Jonnee
Hey, my friends!

I tried to make a camera animation that is triggered by a button click.
The animation works, but there is one small problem:

The camera doesn't rotate. It just moves from the start to the end point. But I want to rotate it too, so that it looks upwards.

I have used two kinds to create the camera IPO: "LocRot" and "LocRotScale". But always with the same result. It doesn't rotate. :(
Anyone knows why it happens?
I did not define the poa. So the camera is not attached to the avatar. It should move free.

Re: Camera IPO

PostPosted: Mon Jun 29, 2009 8:34 am
by D'Lanor
Did you use the simple type camera? That is the type which should be used for animations.

Scaling is not supported in PyPRP btw.

Re: Camera IPO

PostPosted: Mon Jun 29, 2009 9:22 pm
by Jonnee
The camera still doesn't work as I did expect.
I write a PM to you with the code...

Re: Camera IPO

PostPosted: Tue Jun 30, 2009 7:25 am
by D'Lanor
Having never animated a camera myself I am not sure if I can answer this. The general principle is that first you switch to the new camera using a cameramsg and then you start the animation with an animcmdmsg.

And I did notice an additional command in the PyPRP source files which perhaps the wiki forgot to mention? :? The "- setanimated" command.

See if it helps to add that:

Code: Select all
<any object>:
    logic:
        actions:
          - type: responder
            name: <responder name>
            responder:
                states:
                  - cmds:
                      - type: cameramsg
                        params:
                            cmds:
                              - regionpushcamera
                              - respondertrigger
                              - setanimated
                            newcam: <camera name>
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0

Re: Camera IPO

PostPosted: Tue Jun 30, 2009 12:16 pm
by Jojon
As I recall, from my own animated camera, I had to include the cutpos and cutpoa flags and/or (not entirely sure) zero pan limits, or I'd get just what you describe.

In my case, I didn't really want that sharp cut to the camera, but accepted it. I suppose a work-around would be to have duplicates of the camera at its end points and switch between stationary and moving ones at the start and end of the animation.