|
|
|
List of all members.
Detailed Description
Actor class: Contains methods for creating, manipulating
and playing animations on characters
Constructor & Destructor Documentation
| def __init__ |
( |
|
self, |
|
|
|
models = None, |
|
|
|
anims = None, |
|
|
|
other = None, |
|
|
|
copy = True, |
|
|
|
lodNode = None, |
|
|
|
flattenable = True, |
|
|
|
setFinal = False, |
|
|
|
mergeLODBundles = None, |
|
|
|
allowAsyncBind = None, |
|
|
|
okMissing = None |
|
) |
| |
__init__(self, string | string:string{}, string:string{} |
string:(string:string{}){}, Actor=None)
Actor constructor: can be used to create single or multipart
actors. If another Actor is supplied as an argument this
method acts like a copy constructor. Single part actors are
created by calling with a model and animation dictionary
(animName:animPath{}) as follows:
a = Actor("panda-3k.egg", {"walk":"panda-walk.egg" \
"run":"panda-run.egg"})
This could be displayed and animated as such:
a.reparentTo(render)
a.loop("walk")
a.stop()
Multipart actors expect a dictionary of parts and a dictionary
of animation dictionaries (partName:(animName:animPath{}){}) as
below:
a = Actor(
# part dictionary
{"head":"char/dogMM/dogMM_Shorts-head-mod", \
"torso":"char/dogMM/dogMM_Shorts-torso-mod", \
"legs":"char/dogMM/dogMM_Shorts-legs-mod"}, \
# dictionary of anim dictionaries
{"head":{"walk":"char/dogMM/dogMM_Shorts-head-walk", \
"run":"char/dogMM/dogMM_Shorts-head-run"}, \
"torso":{"walk":"char/dogMM/dogMM_Shorts-torso-walk", \
"run":"char/dogMM/dogMM_Shorts-torso-run"}, \
"legs":{"walk":"char/dogMM/dogMM_Shorts-legs-walk", \
"run":"char/dogMM/dogMM_Shorts-legs-run"} \
})
In addition multipart actor parts need to be connected together
in a meaningful fashion:
a.attach("head", "torso", "joint-head")
a.attach("torso", "legs", "joint-hips")
#
# ADD LOD COMMENT HERE!
#
Other useful Actor class functions:
#fix actor eye rendering
a.drawInFront("joint-pupil?", "eyes*")
#fix bounding volumes - this must be done after drawing
#the actor for a few frames, otherwise it has no effect
a.fixBounds()
Member Function Documentation
| def __cmp__ |
( |
|
self, |
|
|
|
other |
|
) |
| |
| def clearPythonData |
( |
|
self | ) |
|
| def copyActor |
( |
|
self, |
|
|
|
other, |
|
|
|
overwrite = False |
|
) |
| |
Utility function to create a list of information about an actor.
Useful for iterating over details of an actor.
| def getAnimControlDict |
( |
|
self | ) |
|
Return the node that contains all actor geometry
Return list of Actor LOD names. If not an LOD actor,
returns 'lodRoot'
Caution - this returns a reference to the list - not your own copy
Return the node that switches actor geometry in and out
| def getPartBundleDict |
( |
|
self | ) |
|
| def getPartBundles |
( |
|
self, |
|
|
|
partName = None |
|
) |
| |
Returns a list of PartBundle objects for the entire Actor,
or for the indicated part only.
Return list of Actor part names. If not an multipart actor,
returns 'modelRoot' NOTE: returns parts of arbitrary LOD
| def listJoints |
( |
|
self, |
|
|
|
partName = "modelRoot", |
|
|
|
lodName = "lodRoot" |
|
) |
| |
Handy utility function to list the joint hierarchy of the
actor.
Pretty print actor's details
| def removeAnimControlDict |
( |
|
self | ) |
|
| def setGeomNode |
( |
|
self, |
|
|
|
node |
|
) |
| |
Set the node that contains all actor geometry
| def setLODNode |
( |
|
self, |
|
|
|
node = None |
|
) |
| |
Set the node that switches actor geometry in and out.
If one is not supplied as an argument, make one
| def useLOD |
( |
|
self, |
|
|
|
lodName |
|
) |
| |
Make the Actor ONLY display the given LOD
Member Data Documentation
Initial value:LoaderOptions(LoaderOptions.LFSearch |
LoaderOptions.LFReportErrors |
LoaderOptions.LFConvertAnim)
Initial value:LoaderOptions(LoaderOptions.LFSearch |
LoaderOptions.LFReportErrors |
LoaderOptions.LFConvertSkeleton)
tuple notify = directNotify.newCategory("Actor") [static] |
| | |