Blender Python Exporter

Hi all,

I’m pleased to announce the release of BPY_exporter v 0.4

BPY exporter is a script that exports selected meshes into a Blender Python format.

It takes all selected meshes from the current scene and generates a script that re-create these meshes. It takes into account:

  • vertices coordinates
  • uv coordinates
  • size, position (relatively to 3D cursor), orientation
  • mesh and object name

Generated scripts are located into your <blender_dir>.blender\script directory and contain Blender specific header …
After each generation, BPY exporter performs an Update Menu so that newly added primitives are immediatly available from Script–>Add menu of Script windows

BPY exporter can be seen as the easiest way to add primitive mesh to Blender.
Non programmer can use it to increase their Blender productivity.
It can also be used by developpers willing to produce autonomous scripts embedding their own 3D content or dynamically creating 3D content.

BPY exporter is released under Blender Artistic Licence
This archive contains the BPY Exporter script itself and its documentation.

Enjoy …

Jean-Baptiste PERIN

Known Bugs:

  • If no mesh is selected …it crashes on some PC…
  • If user changes target directory at export time , the newly created script is not added to menu

Nice one, thanks!

One feature suggestion, though.
I have installed multiple Blender versions and also use them all. So i have set my python script path to a different folder, that is shared by all Blender versions. (You can set that in the config panel in blender.)

So could you change you script so that it reads out the user-defined python path first, and uses that as default in the file-selector.

Something like this:

user_script_dir = Blender.Get('uscriptsdir')
if sys.exists(user_script_dir) == 2:
   blender_script_dir = user_script_dir
   blender_script_dir = ..........

(not tested. And the tabs are actually spaces, so don’t copy and paste :slight_smile: )

This is majik, you should be pleased!


thanks wah_tak for your feedback

I’ve just taken into account your remark …

The current release is now:

The user defined Python path is now properly handled … but I don’t know why … scripts that are generated in this directory don’t appear in the Add menu of the Script Window …

thanks again for your feedback …

cheers …

BPY_Exporter is now released under GPL to postulate for inclusion in 2.41.

Download BPY_exporter v0.8 and check out its online documentation.

Cheers …

Jean-Baptiste …