diff --git a/openpype/hosts/maya/plugins/create/create_multiverse_look.py b/openpype/hosts/maya/plugins/create/create_multiverse_look.py index 44977efca0..3fc834a700 100644 --- a/openpype/hosts/maya/plugins/create/create_multiverse_look.py +++ b/openpype/hosts/maya/plugins/create/create_multiverse_look.py @@ -12,4 +12,4 @@ class CreateMultiverseLook(plugin.Creator): def __init__(self, *args, **kwargs): super(CreateMultiverseLook, self).__init__(*args, **kwargs) self.data["fileFormat"] = ["usda", "usd"] - self.data["expectMipMap"] = True + self.data["publishMipMap"] = True diff --git a/openpype/hosts/maya/plugins/publish/collect_multiverse_look.py b/openpype/hosts/maya/plugins/publish/collect_multiverse_look.py index e77245bca5..edf40a27a6 100644 --- a/openpype/hosts/maya/plugins/publish/collect_multiverse_look.py +++ b/openpype/hosts/maya/plugins/publish/collect_multiverse_look.py @@ -17,7 +17,7 @@ SHAPE_ATTRS = ["castsShadows", "opposite"] SHAPE_ATTRS = set(SHAPE_ATTRS) -COLOUR_SPACES = ['sRGB'] +COLOUR_SPACES = ['sRGB', 'linear', 'auto'] MIPMAP_EXTENSIONS = ['tdl'] @@ -238,7 +238,7 @@ class CollectMultiverseLookData(pyblish.api.InstancePlugin): files = [] sets = {} instance.data["resources"] = [] - expectMipMap = instance.data["expectMipMap"] + publishMipMap = instance.data["publishMipMap"] for node in nodes: self.log.info("Getting resources for '{}'".format(node)) @@ -262,7 +262,7 @@ class CollectMultiverseLookData(pyblish.api.InstancePlugin): files = cmds.ls(history, type="file", long=True) for f in files: - resources = self.collect_resource(f, expectMipMap) + resources = self.collect_resource(f, publishMipMap) instance.data["resources"].append(resources) elif isinstance(matOver, multiverse.MaterialSourceUsdPath): @@ -275,7 +275,7 @@ class CollectMultiverseLookData(pyblish.api.InstancePlugin): "relationships": sets } - def collect_resource(self, node, expectMipMap): + def collect_resource(self, node, publishMipMap): """Collect the link to the file(s) used (resource) Args: node (str): name of the node @@ -330,7 +330,7 @@ class CollectMultiverseLookData(pyblish.api.InstancePlugin): source = source.replace("\\", "/") files = get_file_node_files(node) - files = self.handle_files(files, expectMipMap) + files = self.handle_files(files, publishMipMap) if len(files) == 0: self.log.error("No valid files found from node `%s`" % node) @@ -348,11 +348,11 @@ class CollectMultiverseLookData(pyblish.api.InstancePlugin): "files": files, "color_space": color_space} # required for resources - def handle_files(self, files, expectMipMap): + def handle_files(self, files, publishMipMap): """This will go through all the files and make sure that they are either already mipmapped or have a corresponding mipmap sidecar and add that to the list.""" - if not expectMipMap: + if not publishMipMap: return files extra_files = [] diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index 4bc0322fa8..fe071b08a5 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -133,18 +133,15 @@ class ExtractMultiverseUsd(openpype.api.Extractor): return options - def get_file_format(self, instance): - fileFormat = instance.data["fileFormat"] - if fileFormat in range(len(self.file_formats)): - self.scene_type = self.file_formats[fileFormat] - def process(self, instance): # Load plugin first cmds.loadPlugin("MultiverseForMaya", quiet=True) # Define output file path staging_dir = self.staging_dir(instance) - self.get_file_format(instance) + file_format = instance.data.get("fileFormat", 0) + if file_format in range(len(self.file_formats)): + self.scene_type = self.file_formats[file_format] file_name = "{0}.{1}".format(instance.name, self.scene_type) file_path = os.path.join(staging_dir, file_name) file_path = file_path.replace('\\', '/') diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py index f76a24f7ff..7be6b101d9 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_comp.py @@ -75,18 +75,15 @@ class ExtractMultiverseUsdComposition(openpype.api.Extractor): return options - def get_file_format(self, instance): - fileFormat = instance.data["fileFormat"] - if fileFormat in range(len(self.file_formats)): - self.scene_type = self.file_formats[fileFormat] - def process(self, instance): # Load plugin first cmds.loadPlugin("MultiverseForMaya", quiet=True) # Define output file path staging_dir = self.staging_dir(instance) - self.get_file_format(instance) + file_format = instance.data.get("fileFormat", 0) + if file_format in range(len(self.file_formats)): + self.scene_type = self.file_formats[file_format] file_name = "{0}.{1}".format(instance.name, self.scene_type) file_path = os.path.join(staging_dir, file_name) file_path = file_path.replace('\\', '/') diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py index 3b101ab6cf..091750c32b 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd_over.py @@ -60,18 +60,15 @@ class ExtractMultiverseUsdOverride(openpype.api.Extractor): "timeSamplesSpan": 0.0 } - def get_file_format(self, instance): - fileFormat = instance.data["fileFormat"] - if fileFormat in range(len(self.file_formats)): - self.scene_type = self.file_formats[fileFormat] - def process(self, instance): # Load plugin first cmds.loadPlugin("MultiverseForMaya", quiet=True) # Define output file path staging_dir = self.staging_dir(instance) - self.get_file_format(instance) + file_format = instance.data.get("fileFormat", 0) + if file_format in range(len(self.file_formats)): + self.scene_type = self.file_formats[file_format] file_name = "{0}.{1}".format(instance.name, self.scene_type) file_path = os.path.join(staging_dir, file_name) file_path = file_path.replace("\\", "/") diff --git a/openpype/hosts/maya/plugins/publish/validate_mvlook_contents.py b/openpype/hosts/maya/plugins/publish/validate_mvlook_contents.py index 34a8bc0c85..bac2c030c8 100644 --- a/openpype/hosts/maya/plugins/publish/validate_mvlook_contents.py +++ b/openpype/hosts/maya/plugins/publish/validate_mvlook_contents.py @@ -4,7 +4,7 @@ import openpype.hosts.maya.api.action import os -COLOUR_SPACES = ['sRGB'] +COLOUR_SPACES = ['sRGB', 'linear', 'auto'] MIPMAP_EXTENSIONS = ['tdl'] @@ -24,7 +24,7 @@ class ValidateMvLookContents(pyblish.api.InstancePlugin): def process(self, instance): intent = instance.context.data['intent']['value'] - expectMipMap = instance.data["expectMipMap"] + publishMipMap = instance.data["publishMipMap"] enforced = True if intent in self.enforced_intents: self.log.info("This validation will be enforced: '{}'" @@ -55,7 +55,7 @@ class ValidateMvLookContents(pyblish.api.InstancePlugin): .format(node, fname)) invalid.add(node) - if expectMipMap and not self.is_or_has_mipmap(fname, files): + if publishMipMap and not self.is_or_has_mipmap(fname, files): msg = "File node '{}'/'{}' does not have a mipmap".format( node, fname) if enforced: