removing redundant action

it was residual approach from old workflow
This commit is contained in:
Jakub Jezek 2023-08-31 22:29:18 +02:00
parent 82b50dcfc2
commit 24cbaefe95
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -17,29 +17,14 @@ class RepairActionBase(pyblish.api.Action):
def repair_knob(self, context, instances, state):
create_context = context.data["create_context"]
for instance in instances:
files_to_remove = [
# create full path to file
os.path.join(instance.data["outputDir"], f_)
# iterate representations from instance data
for r_ in instance.data.get("representations", [])
# make sure that the representation has files in list
if r_.get("files") and isinstance(r_.get("files"), list)
# iterate files from representation files list
for f_ in r_.get("files", [])
]
self.log.info("Files to be removed: {}".format(files_to_remove))
for f_ in files_to_remove:
os.remove(f_)
self.log.debug("removing file: {}".format(f_))
# Reset the render knob
instance_id = instance.data.get("instance_id")
created_instance = create_context.get_instance_by_id(
instance_id
)
created_instance.creator_attributes["render_target"] = state
self.log.info("Rendering toggled to `{}`".format(state))
create_context.save_changes()