def _populate_references(self):
        
        sgfs = SGFS()

        reference_statuses = check.check_paths(cmds.file(q=True, reference=True), only_published=False)
        for reference in reference_statuses:
            
            item = ReferenceItem(sgfs, reference)
            self._tree.addTopLevelItem(item)
            item.attach_to_tree(self._tree)

        geocaches = geocache_utils.get_existing_cache_mappings().keys()
        geocache_statuses = check.check_paths(geocaches, only_published=True)
        for geocache in geocache_statuses:

            item = GeocacheItem(sgfs, geocache)
            self._tree.addTopLevelItem(item)
            item.attach_to_tree(self._tree)

        for i in range(7):
            self._tree.resizeColumnToContents(i)
            self._tree.setColumnWidth(i, self._tree.columnWidth(i) + 10)
Example #2
0
    def _populate_references(self):
        
        sgfs = SGFS()

        reference_statuses = check.check_paths(cmds.file(q=True, reference=True), only_published=False)
        for reference in reference_statuses:
            
            item = ReferenceItem(sgfs, reference)
            self._tree.addTopLevelItem(item)
            item.attach_to_tree(self._tree)

        geocaches = geocache_utils.get_existing_cache_mappings().keys()
        geocache_statuses = check.check_paths(geocaches, only_published=True)
        for geocache in geocache_statuses:

            item = GeocacheItem(sgfs, geocache)
            self._tree.addTopLevelItem(item)
            item.attach_to_tree(self._tree)

        for i in range(7):
            self._tree.resizeColumnToContents(i)
            self._tree.setColumnWidth(i, self._tree.columnWidth(i) + 10)
 def _do_picker_reference(self, path, namespace):
     with ticket_ui_context():
         print '#', self.node, 'to', path
         cmds.file(
             path,
             loadReference=self.node,
             type='mayaAscii' if path.endswith('.ma') else 'mayaBinary',
             options='v=0',
         )
         self.status = check.check_paths([path])[0]
         # print self.status.used['sg_path']
         # print path
         new_data = self._viewFields()
         for i, v in enumerate(new_data):
             self.setData(i, Qt.DisplayRole, v)
         self._setupGui()
         self.attach_to_tree()
Example #4
0
 def _do_picker_reference(self, path, namespace):
     with ticket_ui_context():
         print '#', self.node, 'to', path
         cmds.file(
             path,
             loadReference=self.node,
             type='mayaAscii' if path.endswith('.ma') else 'mayaBinary',
             options='v=0',
         )
         self.status = check.check_paths([path])[0]
         # print self.status.used['sg_path']
         # print path
         new_data = self._viewFields()
         for i, v in enumerate(new_data):
             self.setData(i, Qt.DisplayRole, v)
         self._setupGui()
         self.attach_to_tree()
Example #5
0
    def _do_picker_reference(self, path, namespace):
        with ticket_ui_context():
            print '#', self.node, 'to', path
            cmds.file(
                path,
                loadReference=self.node,
                type='mayaAscii' if path.endswith('.ma') else 'mayaBinary',
                options='v=0',
            )
            self.status = check.check_paths([path])[0]
            self.publish = self.status.used
            new_data = self._viewFields()
            for i, v in enumerate(new_data):
                self.setData(i, Q.DisplayRole, v)

            # This is dangerous to call a second time for some reason.
            # On Mike's home machine, I used to not set self.publish above,
            # which would overwrite the button, and for some reason
            # segfault when the dialog was closed.
            self._setupGui()

            self.attach_to_tree()