Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client/ayon_fusion/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ class GenericCreateSaver(Creator):
def create(self, product_name, instance_data, pre_create_data):
self.pass_pre_attributes_to_instance(instance_data, pre_create_data)

product_type = instance_data.get("productType")
if not product_type:
product_type = self.product_base_type

instance = CreatedInstance(
product_type=self.product_type,
product_base_type=self.product_base_type,
product_type=product_type,
product_name=product_name,
data=instance_data,
creator=self,
Expand Down Expand Up @@ -144,6 +149,7 @@ def _configure_saver_tool(self, data, tool, product_name):

# Product name and type
product_type = formatting_data["productType"]
product_base_type = formatting_data["productBaseType"]
f_product_name = formatting_data["productName"]

# Get instance context entities
Expand Down Expand Up @@ -185,6 +191,7 @@ def _configure_saver_tool(self, data, tool, product_name):
"product": {
"name": f_product_name,
"type": product_type,
"basetype": product_base_type,
},
# Backwards compatibility
"subset": f_product_name,
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_fusion/plugins/create/create_image_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class CreateImageSaver(GenericCreateSaver):
identifier = "io.openpype.creators.fusion.imagesaver"
label = "Image (saver)"
name = "image"
product_type = "image"
product_base_type = "image"
product_type = product_base_type
description = "Fusion Saver to generate a single image file"

default_frame = 0
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_fusion/plugins/create/create_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class CreateSaver(GenericCreateSaver):
identifier = "io.openpype.creators.fusion.saver"
label = "Render (saver)"
name = "render"
product_type = "render"
product_base_type = "render"
product_type = product_base_type
description = "Fusion Saver to generate image sequence"

default_frame_range_option = "current_context"
Expand Down
10 changes: 7 additions & 3 deletions client/ayon_fusion/plugins/create/create_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

class FusionWorkfileCreator(AutoCreator):
identifier = "workfile"
product_type = "workfile"
product_base_type = "workfile"
product_type = product_base_type
label = "Workfile"
icon = "fa5.file"

Expand All @@ -21,7 +21,6 @@ class FusionWorkfileCreator(AutoCreator):
data_key = "openpype_workfile"

def collect_instances(self):

comp = get_current_comp()
data = comp.GetData(self.data_key)
if not data:
Expand All @@ -31,6 +30,7 @@ def collect_instances(self):
if product_name is None:
product_name = data["subset"]
instance = CreatedInstance(
product_base_type=self.product_base_type,
product_type=self.product_type,
product_name=product_name,
data=data,
Expand Down Expand Up @@ -98,7 +98,11 @@ def create(self, options=None):
))

new_instance = CreatedInstance(
self.product_type, product_name, data, self
product_base_type=self.product_base_type,
product_type=self.product_type,
product_name=product_name,
data=data,
creator=self,
)
new_instance.transient_data["comp"] = comp
self._add_instance_to_context(new_instance)
Expand Down
6 changes: 4 additions & 2 deletions client/ayon_fusion/plugins/load/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class FusionSetFrameRangeLoader(load.LoaderPlugin):
"""Set frame range excluding pre- and post-handles"""

