From 2ded65bdd64986bb87738989324fb5833fee3b55 Mon Sep 17 00:00:00 2001 From: Eclectiel L Date: Sun, 10 Apr 2011 21:13:15 +0000 Subject: 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. --- mesh_bsurfaces.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mesh_bsurfaces.py') diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py index 2e031b71..27114e2a 100644 --- a/mesh_bsurfaces.py +++ b/mesh_bsurfaces.py @@ -275,11 +275,14 @@ class GPENCIL_OT_SURFSK_add_surface(bpy.types.Operator): 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 @@ class GPENCIL_OT_SURFSK_strokes_to_curves(bpy.types.Operator): 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 @@ def unregister(): if __name__ == "__main__": - register() + register() \ No newline at end of file -- cgit v1.2.3