I have a few development related questions:
-
I found the
makesdna
andmakesrna
code generation tools insource/blender
. Additionally I foundmsgfmt
insource/blender/blentranslation
and I found the filesource/blender/gpu/intern/gpu_codegen.c
- These all appear to be pre-build time code generators. Is this correct?
- Are there any other pre-build time code generators?
- Would it be a good idea to move all of these into a common parent directory? (i.e.
source/blender/codegens
) - Are these (or should these) be run as part of
make format
code cleanup step? - Where should I put a new code generator, if needed (until there is a common parent for them)? and is there a standard place to add it to the makefiles for the build processes?
- Are there any general/multi-purpose code generators in blender’s codebase already, so I am neither reinventing the wheel nor contributing to an explosion of small single-purpose tools in the tree?
-
I was very happy to hear that Blender includes an automated unit test suite. I was also happy to hear that OSL supports automated unit test suites as well. While I’m a big proponent of TDD, I am not using it for my current effort, as I am still stumbling around, trying to find my way around the codebase.
- How do I run the current automated test suite(s) for blender?
- If there are more than one, or one with multiple modes, what does each suite (or mode) cover?
- Do any of these have options to skip slow or hardware dependant tests?
- Do I need any additional software or hardware installed (or other prerequisites) to run any of them (beyond what is required to build blender from source)?
- Do any/all of these return a non-zero exit code on failure, so I can fail my build on a test suite failure?
- Is there any easy way to fail my build on test failure when building on Windows?
- Where in the code are the test suite subdirectories, and how are they subdivided?
- Does GLSL support (at least in blender, if not in general) automated test suites?
- Do Blender’s automated test suite(s) include tests for OSL and/or GLSL shader code already?
- Do Blender’s addons repositories also have automated test suite(s) for the python code there?
- How do I run the current automated test suite(s) for blender?
-
I’m working on a complex patch to Voronoi algorythms in Blender, and am aware that even if I manage to get it finished, submitted, reviewed, tested and merged before the July release cycle, not all of my changes may be desired. Locally, I am keeping my changes grouped in such a way that I can easily squash them into several logical commits that would allow the reviewer(s) to easily remove subfeatures they want to delay or remove.So far I have only seen ways to submit single diff patches to Blender.
- Is there an official mechanism to submit a multi-commit branch for Blender review?
- How?
- Is there anything else I should consider to break this patch up?
-
Some of the shader code I’m working on contains some “unrolled loops” (in quotes because nothing remaining in the code indicates it should be interpreted as a loop) which inhibits readability. In C++ this wouldn’t be a problem, as the compiler’s optimizer can be relied on to unroll them when appropriate. As much as I am no fan of C preprocessor tricks, that seems to be the one trick available to C++, OSL and GLSL that I can use to address this. I will have to experiment, but I believe I can leverage C preprocessor macros to make these unrolled loops much more clear and readable, but the proof will be in the pudding.
- I know very few developers that are fans of doing anything fancy with the C preprocessor. I am no fan of it myself; so I expect this to be controversial. My focus will be on code clarity, but do you anticipate this will still be rejected outright?
- I believe repeated code is a bad idea in general, and I don’t expect any of my C preprocessor macro loop unrolling code to be language specific. Is there anywhere I can put an
.h
file in the blender source code tree that can be included from C++, OSL and GLSL? - Have any of you seen something like this done clearly and successfully? I’m pretty sure I know how I want to do this, but I’m certainly open to better ideas.
-
Should this have been 4 separate posts?
Thank you in advanced for your answers. Everybody in the blender development community has been very welcoming and helpful.