Panda3D
Classes | Functions | Variables
direct.actor.Actor Namespace Reference

Classes

class  Actor
 

Functions

def actorInterval (self, args, kw)
 
def addLOD (self, lodName, inDist=0, outDist=0, center=None)
 sortedKeys = self.switches.keys() sortedKeys.sort() for eachLod in sortedKeys: index = sortedKeys.index(eachLod) self.__LODNode.node().setSwitch(index, self.switches[eachLod][0], self.switches[eachLod][1]) More...
 
def animPanel (self)
 
def attach (self, partName, anotherPartName, jointName, lodName="lodRoot")
 
def bindAllAnims (self, allowAsyncBind=False)
 
def bindAnim (self, animName, partName=None, lodName=None, allowAsyncBind=False)
 
def clearLODAnimation (self)
 
def controlJoint (self, node, partName, jointName, lodName="lodRoot")
 
def disableBlend (self, partName=None)
 
def drawInFront (self, frontPartName, backPartName, mode, root=None, lodName=None)
 
def enableBlend (self, blendType=PartBundle.BTNormalizedLinear, partName=None)
 
def exposeJoint (self, node, partName, jointName, lodName="lodRoot", localTransform=0)
 
def faceAwayFromViewer (self)
 
def faceTowardsViewer (self)
 
def fixBounds (self, partName=None)
 
def fixBounds_old (self, part=None)
 
def freezeJoint (self, partName, jointName, transform=None, pos=Vec3(0, 0, 0), hpr=Vec3(0, 0, 0), scale=Vec3(1, 1, 1))
 
def getAnimBlends (self, animName=None, partName=None, lodName=None)
 
def getAnimControl (self, animName, partName=None, lodName=None, allowAsyncBind=True)
 
def getAnimControls (self, animName=None, partName=None, lodName=None, allowAsyncBind=True)
 
def getAnimFilename (self, animName, partName='modelRoot')
 
def getBaseFrameRate (self, animName=None, partName=None)
 
def getCurrentAnim (self, partName=None)
 
def getCurrentFrame (self, animName=None, partName=None)
 
def getDuration (self, animName=None, partName=None, fromFrame=None, toFrame=None)
 
def getFrameRate (self, animName=None, partName=None)
 
def getFrameTime (self, anim, frame, partName=None)
 
def getJoints (self, partName=None, jointName=' *', lodName=None)
 
def getJointTransform (self, partName, jointName, lodName='lodRoot')
 
def getJointTransformState (self, partName, jointName, lodName='lodRoot')
 
def getLOD (self, lodName)
 
def getLODIndex (self, lodName)
 sortedKeys = self.switches.keys() sortedKeys.sort() More...
 
def getNumFrames (self, animName=None, partName=None)
 
def getOverlappingJoints (self, partNameA, partNameB, jointName=' *', lodName=None)
 
def getPart (self, partName, lodName="lodRoot")
 
def getPartBundle (self, partName, lodName="lodRoot")
 
def getPlayRate (self, animName=None, partName=None)
 
def getSubpartsComplete (self)
 
def hasLOD (self)
 
def hideAllBounds (self)
 
def hidePart (self, partName, lodName="lodRoot")
 
def initAnimsOnAllLODs (self, partNames)
 
def instance (self, path, partName, jointName, lodName="lodRoot")
 
def loadAnims (self, anims, partName="modelRoot", lodName="lodRoot")
 
def loadAnimsOnAllLODs (self, anims, partName="modelRoot")
 
def loadModel (self, modelPath, partName="modelRoot", lodName="lodRoot", copy=True, okMissing=None, autoBindAnims=True)
 
def loop (self, animName, restart=1, partName=None, fromFrame=None, toFrame=None)
 
def makeSubpart (self, partName, includeJoints, excludeJoints=[], parent="modelRoot", overlapping=False)
 
def osdAnimBlends (self, animName=None, partName=None, lodName=None)
 
def pingpong (self, animName, restart=1, partName=None, fromFrame=None, toFrame=None)
 
def play (self, animName, partName=None, fromFrame=None, toFrame=None)
 
def pose (self, animName, frame, partName=None, lodName=None)
 
def postFlatten (self)
 
def printAnimBlends (self, animName=None, partName=None, lodName=None)
 
def printLOD (self)
 
def releaseJoint (self, partName, jointName)
 
def removePart (self, partName, lodName="lodRoot")
 
def renamePartBundles (self, partName, newBundleName)
 
def resetLOD (self)
 
def setBlend (self, animBlend=None, frameBlend=None, blendType=None, partName=None)
 
def setCenter (self, center)
 
def setControlEffect (self, animName, effect, partName=None, lodName=None)
 
def setLOD (self, lodName, inDist=0, outDist=0)
 
def setLODAnimation (self, farDistance, nearDistance, delayFactor)
 
def setPlayRate (self, rate, animName, partName=None)
 
def setSubpartsComplete (self, flag)
 
def showAllBounds (self)
 
def showAllParts (self, partName, lodName="lodRoot")
 
def showPart (self, partName, lodName="lodRoot")
 
def stop (self, animName=None, partName=None)
 
def stopJoint (self, partName, jointName, lodName="lodRoot")
 
def unloadAnims (self, anims=None, partName=None, lodName=None)
 
def update (self, lod=0, partName=None, lodName=None, force=False)
 
def verifySubpartsComplete (self, partName=None, lodName=None)
 
def waitPending (self, partName=None)
 

Variables

 child = self.__LODNode.find(str(lodName))
 sortedKeys = self.switches.keys() sortedKeys.sort() More...
 
 gotName
 
 index = self.__LODNode.node().findChild(child.node())
 
 sortedKeys = self.__sortedLODNames
 sortedKeys = self.switches.keys() sortedKeys.sort() More...
 
 switchNum = self.__LODNode.node().getNumSwitches()
 

Detailed Description

Actor module: contains the Actor class

Function Documentation

◆ actorInterval()

def direct.actor.Actor.actorInterval (   self,
  args,
  kw 
)

◆ addLOD()

def direct.actor.Actor.addLOD (   self,
  lodName,
  inDist = 0,
  outDist = 0,
  center = None 
)

sortedKeys = self.switches.keys() sortedKeys.sort() for eachLod in sortedKeys: index = sortedKeys.index(eachLod) self.__LODNode.node().setSwitch(index, self.switches[eachLod][0], self.switches[eachLod][1])

addLOD(self, string)
Add a named node under the LODNode to parent all geometry
of a specific LOD under.

◆ animPanel()

def direct.actor.Actor.animPanel (   self)

◆ attach()

def direct.actor.Actor.attach (   self,
  partName,
  anotherPartName,
  jointName,
  lodName = "lodRoot" 
)
attach(self, string, string, string, key="lodRoot")
Attach one actor part to another at a joint called jointName

◆ bindAllAnims()

def direct.actor.Actor.bindAllAnims (   self,
  allowAsyncBind = False 
)
Loads and binds all animations that have been defined for
the Actor. 

◆ bindAnim()

def direct.actor.Actor.bindAnim (   self,
  animName,
  partName = None,
  lodName = None,
  allowAsyncBind = False 
)
Binds the named animation to the named part and/or lod.  If
allowAsyncBind is False, this guarantees that the animation is
bound immediately--the animation is never bound in a
sub-thread; it will be loaded and bound in the main thread, so
it will be available by the time this method returns.

The parameters are the same as that for getAnimControls().  In
fact, this method is a thin wrapper around that other method.

Use this method if you need to ensure that an animation is
available before you start to play it, and you don't mind
holding up the render for a frame or two until the animation
is available.

◆ clearLODAnimation()

def direct.actor.Actor.clearLODAnimation (   self)
Description: Undoes the effect of a recent call to
set_lod_animation().  Henceforth, the character will animate
every frame, regardless of its distance from the camera.

◆ controlJoint()

def direct.actor.Actor.controlJoint (   self,
  node,
  partName,
  jointName,
  lodName = "lodRoot" 
)
The converse of exposeJoint: this associates the joint with
the indicated node, so that the joint transform will be copied
from the node to the joint each frame.  This can be used for
programmer animation of a particular joint at runtime.

The parameter node should be the NodePath for the node whose
transform will animate the joint.  If node is None, a new node
will automatically be created and loaded with the joint's
initial transform.  In either case, the node used will be
returned.

It used to be necessary to call this before any animations
have been loaded and bound, but that is no longer so.

◆ disableBlend()

def direct.actor.Actor.disableBlend (   self,
  partName = None 
)
Restores normal one-animation-at-a-time operation after a
previous call to enableBlend().

This method is deprecated.  You should use setBlend() instead.

◆ drawInFront()

