From a712214f4cfd65e9d282da2a90cbff0f95e92582 Mon Sep 17 00:00:00 2001 From: aardschok Date: Mon, 7 Aug 2017 10:20:29 +0200 Subject: [PATCH] added explanaition for split, ensure unique namespace --- colorbleed/plugins/maya/load/load_animation.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/colorbleed/plugins/maya/load/load_animation.py b/colorbleed/plugins/maya/load/load_animation.py index 8f05b7ac7b..058dc85562 100644 --- a/colorbleed/plugins/maya/load/load_animation.py +++ b/colorbleed/plugins/maya/load/load_animation.py @@ -23,7 +23,16 @@ class AbcLoader(api.Loader): # Create unique namespace for the cameras # Get name from asset being loaded - namespace = "{name}_abc".format(name=name) + # Assuming name is subset name from the animation, we split the number + # suffix from the name to ensure the namespace is unique + name = name.split("_")[0] + namespace = maya.unique_namespace("{}_".format(name), + format="%03d", + suffix="_abc") + + # hero_001 (abc) + # asset_counter{optional} + nodes = cmds.file(self.fname, namespace=namespace, sharedReferenceFile=False, @@ -33,7 +42,6 @@ class AbcLoader(api.Loader): returnNewNodes=True) # load colorbleed ID attribute - self[:] = nodes