Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Maya: write color sets in create_model #3690

Merged
merged 7 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions openpype/hosts/maya/plugins/create/create_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ class CreateModel(plugin.Creator):
family = "model"
icon = "cube"
defaults = ["Main", "Proxy", "_MD", "_HD", "_LD"]

write_color_sets = False
def __init__(self, *args, **kwargs):
super(CreateModel, self).__init__(*args, **kwargs)

# Vertex colors with the geometry
self.data["writeColorSets"] = False
self.data["writeColorSets"] = self.write_color_sets
self.data["writeFaceSets"] = False

# Include attributes by attribute name or prefix
Expand Down
6 changes: 5 additions & 1 deletion openpype/hosts/maya/plugins/create/create_rig.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ class CreateRig(plugin.Creator):
label = "Rig"
family = "rig"
icon = "wheelchair"
write_color_sets = False

def __init__(self, *args, **kwargs):
super(CreateRig, self).__init__(*args, **kwargs)
self.data["writeColorSets"] = self.write_color_sets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't make much sense since the rig comes out as maya scene and does not strip any color set data. Animation instances however would extract as Alembic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are trying to unify colors sets (and other sets) flow and even though currently rig creator can only output Maya scene we plan to add fbx representation (replacing the skeletal mesh) so it will make sense then.

It is not influencing anything currently but we thought it would be good to have it there for future use and consistency.

Copy link
Collaborator

@BigRoy BigRoy Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not influencing anything currently but we thought it would be good to have it there for future use and consistency

I see what you're going for - but it'd just confuse the artists into thinking it would do something useful for the rig family.

Also, most usual "rigs" won't be suitable to do an "fbx rig" export for - and then also automate animation instance creation for in maya when loading them again. I'd say fbxRig is a family of its own and should also come with its own creator, validators, etc.

If we're adding the option we should make the extractor capable of removing the values when publishing the maya scene to avoid any confusion whatsoever. Which is not an easy task for rigs with complex history.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we have to decide if we remove the component sets from Rig Creator @antirotor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After internal discussion, we decided to keep the sets for Rig Creator there. We understand it is not very clean from the code perspective as these options are actually modifying the animation output, not the rig output itself, but as it does not have its own creator we gave preference to keeping all attributes settings in one place in preferences and not moving it outside just for the rig.
We think it will be more consistent from the user's point of view.


def process(self):

with lib.undo_chunk():
instance = super(CreateRig, self).process()

self.log.info("Creating Rig instance set up ...")
controls = cmds.sets(name="controls_SET", empty=True)
pointcache = cmds.sets(name="out_SET", empty=True)
Expand Down
4 changes: 3 additions & 1 deletion openpype/settings/defaults/project_settings/maya.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"RenderSettings": {
"apply_render_settings": true,
"default_render_image_folder": "",
"default_render_image_folder": "renders",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unrelated to this PR, other than that I'm happy to merge

"aov_separator": "underscore",
"reset_current_frame": false,
"arnold_renderer": {
Expand Down Expand Up @@ -163,6 +163,7 @@
},
"CreateModel": {
"enabled": true,
"write_color_sets": false,
"defaults": [
"Main",
"Proxy",
Expand All @@ -183,6 +184,7 @@
},
"CreateRig": {
"enabled": true,
"write_color_sets": false,
"defaults": [
"Main",
"Sim",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,56 @@
}
]
},
{
"type": "dict",
"collapsible": true,
"key": "CreateModel",
"label": "Create Model",
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "boolean",
"key": "write_color_sets",
"label": "Write Color Sets"
},
{
"type": "list",
"key": "defaults",
"label": "Default Subsets",
"object_type": "text"
}
]
},
{
"type": "dict",
"collapsible": true,
"key": "CreateRig",
"label": "Create Rig",
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "boolean",
"key": "write_color_sets",
"label": "Write Color Sets"
},
{
"type": "list",
"key": "defaults",
"label": "Default Subsets",
"object_type": "text"
}
]
},
{
"type": "dict",
"collapsible": true,
Expand All @@ -160,7 +210,7 @@
}
]
},

{
"type": "schema_template",
"name": "template_create_plugin",
Expand Down Expand Up @@ -197,10 +247,6 @@
"key": "CreateMayaScene",
"label": "Create Maya Scene"
},
{
"key": "CreateModel",
"label": "Create Model"
},
{
"key": "CreateRenderSetup",
"label": "Create Render Setup"
Expand All @@ -209,10 +255,6 @@
"key": "CreateReview",
"label": "Create Review"
},
{
"key": "CreateRig",
"label": "Create Rig"
},
{
"key": "CreateSetDress",
"label": "Create Set Dress"
Expand Down