def direct.actor.Actor.drawInFront (   self,
  frontPartName,
  backPartName,
  mode,
  root = None,
  lodName = None 
)
drawInFront(self, string, int, string=None, key=None)

Arrange geometry so the frontPart(s) are drawn in front of
backPart.

If mode == -1, the geometry is simply arranged to be drawn in
the correct order, assuming it is already under a
direct-render scene graph (like the DirectGui system).  That
is, frontPart is reparented to backPart, and backPart is
reordered to appear first among its siblings.

If mode == -2, the geometry is arranged to be drawn in the
correct order, and depth test/write is turned off for
frontPart.

If mode == -3, frontPart is drawn as a decal onto backPart.
This assumes that frontPart is mostly coplanar with and does
not extend beyond backPart, and that backPart is mostly flat
(not self-occluding).

If mode > 0, the frontPart geometry is placed in the 'fixed'
bin, with the indicated drawing order.  This will cause it to
be drawn after almost all other geometry.  In this case, the
backPartName is actually unused.

Takes an optional argument root as the start of the search for the
given parts. Also takes optional lod name to refine search for the
named parts. If root and lod are defined, we search for the given
root under the given lod.

◆ enableBlend()

def direct.actor.Actor.enableBlend (   self,
  blendType = PartBundle.BTNormalizedLinear,
  partName = None 
)
Enables blending of multiple animations simultaneously.
After this is called, you may call play(), loop(), or pose()
on multiple animations and have all of them contribute to the
final pose each frame.

With blending in effect, starting a particular animation with
play(), loop(), or pose() does not implicitly make the
animation visible; you must also call setControlEffect() for
each animation you wish to use to indicate how much each
animation contributes to the final pose.

This method is deprecated.  You should use setBlend() instead.

◆ exposeJoint()

def direct.actor.Actor.exposeJoint (   self,
  node,
  partName,
  jointName,
  lodName = "lodRoot",
  localTransform = 0 
)
exposeJoint(self, NodePath, string, string, key="lodRoot")
Starts the joint animating the indicated node.  As the joint
animates, it will transform the node by the corresponding
amount.  This will replace whatever matrix is on the node each
frame.  The default is to expose the net transform from the root,
but if localTransform is true, only the node's local transform
from its parent is exposed.

◆ faceAwayFromViewer()

def direct.actor.Actor.faceAwayFromViewer (   self)

◆ faceTowardsViewer()

def direct.actor.Actor.faceTowardsViewer (   self)

◆ fixBounds()

def direct.actor.Actor.fixBounds (   self,
  partName = None 
)

◆ fixBounds_old()

def direct.actor.Actor.fixBounds_old (   self,
  part = None 
)
fixBounds(self, nodePath=None)
Force recomputation of bounding spheres for all geoms
in a given part. If no part specified, fix all geoms
in this actor

◆ freezeJoint()

def direct.actor.Actor.freezeJoint (   self,
  partName,
  jointName,
  transform = None,
  pos = Vec3(0,0,0),
  hpr = Vec3(0,0,0),
  scale = Vec3(1,1,1) 
)
Similar to controlJoint, but the transform assigned is
static, and may not be animated at runtime (without another
subsequent call to freezeJoint).  This is slightly more
optimal than controlJoint() for cases in which the transform
is not intended to be animated during the lifetime of the
Actor. 

◆ getAnimBlends()

def direct.actor.Actor.getAnimBlends (   self,
  animName = None,
  partName = None,
  lodName = None 
)
Returns a list of the form:

[ (lodName, [(animName, [(partName, effect), (partName, effect), ...]),
             (animName, [(partName, effect), (partName, effect), ...]),
             ...]),
  (lodName, [(animName, [(partName, effect), (partName, effect), ...]),
             (animName, [(partName, effect), (partName, effect), ...]),
             ...]),
   ... ]

This list reports the non-zero control effects for each
partName within a particular animation and LOD. 

◆ getAnimControl()

def direct.actor.Actor.getAnimControl (   self,
  animName,
  partName = None,
  lodName = None,
  allowAsyncBind = True 
)
getAnimControl(self, string, string, string="lodRoot")
Search the animControl dictionary indicated by lodName for
a given anim and part. If none specified, try the first part and lod.
Return the animControl if present, or None otherwise.

◆ getAnimControls()

def direct.actor.Actor.getAnimControls (   self,
  animName = None,
  partName = None,
  lodName = None,
  allowAsyncBind = True 
)
getAnimControls(self, string, string=None, string=None)

