Browse Source

Added code to initialize the controlJoint's valueNode

Josh Yelon 20 năm trước cách đây
mục cha
commit
1f81458370
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      direct/src/actor/Actor.py

+ 4 - 0
direct/src/actor/Actor.py

@@ -768,6 +768,8 @@ class Actor(PandaObject, NodePath):
 
         if node == None:
             node = self.attachNewNode(jointName)
+            if joint.getType().isDerivedFrom(MovingPartMatrix.getClassType()):
+                node.setMat(joint.getInitialValue())
 
         # Store a dictionary of jointName : node to list the controls
         # requested for joints.  The controls will actually be applied
@@ -1367,6 +1369,8 @@ class Actor(PandaObject, NodePath):
                     joint = animBundle.makeChildDynamic(jointName)
                     if joint:
                         joint.setValueNode(node.node())
+                    else:
+                        Actor.notify.debug("controlled joint %s is not present", jointName)
 
         # bind anim
         animControl = bundle.bindAnim(animBundle, -1)