From e35c9898af6716703f5d468f3e7490cdc7ddecc9 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Mon, 7 Aug 2023 19:08:31 +0200 Subject: [PATCH 01/18] Align creator settings to use default_variants instead of defaults --- .../plugins/create/create_arnold_ass.py | 2 +- .../plugins/create/create_arnold_rop.py | 2 +- .../plugins/create/create_karma_rop.py | 2 +- .../plugins/create/create_mantra_rop.py | 2 +- .../plugins/create/create_redshift_rop.py | 2 +- .../houdini/plugins/create/create_vray_rop.py | 2 +- .../defaults/project_settings/houdini.json | 56 +++-- .../defaults/project_settings/maya.json | 47 ++-- .../schemas/schema_houdini_create.json | 204 ++++++++++-------- .../schemas/schema_maya_create.json | 26 +-- .../schemas/schema_maya_create_render.json | 4 +- .../schemas/template_create_plugin.json | 4 +- 12 files changed, 210 insertions(+), 143 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_arnold_ass.py b/openpype/hosts/houdini/plugins/create/create_arnold_ass.py index 8b310753d02..e587041e70c 100644 --- a/openpype/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/openpype/hosts/houdini/plugins/create/create_arnold_ass.py @@ -10,7 +10,7 @@ class CreateArnoldAss(plugin.HoudiniCreator): label = "Arnold ASS" family = "ass" icon = "magic" - defaults = ["Main"] + default_variants = ["Main"] # Default extension: `.ass` or `.ass.gz` ext = ".ass" diff --git a/openpype/hosts/houdini/plugins/create/create_arnold_rop.py b/openpype/hosts/houdini/plugins/create/create_arnold_rop.py index ca516619f62..7d00e8b3e5a 100644 --- a/openpype/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_arnold_rop.py @@ -9,7 +9,7 @@ class CreateArnoldRop(plugin.HoudiniCreator): label = "Arnold ROP" family = "arnold_rop" icon = "magic" - defaults = ["master"] + default_variants = ["master"] # Default extension ext = "exr" diff --git a/openpype/hosts/houdini/plugins/create/create_karma_rop.py b/openpype/hosts/houdini/plugins/create/create_karma_rop.py index 71c2bf1b28a..e8b77c12e55 100644 --- a/openpype/hosts/houdini/plugins/create/create_karma_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_karma_rop.py @@ -11,7 +11,7 @@ class CreateKarmaROP(plugin.HoudiniCreator): label = "Karma ROP" family = "karma_rop" icon = "magic" - defaults = ["master"] + default_variants = ["master"] def create(self, subset_name, instance_data, pre_create_data): import hou # noqa diff --git a/openpype/hosts/houdini/plugins/create/create_mantra_rop.py b/openpype/hosts/houdini/plugins/create/create_mantra_rop.py index 5c29adb33f8..b2846d53fac 100644 --- a/openpype/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_mantra_rop.py @@ -11,7 +11,7 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" family = "mantra_rop" icon = "magic" - defaults = ["master"] + default_variants = ["master"] def create(self, subset_name, instance_data, pre_create_data): import hou # noqa diff --git a/openpype/hosts/houdini/plugins/create/create_redshift_rop.py b/openpype/hosts/houdini/plugins/create/create_redshift_rop.py index 8f4aa1327d3..9b0a36ddd1b 100644 --- a/openpype/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_redshift_rop.py @@ -13,7 +13,7 @@ class CreateRedshiftROP(plugin.HoudiniCreator): label = "Redshift ROP" family = "redshift_rop" icon = "magic" - defaults = ["master"] + default_variants = ["master"] ext = "exr" def create(self, subset_name, instance_data, pre_create_data): diff --git a/openpype/hosts/houdini/plugins/create/create_vray_rop.py b/openpype/hosts/houdini/plugins/create/create_vray_rop.py index 58748d4c348..a3ae01f5aeb 100644 --- a/openpype/hosts/houdini/plugins/create/create_vray_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_vray_rop.py @@ -14,7 +14,7 @@ class CreateVrayROP(plugin.HoudiniCreator): label = "VRay ROP" family = "vray_rop" icon = "magic" - defaults = ["master"] + default_variants = ["master"] ext = "exr" diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index a53f1ff2024..389fdc6d96d 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -14,48 +14,80 @@ "create": { "CreateArnoldAss": { "enabled": true, - "defaults": [], + "default_variants": [], "ext": ".ass" }, + "CreateArnoldRop": { + "enabled": true, + "default_variants": [] + }, "CreateAlembicCamera": { "enabled": true, - "defaults": [] + "default_variants": [] + }, + "CreateBGEO": { + "enabled": true, + "default_variants": [] }, "CreateCompositeSequence": { "enabled": true, - "defaults": [] + "default_variants": [] + }, + "CreateHDA": { + "enabled": true, + "default_variants": [] + }, + "CreateKarmaROP": { + "enabled": true, + "default_variants": [] + }, + "CreateMantraROP": { + "enabled": true, + "default_variants": [] }, "CreatePointCache": { "enabled": true, - "defaults": [] + "default_variants": [] + }, + "CreateRedshiftProxy": { + "enabled": true, + "default_variants": [] }, "CreateRedshiftROP": { "enabled": true, - "defaults": [] + "default_variants": [] }, "CreateRemotePublish": { "enabled": true, - "defaults": [] + "default_variants": [] }, - "CreateVDBCache": { + "CreateReview": { "enabled": true, - "defaults": [] + "default_variants": [] }, "CreateUSD": { "enabled": false, - "defaults": [] + "default_variants": [] }, "CreateUSDModel": { "enabled": false, - "defaults": [] + "default_variants": [] }, "USDCreateShadingWorkspace": { "enabled": false, - "defaults": [] + "default_variants": [] }, "CreateUSDRender": { "enabled": false, - "defaults": [] + "default_variants": [] + }, + "CreateVDBCache": { + "enabled": true, + "default_variants": [] + }, + "CreateVrayROP": { + "enabled": true, + "default_variants": [] } }, "publish": { diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 8e1022f8772..b9817fe4005 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -521,19 +521,19 @@ "enabled": true, "make_tx": true, "rs_tex": false, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateRender": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateUnrealStaticMesh": { "enabled": true, - "defaults": [ + "default_variants": [ "", "_Main" ], @@ -547,7 +547,7 @@ }, "CreateUnrealSkeletalMesh": { "enabled": true, - "defaults": [], + "default_variants": [], "joint_hints": "jnt_org" }, "CreateMultiverseLook": { @@ -555,11 +555,12 @@ "publish_mip_map": true }, "CreateAnimation": { + "enabled": false, "write_color_sets": false, "write_face_sets": false, "include_parent_hierarchy": false, "include_user_defined_attributes": false, - "defaults": [ + "default_variants": [ "Main" ] }, @@ -567,7 +568,7 @@ "enabled": true, "write_color_sets": false, "write_face_sets": false, - "defaults": [ + "default_variants": [ "Main", "Proxy", "Sculpt" @@ -578,7 +579,7 @@ "write_color_sets": false, "write_face_sets": false, "include_user_defined_attributes": false, - "defaults": [ + "default_variants": [ "Main" ] }, @@ -586,20 +587,20 @@ "enabled": true, "write_color_sets": false, "write_face_sets": false, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateReview": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ], "useMayaTimeline": true }, "CreateAss": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ], "expandProcedurals": false, @@ -621,61 +622,61 @@ "enabled": true, "vrmesh": true, "alembic": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateMultiverseUsd": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateMultiverseUsdComp": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateMultiverseUsdOver": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateAssembly": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateCamera": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateLayout": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateMayaScene": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateRenderSetup": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateRig": { "enabled": true, - "defaults": [ + "default_variants": [ "Main", "Sim", "Cloth" @@ -683,20 +684,20 @@ }, "CreateSetDress": { "enabled": true, - "defaults": [ + "default_variants": [ "Main", "Anim" ] }, "CreateVRayScene": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] }, "CreateYetiRig": { "enabled": true, - "defaults": [ + "default_variants": [ "Main" ] } diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json index 83e0cf789a8..52a03677da8 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json @@ -1,89 +1,121 @@ { - "type": "dict", - "collapsible": true, - "key": "create", - "label": "Creator plugins", - "children": [ - { - "type": "dict", - "collapsible": true, - "key": "CreateArnoldAss", - "label": "Create Arnold Ass", - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "list", - "key": "defaults", - "label": "Default Subsets", - "object_type": "text" - }, - { - "type": "enum", - "key": "ext", - "label": "Default Output Format (extension)", - "multiselection": false, - "enum_items": [ - { - ".ass": ".ass" - }, - { - ".ass.gz": ".ass.gz (gzipped)" - } - ] - } - ] + "type": "dict", + "collapsible": true, + "key": "create", + "label": "Creator plugins", + "children": [ + { + "type": "dict", + "collapsible": true, + "key": "CreateArnoldAss", + "label": "Create Arnold Ass", + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "list", + "key": "default_variants", + "label": "Default Variants", + "object_type": "text" + }, + { + "type": "enum", + "key": "ext", + "label": "Default Output Format (extension)", + "multiselection": false, + "enum_items": [ + { + ".ass": ".ass" + }, + { + ".ass.gz": ".ass.gz (gzipped)" + } + ] + } + ] + }, + { + "type": "schema_template", + "name": "template_create_plugin", + "template_data": [ + { + "key": "CreateArnoldRop", + "label": "Create Arnold ROP" }, - { - "type": "schema_template", - "name": "template_create_plugin", - "template_data": [ - { - "key": "CreateAlembicCamera", - "label": "Create Alembic Camera" - }, - { - "key": "CreateCompositeSequence", - "label": "Create Composite (Image Sequence)" - }, - { - "key": "CreatePointCache", - "label": "Create Point Cache" - }, - { - "key": "CreateRedshiftROP", - "label": "Create Redshift ROP" - }, - { - "key": "CreateRemotePublish", - "label": "Create Remote Publish" - }, - { - "key": "CreateVDBCache", - "label": "Create VDB Cache" - }, - { - "key": "CreateUSD", - "label": "Create USD" - }, - { - "key": "CreateUSDModel", - "label": "Create USD Model" - }, - { - "key": "USDCreateShadingWorkspace", - "label": "Create USD Shading Workspace" - }, - { - "key": "CreateUSDRender", - "label": "Create USD Render" - } - ] - } - ] -} \ No newline at end of file + { + "key": "CreateAlembicCamera", + "label": "Create Alembic Camera" + }, + { + "key": "CreateBGEO", + "label": "Create Houdini BGEO" + }, + { + "key": "CreateCompositeSequence", + "label": "Create Composite (Image Sequence)" + }, + { + "key": "CreateKarmaROP", + "label": "Create Karma ROP" + }, + { + "key": "CreateMantraROP", + "label": "Create Mantra ROP" + }, + { + "key": "CreateHDA", + "label": "Create HDA" + }, + { + "key": "CreatePointCache", + "label": "Create Point Cache" + }, + { + "key": "CreateRedshiftProxy", + "label": "Create Redshift Proxy" + }, + { + "key": "CreateRedshiftROP", + "label": "Create Redshift ROP" + }, + { + "key": "CreateRemotePublish", + "label": "Create Remote Publish" + }, + { + "key": "CreateReview", + "label": "Create Review" + }, + { + "key": "CreateUSD", + "label": "Create USD" + }, + { + "key": "CreateUSDModel", + "label": "Create USD Model" + }, + { + "key": "USDCreateShadingWorkspace", + "label": "Create USD Shading Workspace" + }, + { + "key": "CreateUSDRender", + "label": "Create USD Render" + }, + { + "key": "CreateVDBCache", + "label": "Create VDB Cache" + }, + { + "key": "CreateVrayROP", + "label": "Create VRay ROP" + } + ] + } + ] +} diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json index d28d42c10c7..8faf3fcae86 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json @@ -28,7 +28,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } @@ -52,7 +52,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" }, @@ -84,7 +84,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" }, @@ -120,10 +120,12 @@ "collapsible": true, "key": "CreateAnimation", "label": "Create Animation", + "checkbox_key": "enabled", "children": [ { - "type": "label", - "label": "This plugin is not optional due to implicit creation through loading the \"rig\" family.\nThis family is also hidden from creation due to complexity in setup." + "type": "boolean", + "key": "enabled", + "label": "Enabled" }, { "type": "boolean", @@ -147,7 +149,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } @@ -177,7 +179,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } @@ -212,7 +214,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } @@ -242,7 +244,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } @@ -262,7 +264,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" }, @@ -287,7 +289,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" }, @@ -389,7 +391,7 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json index 68ad7ad63df..9d7432fe511 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json @@ -12,9 +12,9 @@ }, { "type": "list", - "key": "defaults", + "key": "default_variants", "label": "Default Subsets", "object_type": "text" } ] -} \ No newline at end of file +} diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json index 14d15e78401..3d2ed9f3d4c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json @@ -13,8 +13,8 @@ }, { "type": "list", - "key": "defaults", - "label": "Default Subsets", + "key": "default_variants", + "label": "Default Variants", "object_type": "text" } ] From 1b794361034c023acef1c3362df6065f1839245a Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Mon, 7 Aug 2023 19:08:50 +0200 Subject: [PATCH 02/18] Add function so Houdini creator settings get applied to instances --- openpype/hosts/houdini/api/plugin.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openpype/hosts/houdini/api/plugin.py b/openpype/hosts/houdini/api/plugin.py index 1e7eaa7e22e..a5efb73c67d 100644 --- a/openpype/hosts/houdini/api/plugin.py +++ b/openpype/hosts/houdini/api/plugin.py @@ -292,3 +292,22 @@ def get_network_categories(self): """ return [hou.ropNodeTypeCategory()] + + def get_creator_settings(self, project_settings, settings_key=None): + if not settings_key: + settings_key = self.__class__.__name__ + return project_settings["houdini"]["create"][settings_key] + + def apply_settings( + self, + project_settings, + system_settings + ): + """Method called on initialization of plugin to apply settings.""" + + # plugin settings + plugin_settings = self.get_creator_settings(project_settings) + + # individual attributes + self.default_variants = plugin_settings.get( + "default_variants") or self.default_variants From 73bbc86d8b54dbe7859737f34d6db71120d6f693 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Mon, 7 Aug 2023 19:09:27 +0200 Subject: [PATCH 03/18] Use default variant from creator plugin for interactive shelve tool --- .../hosts/houdini/api/creator_node_shelves.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/houdini/api/creator_node_shelves.py b/openpype/hosts/houdini/api/creator_node_shelves.py index 7c6122cffee..c724acb16df 100644 --- a/openpype/hosts/houdini/api/creator_node_shelves.py +++ b/openpype/hosts/houdini/api/creator_node_shelves.py @@ -35,11 +35,11 @@ CREATE_SCRIPT = """ from openpype.hosts.houdini.api.creator_node_shelves import create_interactive -create_interactive("{identifier}", **kwargs) +create_interactive("{identifier}", "{variant}", **kwargs) """ -def create_interactive(creator_identifier, **kwargs): +def create_interactive(creator_identifier, default_variant, **kwargs): """Create a Creator using its identifier interactively. This is used by the generated shelf tools as callback when a user selects @@ -59,9 +59,9 @@ def create_interactive(creator_identifier, **kwargs): """ # TODO Use Qt instead - result, variant = hou.ui.readInput('Define variant name', + result, variant = hou.ui.readInput("Define variant name", buttons=("Ok", "Cancel"), - initial_contents='Main', + initial_contents=default_variant, title="Define variant", help="Set the variant for the " "publish instance", @@ -196,7 +196,14 @@ def install(): key = "openpype_create.{}".format(identifier) log.debug(f"Registering {key}") - script = CREATE_SCRIPT.format(identifier=identifier) + default_variant = "Main" + if hasattr(creator, "default_variant"): + default_variant = creator.default_variant + elif hasattr(creator, "default_variants"): + default_variant = creator.default_variants[0] + script = CREATE_SCRIPT.format( + identifier=identifier, variant=default_variant + ) data = { "script": script, "language": hou.scriptLanguage.Python, From 3f626080d6fd042e5f5a5505d8ff08ae298b8b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Mon, 7 Aug 2023 19:28:19 +0200 Subject: [PATCH 04/18] Remove default_variants class variable --- openpype/hosts/houdini/plugins/create/create_arnold_ass.py | 2 -- openpype/hosts/houdini/plugins/create/create_arnold_rop.py | 1 - openpype/hosts/houdini/plugins/create/create_karma_rop.py | 1 - openpype/hosts/houdini/plugins/create/create_mantra_rop.py | 1 - openpype/hosts/houdini/plugins/create/create_redshift_rop.py | 1 - openpype/hosts/houdini/plugins/create/create_vray_rop.py | 1 - 6 files changed, 7 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_arnold_ass.py b/openpype/hosts/houdini/plugins/create/create_arnold_ass.py index 72b12ddba20..12d08f7d838 100644 --- a/openpype/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/openpype/hosts/houdini/plugins/create/create_arnold_ass.py @@ -10,8 +10,6 @@ class CreateArnoldAss(plugin.HoudiniCreator): label = "Arnold ASS" family = "ass" icon = "magic" - default_variants = ["Main"] - # Default extension: `.ass` or `.ass.gz` # however calling HoudiniCreator.create() diff --git a/openpype/hosts/houdini/plugins/create/create_arnold_rop.py b/openpype/hosts/houdini/plugins/create/create_arnold_rop.py index 7d00e8b3e5a..b58c377a204 100644 --- a/openpype/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_arnold_rop.py @@ -9,7 +9,6 @@ class CreateArnoldRop(plugin.HoudiniCreator): label = "Arnold ROP" family = "arnold_rop" icon = "magic" - default_variants = ["master"] # Default extension ext = "exr" diff --git a/openpype/hosts/houdini/plugins/create/create_karma_rop.py b/openpype/hosts/houdini/plugins/create/create_karma_rop.py index cb9c6dd7115..4e1360ca45a 100644 --- a/openpype/hosts/houdini/plugins/create/create_karma_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_karma_rop.py @@ -11,7 +11,6 @@ class CreateKarmaROP(plugin.HoudiniCreator): label = "Karma ROP" family = "karma_rop" icon = "magic" - default_variants = ["master"] def create(self, subset_name, instance_data, pre_create_data): import hou # noqa diff --git a/openpype/hosts/houdini/plugins/create/create_mantra_rop.py b/openpype/hosts/houdini/plugins/create/create_mantra_rop.py index b2846d53fac..d2f0e735a88 100644 --- a/openpype/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_mantra_rop.py @@ -11,7 +11,6 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" family = "mantra_rop" icon = "magic" - default_variants = ["master"] def create(self, subset_name, instance_data, pre_create_data): import hou # noqa diff --git a/openpype/hosts/houdini/plugins/create/create_redshift_rop.py b/openpype/hosts/houdini/plugins/create/create_redshift_rop.py index 9bb1d58d8f6..e37718129c5 100644 --- a/openpype/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_redshift_rop.py @@ -13,7 +13,6 @@ class CreateRedshiftROP(plugin.HoudiniCreator): label = "Redshift ROP" family = "redshift_rop" icon = "magic" - default_variants = ["master"] ext = "exr" diff --git a/openpype/hosts/houdini/plugins/create/create_vray_rop.py b/openpype/hosts/houdini/plugins/create/create_vray_rop.py index a3ae01f5aeb..34c8906bb07 100644 --- a/openpype/hosts/houdini/plugins/create/create_vray_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_vray_rop.py @@ -14,7 +14,6 @@ class CreateVrayROP(plugin.HoudiniCreator): label = "VRay ROP" family = "vray_rop" icon = "magic" - default_variants = ["master"] ext = "exr" From adca11d44bed5c705d4c3e7d9740f732053b7779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Mon, 7 Aug 2023 19:28:58 +0200 Subject: [PATCH 05/18] Remove extra whitespace --- openpype/hosts/houdini/plugins/create/create_redshift_rop.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/create/create_redshift_rop.py b/openpype/hosts/houdini/plugins/create/create_redshift_rop.py index e37718129c5..1b8826a932c 100644 --- a/openpype/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_redshift_rop.py @@ -13,7 +13,6 @@ class CreateRedshiftROP(plugin.HoudiniCreator): label = "Redshift ROP" family = "redshift_rop" icon = "magic" - ext = "exr" def create(self, subset_name, instance_data, pre_create_data): From 84e3ade492bf51084824d520fb914a334a2361d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Mon, 7 Aug 2023 19:30:16 +0200 Subject: [PATCH 06/18] Revert merge conflict --- .../schemas/projects_schema/schemas/schema_maya_create.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json index 8faf3fcae86..10d5bff4455 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json @@ -12,9 +12,8 @@ "checkbox_key": "enabled", "children": [ { - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "label", + "label": "This plugin is not optional due to implicit creation through loading the \"rig\" family.\nThis family is also hidden from creation due to complexity in setup." }, { "type": "boolean", From b57c8a79c090332ce488dc6daad78c77f7d59240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Mon, 7 Aug 2023 19:33:46 +0200 Subject: [PATCH 07/18] Remove extra whitespace --- openpype/hosts/houdini/plugins/create/create_vray_rop.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/create/create_vray_rop.py b/openpype/hosts/houdini/plugins/create/create_vray_rop.py index 34c8906bb07..793a544fdff 100644 --- a/openpype/hosts/houdini/plugins/create/create_vray_rop.py +++ b/openpype/hosts/houdini/plugins/create/create_vray_rop.py @@ -14,7 +14,6 @@ class CreateVrayROP(plugin.HoudiniCreator): label = "VRay ROP" family = "vray_rop" icon = "magic" - ext = "exr" def create(self, subset_name, instance_data, pre_create_data): From bb42369af27992a125ba7110954cd5a365cad542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Mon, 7 Aug 2023 19:34:51 +0200 Subject: [PATCH 08/18] Fix merge conflict --- .../projects_schema/schemas/schema_maya_create.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json index 10d5bff4455..8dec0a8817f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json @@ -12,8 +12,9 @@ "checkbox_key": "enabled", "children": [ { - "type": "label", - "label": "This plugin is not optional due to implicit creation through loading the \"rig\" family.\nThis family is also hidden from creation due to complexity in setup." + "type": "boolean", + "key": "enabled", + "label": "Enabled" }, { "type": "boolean", @@ -119,12 +120,10 @@ "collapsible": true, "key": "CreateAnimation", "label": "Create Animation", - "checkbox_key": "enabled", "children": [ { - "type": "boolean", - "key": "enabled", - "label": "Enabled" + "type": "label", + "label": "This plugin is not optional due to implicit creation through loading the \"rig\" family.\nThis family is also hidden from creation due to complexity in setup." }, { "type": "boolean", From 92254e2abc32d2305497dadf9319ebdef040ee14 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Mon, 7 Aug 2023 19:53:32 +0200 Subject: [PATCH 09/18] Add a default variant to all Houdini creators --- openpype/hosts/houdini/api/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/houdini/api/plugin.py b/openpype/hosts/houdini/api/plugin.py index 70c837205ed..3d3b0e49b9b 100644 --- a/openpype/hosts/houdini/api/plugin.py +++ b/openpype/hosts/houdini/api/plugin.py @@ -169,6 +169,8 @@ class HoudiniCreator(NewCreator, HoudiniCreatorBase): selected_nodes = [] settings_name = None + default_variant = "Main" + def create(self, subset_name, instance_data, pre_create_data): try: self.selected_nodes = [] From 9604656017cf06fb444435dcd37c15e8681719ee Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Mon, 7 Aug 2023 20:21:13 +0200 Subject: [PATCH 10/18] Add default variant on all creators --- .../defaults/project_settings/houdini.json | 29 +++++++++++++++---- .../defaults/project_settings/maya.json | 23 +++++++++++++++ .../schemas/schema_houdini_create.json | 5 ++++ .../schemas/schema_maya_create.json | 5 ++++ .../schemas/template_create_plugin.json | 5 ++++ 5 files changed, 62 insertions(+), 5 deletions(-) diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 389fdc6d96d..cf5d1c93d51 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -14,80 +14,99 @@ "create": { "CreateArnoldAss": { "enabled": true, + "default_variant": "Main", "default_variants": [], "ext": ".ass" }, "CreateArnoldRop": { "enabled": true, - "default_variants": [] + "default_variant": "master", + "default_variants": ["master"] }, "CreateAlembicCamera": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateBGEO": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateCompositeSequence": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateHDA": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateKarmaROP": { "enabled": true, - "default_variants": [] + "default_variant": "master", + "default_variants": ["master"] }, "CreateMantraROP": { "enabled": true, - "default_variants": [] + "default_variant": "master", + "default_variants": ["master"] }, "CreatePointCache": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateRedshiftProxy": { "enabled": true, - "default_variants": [] + "default_variant": "master", + "default_variants": ["master"] }, "CreateRedshiftROP": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateRemotePublish": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateReview": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateUSD": { "enabled": false, + "default_variant": "Main", "default_variants": [] }, "CreateUSDModel": { "enabled": false, + "default_variant": "Main", "default_variants": [] }, "USDCreateShadingWorkspace": { "enabled": false, + "default_variant": "Main", "default_variants": [] }, "CreateUSDRender": { "enabled": false, + "default_variant": "Main", "default_variants": [] }, "CreateVDBCache": { "enabled": true, + "default_variant": "Main", "default_variants": [] }, "CreateVrayROP": { "enabled": true, - "default_variants": [] + "default_variant": "master", + "default_variants": ["master"] } }, "publish": { diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index b9817fe4005..f53501c7ac1 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -521,18 +521,21 @@ "enabled": true, "make_tx": true, "rs_tex": false, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateRender": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateUnrealStaticMesh": { "enabled": true, + "default_variant": "", "default_variants": [ "", "_Main" @@ -547,6 +550,7 @@ }, "CreateUnrealSkeletalMesh": { "enabled": true, + "default_variant": "", "default_variants": [], "joint_hints": "jnt_org" }, @@ -560,6 +564,7 @@ "write_face_sets": false, "include_parent_hierarchy": false, "include_user_defined_attributes": false, + "default_variant": "Main", "default_variants": [ "Main" ] @@ -568,6 +573,7 @@ "enabled": true, "write_color_sets": false, "write_face_sets": false, + "default_variant": "Main", "default_variants": [ "Main", "Proxy", @@ -579,6 +585,7 @@ "write_color_sets": false, "write_face_sets": false, "include_user_defined_attributes": false, + "default_variant": "Main", "default_variants": [ "Main" ] @@ -587,12 +594,14 @@ "enabled": true, "write_color_sets": false, "write_face_sets": false, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateReview": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ], @@ -600,6 +609,7 @@ }, "CreateAss": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ], @@ -622,60 +632,70 @@ "enabled": true, "vrmesh": true, "alembic": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMultiverseUsd": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMultiverseUsdComp": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMultiverseUsdOver": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateAssembly": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateCamera": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateLayout": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMayaScene": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateRenderSetup": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateRig": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main", "Sim", @@ -684,6 +704,7 @@ }, "CreateSetDress": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main", "Anim" @@ -691,12 +712,14 @@ }, "CreateVRayScene": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateYetiRig": { "enabled": true, + "default_variant": "Main", "default_variants": [ "Main" ] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json index a1736c811d4..6e1eaf71465 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json @@ -16,6 +16,11 @@ "key": "enabled", "label": "Enabled" }, + { + "type": "text", + "key": "default_variant", + "label": "Default variant" + }, { "type": "list", "key": "default_variants", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json index 8dec0a8817f..a8105bdb5d9 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json @@ -387,6 +387,11 @@ "key": "alembic", "label": "Alembic" }, + { + "type": "text", + "key": "default_variant", + "label": "Default variant" + }, { "type": "list", "key": "default_variants", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json index 3d2ed9f3d4c..7384060625f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json @@ -11,6 +11,11 @@ "key": "enabled", "label": "Enabled" }, + { + "type": "text", + "key": "default_variant", + "label": "Default variant" + }, { "type": "list", "key": "default_variants", From 8a02654dbc133563fe57a0f7190fd7f72b2210ec Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Mon, 7 Aug 2023 20:24:31 +0200 Subject: [PATCH 11/18] Fill up default variants --- .../defaults/project_settings/houdini.json | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index cf5d1c93d51..630b1897430 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -15,7 +15,7 @@ "CreateArnoldAss": { "enabled": true, "default_variant": "Main", - "default_variants": [], + "default_variants": ["Main"], "ext": ".ass" }, "CreateArnoldRop": { @@ -26,22 +26,22 @@ "CreateAlembicCamera": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateBGEO": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateCompositeSequence": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateHDA": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateKarmaROP": { "enabled": true, @@ -56,7 +56,7 @@ "CreatePointCache": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateRedshiftProxy": { "enabled": true, @@ -66,42 +66,42 @@ "CreateRedshiftROP": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateRemotePublish": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateReview": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateUSD": { "enabled": false, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateUSDModel": { "enabled": false, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "USDCreateShadingWorkspace": { "enabled": false, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateUSDRender": { "enabled": false, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateVDBCache": { "enabled": true, "default_variant": "Main", - "default_variants": [] + "default_variants": ["Main"] }, "CreateVrayROP": { "enabled": true, From 20479595061f2e08c9ca3b3bb710cbe0f3147956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Tue, 8 Aug 2023 20:06:56 +0200 Subject: [PATCH 12/18] Make use of `get_default_variant` function --- openpype/hosts/houdini/api/creator_node_shelves.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/openpype/hosts/houdini/api/creator_node_shelves.py b/openpype/hosts/houdini/api/creator_node_shelves.py index c724acb16df..01da2fc3e1d 100644 --- a/openpype/hosts/houdini/api/creator_node_shelves.py +++ b/openpype/hosts/houdini/api/creator_node_shelves.py @@ -196,13 +196,8 @@ def install(): key = "openpype_create.{}".format(identifier) log.debug(f"Registering {key}") - default_variant = "Main" - if hasattr(creator, "default_variant"): - default_variant = creator.default_variant - elif hasattr(creator, "default_variants"): - default_variant = creator.default_variants[0] script = CREATE_SCRIPT.format( - identifier=identifier, variant=default_variant + identifier=identifier, variant=creator.get_default_variant() ) data = { "script": script, From 2f663bc011ef4bd934f9cc7d690dfd3fd4769eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Tue, 8 Aug 2023 20:20:08 +0200 Subject: [PATCH 13/18] Remove 'default_variant' from schemas --- .../defaults/project_settings/houdini.json | 57 +++++++------------ .../defaults/project_settings/maya.json | 24 -------- .../schemas/schema_houdini_create.json | 5 -- .../schemas/template_create_plugin.json | 5 -- 4 files changed, 19 insertions(+), 72 deletions(-) diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 630b1897430..512690bfd71 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -14,99 +14,80 @@ "create": { "CreateArnoldAss": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"], + "default_variants": ["main"], "ext": ".ass" }, "CreateArnoldRop": { "enabled": true, - "default_variant": "master", - "default_variants": ["master"] + "default_variants": ["main"] }, "CreateAlembicCamera": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateBGEO": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateCompositeSequence": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateHDA": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateKarmaROP": { "enabled": true, - "default_variant": "master", - "default_variants": ["master"] + "default_variants": ["main"] }, "CreateMantraROP": { "enabled": true, - "default_variant": "master", - "default_variants": ["master"] + "default_variants": ["main"] }, "CreatePointCache": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateRedshiftProxy": { "enabled": true, - "default_variant": "master", - "default_variants": ["master"] + "default_variants": ["main"] }, "CreateRedshiftROP": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateRemotePublish": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateReview": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateUSD": { "enabled": false, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateUSDModel": { "enabled": false, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "USDCreateShadingWorkspace": { "enabled": false, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateUSDRender": { "enabled": false, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateVDBCache": { "enabled": true, - "default_variant": "Main", - "default_variants": ["Main"] + "default_variants": ["main"] }, "CreateVrayROP": { "enabled": true, - "default_variant": "master", - "default_variants": ["master"] + "default_variants": ["main"] } }, "publish": { diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index f53501c7ac1..e1c6d2d827b 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -521,21 +521,18 @@ "enabled": true, "make_tx": true, "rs_tex": false, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateRender": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateUnrealStaticMesh": { "enabled": true, - "default_variant": "", "default_variants": [ "", "_Main" @@ -550,7 +547,6 @@ }, "CreateUnrealSkeletalMesh": { "enabled": true, - "default_variant": "", "default_variants": [], "joint_hints": "jnt_org" }, @@ -559,12 +555,10 @@ "publish_mip_map": true }, "CreateAnimation": { - "enabled": false, "write_color_sets": false, "write_face_sets": false, "include_parent_hierarchy": false, "include_user_defined_attributes": false, - "default_variant": "Main", "default_variants": [ "Main" ] @@ -573,7 +567,6 @@ "enabled": true, "write_color_sets": false, "write_face_sets": false, - "default_variant": "Main", "default_variants": [ "Main", "Proxy", @@ -585,7 +578,6 @@ "write_color_sets": false, "write_face_sets": false, "include_user_defined_attributes": false, - "default_variant": "Main", "default_variants": [ "Main" ] @@ -594,14 +586,12 @@ "enabled": true, "write_color_sets": false, "write_face_sets": false, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateReview": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ], @@ -609,7 +599,6 @@ }, "CreateAss": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ], @@ -632,70 +621,60 @@ "enabled": true, "vrmesh": true, "alembic": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMultiverseUsd": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMultiverseUsdComp": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMultiverseUsdOver": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateAssembly": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateCamera": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateLayout": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateMayaScene": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateRenderSetup": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateRig": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main", "Sim", @@ -704,7 +683,6 @@ }, "CreateSetDress": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main", "Anim" @@ -712,14 +690,12 @@ }, "CreateVRayScene": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] }, "CreateYetiRig": { "enabled": true, - "default_variant": "Main", "default_variants": [ "Main" ] diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json index 6e1eaf71465..a1736c811d4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json @@ -16,11 +16,6 @@ "key": "enabled", "label": "Enabled" }, - { - "type": "text", - "key": "default_variant", - "label": "Default variant" - }, { "type": "list", "key": "default_variants", diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json index 7384060625f..3d2ed9f3d4c 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json @@ -11,11 +11,6 @@ "key": "enabled", "label": "Enabled" }, - { - "type": "text", - "key": "default_variant", - "label": "Default variant" - }, { "type": "list", "key": "default_variants", From d06b9dcdca4e6af00789a77806ed67f240bea4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Tue, 8 Aug 2023 20:21:02 +0200 Subject: [PATCH 14/18] Remove fallback default_variant from Houdini base creator --- openpype/hosts/houdini/api/plugin.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openpype/hosts/houdini/api/plugin.py b/openpype/hosts/houdini/api/plugin.py index 3d3b0e49b9b..70c837205ed 100644 --- a/openpype/hosts/houdini/api/plugin.py +++ b/openpype/hosts/houdini/api/plugin.py @@ -169,8 +169,6 @@ class HoudiniCreator(NewCreator, HoudiniCreatorBase): selected_nodes = [] settings_name = None - default_variant = "Main" - def create(self, subset_name, instance_data, pre_create_data): try: self.selected_nodes = [] From 0703c1c0d18206966cbb37885f9dc96b0e4336aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Tue, 8 Aug 2023 20:22:08 +0200 Subject: [PATCH 15/18] Remove default_variant from Maya schema --- .../schemas/projects_schema/schemas/schema_maya_create.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json index a8105bdb5d9..8dec0a8817f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create.json @@ -387,11 +387,6 @@ "key": "alembic", "label": "Alembic" }, - { - "type": "text", - "key": "default_variant", - "label": "Default variant" - }, { "type": "list", "key": "default_variants", From ef50ba5130d6be0b6f709ef60aa49181c67016a4 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Wed, 9 Aug 2023 15:25:48 +0200 Subject: [PATCH 16/18] Remove schema setting changes from PR --- .../defaults/project_settings/houdini.json | 56 ++------- .../defaults/project_settings/maya.json | 26 ++-- .../schemas/schema_houdini_create.json | 113 +++++++----------- .../schemas/schema_maya_create_render.json | 2 +- .../schemas/template_create_plugin.json | 4 +- 5 files changed, 69 insertions(+), 132 deletions(-) diff --git a/openpype/settings/defaults/project_settings/houdini.json b/openpype/settings/defaults/project_settings/houdini.json index 512690bfd71..a5256aad8be 100644 --- a/openpype/settings/defaults/project_settings/houdini.json +++ b/openpype/settings/defaults/project_settings/houdini.json @@ -14,80 +14,48 @@ "create": { "CreateArnoldAss": { "enabled": true, - "default_variants": ["main"], + "default_variants": [], "ext": ".ass" }, - "CreateArnoldRop": { - "enabled": true, - "default_variants": ["main"] - }, "CreateAlembicCamera": { "enabled": true, - "default_variants": ["main"] - }, - "CreateBGEO": { - "enabled": true, - "default_variants": ["main"] + "defaults": [] }, "CreateCompositeSequence": { "enabled": true, - "default_variants": ["main"] - }, - "CreateHDA": { - "enabled": true, - "default_variants": ["main"] - }, - "CreateKarmaROP": { - "enabled": true, - "default_variants": ["main"] - }, - "CreateMantraROP": { - "enabled": true, - "default_variants": ["main"] + "defaults": [] }, "CreatePointCache": { "enabled": true, - "default_variants": ["main"] - }, - "CreateRedshiftProxy": { - "enabled": true, - "default_variants": ["main"] + "defaults": [] }, "CreateRedshiftROP": { "enabled": true, - "default_variants": ["main"] + "defaults": [] }, "CreateRemotePublish": { "enabled": true, - "default_variants": ["main"] + "defaults": [] }, - "CreateReview": { + "CreateVDBCache": { "enabled": true, - "default_variants": ["main"] + "defaults": [] }, "CreateUSD": { "enabled": false, - "default_variants": ["main"] + "defaults": [] }, "CreateUSDModel": { "enabled": false, - "default_variants": ["main"] + "defaults": [] }, "USDCreateShadingWorkspace": { "enabled": false, - "default_variants": ["main"] + "defaults": [] }, "CreateUSDRender": { "enabled": false, - "default_variants": ["main"] - }, - "CreateVDBCache": { - "enabled": true, - "default_variants": ["main"] - }, - "CreateVrayROP": { - "enabled": true, - "default_variants": ["main"] + "defaults": [] } }, "publish": { diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index e1c6d2d827b..342d2bfb2a0 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -527,7 +527,7 @@ }, "CreateRender": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, @@ -627,55 +627,55 @@ }, "CreateMultiverseUsd": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateMultiverseUsdComp": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateMultiverseUsdOver": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateAssembly": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateCamera": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateLayout": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateMayaScene": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateRenderSetup": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateRig": { "enabled": true, - "default_variants": [ + "defaults": [ "Main", "Sim", "Cloth" @@ -683,20 +683,20 @@ }, "CreateSetDress": { "enabled": true, - "default_variants": [ + "defaults": [ "Main", "Anim" ] }, "CreateVRayScene": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] }, "CreateYetiRig": { "enabled": true, - "default_variants": [ + "defaults": [ "Main" ] } diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json index a1736c811d4..4eb976d7b60 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json @@ -1,83 +1,60 @@ { - "type": "dict", - "collapsible": true, - "key": "create", - "label": "Creator plugins", - "children": [ - { - "type": "dict", - "collapsible": true, - "key": "CreateArnoldAss", - "label": "Create Arnold Ass", - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "list", - "key": "default_variants", - "label": "Default Subsets", - "object_type": "text" - }, - { - "type": "enum", - "key": "ext", - "label": "Default Output Format (extension)", - "multiselection": false, - "enum_items": [ - { - ".ass": ".ass" - }, - { - ".ass.gz": ".ass.gz (gzipped)" - } - ] - } - ] + "type": "dict", + "collapsible": true, + "key": "create", + "label": "Creator plugins", + "children": [ + { + "type": "dict", + "collapsible": true, + "key": "CreateArnoldAss", + "label": "Create Arnold Ass", + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "list", + "key": "default_variants", + "label": "Default Subsets", + "object_type": "text" + }, + { + "type": "enum", + "key": "ext", + "label": "Default Output Format (extension)", + "multiselection": false, + "enum_items": [ + { + ".ass": ".ass" + }, + { + ".ass.gz": ".ass.gz (gzipped)" + } + ] + } + ] + }, { "type": "schema_template", "name": "template_create_plugin", "template_data": [ - { - "key": "CreateArnoldRop", - "label": "Create Arnold ROP" - }, { "key": "CreateAlembicCamera", "label": "Create Alembic Camera" }, - { - "key": "CreateBGEO", - "label": "Create Houdini BGEO" - }, { "key": "CreateCompositeSequence", "label": "Create Composite (Image Sequence)" }, - { - "key": "CreateKarmaROP", - "label": "Create Karma ROP" - }, - { - "key": "CreateMantraROP", - "label": "Create Mantra ROP" - }, - { - "key": "CreateHDA", - "label": "Create HDA" - }, { "key": "CreatePointCache", "label": "Create Point Cache" }, - { - "key": "CreateRedshiftProxy", - "label": "Create Redshift Proxy" - }, { "key": "CreateRedshiftROP", "label": "Create Redshift ROP" @@ -87,8 +64,8 @@ "label": "Create Remote Publish" }, { - "key": "CreateReview", - "label": "Create Review" + "key": "CreateVDBCache", + "label": "Create VDB Cache" }, { "key": "CreateUSD", @@ -105,14 +82,6 @@ { "key": "CreateUSDRender", "label": "Create USD Render" - }, - { - "key": "CreateVDBCache", - "label": "Create VDB Cache" - }, - { - "key": "CreateVrayROP", - "label": "Create VRay ROP" } ] } diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json index 9d7432fe511..bc203a05145 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_create_render.json @@ -12,7 +12,7 @@ }, { "type": "list", - "key": "default_variants", + "key": "defaults", "label": "Default Subsets", "object_type": "text" } diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json index 3d2ed9f3d4c..14d15e78401 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/template_create_plugin.json @@ -13,8 +13,8 @@ }, { "type": "list", - "key": "default_variants", - "label": "Default Variants", + "key": "defaults", + "label": "Default Subsets", "object_type": "text" } ] From a9fd8349fc27b4744b19d6a125a25440de973917 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Wed, 9 Aug 2023 15:27:08 +0200 Subject: [PATCH 17/18] Remove whitespace differences --- .../schemas/schema_houdini_create.json | 170 +++++++++--------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json index 4eb976d7b60..64d157d281a 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_houdini_create.json @@ -1,89 +1,89 @@ { - "type": "dict", - "collapsible": true, - "key": "create", - "label": "Creator plugins", - "children": [ - { - "type": "dict", - "collapsible": true, - "key": "CreateArnoldAss", - "label": "Create Arnold Ass", - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "type": "list", - "key": "default_variants", - "label": "Default Subsets", - "object_type": "text" - }, - { - "type": "enum", - "key": "ext", - "label": "Default Output Format (extension)", - "multiselection": false, - "enum_items": [ - { - ".ass": ".ass" - }, - { - ".ass.gz": ".ass.gz (gzipped)" - } - ] - } - ] - - }, - { - "type": "schema_template", - "name": "template_create_plugin", - "template_data": [ - { - "key": "CreateAlembicCamera", - "label": "Create Alembic Camera" - }, - { - "key": "CreateCompositeSequence", - "label": "Create Composite (Image Sequence)" - }, + "type": "dict", + "collapsible": true, + "key": "create", + "label": "Creator plugins", + "children": [ { - "key": "CreatePointCache", - "label": "Create Point Cache" - }, - { - "key": "CreateRedshiftROP", - "label": "Create Redshift ROP" - }, - { - "key": "CreateRemotePublish", - "label": "Create Remote Publish" - }, - { - "key": "CreateVDBCache", - "label": "Create VDB Cache" - }, - { - "key": "CreateUSD", - "label": "Create USD" - }, - { - "key": "CreateUSDModel", - "label": "Create USD Model" - }, - { - "key": "USDCreateShadingWorkspace", - "label": "Create USD Shading Workspace" + "type": "dict", + "collapsible": true, + "key": "CreateArnoldAss", + "label": "Create Arnold Ass", + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "list", + "key": "default_variants", + "label": "Default Subsets", + "object_type": "text" + }, + { + "type": "enum", + "key": "ext", + "label": "Default Output Format (extension)", + "multiselection": false, + "enum_items": [ + { + ".ass": ".ass" + }, + { + ".ass.gz": ".ass.gz (gzipped)" + } + ] + } + ] + }, - { - "key": "CreateUSDRender", - "label": "Create USD Render" - } - ] - } - ] + { + "type": "schema_template", + "name": "template_create_plugin", + "template_data": [ + { + "key": "CreateAlembicCamera", + "label": "Create Alembic Camera" + }, + { + "key": "CreateCompositeSequence", + "label": "Create Composite (Image Sequence)" + }, + { + "key": "CreatePointCache", + "label": "Create Point Cache" + }, + { + "key": "CreateRedshiftROP", + "label": "Create Redshift ROP" + }, + { + "key": "CreateRemotePublish", + "label": "Create Remote Publish" + }, + { + "key": "CreateVDBCache", + "label": "Create VDB Cache" + }, + { + "key": "CreateUSD", + "label": "Create USD" + }, + { + "key": "CreateUSDModel", + "label": "Create USD Model" + }, + { + "key": "USDCreateShadingWorkspace", + "label": "Create USD Shading Workspace" + }, + { + "key": "CreateUSDRender", + "label": "Create USD Render" + } + ] + } + ] } From ab3d94fdb6f607b958704a06d3fa87187ac03d71 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Thu, 17 Aug 2023 15:59:46 -0700 Subject: [PATCH 18/18] Move variant query to the create_interactive function --- .../hosts/houdini/api/creator_node_shelves.py | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/openpype/hosts/houdini/api/creator_node_shelves.py b/openpype/hosts/houdini/api/creator_node_shelves.py index 01da2fc3e1d..1f9fef7417b 100644 --- a/openpype/hosts/houdini/api/creator_node_shelves.py +++ b/openpype/hosts/houdini/api/creator_node_shelves.py @@ -35,11 +35,11 @@ CREATE_SCRIPT = """ from openpype.hosts.houdini.api.creator_node_shelves import create_interactive -create_interactive("{identifier}", "{variant}", **kwargs) +create_interactive("{identifier}", **kwargs) """ -def create_interactive(creator_identifier, default_variant, **kwargs): +def create_interactive(creator_identifier, **kwargs): """Create a Creator using its identifier interactively. This is used by the generated shelf tools as callback when a user selects @@ -57,29 +57,32 @@ def create_interactive(creator_identifier, default_variant, **kwargs): list: The created instances. """ + host = registered_host() + context = CreateContext(host) + creator = context.manual_creators.get(creator_identifier) + if not creator: + raise RuntimeError("Invalid creator identifier: {}".format( + creator_identifier) + ) # TODO Use Qt instead - result, variant = hou.ui.readInput("Define variant name", - buttons=("Ok", "Cancel"), - initial_contents=default_variant, - title="Define variant", - help="Set the variant for the " - "publish instance", - close_choice=1) + result, variant = hou.ui.readInput( + "Define variant name", + buttons=("Ok", "Cancel"), + initial_contents=creator.get_default_variant(), + title="Define variant", + help="Set the variant for the publish instance", + close_choice=1 + ) + if result == 1: # User interrupted return + variant = variant.strip() if not variant: raise RuntimeError("Empty variant value entered.") - host = registered_host() - context = CreateContext(host) - creator = context.manual_creators.get(creator_identifier) - if not creator: - raise RuntimeError("Invalid creator identifier: " - "{}".format(creator_identifier)) - # TODO: Once more elaborate unique create behavior should exist per Creator # instead of per network editor area then we should move this from here # to a method on the Creators for which this could be the default @@ -196,9 +199,7 @@ def install(): key = "openpype_create.{}".format(identifier) log.debug(f"Registering {key}") - script = CREATE_SCRIPT.format( - identifier=identifier, variant=creator.get_default_variant() - ) + script = CREATE_SCRIPT.format(identifier=identifier) data = { "script": script, "language": hou.scriptLanguage.Python,