Returns a list of the AnimControls that represent the given
animation for the given part and the given lod.

If animName is None or omitted, the currently-playing
animation (or all currently-playing animations) is returned.
If animName is True, all animations are returned.  If animName
is a single string name, that particular animation is
returned.  If animName is a list of string names, all of the
names animations are returned.

If partName is None or omitted, all parts are returned (or
possibly the one overall Actor part, according to the
subpartsComplete flag).

If lodName is None or omitted, all LOD's are returned.

◆ getAnimFilename()

def direct.actor.Actor.getAnimFilename (   self,
  animName,
  partName = 'modelRoot' 
)
getAnimFilename(self, animName)
return the animFilename given the animName

◆ getBaseFrameRate()

def direct.actor.Actor.getBaseFrameRate (   self,
  animName = None,
  partName = None 
)
getBaseFrameRate(self, string, string=None)
Return frame rate of given anim name and given part, unmodified
by any play rate in effect.

◆ getCurrentAnim()

def direct.actor.Actor.getCurrentAnim (   self,
  partName = None 
)
Return the anim currently playing on the actor. If part not
specified return current anim of an arbitrary part in dictionary.
NOTE: only returns info for an arbitrary LOD

◆ getCurrentFrame()

def direct.actor.Actor.getCurrentFrame (   self,
  animName = None,
  partName = None 
)
Return the current frame number of the named anim, or if no
anim is specified, then the anim current playing on the
actor. If part not specified return current anim of first part
in dictionary.  NOTE: only returns info for an arbitrary LOD

◆ getDuration()

def direct.actor.Actor.getDuration (   self,
  animName = None,
  partName = None,
  fromFrame = None,
  toFrame = None 
)
Return duration of given anim name and given part.
If no anim specified, use the currently playing anim.
If no part specified, return anim duration of first part.
NOTE: returns info for arbitrary LOD

◆ getFrameRate()

def direct.actor.Actor.getFrameRate (   self,
  animName = None,
  partName = None 
)
getFrameRate(self, string, string=None)
Return actual frame rate of given anim name and given part.
If no anim specified, use the currently playing anim.
If no part specified, return anim durations of first part.
NOTE: returns info only for an arbitrary LOD

◆ getFrameTime()

def direct.actor.Actor.getFrameTime (   self,
  anim,
  frame,
  partName = None 
)

◆ getJoints()

def direct.actor.Actor.getJoints (   self,
  partName = None,
  jointName = '*',
  lodName = None 
)
Returns the list of all joints, from the named part or
from all parts, that match the indicated jointName.  The
jointName may include pattern characters like *. 

◆ getJointTransform()

def direct.actor.Actor.getJointTransform (   self,
  partName,
  jointName,
  lodName = 'lodRoot' 
)

◆ getJointTransformState()

def direct.actor.Actor.getJointTransformState (   self,
  partName,
  jointName,
  lodName = 'lodRoot' 
)

◆ getLOD()

def direct.actor.Actor.getLOD (   self,
  lodName 
)
getLOD(self, string)
Get the named node under the LOD to which we parent all LOD
specific geometry to. Returns 'None' if not found

◆ getLODIndex()

def direct.actor.Actor.getLODIndex (   self,
  lodName 
)

sortedKeys = self.switches.keys() sortedKeys.sort()

getLODIndex(self)
safe method (but expensive) for retrieving the child index

◆ getNumFrames()

def direct.actor.Actor.getNumFrames (   self,
  animName = None,
  partName = None 
)

◆ getOverlappingJoints()

def direct.actor.Actor.getOverlappingJoints (   self,
  partNameA,
  partNameB,
  jointName = '*',
  lodName = None 
)
Returns the set of joints, matching jointName, that are
shared between partNameA and partNameB. 

◆ getPart()

def direct.actor.Actor.getPart (   self,
  partName,
  lodName = "lodRoot" 
)
Find the named part in the optional named lod and return it, or
return None if not present

◆ getPartBundle()

def direct.actor.Actor.getPartBundle (   self,
  partName,
  lodName = "lodRoot" 
)
Find the named part in the optional named lod and return its
associated PartBundle, or return None if not present

◆ getPlayRate()

def direct.actor.Actor.getPlayRate (   self,
  animName = None,
  partName = None 
)
Return the play rate of given anim for a given part.
If no part is given, assume first part in dictionary.
If no anim is given, find the current anim for the part.
NOTE: Returns info only for an arbitrary LOD

