Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Layer Group set active
#3
(05-17-2023, 09:17 PM)Ofnuts Wrote: In script-fu you can use (gimp-image-set-active-layer image active-layer), in Python pdb.gimp_image_set_active_layer(image, active_layer), but the active_layer attribute of a gimp.Image object is writable: image.active_layer=image.layers[1].

However the "active layer" is a human user thing. All the functions that apply to a layer take an explicit layer parameter so there is little point in changing the active layer. The only thing I would use this for is to change the active layer before returning control to the user, assuming it is not what the user would expect.

Indeed so, but I've come across some exceptions that reply on the active layer so they would need it setting to the one that's wanted if not already it e.g.

pdb.plug_in_autocrop_layer (that caught me out)
pdb.script_fu_perspective_shadow (strangely)
pdb.plug_in_gmic_qt (maybe)

Of course it's a long shot david wants to use one of these so I guess that raises the question, david what do you want the active layer set for?
Reply


Messages In This Thread
Layer Group set active - by david - 05-17-2023, 08:36 PM
RE: Layer Group set active - by Ofnuts - 05-17-2023, 09:17 PM
RE: Layer Group set active - by teapot - 05-17-2023, 11:21 PM
RE: Layer Group set active - by david - 05-18-2023, 08:31 AM
RE: Layer Group set active - by Ofnuts - 05-18-2023, 09:47 AM

Forum Jump: