|
def | __init__ (self, models=None, anims=None, other=None, copy=True, lodNode=None, flattenable=True, setFinal=False, mergeLODBundles=None, allowAsyncBind=None, okMissing=None) |
|
def | __cmp__ (self, other) |
|
def | __str__ (self) |
|
def | cleanup (self) |
|
def | clearPythonData (self) |
|
def | copyActor (self, other, overwrite=False) |
|
def | delete (self) |
|
def | flush (self) |
|
def | getActorInfo (self) |
|
def | getAnimControlDict (self) |
|
def | getAnimNames (self) |
|
def | getGeomNode (self) |
|
def | getLODNames (self) |
|
def | getLODNode (self) |
|
def | getPartBundleDict (self) |
|
def | getPartBundles (self, partName=None) |
|
def | getPartNames (self) |
|
def | listJoints (self, partName="modelRoot", lodName="lodRoot") |
|
def | pprint (self) |
|
def | removeAnimControlDict (self) |
|
def | removeNode (self) |
|
def | setGeomNode (self, node) |
|
def | setLODNode (self, node=None) |
|
def | useLOD (self, lodName) |
|
def | __init__ (self) |
|
def | accept (self, event, method, extraArgs=[]) |
|
def | acceptOnce (self, event, method, extraArgs=[]) |
|
def | addTask (self, args, kwargs) |
|
def | detectLeaks (self) |
|
def | doMethodLater (self, args, kwargs) |
|
def | getAllAccepting (self) |
|
def | ignore (self, event) |
|
def | ignoreAll (self) |
|
def | isAccepting (self, event) |
|
def | isIgnoring (self, event) |
|
def | removeAllTasks (self) |
|
def | removeTask (self, taskOrName) |
|
Actor class: Contains methods for creating, manipulating
and playing animations on characters
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()