I am in blender 2.79b. I would want to draw grease pencil lines by feeding in the points_list calculated in a programatic manner.
When used in "Poly" mode, this is the info output:
bpy.ops.gpencil.draw(mode='DRAW_POLY',
stroke=[{"name":"",
"location":(0, 0, 0),
"mouse":(451, 503),
"pressure":1,
"size":0,
"pen_flip":False,
"time":0,
"is_start":False},
{"name":"",
"location":(0, 0, 0),
"mouse":(429, 415),
"pressure":1,
"size":0,
"pen_flip":False,
"time":0,
"is_start":False},
{"name":"",
"location":(0, 0, 0),
"mouse":(363, 347),
"pressure":1,
"size":0,
"pen_flip":False,
"time":0,
"is_start":False},
{"name":"",
"location":(0, 0, 0),
"mouse":(407, 295),
"pressure":1,
"size":0,
"pen_flip":False,
"time":0,
"is_start":False},
{"name":"",
"location":(0, 0, 0),
"mouse":(527, 219),
"pressure":1,
"size":0,
"pen_flip":False,
"time":0,
"is_start":False}])
but when executed in console, it is giving me an error:
RuntimeError: Operator bpy.ops.gpencil.draw.poll() Failed to find Grease Pencil data to draw into
What steps am I missing to activate the grease pencil , so that it can work from a script?
def draw_poly(self, points, closed=Fase):And cheers in that I have a project where having answered this realize the gp would be ideal. – batFINGER Oct 01 '18 at 11:23