product_types = {
product_base_types = {
"animation",
"camera",
"imagesequence",
Expand All @@ -17,6 +17,7 @@ class FusionSetFrameRangeLoader(load.LoaderPlugin):
"pointcache",
"render",
}
product_types = product_base_types
representations = {"*"}
extensions = {"*"}

Expand Down Expand Up @@ -45,7 +46,7 @@ def load(self, context, name, namespace, data):
class FusionSetFrameRangeWithHandlesLoader(load.LoaderPlugin):
"""Set frame range including pre- and post-handles"""

product_types = {
product_base_types = {
"animation",
"camera",
"imagesequence",
Expand All @@ -54,6 +55,7 @@ class FusionSetFrameRangeWithHandlesLoader(load.LoaderPlugin):
"pointcache",
"render",
}
product_types = product_base_types
representations = {"*"}

label = "Set frame range (with handles)"
Expand Down
3 changes: 2 additions & 1 deletion client/ayon_fusion/plugins/load/load_alembic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
class FusionLoadAlembicMesh(load.LoaderPlugin):
"""Load Alembic mesh into Fusion"""

product_types = {"pointcache", "model"}
product_base_types = {"pointcache", "model"}
product_types = product_base_types
representations = {"*"}
extensions = {"abc"}

Expand Down
3 changes: 2 additions & 1 deletion client/ayon_fusion/plugins/load/load_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
class FusionLoadFBXMesh(load.LoaderPlugin):
"""Load FBX mesh into Fusion"""

product_types = {"*"}
product_base_types = {"*"}
product_types = product_base_types
representations = {"*"}
extensions = {
"3ds",
Expand Down
3 changes: 2 additions & 1 deletion client/ayon_fusion/plugins/load/load_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,15 @@ def loader_shift(loader, frame, relative=True):
class FusionLoadSequence(load.LoaderPlugin):
"""Load image sequence into Fusion"""

product_types = {
product_base_types = {
"imagesequence",
"review",
"render",
"plate",
"image",
"online",
}
product_types = product_base_types
representations = {"*"}
extensions = set(
ext.lstrip(".") for ext in IMAGE_EXTENSIONS.union(VIDEO_EXTENSIONS)
Expand Down
3 changes: 2 additions & 1 deletion client/ayon_fusion/plugins/load/load_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class FusionLoadUSD(load.LoaderPlugin):
Support for USD was added since Fusion 18.5
"""

product_types = {"*"}
product_base_types = {"*"}
product_types = product_base_types
representations = {"*"}
extensions = {"usd", "usda", "usdz"}

Expand Down
3 changes: 2 additions & 1 deletion client/ayon_fusion/plugins/load/load_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
class FusionLoadWorkfile(load.LoaderPlugin):
"""Load the content of a workfile into Fusion"""

product_types = {"workfile"}
product_base_types = {"workfile"}
product_types = product_base_types
representations = {"*"}
extensions = {"comp"}

Expand Down
15 changes: 3 additions & 12 deletions client/ayon_fusion/plugins/publish/collect_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ def get_instances(self, context):
if not inst.data.get("active", True):
continue

product_type = inst.data["productType"]
product_base_type = inst.data.get("productBaseType")
if not product_base_type:
product_base_type = product_type

product_base_type = inst.data["productBaseType"]
if product_base_type not in ["render", "image"]:
continue

Expand All @@ -69,15 +65,10 @@ def get_instances(self, context):

instance_families = inst.data.get("families", [])
product_name = inst.data["productName"]
kwargs = dict(
productBaseType=product_base_type,
productType=product_type,
)
if "productBaseType" not in attr.fields_dict(FusionRenderInstance):
kwargs["productType"] = kwargs.pop("productBaseType")

instance = FusionRenderInstance(
**kwargs,
productBaseType=product_base_type,
productType=inst.data["productType"],
tool=inst.data["transientData"]["tool"],
workfileComp=comp,
family=product_base_type,
Expand Down
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

ayon_server_version = ">=1.1.2"
ayon_required_addons = {
"core": ">1.0.3",
"core": ">=1.8.0",
}
ayon_compatible_addons = {}
27 changes: 27 additions & 0 deletions server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ def _set_masterprefs_mode_enum():
]


class ProductTypeItemModel(BaseSettingsModel):
_layout = "compact"
product_type: str = SettingsField(
title="Product type",
description="Product type name",
)
label: str = SettingsField(
"",
title="Label",
description="Label to display in UI for the product type",
)


class CreateSaverPluginModel(BaseSettingsModel):
_isGroup = True
temp_rendering_path_template: str = SettingsField(
Expand Down Expand Up @@ -128,13 +141,27 @@ class CreateSaverModel(CreateSaverPluginModel):
enum_resolver=_frame_range_options_enum,
title="Default frame range source"
)
product_type_items: list[ProductTypeItemModel] = SettingsField(
default_factory=list,
title="Product type items",
description=(
"Optional list of product types that this plugin can create."
)
)


class CreateImageSaverModel(CreateSaverPluginModel):
default_frame: int = SettingsField(
0,
title="Default rendered frame"
)
product_type_items: list[ProductTypeItemModel] = SettingsField(
default_factory=list,
title="Product type items",
description=(
"Optional list of product types that this plugin can create."
)
)


class CreatPluginsModel(BaseSettingsModel):
Expand Down