Example #1
0
        def aboutToDrag(item, dragObject):
            if not item: return
            item = item[0]

            mimeData = dragObject.mimeData()
            if not mimeData:
                mimeData = QtCore.QMimeData()
                dragObject.setMimeData(mimeData)

            mimeData.setData('ShadowManager/lightpass',
                    item.getItemData().getName())
            mimeData.setData('scenegraph/paths', item.getItemData().getName())
Example #2
0
        def aboutToDrag(item, dragObject):
            if not item: return
            item = item[0]

            mimeData = dragObject.mimeData()
            if not mimeData:
                mimeData = QtCore.QMimeData()
                dragObject.setMimeData(mimeData)

            mimeData.setData('ShadowManager/renderpass',
                    item.getItemData().getName())
            mimeData.setData('python/text',
                    'NodegraphAPI.GetNode(%r).getRenderPasses()[%i]' % (
                            self.__node.getName(),
                                    item.getItemData().getIndex()))
Example #3
0
 def __aboutToDragCallback(self, items, dragObject):
     itemData = items[0].getItemData()
     mimeType = 'nodegraph/noderefs'
     if 'node' in itemData:
         name = itemData['node'].getName()
     else:
         if 'port' in itemData:
             name = (' ').join(
                 (x.getName()
                  for x in self.node.getProductStructureForOutput(
                      itemData['port'].getName())))
         else:
             if itemData.get('type') == 'assetTree':
                 name = ''
                 mimeType = 'importatomic/assettree'
             else:
                 name = self.node.getName()
     data = dragObject.mimeData()
     if not data:
         data = QtCore.QMimeData()
     data.setData(mimeType, name)
     if not dragObject.mimeData():
         dragObject.setMimeData(data)