Grease pencil rendering in VSE [request]

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Wed Feb 27, 2013 5:00 pm
Location: France

Grease pencil rendering in VSE [request]

Post by tynaud »

Hi Everybody !

Actually I am studying animation, and I am using Blender and Maya (because of the rigs provided by the school, they are Maya ones...). But I am using Blender for modeling, texturing, rendering (thanks to mdd I can import my animations), and even video editing for making video references and stick original movie audio on top of it (using drawform and lipsync principles to adjust them together), and also exporting in a lighter format in order to send it to my instructor. And it's great too in order to put all your exercises together and do what we should not show : a "progress" reel... :lol:

There is one more feature which is really great but a bit useless at the same time if you integrate blender in a workflow with maya for animation... The Grease Pencil ! There is no good grease pencil in Maya, but Blender has one which is really nice, and it's really handy to draw some line of actions and write some notes on your video reference in order to speed up the blocking pass - importing image sequence on a plane directly in 3D view (this is a golden pose frame 11, this one a key, here it's becoming almost static, slight tx on left...) The fact is that if you put some notes with GP in the sequencer window, when you export your image sequence the GP strokes are not rendered...

I tried to do some screencast while playing the animation, but there is no sync so it dropped a lot of frames.

Finally I wrote this dirty thing (first time I am writing something in python, in a recursive way because I learnt scheme a long time ago... haha ! But I think a lot of things could be simplified, it's more some guessing and a trial/error process for me)

Code: Select all

import bpy
import os

basedir = os.path.dirname(
if not basedir:
raise Exception("Blend file is not saved")

name = "vsegreasepencil"
fullpath = os.path.join(basedir, name)

bpy.types.Scene.frame_preview_start = 0
bpy.types.Scene.frame_preview_end = 320
bpy.types.Scene.frame_current = bpy.types.Scene.frame_preview_start

while bpy.types.Scene.frame_current <= bpy.types.Scene.frame_preview_end :
    bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)    # the wiki is saying that it is really dirty. Should be modal, but don't know what it is
    bpy.types.Scene.frame_current = bpy.types.Scene.frame_current + 1
    incremented_name = fullpath + str(bpy.types.Scene.frame_current)
    bpy.ops.screen.screenshot(filepath=incremented_name + ".png", check_existing=False, filter_blender=False, filter_backup=False, filter_image=True, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, display_type='FILE_DEFAULTDISPLAY', full=True)
    print (bpy.types.Scene.frame_current)                              # just to be sure that it's looping

So I was asking myself if it was possible to add a little box to tick (or the default image camera button) near a grease pencil layer in order to have it renderable (at least in sequencer) ?

Thanks a lot for this amazing piece of software, and have a nice day :)

Posts: 0
Joined: Wed Feb 27, 2013 5:00 pm
Location: France

Found a very good workaround :)

Post by tynaud »

Ok, I found a workaround/solution to my problem which is not using the VSE but using the 3D viewport instead...

So this is what I did and it worked great... Just go into camera view, add a background movie, draw with grease pencil and render the animation in opengl ! Worked like a charm, so happy with this solution !
Well it would be easier to have the option to make renderable the grease pencil but for now this way to do it is working right.

Have a nice day !

Posts: 18
Joined: Fri Oct 25, 2002 9:32 am

Post by pildanovak »

Hello, I tried to solve similar problem today. I painted my script in the sequencer, then tried to export...
I read your message, and wrote a little script. assign your greasepencil to an object in the 3d scene, then run this code. It converts 2d grease pencil layers to 3d. Then set an ortographic camera with the size of your output resolution. and aim it top-down in the scene.
that worked for me.
script here:

Code: Select all

import bpy
for l in o.grease_pencil.layers:
    for f in l.frames:
        for s in f.strokes:

Post Reply