From 273d87f8b8dec02b80e07da9eea038ac840f319b Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 7 Apr 2023 10:44:08 +0100 Subject: [PATCH] Fix flat lighting and sync labels with project settings. --- openpype/hosts/maya/api/lib.py | 12 ++++++++++-- openpype/hosts/maya/plugins/create/create_review.py | 2 +- .../hosts/maya/plugins/publish/collect_review.py | 4 +--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 931c0f9e5b..f94b32d917 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -112,8 +112,16 @@ FLOAT_FPS = {23.98, 23.976, 29.97, 47.952, 59.94} RENDERLIKE_INSTANCE_FAMILIES = ["rendering", "vrayscene"] -DISPLAY_LIGHTS = [ - "project_settings", "default", "all", "selected", "active", "none" +DISPLAY_LIGHTS_VALUES = [ + "project_settings", "default", "all", "selected", "flat", "none" +] +DISPLAY_LIGHTS_LABELS = [ + "Use Project Settings", + "Default Lighting", + "All Lights", + "Selected Lights", + "Flat Lighting", + "No Lights" ] diff --git a/openpype/hosts/maya/plugins/create/create_review.py b/openpype/hosts/maya/plugins/create/create_review.py index de92bbb6b5..094c9ebf8c 100644 --- a/openpype/hosts/maya/plugins/create/create_review.py +++ b/openpype/hosts/maya/plugins/create/create_review.py @@ -47,6 +47,6 @@ class CreateReview(plugin.Creator): data["imagePlane"] = self.imagePlane data["transparency"] = self.transparency data["panZoom"] = self.panZoom - data["displayLights"] = lib.DISPLAY_LIGHTS + data["displayLights"] = lib.DISPLAY_LIGHTS_LABELS self.data = data diff --git a/openpype/hosts/maya/plugins/publish/collect_review.py b/openpype/hosts/maya/plugins/publish/collect_review.py index 516a83de64..3ca45deb3a 100644 --- a/openpype/hosts/maya/plugins/publish/collect_review.py +++ b/openpype/hosts/maya/plugins/publish/collect_review.py @@ -150,10 +150,8 @@ class CollectReview(pyblish.api.InstancePlugin): # Convert enum attribute index to string. index = instance.data.get("displayLights", 0) - display_lights = lib.DISPLAY_LIGHTS[index] + display_lights = lib.DISPLAY_LIGHTS_VALUES[index] if display_lights == "project_settings": - # project_settings/maya/publish/ExtractPlayblast/capture_preset - # /Viewport Options/displayLights settings = instance.context.data["project_settings"] settings = settings["maya"]["publish"]["ExtractPlayblast"] settings = settings["capture_preset"]["Viewport Options"]