← All ideas
  • Published 6 Mar 2020

Add a python based drawing api for easier procedural 2d texture creation.

Libraries like cairo or processing in java or P5 in javascript make it very easy for people with just a little programming knowledge and bare minimum math knowledge to make simple/useful/interesting 2d graphics. For many this is far easier than using Blender's shading nodes. Some of these libraries like Cairo have a python version.

I would like to be able to type some relatively simple python code in Blender and then use the pixels generated by that as part of my regular material shader nodes.

For example I wanted to make a sawtooth-like pattern to use on some easter eggs. I could make it in photoshop but photoshop is slow on my computer. I could make it in gimp but I just don't like using gimp. Either way I wanted to make at least 20 color variations and doing that in gimp or photoshop would be a chore.

Instead I re-used some code I had written in JS to make this: khanacademy.org/computer-programming/picket-fence-pattern-function/4589393052631040 and wrote some other code to save that to png images with an array of different colors.

It would have been really nice to do something similar directly in Blender with Python.

50%

Development Status: Open

Upvote 1 Downvote 1
thinsoldier
6 Mar 2020

2 Comments

XYZS

python is slow, there is OSL for this

thinsoldier Author

* @XYZS * it's slow if it's part of the live computation of the materials. What I propose would be something just used for drawing shapes and patterns with simple code over in the texures area which are then saved or cached and you can then use the final result of that over in the materials. Also python is the main language used for so many other things in Blender it is the language most Blender users know or would be willing to learn over other languages.