Skip to content

Commit

Permalink
hotfix for importing scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
masqu3rad3 committed Sep 23, 2023
1 parent bb1c83c commit 57fb760
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tik_manager4/objects/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ def load_version(self, version_number):
abs_path = self.get_abs_project_path(relative_path)
self._dcc_handler.open(abs_path)

def import_version(self, version_number):
"""Import the given version of the work to the scene."""
version_obj = self.get_version(version_number)
if version_obj:
relative_path = version_obj.get("scene_path")
abs_path = self.get_abs_project_path(relative_path)
self._dcc_handler.import_file(abs_path)

def delete_work(self):
"""Delete the work."""
# TODO: implement this. This should move the work to the purgatory.
Expand Down
4 changes: 2 additions & 2 deletions tik_manager4/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def initialize_mcv(self):
self.categories_mcv.work_tree_view.version_created.connect(self._ingest_success)
self.categories_mcv.work_tree_view.doubleClicked.connect(self.load_work)
self.categories_mcv.work_tree_view.load_event.connect(self.load_work)
self.categories_mcv.work_tree_view.import_event.connect(self.load_work)
self.categories_mcv.work_tree_view.import_event.connect(self.import_work)

def set_last_state(self):
"""Set the last selections for the user"""
Expand Down Expand Up @@ -416,7 +416,7 @@ def import_work(self):
return
# get the version
selected_version = self.versions_mcv.get_selected_version()

selected_work_item.work.import_version(selected_version)
print(selected_work_item)
print(selected_version)
print("Not implemented yet.")
Expand Down

0 comments on commit 57fb760

Please sign in to comment.