From 696c67462a7cac260d29e44e6b9b4da8e49f1256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 13 May 2024 17:16:13 +0200 Subject: [PATCH] :recycle: remove init shading context manager and reformat options --- .../hosts/maya/plugins/publish/extract_obj.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_obj.py b/client/ayon_core/hosts/maya/plugins/publish/extract_obj.py index 72e716b430..b74dbe23f4 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_obj.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_obj.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import os -from contextlib import nullcontext import pyblish.api from ayon_core.hosts.maya.api import lib @@ -60,6 +59,9 @@ class ExtractObj(publish.Extractor): self.obj_options["materials"] = 0 # Export + # format options for the exporter + options = ';'.join( + f"{key}={val}" for key, val in self.obj_options.items()) with lib.no_display_layers(instance): with lib.displaySmoothness(members, divisionsU=0, @@ -67,16 +69,14 @@ class ExtractObj(publish.Extractor): pointsWire=4, pointsShaded=1, polygonObject=1): - with lib.shader(members, - shadingEngine="initialShadingGroup") if strip_shader else nullcontext(): # noqa: E501 - with lib.maintained_selection(): - cmds.select(members, noExpand=True) - cmds.file(path, - exportSelected=True, - type='OBJexport', - op=';'.join(f"{key}={val}" for key, val in self.obj_options.items()), # noqa: E501 - preserveReferences=True, - force=True) + with lib.maintained_selection(): + cmds.select(members, noExpand=True) + cmds.file(path, + exportSelected=True, + type='OBJexport', + op=options, + preserveReferences=True, + force=True) if "representation" not in instance.data: instance.data["representation"] = []