Exemple #1
0
    def load_nodes(self):
        if SCloudUtils.is_any_cloud_operation_running():
            print "Please wait for current cloud operation finish"
            self.close()
            return
        if self.accepted_index.row < 0:
            return
        source_selected_index = self.sort_filter.mapToSource(
            self.accepted_index)
        selected_item = self.sort_filter.sourceModel().itemFromIndex(
            source_selected_index)
        if selected_item.text()[-1] == '/':
            return
        selected_path = "%s.nod" % PopWidget.get_selected_path(selected_item)

        cat_name = self.pwd_for_load_nodes.childTypeCategory().name()
        file_path = '%s/%s/%s' % (HaocUtils.get_local_nodes_path(), cat_name,
                                  selected_path)

        if os.path.getsize(file_path) == 0:
            d = SCloudUtils.TDownloadNode("%s/%s" % (cat_name, selected_path))
            d.download_finished.connect(self.on_download_finished)
            d.start()
        else:
            self.load_asset_in_houdini(file_path)
        self.close()
        self.network_editor.homeToSelection()
Exemple #2
0
 def on_rename_menu(self):
     if SCloudUtils.is_any_cloud_operation_running():
         print "Please wait for current cloud operation finish"
         return
     index = self.tree_view.currentIndex()
     source_index = self.sort_filter.mapToSource(index)
     selected_item = self.sort_filter.sourceModel().itemFromIndex(
         source_index)
     self.__old_name_for_rename = selected_item.text()
     self.tree_view.edit(index)
Exemple #3
0
 def on_delete_menu(self):
     if SCloudUtils.is_any_cloud_operation_running():
         print "Please wait for current cloud operation finish"
         return
     selected_path = HaocObjects.get_selected_path(self.get_current_item())
     local_path = "%s/%s" % (HaocUtils.get_local_nodes_path(),
                             selected_path)
     if selected_path[-1] == '/':
         os.rmdir(local_path)
     else:
         os.remove("%s.nod" % local_path)
         if os.path.exists("%s.hlp" % local_path):
             os.remove("%s.hlp" % local_path)
     com = HaocObjects.CommandItem(2, path=selected_path)
     t_delete = SCloudUtils.TDoCommands([com])
     t_delete.start()
     index = self.tree_view.currentIndex()
     self.tree_view.sort_filter.removeRow(index.row(), index.parent())
Exemple #4
0
    def on_tree_dou_clicked(self, index):
        if SCloudUtils.is_any_cloud_operation_running():
            print "Please wait for current cloud operation finish"
            return
        index = self.tree_view.sort_filter.mapToSource(index)
        item = self.tree_view.sort_filter.sourceModel().itemFromIndex(index)
        common_path = HaocObjects.get_selected_path(item)
        if common_path[-1] == '/':
            return
        else:
            common_path = "%s.nod" % common_path

        local_path = "%s/%s" % (HaocUtils.get_local_nodes_path(), common_path)
        if os.path.getsize(local_path) == 0:
            d = SCloudUtils.TDownloadNode(common_path)
            d.download_finished.connect(self.on_download_finished)
            d.start()
            self.__downloading_item = item
Exemple #5
0
    def on_apply_help_change(self):
        txt = self.help_tee.toPlainText().strip()
        if txt == '':
            return
        sel_item = self.get_current_item()
        if sel_item is None:
            return
        sel_path = HaocObjects.get_selected_path(sel_item)
        if sel_path[-1] == '/':
            return
        if SCloudUtils.is_any_cloud_operation_running():
            print "Please wait for current cloud operation finish"
            return
        local_path = "%s/%s.hlp" % (HaocUtils.get_local_nodes_path(), sel_path)

        with codecs.open(local_path, 'w', 'utf-8') as f:
            f.write(txt)
        upload_hlp_t = SCloudUtils.TUploadHlp(sel_path)
        upload_hlp_t.start()
Exemple #6
0
 def on_sync():
     if SCloudUtils.is_any_cloud_operation_running():
         print "Please wait for current cloud operation finish"
         return
     SCloudUtils.sync_data()