10 hours ago
Hello!
For a game I'd like to create tiles for tileset. The task is simple: get a image with 3+ layers (colors, and heightmap), for each layer create 3 copy, rotate it 60, 180 ,270 degree and offset it 1*,2*,3* width.
After get the heightmap layer duplicate it, add noise and call the normal map filter. (there are some masking, etc). Get the color layers, add some nose. Flattering down each group of layers.
Because I'd like to use it many times, i created (or try to create) a plugin for it.
Looks like easy.
The problems: because its a python, you need to test is, for the typos too. so each iteration need to restart gimp load the image test the script.
There are no usable documentation. I already found the https://lazka.github.io/pgi-docs/#Gimp-3.0, helped a lot, but lack of examples. all examples for the gimp 2.x
For example, how can I do filter->generic->normal map?
There are some undocumented "features": If you rename a layer, in the gimp UI the name stay the old one (its not a big problem) but after you cant export it into .ora and gimp went some unstable state. If remove a layer from image cant add it again to it, because already had.
Now I have 300+ line of code for that "simple" task, about quarter are dead code ("maybe that work") and not working well:
- after I call <layer>.transform_rotate_simple(rotate_angle,True,0,0) its stay is "floating selection transform" state and somehow need to anchor it how?
- how can I proper call the filters->generic->normal map filter with preset or how set the values?
- how can I proper call the filters->noise->hsv filter with preset or how set the values?
- how can I invert selection?
- how can I proper generate greyscale noise between color rgb(123,123,123) and rgb (133,133,133), I tried the buffer.set(rect, "RGBA u8", bytes(pixels)) with pixels.extend([gray, gray, gray, 255]) it's worked, but not get the right color (I get lighter about rgb(180,180,180), now I use set_pixel but its slow for 64x64 images
- from where can I get some useful examples for gimp 3 python scripting?
Thanx
For a game I'd like to create tiles for tileset. The task is simple: get a image with 3+ layers (colors, and heightmap), for each layer create 3 copy, rotate it 60, 180 ,270 degree and offset it 1*,2*,3* width.
After get the heightmap layer duplicate it, add noise and call the normal map filter. (there are some masking, etc). Get the color layers, add some nose. Flattering down each group of layers.
Because I'd like to use it many times, i created (or try to create) a plugin for it.
Looks like easy.
The problems: because its a python, you need to test is, for the typos too. so each iteration need to restart gimp load the image test the script.
There are no usable documentation. I already found the https://lazka.github.io/pgi-docs/#Gimp-3.0, helped a lot, but lack of examples. all examples for the gimp 2.x
For example, how can I do filter->generic->normal map?
There are some undocumented "features": If you rename a layer, in the gimp UI the name stay the old one (its not a big problem) but after you cant export it into .ora and gimp went some unstable state. If remove a layer from image cant add it again to it, because already had.
Now I have 300+ line of code for that "simple" task, about quarter are dead code ("maybe that work") and not working well:
- after I call <layer>.transform_rotate_simple(rotate_angle,True,0,0) its stay is "floating selection transform" state and somehow need to anchor it how?
- how can I proper call the filters->generic->normal map filter with preset or how set the values?
- how can I proper call the filters->noise->hsv filter with preset or how set the values?
- how can I invert selection?
- how can I proper generate greyscale noise between color rgb(123,123,123) and rgb (133,133,133), I tried the buffer.set(rect, "RGBA u8", bytes(pixels)) with pixels.extend([gray, gray, gray, 255]) it's worked, but not get the right color (I get lighter about rgb(180,180,180), now I use set_pixel but its slow for 64x64 images
- from where can I get some useful examples for gimp 3 python scripting?
Thanx