[Bf-committers] Fwd: Request for Help

Joshua Leung aligorith at gmail.com
Sun Nov 23 10:57:22 CET 2014


Hi,

What you want to do is to create a Python script which you run from Blender
to export the information.

For example, you might do something as follows (untested code):

###########################
import bpy

OUTPUT_PATH = "c:\\path\\to\\exported\\data.txt"
GP_NAME         = "GPencil Datablock Name"

gpd = bpy.data.grease_pencil[GP_NAME]
if gpd:
    with open(OUTPUT_PATH, 'w') as f:
        # gpl = gpd.layers.active   # <----- use this instead if you only
want the active layer
        for gpl in gpd.layers:
            gpf = gpl.active_frame
            for stroke in gpf.strokes:
                # XXX: you may want to insert a marker or some way of
indicating different strokes....
                for pt in stroke.points:
                    f.write("%f %f %f\n" % (pt.co[0], pt.co[1], pt.co[2]))

###########################



On Sun, Nov 23, 2014 at 10:48 PM, Bhaskar Jyoti Dutta <
bhaskar at infiniumrobotics.com> wrote:

> Hello ,
>
> I am trying to use Blender to generate a .txt file which will have the 3D
> coordinates generated by the " Grease Pencil " feature.Please help me.I
> have already the .sln file I built from Blender.
>
> --
> Warm Regards,
> *Bhaskar Jyoti Dutta*
> *Robotics Engineer*
> [image: http://www.infiniumrobotics.com/] <
> http://www.infiniumrobotics.com/>
> T : +65-82691083
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list