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 4 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
3 changes: 2 additions & 1 deletion openpype/hosts/maya/plugins/create/create_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreateAnimation(plugin.Creator):
family = "animation"
icon = "male"
write_color_sets = False
write_face_sets = False

def __init__(self, *args, **kwargs):
super(CreateAnimation, self).__init__(*args, **kwargs)
Expand All @@ -24,7 +25,7 @@ def __init__(self, *args, **kwargs):

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

# Include only renderable visible shapes.
# Skips locators and empty transforms
Expand Down
7 changes: 4 additions & 3 deletions openpype/hosts/maya/plugins/create/create_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ class CreateModel(plugin.Creator):
family = "model"
icon = "cube"
defaults = ["Main", "Proxy", "_MD", "_HD", "_LD"]

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

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

# Include attributes by attribute name or prefix
self.data["attr"] = ""
Expand Down
4 changes: 3 additions & 1 deletion openpype/hosts/maya/plugins/create/create_pointcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreatePointCache(plugin.Creator):
family = "pointcache"
icon = "gears"
write_color_sets = False
write_face_sets = False

def __init__(self, *args, **kwargs):
super(CreatePointCache, self).__init__(*args, **kwargs)
Expand All @@ -21,7 +22,8 @@ def __init__(self, *args, **kwargs):

# Vertex colors with the geometry.
self.data["writeColorSets"] = self.write_color_sets
self.data["writeFaceSets"] = False # Vertex colors with the geometry.
# Vertex colors with the geometry.
self.data["writeFaceSets"] = self.write_face_sets
self.data["renderableOnly"] = False # Only renderable visible shapes
self.data["visibleOnly"] = False # only nodes that are visible
self.data["includeParentHierarchy"] = False # Include parent groups
Expand Down
8 changes: 7 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,18 @@ class CreateRig(plugin.Creator):
label = "Rig"
family = "rig"
icon = "wheelchair"
write_color_sets = False
write_face_sets = False

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

@mkolar mkolar Sep 28, 2022

Choose a reason for hiding this comment

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

@BigRoy is correct. This code has absolutely no bearing on any result anywhere. When we load the rig, an animation instance is created automatically, but that uses the settings from animation creator, rather than rig. So this introduces two attributes that are just extra and will create confusion.

It would of course be possible to have these parsed into the animation instance that is created, so that rigger could choose what values should be used down the line as starting point, but I'm not sure that it's actually worth the hassle at the moment, considering that simply adding the attributes to the animation creator solves the immediate issue for the upcoming production.

that being said, the confusion between animation family, animation creator and how and if they are affected from the rig, is almighty and should be addressed. I'm not convinced it is the responsibility of this PR though, so I reckon let's just remove the obsolete code from the rig creator here and separately have a look at how to clean up the rig -> animation workflow to make it a bit more clear.


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
8 changes: 7 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 @@ -102,13 +102,15 @@
"CreateAnimation": {
"enabled": true,
"write_color_sets": false,
"write_face_sets": false,
"defaults": [
"Main"
]
},
"CreatePointCache": {
"enabled": true,
"write_color_sets": false,
"write_face_sets": false,
"defaults": [
"Main"
]
Expand Down Expand Up @@ -163,6 +165,8 @@
},
"CreateModel": {
"enabled": true,
"write_color_sets": false,
"write_face_sets": false,
"defaults": [
"Main",
"Proxy",
Expand All @@ -183,6 +187,8 @@
},
"CreateRig": {
"enabled": true,
"write_color_sets": false,
"write_face_sets": false,
"defaults": [
"Main",
"Sim",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,71 @@
"key": "write_color_sets",
"label": "Write Color Sets"
},
{
"type": "boolean",
"key": "write_face_sets",
"label": "Write Face Sets"
},
{
"type": "list",
"key": "defaults",
"label": "Default Subsets",
"object_type": "text"
}
]
},
{
"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": "boolean",
"key": "write_face_sets",
"label": "Write Face 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": "boolean",
"key": "write_face_sets",
"label": "Write Face Sets"
},
{
"type": "list",
"key": "defaults",
Expand All @@ -152,6 +217,11 @@
"key": "write_color_sets",
"label": "Write Color Sets"
},
{
"type": "boolean",
"key": "write_face_sets",
"label": "Write Face Sets"
},
{
"type": "list",
"key": "defaults",
Expand All @@ -160,7 +230,7 @@
}
]
},

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