[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4193] trunk/py/scripts/addons/rigify/ utils.py: Rigify: patch from Shinsuke Irie fixing rig imports on some systems.

Nathan Vegdahl cessen at cessen.com
Tue Jan 22 19:51:08 CET 2013


Revision: 4193
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4193
Author:   cessen
Date:     2013-01-22 18:51:08 +0000 (Tue, 22 Jan 2013)
Log Message:
-----------
Rigify: patch from Shinsuke Irie fixing rig imports on some systems.

>From the report:
  This patch fixes a bug that rig modules of 'arm' and
  'leg' cannot be loaded failing as follows:
  
  Rigify: No module named 'rigify.rigs.biped.arm.biped'
  Rigify: No module named 'rigify.rigs.biped.leg.biped'

I couldn't reproduce the error, but new code works on my system
just as well as the old code, so I assume this serves to make the
code more robust on a larger range of systems.

Thanks Shinsuke!

Modified Paths:
--------------
    trunk/py/scripts/addons/rigify/utils.py

Modified: trunk/py/scripts/addons/rigify/utils.py
===================================================================
--- trunk/py/scripts/addons/rigify/utils.py	2013-01-22 18:41:16 UTC (rev 4192)
+++ trunk/py/scripts/addons/rigify/utils.py	2013-01-22 18:51:08 UTC (rev 4193)
@@ -396,7 +396,10 @@
     """ Fetches a rig module by name, and returns it.
     """
     #print("%s.%s.%s" % (__package__,RIG_DIR,rig_type))
-    submod = __import__(name="%s.%s.%s" % (MODULE_NAME, RIG_DIR, rig_type), fromlist=[rig_type])
+    name="%s.%s.%s" % (MODULE_NAME, RIG_DIR, rig_type)
+    submod = __import__(name)
+    for c in (name.split("."))[1:]:
+        submod = getattr(submod, c)
     imp.reload(submod)
     return submod
 



More information about the Bf-extensions-cvs mailing list