Esempio n. 1
0
    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))
Esempio n. 2
0
 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))
Esempio n. 3
0
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()
Esempio n. 4
0
    def _validateParent(self, parent=None):
        if parent is None:
            parent = Core.rootWindow()

        return parent
Esempio n. 5
0
def getSaveFileFromUser(parent=None, ext=[]):
    return Core.getSaveFileFromUser()
Esempio n. 6
0
def getDirFromUser(parent=None):
    return Core.getDirFromUser()
Esempio n. 7
0
def getFileFromUser(parent=None, ext=''):
    return Core.getFileFromUser()
Esempio n. 8
0
    def _validateParent(self, parent=None):
        if parent is None:
            parent = Core.rootWindow()

        return parent
Esempio n. 9
0
def getSaveFileFromUser(parent=None, ext=[]):
    return Core.getSaveFileFromUser()
Esempio n. 10
0
def getDirFromUser(parent=None):
    return Core.getDirFromUser()
Esempio n. 11
0
def getFileFromUser(parent=None, ext=''):
    return Core.getFileFromUser()