[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4821] trunk/py/scripts/addons/ io_import_scene_mhx.py: Mhx layer buttons depend on imported rig type.
Thomas Larsson
thomas_larsson_01 at hotmail.com
Fri Nov 1 14:23:24 CET 2013
Revision: 4821
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4821
Author: thomasl
Date: 2013-11-01 13:23:24 +0000 (Fri, 01 Nov 2013)
Log Message:
-----------
Mhx layer buttons depend on imported rig type.
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 2013-10-31 12:07:42 UTC (rev 4820)
+++ trunk/py/scripts/addons/io_import_scene_mhx.py 2013-11-01 13:23:24 UTC (rev 4821)
@@ -38,7 +38,7 @@
bl_info = {
'name': 'Import: MakeHuman (.mhx)',
'author': 'Thomas Larsson',
- 'version': "1.16.11",
+ 'version': "1.16.12",
"blender": (2, 68, 0),
'location': "File > Import > MakeHuman (.mhx)",
'description': 'Import files in the MakeHuman eXchange format (.mhx)',
@@ -51,7 +51,7 @@
MAJOR_VERSION = 1
MINOR_VERSION = 16
FROM_VERSION = 13
-SUB_VERSION = 8
+SUB_VERSION = 12
majorVersion = MAJOR_VERSION
minorVersion = MINOR_VERSION
@@ -3032,13 +3032,13 @@
MhxLayers = [
(( 0, 'Root', 'MhxRoot'),
+ ( 1, 'Spine', 'MhxFKSpine')),
+ ((10, 'Head', 'MhxHead'),
( 8, 'Face', 'MhxFace')),
(( 9, 'Tweak', 'MhxTweak'),
- (10, 'Head', 'MhxHead')),
- (( 1, 'FK Spine', 'MhxFKSpine'),
- #(17, 'IK Spine', 'MhxIKSpine')),
- #((13, 'Inv FK Spine', 'MhxInvFKSpine'),
(16, 'Clothes', 'MhxClothes')),
+ #((17, 'IK Spine', 'MhxIKSpine'),
+ #((13, 'Inv FK Spine', 'MhxInvFKSpine')),
('Left', 'Right'),
(( 2, 'IK Arm', 'MhxIKArm'),
(18, 'IK Arm', 'MhxIKArm')),
@@ -3058,6 +3058,23 @@
(27, 'Palm', 'MhxPalm')),
]
+OtherLayers = [
+ (( 1, 'Spine', 'MhxFKSpine'),
+ ( 10, 'Head', 'MhxHead')),
+ (( 9, 'Tweak', 'MhxTweak'),
+ ( 8, 'Face', 'MhxFace')),
+ ('Left', 'Right'),
+ (( 3, 'Arm', 'MhxFKArm'),
+ (19, 'Arm', 'MhxFKArm')),
+ (( 5, 'Leg', 'MhxFKLeg'),
+ (21, 'Leg', 'MhxFKLeg')),
+ (( 7, 'Fingers', 'MhxLinks'),
+ (23, 'Fingers', 'MhxLinks')),
+ ((11, 'Palm', 'MhxPalm'),
+ (27, 'Palm', 'MhxPalm')),
+]
+
+
#
# class MhxMainPanel(bpy.types.Panel):
#
@@ -3077,15 +3094,21 @@
layout.label("Layers")
layout.operator("mhx.pose_enable_all_layers")
layout.operator("mhx.pose_disable_all_layers")
- amt = context.object.data
- for (left,right) in MhxLayers:
+
+ rig = context.object
+ if rig.MhxRig == 'MHX':
+ layers = MhxLayers
+ else:
+ layers = OtherLayers
+
+ for (left,right) in layers:
row = layout.row()
if type(left) == str:
row.label(left)
row.label(right)
else:
for (n, name, prop) in [left,right]:
- row.prop(amt, "layers", index=n, toggle=True, text=name)
+ row.prop(rig.data, "layers", index=n, toggle=True, text=name)
layout.separator()
layout.label("Export/Import MHP")
More information about the Bf-extensions-cvs
mailing list