Page MenuHome

Export Materials to GLSL Code
Closed, InvalidPublicPATCH


Project: Blender Extensions
Tracker: Py Scripts Upload
Blender: 2.60
Category: Game Engine
Python: 3.2
Script name: GLSL Exporter
Wiki page:
Author(s): Vitor Balbio
Status: Open

Export one or more materials to GLSL Code
Select the Export mode in "Material Properties" and click in "Export"

Event Timeline

Due to changes to the api including the merging of bmesh, several addons are outdated.
Please, if you are the author of an addon check your script with blender revision 44256 or newer.
That is builds made After blender 2.62 official release.
I would ask that updates be made to your addon before the Blender 2.63 release.
6-8 weeks away.
This allows time for the api to become more exposed & bmesh to stablize furthur.
If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions.
At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed"
this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened.

Thanks for your understanding & patience during these Exciting Times.

Please don't use backslashes as path separators.


frag = open(self.filepath + "\mat_" + + ".frag","w")


frag = open(os.path.join(self.filepath, "mat_" + + ".frag"),"w")

I have taken the liberty to update the code for the following:

  • Using proper path separators, as described above.
  • Removed duplicated and commented-out code.
  • Removed unused properties on the Scene type.
  • Moved the enum property from Scene to WindowManager and used meaningful names.
  • Safer writing of files (using context manager rather than depending on reference counting).
  • Reporting how many materials were exported.

The new version:

That is great Sybren. There was a while that i don't check it to update and fix bugs. Sure this addon can be useful to someone yet. Thanks!

Brendon Murphy (meta-androcto) changed the task status from Unknown Status to Unknown Status.Sep 3 2015, 9:20 AM

hi, Vitor Balbio (vitorbalbio), could you please update the wiki page with a link to your latest code.
Archiving this page for now.
Feel free to resubmit this addon if your maintaining it & would like to develop in Blender.

Ryan (r_guy) added a subscriber: Ryan (r_guy).EditedDec 13 2016, 12:46 AM

Will this work with the most recent version of blender (2.78)?
The download link on the wiki page
takes me to the maniphest page, which makes me wonder if this add on is no longer supported. Is there a new way to export glsl that has supplanted this one?

edit: the updated script that @Sybren A. Stüvel (sybren) links to still seems to work

Hello Guys,
There is a chance so start using Blender, in serious pipeline for automotive industry, I'm already in a process but I was wondering if this plugin could be updated for 2.8, or there is a plan for another tool in 2.8 similar like this one for exporting Cycles or Eevee shaders to Frag, Vertex once?

Basically, we need to have proper Ver, Frag sharer availability after the export.
We are using real-time engines for Auto-Cockpit and embedded systems. I will appreciate to discuss the topic with someone of the developers.

This was developed for BGE that was removed in 2.8 and there's no direct shader access from python in EEVEE so i don't think it's possible to get GLSL shaders at this time.

Thank you for respond Vitor,

Do you think this could be done in addition by someone for 2.8 or? Are you saying there is no possibilities of access the GLSL generated materials in viewport via python. Interesting, then how the shader nodes are translated to the GLSL view-port environment then?