[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1810] trunk/py/scripts/addons/ mesh_bsurfaces.py: Updated the grease pencil layer conversion to work in Object mode instead of Edit mode , for GPENCIL_OT_SURFSK_add_surface and GPENCIL_OT_SURFSK_strokes_to_curves .

Eclectiel L eclect25 at yahoo.com
Sun Apr 10 23:13:15 CEST 2011


Revision: 1810
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1810
Author:   eclectiel
Date:     2011-04-10 21:13:15 +0000 (Sun, 10 Apr 2011)
Log Message:
-----------
Updated the grease pencil layer conversion to work in Object mode instead of Edit mode, for GPENCIL_OT_SURFSK_add_surface and GPENCIL_OT_SURFSK_strokes_to_curves.

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

Modified: trunk/py/scripts/addons/mesh_bsurfaces.py
===================================================================
--- trunk/py/scripts/addons/mesh_bsurfaces.py	2011-04-10 15:07:34 UTC (rev 1809)
+++ trunk/py/scripts/addons/mesh_bsurfaces.py	2011-04-10 21:13:15 UTC (rev 1810)
@@ -275,11 +275,14 @@
                 return{'CANCELLED'}
                 
             #### Convert grease pencil strokes to curve.
+            bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
             bpy.ops.gpencil.convert('INVOKE_REGION_WIN', type='CURVE')
             ob_gp_strokes = bpy.context.object
+            
+            
             using_external_curves = False
             
-            bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
+            
         
         ob_gp_strokes.name = "SURFSK_temp_strokes"
         
@@ -767,12 +770,12 @@
     
     def execute(self, context):
         #### Convert grease pencil strokes to curve.
+        bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
         bpy.ops.gpencil.convert('INVOKE_REGION_WIN', type='CURVE')
         ob_gp_strokes = bpy.context.object
         ob_gp_strokes.name = "SURFSK_strokes"
         
         #### Delete grease pencil strokes.
-        bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
         bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT')
         bpy.ops.object.select_name('INVOKE_REGION_WIN', name = self.main_object.name)
         bpy.context.scene.objects.active = bpy.data.objects[self.main_object.name]
@@ -851,4 +854,4 @@
 
     
 if __name__ == "__main__":
-    register()
+    register()
\ No newline at end of file



More information about the Bf-extensions-cvs mailing list