[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3971] trunk/py/scripts/addons/ mesh_bsurfaces.py: Should fix the problem with bsurfaces ( did not test deeply, though, not used to this tool...).

Bastien Montagne montagne29 at wanadoo.fr
Thu Nov 15 09:36:18 CET 2012


Revision: 3971
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3971
Author:   mont29
Date:     2012-11-15 08:36:16 +0000 (Thu, 15 Nov 2012)
Log Message:
-----------
Should fix the problem with bsurfaces (did not test deeply, though, not used to this tool...).

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

Modified: trunk/py/scripts/addons/mesh_bsurfaces.py
===================================================================
--- trunk/py/scripts/addons/mesh_bsurfaces.py	2012-11-15 03:16:54 UTC (rev 3970)
+++ trunk/py/scripts/addons/mesh_bsurfaces.py	2012-11-15 08:36:16 UTC (rev 3971)
@@ -2987,8 +2987,13 @@
             if self.strokes_type == "GP_STROKES":
                 # Convert grease pencil strokes to curve.
                 bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN')
-                bpy.ops.gpencil.convert('INVOKE_REGION_WIN', type='CURVE')
-                self.original_curve = bpy.context.object
+                bpy.ops.gpencil.convert('INVOKE_REGION_WIN', type='CURVE', use_link_strokes=False)
+                # XXX gpencil.convert now keep org object as active/selected, *not* newly created curve!
+                # XXX This is far from perfect, but should work in most cases...
+#                self.original_curve = bpy.context.object
+                for ob in bpy.context.selected_objects:
+                    if ob != bpy.context.scene.objects.active and ob.name.startswith("GP_Layer"):
+                        self.original_curve = ob
                 self.using_external_curves = False
             elif self.strokes_type == "EXTERNAL_CURVE":
                 for ob in bpy.context.selected_objects:



More information about the Bf-extensions-cvs mailing list