Ejemplo n.º 1
0
    def _ClearDrawMode(self):
        with Timer() as t:
            drawModeAttr = self._modelAPI.GetModelDrawModeAttr()
            if drawModeAttr:
                sessionSpec = _GetPropertySpecInSessionLayer(drawModeAttr)
                if sessionSpec:
                    self._primViewItem.drawModeWidget = None
                    self._primViewItem.treeWidget().closePersistentEditor(
                        self._primViewItem, PrimViewColumnIndex.DRAWMODE)

                    sessionSpec.ClearDefaultValue()
                    sessionSpec.layer.ScheduleRemoveIfInert(sessionSpec)
                    self._refreshFunc(self._primViewItem)
                else:
                    PrintWarning(
                        self._modelAPI.GetPath(), "Failed to get "
                        "session layer spec for the model:drawMode attribute")
                    return
            else:
                PrintWarning(self._modelAPI.GetPath(), "Failed to get "
                             "model:drawMode attribute")
                return
        if self._printTiming:
            t.PrintTime(
                "clear model:drawMode on <%s> to %s" %
                (self._modelAPI.GetPath(), self._comboBox.currentText()))
Ejemplo n.º 2
0
 def cameraPrim(self, value):
     if value is not None:
         if value.IsA(UsdGeom.Camera):
             self.cameraPath = value.GetPrimPath()
         else:
             PrintWarning("Incorrect Prim Type",
                 "Attempted to view the scene using the prim '%s', but "
                 "the prim is not a UsdGeom.Camera." % (value.GetName()))
     else:
         self.cameraPath = None