|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
from PandaObject import *
|
|
|
import LODNode
|
|
|
+import UsePgraph
|
|
|
|
|
|
class Actor(PandaObject, NodePath):
|
|
|
"""Actor class: Contains methods for creating, manipulating
|
|
|
@@ -205,7 +206,10 @@ class Actor(PandaObject, NodePath):
|
|
|
# bounding volume for pieces that animate away from their
|
|
|
# original position. It's disturbing to see someone's hands
|
|
|
# disappear; better to cull the whole object or none of it.
|
|
|
- self.__geomNode.arc().setFinal(1)
|
|
|
+ if UsePgraph.use:
|
|
|
+ self.__geomNode.node().setFinal(1)
|
|
|
+ else:
|
|
|
+ self.__geomNode.arc().setFinal(1)
|
|
|
|
|
|
def delete(self):
|
|
|
try:
|
|
|
@@ -707,7 +711,10 @@ class Actor(PandaObject, NodePath):
|
|
|
joint = bundle.findChild(jointName)
|
|
|
|
|
|
if (joint):
|
|
|
- joint.addNetTransform(node.arc())
|
|
|
+ if UsePgraph.use:
|
|
|
+ joint.addNetTransform(node.node())
|
|
|
+ else:
|
|
|
+ joint.addNetTransform(node.arc())
|
|
|
else:
|
|
|
Actor.notify.warning("no joint named %s!" % (jointName))
|
|
|
|
|
|
@@ -832,13 +839,19 @@ class Actor(PandaObject, NodePath):
|
|
|
|
|
|
if mode == -2:
|
|
|
# Turn off depth test/write on the frontParts.
|
|
|
- dw = DepthWriteTransition.off()
|
|
|
- dt = DepthTestTransition(DepthTestProperty.MNone)
|
|
|
- numFrontParts = frontParts.getNumPaths()
|
|
|
- for partNum in range(0, numFrontParts):
|
|
|
- frontParts[partNum].arc().setTransition(dw, 1)
|
|
|
- frontParts[partNum].arc().setTransition(dt, 1)
|
|
|
-
|
|
|
+ if UsePgraph.use:
|
|
|
+ numFrontParts = frontParts.getNumPaths()
|
|
|
+ for partNum in range(0, numFrontParts):
|
|
|
+ frontParts[partNum].setDepthWrite(0, 1)
|
|
|
+ frontParts[partNum].setDepthTest(0, 1)
|
|
|
+ else:
|
|
|
+ dw = DepthWriteTransition.off()
|
|
|
+ dt = DepthTestTransition(DepthTestProperty.MNone)
|
|
|
+ numFrontParts = frontParts.getNumPaths()
|
|
|
+ for partNum in range(0, numFrontParts):
|
|
|
+ frontParts[partNum].arc().setTransition(dw, 1)
|
|
|
+ frontParts[partNum].arc().setTransition(dt, 1)
|
|
|
+
|
|
|
# Find the back part.
|
|
|
backPart = root.find("**/" + backPartName)
|
|
|
if (backPart.isEmpty()):
|
|
|
@@ -847,8 +860,11 @@ class Actor(PandaObject, NodePath):
|
|
|
|
|
|
if mode == -3:
|
|
|
# Draw as a decal.
|
|
|
- dt = DecalTransition()
|
|
|
- backPart.arc().setTransition(dt)
|
|
|
+ if UsePgraph.use:
|
|
|
+ backPart.node().setEffect(DecalEffect.make())
|
|
|
+ else:
|
|
|
+ dt = DecalTransition()
|
|
|
+ backPart.arc().setTransition(dt)
|
|
|
else:
|
|
|
# Reorder the backPart to be the first of its siblings.
|
|
|
backPart.reparentTo(backPart.getParent(), -1)
|