[Bf-extensions-cvs] [11e9bba] master: avoid double lookup for library attr

Campbell Barton noreply at git.blender.org
Wed Mar 4 22:33:12 CET 2015


Commit: 11e9bba2ff6110f370dda7dd7651c2bd45ad3458
Author: Campbell Barton
Date:   Thu Mar 5 08:32:10 2015 +1100
Branches: master
https://developer.blender.org/rBA11e9bba2ff6110f370dda7dd7651c2bd45ad3458

avoid double lookup for library attr

===================================================================

M	io_scene_fbx/fbx_utils.py

===================================================================

diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py
index 3175149..02d2f6d 100644
--- a/io_scene_fbx/fbx_utils.py
+++ b/io_scene_fbx/fbx_utils.py
@@ -285,9 +285,11 @@ def get_key_from_fbx_uuid(uuid):
 
 # Blender-specific key generators
 def get_bid_name(bid):
-    if getattr(bid, 'library', None) is not None:
-        return "_L_".join((bid.name, bid.library.name))
-    return bid.name
+    library = getattr(bid, "library", None)
+    if library is not None:
+        return "%s_L_%s" % (bid.name, library.name)
+    else:
+        return bid.name
 
 
 def get_blenderID_key(bid):



More information about the Bf-extensions-cvs mailing list