コード例 #1
0
ファイル: Popup.py プロジェクト: gonnaflyzhang/HAOC
    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()
コード例 #2
0
ファイル: AssetManage.py プロジェクト: gonnaflyzhang/HAOC
    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