◆ getSubpartsComplete()

def direct.actor.Actor.getSubpartsComplete (   self)
See setSubpartsComplete().

◆ hasLOD()

def direct.actor.Actor.hasLOD (   self)
Return 1 if the actor has LODs, 0 otherwise

◆ hideAllBounds()

def direct.actor.Actor.hideAllBounds (   self)
Hide the bounds of all actor geoms

◆ hidePart()

def direct.actor.Actor.hidePart (   self,
  partName,
  lodName = "lodRoot" 
)
Make the given part of the optionally given lod not render,
even though still in the tree.
NOTE: this will affect child geometry

◆ initAnimsOnAllLODs()

def direct.actor.Actor.initAnimsOnAllLODs (   self,
  partNames 
)

◆ instance()

def direct.actor.Actor.instance (   self,
  path,
  partName,
  jointName,
  lodName = "lodRoot" 
)
instance(self, NodePath, string, string, key="lodRoot")
Instance a nodePath to an actor part at a joint called jointName

◆ loadAnims()

def direct.actor.Actor.loadAnims (   self,
  anims,
  partName = "modelRoot",
  lodName = "lodRoot" 
)
loadAnims(self, string:string{}, string='modelRoot',
string='lodRoot')
Actor anim loader. Takes an optional partName (defaults to
'modelRoot' for non-multipart actors) and lodName (defaults
to 'lodRoot' for non-LOD actors) and dict of corresponding
anims in the form animName:animPath{}

◆ loadAnimsOnAllLODs()

def direct.actor.Actor.loadAnimsOnAllLODs (   self,
  anims,
  partName = "modelRoot" 
)
loadAnims(self, string:string{}, string='modelRoot',
string='lodRoot')
Actor anim loader. Takes an optional partName (defaults to
'modelRoot' for non-multipart actors) and lodName (defaults
to 'lodRoot' for non-LOD actors) and dict of corresponding
anims in the form animName:animPath{}

◆ loadModel()

def direct.actor.Actor.loadModel (   self,
  modelPath,
  partName = "modelRoot",
  lodName = "lodRoot",
  copy = True,
  okMissing = None,
  autoBindAnims = True 
)
Actor model loader. Takes a model name (ie file path), a part
name(defaults to "modelRoot") and an lod name(defaults to "lodRoot").

◆ loop()

def direct.actor.Actor.loop (   self,
  animName,
  restart = 1,
  partName = None,
  fromFrame = None,
  toFrame = None 
)
loop(self, string, int=1, string=None)
Loop the given animation on the given part of the actor,
restarting at zero frame if requested. If no part name
is given then try to loop on all parts. NOTE: loops on
all LOD's

◆ makeSubpart()

def direct.actor.Actor.makeSubpart (   self,
  partName,
  includeJoints,
  excludeJoints = [],
  parent = "modelRoot",
  overlapping = False 
)
Defines a new "part" of the Actor that corresponds to the
same geometry as the named parent part, but animates only a
certain subset of the joints.  This can be used for
partial-body animations, for instance to animate a hand waving
while the rest of the body continues to play its walking
animation.

includeJoints is a list of joint names that are to be animated
by the subpart.  Each name can include globbing characters
like '?' or '*', which will match one or any number of
characters, respectively.  Including a joint by naming it in
includeJoints implicitly includes all of the descendents of
that joint as well, except for excludeJoints, below.

excludeJoints is a list of joint names that are *not* to be
animated by the subpart.  As in includeJoints, each name can
include globbing characters.  If a joint is named by
excludeJoints, it will not be included (and neither will any
of its descendents), even if a parent joint was named by
includeJoints.

if overlapping is False, an error is raised (in the dev build)
if this subpart shares joints with any other subparts.  If
overlapping is True, no such error is raised.

parent is the actual partName that this subpart is based
on.

◆ osdAnimBlends()

def direct.actor.Actor.osdAnimBlends (   self,
  animName = None,
  partName = None,
  lodName = None 
)

◆ pingpong()

def direct.actor.Actor.pingpong (   self,
  animName,
  restart = 1,
  partName = None,
  fromFrame = None,
  toFrame = None 
)
pingpong(self, string, int=1, string=None)
Loop the given animation on the given part of the actor,
restarting at zero frame if requested. If no part name
is given then try to loop on all parts. NOTE: loops on
all LOD's

