mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
*** empty log message ***
This commit is contained in:
parent
77dea4e5e1
commit
51fa40c5e7
@ -759,7 +759,7 @@ class Actor(PandaObject, NodePath):
|
|||||||
name(defaults to "modelRoot") and an lod name(defaults to "lodRoot").
|
name(defaults to "modelRoot") and an lod name(defaults to "lodRoot").
|
||||||
If copy is set to 0, do a lodModelOnce instead of a loadModelCopy.
|
If copy is set to 0, do a lodModelOnce instead of a loadModelCopy.
|
||||||
"""
|
"""
|
||||||
Actor.notify.info("in loadModel: %s , part: %s, lod: %s, copy: %s" % \
|
Actor.notify.warning("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
|
# load the model and extract its part bundle
|
||||||
@ -767,6 +767,10 @@ class Actor(PandaObject, NodePath):
|
|||||||
model = loader.loadModelCopy(modelPath)
|
model = loader.loadModelCopy(modelPath)
|
||||||
else:
|
else:
|
||||||
model = loader.loadModelOnce(modelPath)
|
model = loader.loadModelOnce(modelPath)
|
||||||
|
|
||||||
|
if (model == None):
|
||||||
|
print "model = None!!!"
|
||||||
|
|
||||||
bundle = NodePath(model, "**/+PartBundleNode")
|
bundle = NodePath(model, "**/+PartBundleNode")
|
||||||
if (bundle.isEmpty()):
|
if (bundle.isEmpty()):
|
||||||
Actor.notify.warning("%s is not a character!" % (modelPath))
|
Actor.notify.warning("%s is not a character!" % (modelPath))
|
||||||
|
53
direct/src/gui/Sign.py
Normal file
53
direct/src/gui/Sign.py
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
from ShowBaseGlobal import *
|
||||||
|
import GuiSign
|
||||||
|
import GuiManager
|
||||||
|
|
||||||
|
guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node())
|
||||||
|
|
||||||
|
class Sign:
|
||||||
|
|
||||||
|
def __init__(self, name, label):
|
||||||
|
self.name = name
|
||||||
|
self.label = label
|
||||||
|
self.sign = GuiSign.GuiSign(name, label)
|
||||||
|
self.setScale(0.1)
|
||||||
|
self.managed = 0
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
if (self.managed):
|
||||||
|
self.unmanage()
|
||||||
|
del(self.sign)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "sign: %s contains label: %s" % (self.name, self.label.name)
|
||||||
|
|
||||||
|
# accessing
|
||||||
|
def getName(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def setText(self, text):
|
||||||
|
self.label.setText(text)
|
||||||
|
|
||||||
|
def getLabel(self):
|
||||||
|
return self.label
|
||||||
|
|
||||||
|
def getGuiItem(self):
|
||||||
|
return self.sign
|
||||||
|
|
||||||
|
def setScale(self, scale):
|
||||||
|
self.sign.setScale(scale)
|
||||||
|
|
||||||
|
def getWidth(self):
|
||||||
|
return self.label.getWidth()
|
||||||
|
|
||||||
|
def setWidth(self, width):
|
||||||
|
self.label.setWidth(width)
|
||||||
|
|
||||||
|
# actions
|
||||||
|
def manage(self):
|
||||||
|
self.managed = 1
|
||||||
|
self.sign.manage(guiMgr, base.eventMgr.eventHandler)
|
||||||
|
|
||||||
|
def unmanage(self):
|
||||||
|
self.managed = 0
|
||||||
|
self.sign.unmanage()
|
Loading…
x
Reference in New Issue
Block a user