fix logging

This commit is contained in:
Ondrej Samohel 2022-02-18 18:40:21 +01:00
parent 487b273a09
commit 9604dca259
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
3 changed files with 9 additions and 4 deletions

View file

@ -110,7 +110,7 @@ class FBXExtractor:
def __init__(self, log=None):
# Ensure FBX plug-in is loaded
self.log = log or logging.getLogger(__class__.__name__)
self.log = log or logging.getLogger(self.__class__.__name__)
cmds.loadPlugin("fbxmaya", quiet=True)
def parse_overrides(self, instance, options):

View file

@ -22,7 +22,6 @@ class ExtractUnrealStaticMesh(openpype.api.Extractor):
families = ["staticMesh"]
def process(self, instance):
fbx_exporter = fbx.FBXExtractor(log=self.log)
to_combine = instance.data.get("membersToCombine")
static_mesh_name = instance.data.get("staticMeshCombinedName")
duplicates = []
@ -46,13 +45,13 @@ class ExtractUnrealStaticMesh(openpype.api.Extractor):
)
cmds.duplicate(to_combine[0], name=static_mesh_name, ic=True)
delete_bin.extend(static_mesh_name)
delete_bin.extend([static_mesh_name])
delete_bin.extend(duplicates)
members = [static_mesh_name]
members += instance.data["collisionMembers"]
fbx_exporter = fbx.FBXExtractor()
fbx_exporter = fbx.FBXExtractor(log=self.log)
# Define output path
staging_dir = self.staging_dir(instance)
@ -74,6 +73,9 @@ class ExtractUnrealStaticMesh(openpype.api.Extractor):
self.log.info("Un-parenting: {}".format(members))
fbx_exporter.export(members, path)
if "representations" not in instance.data:
instance.data["representations"] = []
representation = {
'name': 'fbx',
'ext': 'fbx',

View file

@ -79,6 +79,9 @@ class ValidateUnrealStaticMeshName(pyblish.api.InstancePlugin):
["static_mesh_prefix"]
)
to_combine = instance.data.get("membersToCombine")
if not to_combine:
raise ValueError("Missing geometry to export.")
combined_geometry_name = instance.data.get(
"staticMeshCombinedName", None)
if cls.validate_mesh: