diff --git a/openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py b/openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py index 30f024a160..296116caae 100644 --- a/openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py +++ b/openpype/hosts/maya/plugins/create/create_unreal_staticmesh.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator for Unreal Static Meshes.""" from openpype.hosts.maya.api import plugin, lib -from avalon.api import CreatorError, Session +from avalon.api import Session from openpype.api import get_project_settings from maya import cmds # noqa @@ -38,5 +38,8 @@ class CreateUnrealStaticMesh(plugin.Creator): geometry = cmds.sets(name="geometry_SET", empty=True) collisions = cmds.sets(name="collisions_SET", empty=True) cmds.sets([geometry, collisions], forceElement=instance) - # todo: Iterate over collision prefixes and add them to correct - # sets. Put rest to the geometry set. + for node in content: + if [n for n in self.collision_prefixes if node.startswith(n)]: + cmds.sets(node, forceElement=collisions) + else: + cmds.sets(node, forceElement=geometry) diff --git a/openpype/hosts/maya/plugins/publish/clean_nodes.py b/openpype/hosts/maya/plugins/publish/clean_nodes.py index e6667b7036..cd3613cc4f 100644 --- a/openpype/hosts/maya/plugins/publish/clean_nodes.py +++ b/openpype/hosts/maya/plugins/publish/clean_nodes.py @@ -24,4 +24,3 @@ class CleanNodesUp(pyblish.api.InstancePlugin): self.log.info("Removing {} nodes".format(len(nodes_to_clean))) for node in nodes_to_clean: cmds.remove(node) - \ No newline at end of file diff --git a/openpype/hosts/maya/plugins/publish/validate_unreal_staticmesh_naming.py b/openpype/hosts/maya/plugins/publish/validate_unreal_staticmesh_naming.py index e7df7c8cbb..c5aa14ec0c 100644 --- a/openpype/hosts/maya/plugins/publish/validate_unreal_staticmesh_naming.py +++ b/openpype/hosts/maya/plugins/publish/validate_unreal_staticmesh_naming.py @@ -118,4 +118,4 @@ class ValidateUnrealStaticMeshName(pyblish.api.InstancePlugin): invalid = self.get_invalid(instance) if invalid: - raise RuntimeError("Model naming is invalid. See log.") \ No newline at end of file + raise RuntimeError("Model naming is invalid. See log.")