[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2206] trunk/py/scripts/addons/ io_import_scene_mhx.py: Added switch for ignoring Limit rotation and distance constraints.

Thomas Larsson thomas_larsson_01 at hotmail.com
Mon Aug 1 11:05:55 CEST 2011


Revision: 2206
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2206
Author:   thomasl
Date:     2011-08-01 09:05:55 +0000 (Mon, 01 Aug 2011)
Log Message:
-----------
Added switch for ignoring Limit rotation and distance constraints.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_import_scene_mhx.py

Modified: trunk/py/scripts/addons/io_import_scene_mhx.py
===================================================================
--- trunk/py/scripts/addons/io_import_scene_mhx.py	2011-08-01 00:47:09 UTC (rev 2205)
+++ trunk/py/scripts/addons/io_import_scene_mhx.py	2011-08-01 09:05:55 UTC (rev 2206)
@@ -26,7 +26,7 @@
 """
 Abstract
 MHX (MakeHuman eXchange format) importer for Blender 2.5x.
-Version 1.6.0
+Version 1.6.1
 
 This script should be distributed with Blender.
 If not, place it in the .blender/scripts/addons dir
@@ -39,7 +39,7 @@
 bl_info = {
     'name': 'Import: MakeHuman (.mhx)',
     'author': 'Thomas Larsson',
-    'version': (1, 6, 0),
+    'version': (1, 6, 1),
     "blender": (2, 5, 8),
     "api": 37702,
     'location': "File > Import > MakeHuman (.mhx)",
@@ -52,7 +52,7 @@
 
 MAJOR_VERSION = 1
 MINOR_VERSION = 6
-SUB_VERSION = 0
+SUB_VERSION = 1
 BLENDER_VERSION = (2, 58, 0)
 
 #
@@ -99,7 +99,7 @@
 T_EnforceVersion = 0x01
 T_Clothes = 0x02
 T_Stretch = 0x04
-T_Bend = 0x08
+T_Limit = 0x08
 
 T_Diamond = 0x10
 T_Replace = 0x20
@@ -116,7 +116,7 @@
 T_Symm = 0x4000
 
 toggle = (T_EnforceVersion + T_Replace + T_Mesh + T_Armature + 
-        T_Face + T_Shape + T_Proxy + T_Clothes + T_Rigify)
+        T_Face + T_Shape + T_Proxy + T_Clothes + T_Rigify + T_Limit)
 
 #
 #    Blender versions
@@ -2033,6 +2033,9 @@
             if cns.type == 'CHILD_OF':
                 cnslist.append((pb, cns, cns.influence))
                 cns.influence = 0
+            elif ((toggle & T_Limit == 0) and 
+                  (cns.type in ['LIMIT_DISTANCE', 'LIMIT_ROTATION'])):                
+                cns.influence = 0
 
     for (pb, cns, inf) in cnslist:
         amt.bones.active = pb.bone
@@ -2092,6 +2095,8 @@
 #
 
 def parseProcess(args, tokens):
+    return
+    """
     if toggle & T_Bend == 0:
         return
     try:
@@ -2218,6 +2223,7 @@
 
     bpy.ops.object.mode_set(mode='OBJECT')
     return            
+    """    
 
 #
 #    defaultKey(ext, args, tokens, var, exclude, glbals, lcals):
@@ -2984,7 +2990,7 @@
     ("symm", "Symmetric shapes", "Keep shapekeys symmetric", T_Symm),
     ("diamond", "Diamonds", "Keep joint diamonds", T_Diamond),
     ("rigify", "Rigify", "Create rigify control rig", T_Rigify),
-    #("bend", "Bend joints", "Bend joints for better IK", T_Bend),
+    ("limit", "Limit constraints", "Keep limit constraints", T_Limit),
 ]
 
 class ImportMhx(bpy.types.Operator, ImportHelper):



More information about the Bf-extensions-cvs mailing list