mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
support creating actors with node paths
This commit is contained in:
parent
9c58983bfa
commit
daa73b4c9c
@ -1086,11 +1086,19 @@ class Actor(PandaObject, NodePath):
|
|||||||
Actor.notify.debug("in loadModel: %s , part: %s, lod: %s, copy: %s" % \
|
Actor.notify.debug("in loadModel: %s , part: %s, lod: %s, copy: %s" % \
|
||||||
(modelPath, partName, lodName, copy))
|
(modelPath, partName, lodName, copy))
|
||||||
|
|
||||||
# load the model and extract its part bundle
|
if isinstance(modelPath, NodePath):
|
||||||
if (copy):
|
# If we got a NodePath instead of a string, use *that* as
|
||||||
model = loader.loadModelCopy(modelPath)
|
# the model directly.
|
||||||
|
if (copy):
|
||||||
|
model = modelPath.copyTo(hidden)
|
||||||
|
else:
|
||||||
|
model = modelPath
|
||||||
else:
|
else:
|
||||||
model = loader.loadModelOnce(modelPath)
|
# otherwise, we got the name of the model to load.
|
||||||
|
if (copy):
|
||||||
|
model = loader.loadModelCopy(modelPath)
|
||||||
|
else:
|
||||||
|
model = loader.loadModelOnce(modelPath)
|
||||||
|
|
||||||
if (model == None):
|
if (model == None):
|
||||||
print "model = None!!!"
|
print "model = None!!!"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user