From 945f1e9890e40bb0b01c53f6dde1fd1a3b64e05e Mon Sep 17 00:00:00 2001 From: Marcus Ottosson Date: Tue, 17 Jan 2017 13:53:13 +0100 Subject: [PATCH] Implement #8 --- mindbender/maya/lib.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mindbender/maya/lib.py b/mindbender/maya/lib.py index b369158..f206135 100644 --- a/mindbender/maya/lib.py +++ b/mindbender/maya/lib.py @@ -318,7 +318,13 @@ def apply_shaders(relationships): assert shader, "Associated shader not part of asset, this is a bug" for id_ in ids: - meshes = lsattr("mbID", value=id_) + mesh, faces = (id_.rsplit(".", 1) + [""])[:2] + + # Find all meshes matching this particular ID + # Convert IDs to mesh + id, e.g. "nameOfNode.f[1:100]" + meshes = list(".".join([mesh, faces]) + for mesh in lsattr("mbID", value=mesh)) + if not meshes: continue