瀏覽代碼

Made additional geometry for visual aid doesn't inherit object color and sceneGraph label updated after changing model

Gyedo Jeon 15 年之前
父節點
當前提交
ecfa584a26
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      direct/src/leveleditor/ObjectMgrBase.py

+ 4 - 0
direct/src/leveleditor/ObjectMgrBase.py

@@ -373,6 +373,7 @@ class ObjectMgrBase:
         obj[OG.OBJ_RGBA] = (r,g,b,a)
         obj[OG.OBJ_RGBA] = (r,g,b,a)
         for child in np.getChildren():
         for child in np.getChildren():
             if not child.hasTag('OBJRoot') and\
             if not child.hasTag('OBJRoot') and\
+               not child.hasTag('_le_sys') and\
                child.getName() != 'bboxLines':
                child.getName() != 'bboxLines':
                 child.setTransparency(1)
                 child.setTransparency(1)
                 child.setColorScale(r, g, b, a)
                 child.setColorScale(r, g, b, a)
@@ -423,6 +424,9 @@ class ObjectMgrBase:
             obj[OG.OBJ_MODEL] = model
             obj[OG.OBJ_MODEL] = model
             self.npIndex[NodePath(newobj)] = obj[OG.OBJ_UID]
             self.npIndex[NodePath(newobj)] = obj[OG.OBJ_UID]
 
 
+            # update scene graph label
+            self.editor.ui.sceneGraphUI.changeLabel(obj[OG.OBJ_UID], newobj.getName())
+
             self.editor.fNeedToSave = True
             self.editor.fNeedToSave = True
             # update anim if necessary
             # update anim if necessary
             animList = obj[OG.OBJ_DEF].animDict.get(model)
             animList = obj[OG.OBJ_DEF].animDict.get(model)