Revision: 16572
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16572
Author:   broken
Date:     2008-09-17 06:07:58 +0200 (Wed, 17 Sep 2008)

Log Message:
-----------
* Some tweaks to the OBJ importer/exporter after chatting with Campbell
- renamed the 'morph target' option to 'keep vertex order'
- enabled 'keep vertex order' by default

This should improve usability for importing and exporting shape keys, point 
caches, mdds ,etc.

Modified Paths:
--------------
    trunk/blender/release/scripts/export_obj.py
    trunk/blender/release/scripts/import_obj.py

Modified: trunk/blender/release/scripts/export_obj.py
===================================================================
--- trunk/blender/release/scripts/export_obj.py 2008-09-17 04:06:59 UTC (rev 
16571)
+++ trunk/blender/release/scripts/export_obj.py 2008-09-17 04:07:58 UTC (rev 
16572)
@@ -185,7 +185,7 @@
 EXPORT_TRI=False,  EXPORT_EDGES=False,  EXPORT_NORMALS=False,  
EXPORT_NORMALS_HQ=False,\
 EXPORT_UV=True,  EXPORT_MTL=True,  EXPORT_COPY_IMAGES=False,\
 EXPORT_APPLY_MODIFIERS=True, EXPORT_ROTX90=True, EXPORT_BLEN_OBS=True,\
-EXPORT_GROUP_BY_OB=False,  EXPORT_GROUP_BY_MAT=False, 
EXPORT_MORPH_TARGET=False):
+EXPORT_GROUP_BY_OB=False,  EXPORT_GROUP_BY_MAT=False, 
EXPORT_KEEP_VERT_ORDER=False):
        '''
        Basic write function. The context and options must be alredy set
        This can be accessed externaly
@@ -322,7 +322,7 @@
                        
                        # Sort by Material, then images
                        # so we dont over context switch in the obj file.
-                       if EXPORT_MORPH_TARGET:
+                       if EXPORT_KEEP_VERT_ORDER:
                                pass
                        elif faceuv:
                                try:    faces.sort(key = lambda a: (a.mat, 
a.image, a.smooth))
@@ -550,7 +550,7 @@
        EXPORT_BLEN_OBS = Draw.Create(1)
        EXPORT_GROUP_BY_OB = Draw.Create(0)
        EXPORT_GROUP_BY_MAT = Draw.Create(0)
-       EXPORT_MORPH_TARGET = Draw.Create(0)
+       EXPORT_KEEP_VERT_ORDER = Draw.Create(1)
        
        # removed too many options are bad!
        
@@ -563,7 +563,7 @@
        ('Object Prefs...'),\
        ('Apply Modifiers', EXPORT_APPLY_MODIFIERS, 'Use transformed mesh data 
from each object. May break vert order for morph targets.'),\
        ('Rotate X90', EXPORT_ROTX90 , 'Rotate on export so Blenders UP is 
translated into OBJs UP'),\
-       ('Morph Target', EXPORT_MORPH_TARGET, 'Keep vert and face order, 
disables some other options.'),\
+       ('Keep Vert Order', EXPORT_KEEP_VERT_ORDER, 'Keep vert and face order, 
disables some other options.'),\
        ('Extra Data...'),\
        ('Edges', EXPORT_EDGES, 'Edges not connected to faces.'),\
        ('Normals', EXPORT_NORMALS, 'Export vertex normal data (Ignored on 
import).'),\
@@ -581,7 +581,7 @@
        if not Draw.PupBlock('Export...', pup_block):
                return
        
-       if EXPORT_MORPH_TARGET.val:
+       if EXPORT_KEEP_VERT_ORDER.val:
                EXPORT_BLEN_OBS.val = False
                EXPORT_GROUP_BY_OB.val = False
                EXPORT_GROUP_BY_MAT.val = False
@@ -606,7 +606,7 @@
        EXPORT_BLEN_OBS = EXPORT_BLEN_OBS.val
        EXPORT_GROUP_BY_OB = EXPORT_GROUP_BY_OB.val
        EXPORT_GROUP_BY_MAT = EXPORT_GROUP_BY_MAT.val
-       EXPORT_MORPH_TARGET = EXPORT_MORPH_TARGET.val
+       EXPORT_KEEP_VERT_ORDER = EXPORT_KEEP_VERT_ORDER.val
        
        
        
@@ -656,7 +656,7 @@
                        EXPORT_NORMALS_HQ, EXPORT_UV, EXPORT_MTL,\
                        EXPORT_COPY_IMAGES, EXPORT_APPLY_MODIFIERS,\
                        EXPORT_ROTX90, EXPORT_BLEN_OBS,\
-                       EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, 
EXPORT_MORPH_TARGET)
+                       EXPORT_GROUP_BY_OB, EXPORT_GROUP_BY_MAT, 
EXPORT_KEEP_VERT_ORDER)
                
                Blender.Set('curframe', orig_frame)
        

Modified: trunk/blender/release/scripts/import_obj.py
===================================================================
--- trunk/blender/release/scripts/import_obj.py 2008-09-17 04:06:59 UTC (rev 
16571)
+++ trunk/blender/release/scripts/import_obj.py 2008-09-17 04:07:58 UTC (rev 
16572)
@@ -763,7 +763,7 @@
        SPLIT_OBJECTS= Draw.Create(1)
        SPLIT_GROUPS= Draw.Create(1)
        SPLIT_MATERIALS= Draw.Create(1)
-       MORPH_TARGET= Draw.Create(0)
+       KEEP_VERT_ORDER= Draw.Create(1)
        CLAMP_SIZE= Draw.Create(10.0)
        IMAGE_SEARCH= Draw.Create(1)
        
@@ -779,7 +779,7 @@
        ('Group', SPLIT_GROUPS, 'Import OBJ Groups into Blender Objects'),\
        ('Material', SPLIT_MATERIALS, 'Import each material into a seperate 
mesh (Avoids > 16 per mesh error)'),\
        'Options...',\
-       ('Morph Target', MORPH_TARGET, 'Keep vert and face order, disables some 
other options.'),\
+       ('Keep Vert Order', KEEP_VERT_ORDER, 'Keep vert and face order, 
disables some other options.'),\
        ('Clamp Scale:', CLAMP_SIZE, 0.0, 1000.0, 'Clamp the size to this 
maximum (Zero to Disable)'),\
        ('Image Search', IMAGE_SEARCH, 'Search subdirs for any assosiated 
images (Warning, may be slow)'),\
        ]
@@ -787,7 +787,7 @@
        if not Draw.PupBlock('Import OBJ...', pup_block):
                return
        
-       if MORPH_TARGET.val:
+       if KEEP_VERT_ORDER.val:
                SPLIT_OBJECTS.val = False
                SPLIT_GROUPS.val = False
                SPLIT_MATERIALS.val = False


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to