def pickFile(self): picked = None if self.pickerType == PathWidget.pickerTypes.Node: if Core.environment == Core.EnvironmentTypes.Maya: picked = Core.getMayaSelection()[0] if picked is None: return else: #Begin Testing for path types if self.pickerType == PathWidget.pickerTypes.File: picked = guiUtils.getFileFromUser(ext=self.ext) if self.pickerType == PathWidget.pickerTypes.Folder: picked = guiUtils.getDirFromUser() if not picked: return self.ui_Field.setText(str(picked))
def pickFile(self): picked = None if self.pickerType == PathWidget.pickerTypes.Node : if Core.environment == Core.EnvironmentTypes.Maya : picked = Core.getMayaSelection()[0] if picked is None: return else: #Begin Testing for path types if self.pickerType == PathWidget.pickerTypes.File : picked = guiUtils.getFileFromUser(ext=self.ext) if self.pickerType == PathWidget.pickerTypes.Folder : picked = guiUtils.getDirFromUser() if not picked : return self.ui_Field.setText(str(picked))
class LayerEditor(Editor): #------------------------------------------------------------ def __init__(self, *args, **kwds): super(LayerEditor, self).__init__(*args, **kwds) #------------------------------------------------------------ def setMappings(self): self.dataMapper.addMapping(self.prop_index, 1) if __name__ == '__main__': from DTL.db.models import SceneGraphModel from DTL.db.data import Node, FloatTransformNode, IntTransformNode, Layer from DTL.gui import Core root = Layer() node1 = Node(name='Node1', parent=root) node2 = Node(name='Node2', parent=root) layer1 = Layer(name='Layer1', parent=node2) node3 = Node(name='Node3', parent=layer1) trans1 = FloatTransformNode(name='Trans1', parent=node2) trans2 = FloatTransformNode(name='Trans2', parent=trans1) trans3 = IntTransformNode(name='Trans3', parent=trans1) model = SceneGraphModel(root) propeditor = PropertiesEditor(model=model) propeditor.show() Core.Start()
def _validateParent(self, parent=None): if parent is None: parent = Core.rootWindow() return parent
def getSaveFileFromUser(parent=None, ext=[]): return Core.getSaveFileFromUser()
def getDirFromUser(parent=None): return Core.getDirFromUser()
def getFileFromUser(parent=None, ext=''): return Core.getFileFromUser()