11-17-2024, 09:26 AM
(11-17-2024, 05:07 AM)Newman Wrote: Plug-in: group-selected-layers
Description: nests all currently selected layers inside a new group layer.
UPDATED VERSION addressing most of the changes suggested (again many thanks, Ofnuts).
Anymore feedback still very much welcome
Now tested and working on version 3.0.0-RC1+git
More details in code comments
Commit history here: https://github.com/newinput/gimp3_plug-i...ted_layers
For do_set_i18n() you can return (False, None, None)
|code]
for drawable in n_drawables:
if drawable not in selected_layers and (Gimp.Item.is_layer(drawable) or Gimp.Item.is_group_layer(drawable)):
selected_layers.append(drawable)
[/code]
Since
- I doubt that a layer/group appears twice in n_layers
- GroupLayer is a subclass of Layer, so any GroupLayer is a Layer
Code:
selected_layers=[drawable for drawable in n_drawables if drawable.is_group()]
Code:
if len(selected_layers) == 0:
Code:
if not selected_layers:
Your "messages" are a soup of "\n". (and IMHO they are too long anyway). If you want a clean message, investigate using triple quoting:
Code:
Gimp.message('''
This message appears exactly
as you
type it!''')