Skip to content

Instantly share code, notes, and snippets.

@zeffii zeffii/
Last active Aug 29, 2015

What would you like to do?
import bpy
from mathutils import Vector
def convert_curve_to_gp(obj):
pencil ="pencil")
scene = bpy.context.scene
scene.grease_pencil = pencil
mesh =
layer ="layer", set_active=True)
frame =
mesh = obj.to_mesh(scene, apply_modifiers=False, settings='PREVIEW')
verts = mesh.vertices
for edge in mesh.edges:
stroke =
stroke.draw_mode = '3DSPACE'
stroke.points[0].co = obj.matrix_world * verts[edge.vertices[0]].co
stroke.points[1].co = obj.matrix_world * verts[edge.vertices[1]].co
obj = bpy.context.object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.