File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,12 @@ def pprint(self):
500
500
501
501
def cleanup (self ):
502
502
"""
503
- Actor cleanup function
503
+ This method should be called when intending to destroy the Actor, and
504
+ cleans up any additional resources stored on the Actor class before
505
+ removing the underlying node using `removeNode()`.
506
+
507
+ Note that `removeNode()` itself is not sufficient to destroy actors,
508
+ which is why this method exists.
504
509
"""
505
510
self .stop (None )
506
511
self .clearPythonData ()
@@ -512,6 +517,11 @@ def cleanup(self):
512
517
self .removeNode ()
513
518
514
519
def removeNode (self ):
520
+ """
521
+ You should call `cleanup()` for Actor objects instead, since
522
+ :meth:`~panda3d.core.NodePath.removeNode()` is not sufficient for
523
+ completely destroying Actor objects.
524
+ """
515
525
if self .__geomNode and (self .__geomNode .getNumChildren () > 0 ):
516
526
assert self .notify .warning ("called actor.removeNode() on %s without calling cleanup()" % self .getName ())
517
527
NodePath .removeNode (self )
@@ -525,7 +535,7 @@ def clearPythonData(self):
525
535
526
536
def flush (self ):
527
537
"""
528
- Actor flush function
538
+ Actor flush function. Used by `cleanup()`.
529
539
"""
530
540
self .clearPythonData ()
531
541
You can’t perform that action at this time.
0 commit comments