mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
fill both 'family' and 'productType'
This commit is contained in:
parent
4a7bc9a571
commit
3afa0e3bca
33 changed files with 67 additions and 31 deletions
|
|
@ -1193,14 +1193,14 @@ class CreatedInstance:
|
|||
|
||||
instance_data = copy.deepcopy(instance_data)
|
||||
|
||||
product_type = instance_data.get("productType", None)
|
||||
if not product_type:
|
||||
product_type = instance_data.get("family", None)
|
||||
product_type = instance_data.get("productType")
|
||||
if product_type is None:
|
||||
product_type = instance_data.get("family")
|
||||
if product_type is None:
|
||||
product_type = creator.product_type
|
||||
product_name = instance_data.get("productName", None)
|
||||
if not product_name:
|
||||
product_name = instance_data.get("subset", None)
|
||||
product_name = instance_data.get("productName")
|
||||
if product_name is None:
|
||||
product_name = instance_data.get("subset")
|
||||
|
||||
return cls(
|
||||
product_type, product_name, instance_data, creator
|
||||
|
|
|
|||
|
|
@ -801,8 +801,9 @@ def create_skeleton_instance_cache(instance):
|
|||
families = ["render", product_type]
|
||||
|
||||
instance_skeleton_data = {
|
||||
"productType": product_type,
|
||||
"productName": data["productName"],
|
||||
"productType": product_type,
|
||||
"family": product_type,
|
||||
"families": families,
|
||||
"folderPath": data["folderPath"],
|
||||
"frameStart": time_data.start,
|
||||
|
|
@ -1085,6 +1086,7 @@ def attach_instances_to_product(attach_to, instances):
|
|||
new_inst["version"] = attach_instance.get("version")
|
||||
new_inst["productName"] = attach_instance.get("productName")
|
||||
new_inst["productType"] = attach_instance.get("productType")
|
||||
new_inst["family"] = attach_instance.get("family")
|
||||
new_inst["append"] = True
|
||||
# don't set subsetGroup if we are attaching
|
||||
new_inst.pop("subsetGroup")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class RenderInstance(object):
|
|||
time = attr.ib() # time of instance creation (get_formatted_current_time)
|
||||
source = attr.ib() # path to source scene file
|
||||
label = attr.ib() # label to show in GUI
|
||||
family = attr.ib() # product type for pyblish filtering
|
||||
productType = attr.ib() # product type
|
||||
productName = attr.ib() # product name
|
||||
folderPath = attr.ib() # folder path
|
||||
|
|
|
|||
|
|
@ -954,11 +954,11 @@ def get_publish_instance_families(instance):
|
|||
list[str]: List of families.
|
||||
"""
|
||||
|
||||
product_type = instance.data.get("productType")
|
||||
family = instance.data.get("family")
|
||||
families = set(instance.data.get("families") or [])
|
||||
output = []
|
||||
if product_type:
|
||||
output.append(product_type)
|
||||
families.discard(product_type)
|
||||
if family:
|
||||
output.append(family)
|
||||
families.discard(family)
|
||||
output.extend(families)
|
||||
return output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue