mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Revert "OP-2765 - cleaned up workfile collector"
This reverts commit 0506c38e
This commit is contained in:
parent
0506c38e00
commit
2c20f6832d
2 changed files with 35 additions and 43 deletions
|
|
@ -17,37 +17,16 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
|
|||
existing_instance = instance
|
||||
break
|
||||
|
||||
task = api.Session["AVALON_TASK"]
|
||||
current_file = context.data["currentFile"]
|
||||
staging_dir = os.path.dirname(current_file)
|
||||
scene_file = os.path.basename(current_file)
|
||||
if existing_instance is None: # old publish
|
||||
instance = self._get_new_instance(context, scene_file)
|
||||
else:
|
||||
instance = existing_instance
|
||||
|
||||
# creating representation
|
||||
representation = {
|
||||
'name': 'aep',
|
||||
'ext': 'aep',
|
||||
'files': scene_file,
|
||||
"stagingDir": staging_dir,
|
||||
}
|
||||
|
||||
instance.data["representations"].append(representation)
|
||||
|
||||
def _get_new_instance(self, context, scene_file):
|
||||
task = api.Session["AVALON_TASK"]
|
||||
version = context.data["version"]
|
||||
asset_entity = context.data["assetEntity"]
|
||||
project_entity = context.data["projectEntity"]
|
||||
|
||||
# workfile instance
|
||||
family = "workfile"
|
||||
subset = family + task.capitalize() # TOOD use method
|
||||
|
||||
instance_data = {
|
||||
shared_instance_data = {
|
||||
"asset": asset_entity["name"],
|
||||
"task": task,
|
||||
"frameStart": asset_entity["data"]["frameStart"],
|
||||
"frameEnd": asset_entity["data"]["frameEnd"],
|
||||
"handleStart": asset_entity["data"]["handleStart"],
|
||||
|
|
@ -61,16 +40,37 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
|
|||
project_entity["data"]["resolutionHeight"]),
|
||||
"pixelAspect": 1,
|
||||
"step": 1,
|
||||
"version": version,
|
||||
"subset": subset,
|
||||
"label": scene_file,
|
||||
"family": family,
|
||||
"families": [family],
|
||||
"representations": list()
|
||||
"version": version
|
||||
}
|
||||
|
||||
# Create instance
|
||||
instance = context.create_instance(subset)
|
||||
instance.data.update(instance_data)
|
||||
# workfile instance
|
||||
family = "workfile"
|
||||
subset = family + task.capitalize()
|
||||
if existing_instance is None: # old publish
|
||||
# Create instance
|
||||
instance = context.create_instance(subset)
|
||||
|
||||
return instance
|
||||
# creating instance data
|
||||
instance.data.update({
|
||||
"subset": subset,
|
||||
"label": scene_file,
|
||||
"family": family,
|
||||
"families": [family],
|
||||
"representations": list()
|
||||
})
|
||||
|
||||
# adding basic script data
|
||||
instance.data.update(shared_instance_data)
|
||||
else:
|
||||
instance = existing_instance
|
||||
instance.data["publish"] = True # for DL
|
||||
|
||||
# creating representation
|
||||
representation = {
|
||||
'name': 'aep',
|
||||
'ext': 'aep',
|
||||
'files': scene_file,
|
||||
"stagingDir": staging_dir,
|
||||
}
|
||||
|
||||
instance.data["representations"].append(representation)
|
||||
|
|
|
|||
|
|
@ -392,7 +392,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
list of instances
|
||||
|
||||
"""
|
||||
self.log.info("!!!!! _create_instances_for_aov")
|
||||
task = os.environ["AVALON_TASK"]
|
||||
subset = instance_data["subset"]
|
||||
cameras = instance_data.get("cameras", [])
|
||||
|
|
@ -455,7 +454,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
break
|
||||
|
||||
if instance_data.get("multipartExr"):
|
||||
self.log.info("!!!!! _create_instances_for_aov add multipartExr")
|
||||
preview = True
|
||||
|
||||
new_instance = copy(instance_data)
|
||||
|
|
@ -521,10 +519,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
"""
|
||||
representations = []
|
||||
collections, remainders = clique.assemble(exp_files)
|
||||
self.log.info("!!!!! _get_representations")
|
||||
|
||||
# create representation for every collected sequento ce
|
||||
for collection in collections:
|
||||
self.log.info("!!!!! collection")
|
||||
ext = collection.tail.lstrip(".")
|
||||
preview = False
|
||||
# if filtered aov name is found in filename, toggle it for
|
||||
|
|
@ -536,7 +533,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
aov,
|
||||
list(collection)[0]
|
||||
):
|
||||
self.log.info("!!!!! add preview")
|
||||
preview = True
|
||||
break
|
||||
|
||||
|
|
@ -586,7 +582,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
|
||||
# add reminders as representations
|
||||
for remainder in remainders:
|
||||
self.log.info("!!!!! remainder")
|
||||
ext = remainder.split(".")[-1]
|
||||
|
||||
staging = os.path.dirname(remainder)
|
||||
|
|
@ -607,10 +602,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
"files": os.path.basename(remainder),
|
||||
"stagingDir": os.path.dirname(remainder),
|
||||
}
|
||||
is_render_type = set(["render"]).\
|
||||
intersection(instance.get("families"))
|
||||
if is_render_type:
|
||||
self.log.info("!!!!! is_render_type")
|
||||
if "render" in instance.get("families"):
|
||||
rep.update({
|
||||
"fps": instance.get("fps"),
|
||||
"tags": ["review"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue