Blender Real-time Exporter (simple version)

Sometimes, working with tools like Processing or Grasshopper I’ve felt the lack of maneuverability of blender meshes modeling. I therefore decided to develop a small script for export my mesh refreshing it in real-time. This will make it possible to read information from different software programs interactively with the ability to store files prefix.vertices and prefix.faces, containing respectively the vertices and faces of the mesh.
Is also possible to simultaneously export multiple objects with the ability to apply the modifiers before exporting. The export deals only with the mesh, so there are not applied the transformations like translation / rotation / scale of the object.

Following is a brief description of the syntax adopted for export .vertices file:

n_vertices
vertex_01_x vertex_01_y vertex_01_z
vertex_02_x vertex_02_y vertex_02_z
vertex_03_x vertex_03_y vertex_03_z
vertex_04_x vertex_04_y vertex_04_z
vertex_05_x vertex_05_y vertex_05_z
...

and .faces file:

n_faces
face_01_vertex_01_ID face_01_vertex_02_ID face_01_vertex_03_ID face_01_vertex_04_ID
face_02_vertex_01_ID face_02_vertex_02_ID face_02_vertex_03_ID face_02_vertex_04_ID
face_03_vertex_01_ID face_03_vertex_02_ID face_03_vertex_03_ID face_03_vertex_04_ID
face_04_vertex_01_ID face_04_vertex_02_ID face_04_vertex_03_ID face_04_vertex_04_ID
...

In the future, the intention would be to expand export opportunities allowing you to export files with different formats and reporting information about the vertex-colors.

Installation of Blender Real-time Exporter:
Download realtime_mesh_exporter.py and open it with blender text editor, press Alt-P for run the script and in Object Data menu it will appear the new panel: Real-time Mesh Exporter.

You can also try the exporter with my simple Processing sketch BlenderToProcessing.pde. I don’t use libraries like toxiclibs or hemesh, but only Processing function beginShape(). So with particular quad faces it gives some errors of visualization.

Happy Blending

[UPDATE]

Here is an updated versione of the script to blender 2.69:

simple_realtime_mesh_exporter_v269.py

About these ads

11 Responses to “Blender Real-time Exporter (simple version)”

  1. Hello. I am wondering if you can help me. I have installed your scripts as you show in your video but I can not see the blender object in the processing window when the script is running.
    Any help please?

    Thank you

    Marco

  2. hi Marco!
    try to check if the files have been written correctly, opening with your text editor. Then check if the processing path is set for the same directory. Which version of blender / processing do tou use?

  3. which files do you mean for me to check? And I am using Blender 2.6 and processing 2.0.
    thank you

    • Well, the script was deprecated, this is a newer version that I tested with blender 2.65:

      http://alessandrozompa.altervista.org/download/simple_realtime_mesh_exporter_v265.py

      After running the script, in blender intarface you will find the exporter panel inside the “Object Data” menu. Here set the path where you want to save your mesh informations. It is important that you use the same path for both blender and processing. It is a good choice to store information from blender directly inside processing sketch.
      I also updated the .pde file for a small fix. Now it looks directly for files “myMesh.vertices” and “myMesh.faces” inside the sketch folder. (obviously you must use the right name)

  4. it works! :D
    I think it was the updated script version for blender. But thanks a lot! Its great.

  5. Hello Alessandro :)
    You have done such a nice work with this script. Unfortunately I can’t run it. I’m trying to follow your steps in the tutorial you’ve made, but somehow, something is missing. Let’s try again and you will tell me if I’m wrong – step by step.
    So 1-st:
    -> I’m importing .py script to blender (should I save it after, or before that? Curently I’m using the last version of Blender which is 2.69, is that a problem also?)

    2nd
    -> I already opened processing with the script there, and saved the sketch into the same folder/place with the blend file is. In my case “BlenderToProcessing” sketch folder.
    Now, my question as a begginer in this case is – should I have 2 more files into the same folder, after I run the script(.py) or they should appear in separate folder?), again in my case “.faces”; “.vetices” into same folder.

    3th
    -> and at the end
    Thank you again for your time and work imput – developing such script. If I find out how to use it – I will try to collaborate it for my next art work.
    Thank you!

    p.s: The current message from Processing (version 2) is :

    “Framebuffer error (unknown error), rendering will probably not work as expected Read http://wiki.processing.org/w/OpenGL_Issues for help.
    OpenGL error 1286 at bot beginDraw(): invalid framebuffer operation
    OpenGL error 1286 at bot endDraw(): invalid framebuffer operation
    Framebuffer error (unknown error), rendering will probably not work as expected Read http://wiki.processing.org/w/OpenGL_Issues for help.
    OpenGL error 1286 at top endDraw(): invalid framebuffer operation”.

    • Hi dama! Thank for your feedback. The issues are probably related to the version of both blender and processing. I’ll update both script soon ;-)

      • Thank you Alessandro!
        Good luck :)

      • Hi Dama,
        I updated the blender script to the version 2.69. I also tested the processing one, and with the latest 2.1.1 it works perfectly.
        Try to run it again.
        Answering to your question regarding the files location, you need to export both files “myMesh.faces” and “myMesh.vertices” directly in the sketch folder. Let me know ;)

        cheers
        Alessandro

Trackbacks

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

Iscriviti

Ricevi al tuo indirizzo email tutti i nuovi post del sito.

Unisciti agli altri 26 follower

%d blogger cliccano Mi Piace per questo: