dinasset wrote:
Update:
- completed the application of all 5 curves (value, red, green, bue, alpha)
here the new zipped program
Attachment:
python_cc_test2.7z
Now, because there are incomplete presets(*), I would like to know which statement insert to skip the types absent
("if ...." do not prepare/run the gimp command curves-explicit).As I said, I'm ignorant enough not to know it myself.
Thanks for any help.
(*) I get always error messages for one channel, different from preset to preset...Some channels won't be present in the settings data as Ofnuts code doesn't add the identity channels (those that don't do anything as their curve is a straight line from bottom left to top right).
Identity channels have this in the GimpCurvesConfig.settings file:
points 4 0 0 1 1
e.g. Your preset "Alien" channel value and channel alpha.
Therefore your preset "Alien" only has red, green and blue channels in the settings data.
So code in your function python_cc_test2 won't work as in hard coding the indices it assumes all channels are present.
I'd suggest you have a for loop that goes through the channels like Ofnuts does at the end of his load-colour-curves-preset.py code:
for c in s.channels:
Or with your variable name
for c in chosen_setting.channels:
Then use c.name to see which one it is e.g. red and c.samples to get the samples.
Unfortunately I'm stuck on an old version of gimp due to hardware issues so can't run your code. (Am hoping for a new computer next month).