NewGrowth Interactive tree design, Blender 2.80 edition

Today I am happy to announce the Blender 2.80 edition of my NewGrowth add-on.

The add-on allows you to design trees interactively and later even adjust some parameters of the generated tree mesh.

An introduction and a feature overview are avaliable in the next two videos (still showing the 2.79 user interface)

The add-on is available on BlenderMarket.

More convenient debug output when compiling Blender 2.80 OpenGL shader programs

Because this might be useful to other people as well, I created a small module that compiles OpenGL shader programs and shows compilation and linking errors in a more convenient manner. On successful compilation it also list all remaining active attributes and uniforms so you can see which ones have been optimized away (and may cause errors when trying to assign values to them with batch_for_shader() or shader.uniform_xxx()

On compiling OpenGL shaders Blender lists errors on the console and (with the --debug-gpu-shaders option) will dump source code into the /temp directory. That is not very convenient because it is not in one place and the source code does not contain line numbers. When you use the debug_program() function form the opengl_debug module the output is all on the console and reorganized for readability.

Nicer error listing

For example, with the code below
    vs_syntax_error = '''
    in vec3  pos;

    void main()
    {
        gl_Position = pos
    }
    '''

    debug_program(vshader=vs_syntax_error, name="Syntax error sample")
The output will be
GL Error: 0 (Syntax error sample:vertexshader)
0(7) : error C1035: assignment of incompatible types
0(8) : error C0000: syntax error, unexpected '}', expecting ',' or ';' at token "}"

[0001] #version 330
[0002] 
[0003]     in vec3  pos;
[0004] 
[0005]     void main()
[0006]     {
[0007]         gl_Position = pos
[0008]     }
[0009]

Active attributes and uniforms

Also, when there are syntax errors it shows the remaining active attributes and uniforms. For example, with the code below (assuming you have done import debug_program from opengl_debug)
    vs_opt = '''
    in vec3  pos;
    in vec3  pos2;
    void main()
    {
        gl_Position = vec4(pos, 1.0);
    }
    '''

    debug_program(vshader=vs_opt, name="Optimized attribute")
The output will be
active attributes
['GL_FLOAT_VEC3'] pos 
active uniforms
showing that there are no active uniforms whatsoever and that the pos2 attribute has been optimized away.

Code availability

The code is available from my GitHub repository.

floorboard add-on: Blender 2.80 compatible version available

A new version of the floorboards add-on that is compatible woth Blender 2.80 is available on GitHub. (this is a single python file: select File->Save As... from your browser and save it somewhere as planks.py. Then in Blender, select File->User preferences->Add-ons->install from file... (don't forget to remove an earlier version if you have one).

It is a pretty minimal port, i.e. I only made the necessary changes to make it run on 2.80 but to be honest, the add-on shows its age. The coding isn't very elegant and there are still a number of known issues. Nevertheless, it's a start, so enjoy!

PS. there are quite a few articles on this blog that talk about this add-on, check here for a list.