◆ play()

def direct.actor.Actor.play (   self,
  animName,
  partName = None,
  fromFrame = None,
  toFrame = None 
)
play(self, string, string=None)
Play the given animation on the given part of the actor.
If no part is specified, try to play on all parts. NOTE:
plays over ALL LODs

◆ pose()

def direct.actor.Actor.pose (   self,
  animName,
  frame,
  partName = None,
  lodName = None 
)
pose(self, string, int, string=None)
Pose the actor in position found at given frame in the specified
animation for the specified part. If no part is specified attempt
to apply pose to all parts.

◆ postFlatten()

def direct.actor.Actor.postFlatten (   self)
Call this after performing an aggressive flatten operation,
such as flattenStrong(), that involves the Actor.  This is
especially necessary when mergeLODBundles is true, since this
kind of actor may be broken after a flatten operation; this
method should restore proper Actor functionality. 

◆ printAnimBlends()

def direct.actor.Actor.printAnimBlends (   self,
  animName = None,
  partName = None,
  lodName = None 
)

◆ printLOD()

def direct.actor.Actor.printLOD (   self)

◆ releaseJoint()

def direct.actor.Actor.releaseJoint (   self,
  partName,
  jointName 
)
Undoes a previous call to controlJoint() or freezeJoint()
and restores the named joint to its normal animation. 

◆ removePart()

def direct.actor.Actor.removePart (   self,
  partName,
  lodName = "lodRoot" 
)
Remove the geometry and animations of the named part of the
optional named lod if present.
NOTE: this will remove child geometry also!

◆ renamePartBundles()

def direct.actor.Actor.renamePartBundles (   self,
  partName,
  newBundleName 
)

◆ resetLOD()

def direct.actor.Actor.resetLOD (   self)
Restore all switch distance info (usually after a useLOD call)

◆ setBlend()

def direct.actor.Actor.setBlend (   self,
  animBlend = None,
  frameBlend = None,
  blendType = None,
  partName = None 
)
Changes the way the Actor handles blending of multiple
different animations, and/or interpolation between consecutive
frames.

The animBlend and frameBlend parameters are boolean flags.
You may set either or both to True or False.  If you do not
specify them, they do not change from the previous value.

When animBlend is True, multiple different animations may
simultaneously be playing on the Actor.  This means you may
call play(), loop(), or pose() on multiple animations and have
all of them contribute to the final pose each frame.

In this mode (that is, when animBlend is True), starting a
particular animation with play(), loop(), or pose() does not
implicitly make the animation visible; you must also call
setControlEffect() for each animation you wish to use to
indicate how much each animation contributes to the final
pose.

The frameBlend flag is unrelated to playing multiple
animations.  It controls whether the Actor smoothly
interpolates between consecutive frames of its animation (when
the flag is True) or holds each frame until the next one is
ready (when the flag is False).  The default value of
frameBlend is controlled by the interpolate-frames Config.prc
variable.

In either case, you may also specify blendType, which controls
the precise algorithm used to blend two or more different
matrix values into a final result.  Different skeleton
hierarchies may benefit from different algorithms.  The
default blendType is controlled by the anim-blend-type
Config.prc variable.

◆ setCenter()

def direct.actor.Actor.setCenter (   self,
  center 
)

◆ setControlEffect()

def direct.actor.Actor.setControlEffect (   self,
  animName,
  effect,
  partName = None,
  lodName = None 
)
Sets the amount by which the named animation contributes to
the overall pose.  This controls blending of multiple
animations; it only makes sense to call this after a previous
call to setBlend(animBlend = True).

◆ setLOD()

def direct.actor.Actor.setLOD (   self,
  lodName,
  inDist = 0,
  outDist = 0 
)
setLOD(self, string)
Set the switch distance for given LOD

◆ setLODAnimation()

def direct.actor.Actor.setLODAnimation (   self,
  farDistance,
  nearDistance,
  delayFactor 
)
Activates a special mode in which the Actor animates less
frequently as it gets further from the camera.  This is
intended as a simple optimization to minimize the effort of
computing animation for lots of characters that may not
necessarily be very important to animate every frame.

If the character is closer to the camera than near_distance,
then it is animated its normal rate, every frame.  If the
character is exactly far_distance away, it is animated only
every delay_factor seconds (which should be a number greater
than 0).  If the character is between near_distance and
far_distance, its animation rate is linearly interpolated
according to its distance between the two.  The interpolation
function continues beyond far_distance, so that the character
is animated increasingly less frequently as it gets farther
away. 

◆ setPlayRate()

def direct.actor.Actor.setPlayRate (   self,
  rate,
  animName,
  partName = None 
)
setPlayRate(self, float, string, string=None)
Set the play rate of given anim for a given part.
If no part is given, set for all parts in dictionary.

It used to be legal to let the animName default to the
currently-playing anim, but this was confusing and could lead
to the wrong anim's play rate getting set.  Better to insist
on this parameter.
NOTE: sets play rate on all LODs

◆ setSubpartsComplete()

def direct.actor.Actor.setSubpartsComplete (   self,
  flag 
)
Sets the subpartsComplete flag.  This affects the behavior
of play(), loop(), stop(), etc., when no explicit parts are
specified.

When this flag is False (the default), play() with no parts
means to play the animation on the overall Actor, which is a
separate part that overlaps each of the subparts.  If you then
play a different animation on a subpart, it may stop the
overall animation (in non-blend mode) or blend with it (in
blend mode).

When this flag is True, play() with no parts means to play the
animation on each of the subparts--instead of on the overall
Actor.  In this case, you may then play a different animation
on a subpart, which replaces only that subpart's animation.

It makes sense to set this True when the union of all of your
subparts completely defines the entire Actor.

◆ showAllBounds()

def direct.actor.Actor.showAllBounds (   self)
Show the bounds of all actor geoms

◆ showAllParts()

def direct.actor.Actor.showAllParts (   self,
  partName,
  lodName = "lodRoot" 
)
Make the given part and all its children render while in the tree.
NOTE: this will affect child geometry

◆ showPart()

def direct.actor.Actor.showPart (   self,
  partName,
  lodName = "lodRoot" 
)
Make the given part render while in the tree.
NOTE: this will affect child geometry

◆ stop()

def direct.actor.Actor.stop (   self,
  animName = None,
  partName = None 
)
stop(self, string=None, string=None)
Stop named animation on the given part of the actor.
If no name specified then stop all animations on the actor.
NOTE: stops all LODs

◆ stopJoint()

def direct.actor.Actor.stopJoint (   self,
  partName,
  jointName,
  lodName = "lodRoot" 
)
stopJoint(self, string, string, key="lodRoot")
Stops the joint from animating external nodes.  If the joint
is animating a transform on a node, this will permanently stop
it.  However, this does not affect vertex animations.

◆ unloadAnims()

def direct.actor.Actor.unloadAnims (   self,
  anims = None,
  partName = None,
  lodName = None 
)
unloadAnims(self, string:string{}, string='modelRoot',
string='lodRoot')
Actor anim unloader. Takes an optional partName (defaults to
'modelRoot' for non-multipart actors) and lodName (defaults to
'lodRoot' for non-LOD actors) and list of animation
names. Deletes the anim control for the given animation and
parts/lods.

If any parameter is None or omitted, it means all of them.

◆ update()

def direct.actor.Actor.update (   self,
  lod = 0,
  partName = None,
  lodName = None,
  force = False 
)
Updates all of the Actor's joints in the indicated LOD.
The LOD may be specified by name, or by number, where 0 is the
highest level of detail, 1 is the next highest, and so on.

If force is True, this will update every joint, even if we
don't believe it's necessary.

Returns True if any joint has changed as a result of this,
False otherwise. 

◆ verifySubpartsComplete()

def direct.actor.Actor.verifySubpartsComplete (   self,
  partName = None,
  lodName = None 
)
Ensures that each joint is defined by at least one
subPart.  Prints a warning if this is not the case. 

◆ waitPending()

def direct.actor.Actor.waitPending (   self,
  partName = None 
)
Blocks until all asynchronously pending animations (that
are currently playing) have been loaded and bound the the
Actor.  Call this after calling play() if you are using
asynchronous binds, but you need this particular animation
to be loaded immediately. 

Variable Documentation

◆ child

child = self.__LODNode.find(str(lodName))

sortedKeys = self.switches.keys() sortedKeys.sort()

◆ gotName

gotName

◆ index

index = self.__LODNode.node().findChild(child.node())

◆ sortedKeys

sortedKeys = self.__sortedLODNames

sortedKeys = self.switches.keys() sortedKeys.sort()

◆ switchNum

switchNum = self.__LODNode.node().getNumSwitches()