api doc navigation

taking for example this line of code from the
manual (1st chapter)

   pandaPosInterval1 = self.pandaActor.posInterval(13,Point3(0, -10, 0),startPos=Point3(0, 10, 0))

look as I might I cannot find the function posInterval in the Actor class document (including looking through the Actor namespace, inheritance etc)

How would I navigate to this?
If this function is some kind of special case, how do I recognise this?

It’s runtime generated, defined in /pandac/libpandaModules.py

so it’s not documented???

if it is, where and how do you know how to find the documentation and recognise other such functions

If you read the code :

def posInterval(self, *args, **kw):
        from direct.interval import LerpInterval
        return LerpInterval.LerpPosInterval(self, *args, **kw)

It’s simply a wrapper of LerpPosInterval :
panda3d.org/reference/python … terval.php

The online API reference uses the new import structure, which deprecates those extra methods like posInterval.

so should I report the manual being out of date as a bug?

and where is lerpInterval documented ?

now I’m even more confused!

the manual example has a single number duration ??

but nodePath is mentioned, but not used by the manual example, very confusing think I’ll go with C++ its more accessible

LerpInterval is just the Python module that defines LerpPosInterval and similar intervals. LerpPosInterval itself is documented on the link referenced above.

nodePath.posInterval(blah blah blah)

is equivalent to:

LerpPosInterval(nodePath, blah blah blah)

This is just a tiny Python shorthand that is not documented anywhere specifically, but which we’re explaining to you now. It is true the manual should either explain this shorthand, or not use it in the first place.

What kind of duration do you expect an interval to have, if not a single number?


works, but you cant do the same trick with the first parameter, whats different? and what am I missing?

the manual should defiantly use something like the above to avoid confusion !!

I don’t understand what you’re asking. What trick? The only thing going on here is that there is a method defined on NodePath called posInterval, which has the definition ynjh_jo quoted above–it immediately constructs and returns a LerpPosInterval by applying self as the first parameter, and all of the remaining parameters as the remaining parameters.


nodePath.posInterval(blah blah blah)

is equivalent to:

LerpPosInterval(nodePath, blah blah blah)
pandaPosInterval1 = self.pandaActor.LerpPosInterval(13,Point3(0, -10, 0),startPos=Point3(0, 10, 0))

I still don’t understand what your question is.

This line:

pandaPosInterval1 = LerpPosInterval(self.pandaActor,13,Point3(0, -10, 0),startPos=Point3(0, 10, 0))

is equivalent to this line:

pandaPosInterval1 = self.pandaActor.posInterval(13,Point3(0, -10, 0),startPos=Point3(0, 10, 0))

But it doesn’t make sense to try to use pandaActor.LerpPosInterval(), there’s no such method.


posInterval aint in the docs either so I was guessing much like I had to do to divine the params of posInterval…

Haven’t we been talking about posInterval this whole time?

who knows… the manual has certainly confused me I though we were talking about a method of Actor that wasn’t documented for most of the time.

but I still dont see why putting actor first it doesn’t get put as the first parameter like

nodePath.posInterval(blah blah blah)
LerpPosInterval(nodePath, blah blah blah)

I’m still not sure what you’re asking about, I’m sorry. I’m just not getting your questions.

There is no magic going on here. There is no special handling of the first parameter as the “self” parameter. (Python can do this sort of thing, sort of, but it’s not normally the way you would call a method.)

What’s happening here is that Actor inherits from NodePath, and there is a method of NodePath called “posInterval” that simply constructs and returns a LerpPosInterval. So Actor inherits this method from NodePath.

Ostensibly, this method exists solely as a typing convenience, which is a little odd because it doesn’t save very much typing. But there you have it. Someone, at one point, thought it would be convenient to have such a method, and they defined it. But they defined it in such a way that the generated API docs can’t find it, so it doesn’t get documented. And we will probably remove it in the future.

So, yeah, the manual should probably avoid using this confusing little method in its example.

For the record, there is also a similar method called hprInterval that constructs and returns a LerpHprInterval, and so on.