Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

June 22, 2013

Data Viz Episode 1 (WIP don't share yet)

Creating a Vector overlay for rendered raster images.

I'm of the school that considers typography most effective when rendered in 2d, i.e. I don't want my topography for labels / names / scales / dimensions etc to be renderable 3d geometry. I'd have to set up a constraint to always point the typography at the camera so it doesn't distort. But if I can get the 2d locations of these entities it is possible to create vector graphics overlays. Not just useful for typography but grids and axis ticks too.

Let us construct some json from the cube object. This json will have a readability issue if we use indent=0, but with indent list members each get a new line. I know about it, and so do these guys. Some of this code is the same as the first post, but now it writes to a file in the same location as blender.exe

This will make a lot more sense with some images now it is possible and easy to turn this:

into this (here live d3.js code on tributary to parse the json into svg)

How to proceed from here

What i've shown so far is both trivial and awesome at the same time. Imagine now that we construct the guides / axis as a edge based mesh object, that never gets rendered as pixels. This object would still be visible in 3d view, but the edges wouldn't be rendered in the final render, instead their information can be deferred to this svg-overlay I keep banging on about. Some of this process can be bound to reusable functions both in python and d3.js. i'll probably write a few as examples and start a github repo and get this ball rolling.

Like:

here's the live link

stacked chart


With a little bit of d3.js overlay here

No comments:

Post a Comment

Please use Blender.StackExchange.com for python scripting questions unrelated to this post.