forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDistributedActor.py
More file actions
37 lines (29 loc) · 1.26 KB
/
DistributedActor.py
File metadata and controls
37 lines (29 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""DistributedActor module: contains the DistributedActor class"""
__all__ = ['DistributedActor']
from direct.distributed import DistributedNode
from . import Actor
class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
def __init__(self, cr):
try:
self.DistributedActor_initialized
except:
self.DistributedActor_initialized = 1
Actor.Actor.__init__(self)
DistributedNode.DistributedNode.__init__(self, cr)
# Since actors are probably fairly heavyweight, we'd
# rather cache them than delete them if possible.
self.setCacheable(1)
def disable(self):
# remove all anims, on all parts and all lods
if (not self.isEmpty()):
Actor.Actor.unloadAnims(self, None, None, None)
DistributedNode.DistributedNode.disable(self)
def delete(self):
try:
self.DistributedActor_deleted
except:
self.DistributedActor_deleted = 1
DistributedNode.DistributedNode.delete(self)
Actor.Actor.delete(self)
def loop(self, animName, restart=1, partName=None, fromFrame=None, toFrame=None):
return Actor.Actor.loop(self, animName, restart, partName, fromFrame, toFrame)