Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Normal Map scripting function

Sat Mar 14, 2020 1:35 am

hello guys,
i am working on a script to automate creating normal maps from a texture with the integrated Filters > Generic > Normal Map but i cant find the python function for it when searching the Python procedure browser.
but i found another function that is in the same menu so are some just missing or did not got "wrapped" into python? any info/help will be appreciated

i am using gimp 2.10.18 on Manjaro Linux

Re: Normal Map scripting function

Sat Mar 14, 2020 2:02 am

All Gimp functions with a big G in front have no corresponding pdb entry (yet).

Re: Normal Map scripting function

Sat Mar 14, 2020 2:48 am

ok thank you very much, is there another way to get it working in python or maybe in script-fu (havnt looked into that yet) to use it in a automated script?

Re: Normal Map scripting function

Sat Mar 14, 2020 3:57 pm

Officially no. The "pdb" is the procedural-database, which the scripting languages use to access various GIMP functions.

However, there may be a possiblity. In the issue raised about scripting GEGL actions: https://gitlab.gnome.org/GNOME/gimp/issues/1686 Massimo showed a way that it was possible to call the GEGL shared library from Python.

I've had some success implementing some of the functions, but I've not tried Normal Map yet.

Kevin

Re: Normal Map scripting function

Wed Mar 18, 2020 10:35 am

On the off chance that you come back, here is a python plugin that adds gegl-normal-map to the PDB

Kevin

Re: Normal Map scripting function

Sat Mar 28, 2020 8:33 am

hey, thank you for your effort tho i found another way to achive what i wanted.

i used the gimp-normalmap plugin (can be found on google code archive - "cant post links here") to do the converstion tho there was a problem that the plugin did not let me do that so i had to change one line in the code and compile it myself. That was pretty easy on linux but a little harder for windows but i got it working.

Not sure if i am allowed to share that modification but if so i can provide the compilled dll.
The only thing i did there was to change line 202 to:
Code:
nmapvals.alphamap_id = 0;


this was causing the plugin to crash when i was using it from NONINTERACTIVE gimp console so i changed it, not sure if that is the right solution but it did work for me sofar, so good enough ;)

Re: Normal Map scripting function

Wed Oct 12, 2022 12:03 am

Hi,I am facing the same issue and I have around 70k human face images. This is the first time I am using GIMP, can anybody tell me the easiest way to do the normal map generation? I have used the python code but unfortunately it gets crashed everytime I try using BIMP to automate task.
I am using Windows 10 and GIMP 2.10.
Thank you!
Post a reply