GIMP Chat
http://gimpchat.com/

Group scripts (python scripts that work on layer groups)
http://gimpchat.com/viewtopic.php?f=9&t=4899
Page 1 of 1

Author:  dd [ Tue Aug 07, 2012 8:49 am ]
Post subject:  Group scripts (python scripts that work on layer groups)

Group offset

This script basically does what Layer>Transform>Offset does, except it works on layer groups. All layers inside the group will be offset, including ones in nested groups - I used a recursive function so it doesn't matter how many levels of nesting there are.

http://registry.gimp.org/node/26996

Should be useful for texture making.


Group change font

This script changes the font and/or font size of all text layers within a layer group. Recursion optional.

http://registry.gimp.org/node/26997


---------------

All scripts install under "Group" top-level menu. I intend making more of these group tools in the future, which will all also install under "Group". If you don't like the creation of another top-level menu, feel free to modify the scripts for yourself.

Also taking requests - if there's anything you'd like to be able to do to a layer group, let me know and I can attempt to make it a reality (if it's not too difficult for me).

All scripts are released under GNU GPLv2.

Author:  Rod [ Tue Aug 07, 2012 9:39 am ]
Post subject:  Re: Group Offset (python script)

Thanks dd i was wondering when you were going to write another plug-in. :)

Author:  dd [ Tue Aug 07, 2012 9:50 am ]
Post subject:  Re: Group scripts

Thanks. I made another one.

Author:  Rod [ Tue Aug 07, 2012 10:18 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

I see that.I have a request for a all layers to image size within a group.
I found one - http://registry.gimp.org/node/26310 :)

By the way i have been placing them here...
"<Image>/Layer/Group/ because i have other Python and SCM filters that show there.

Example...

Image


Thanks again.

Author:  dd [ Tue Aug 07, 2012 11:48 pm ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

You can already crop a layer group to image size in GIMP by simply selecting "layer to image size" on a group. In practice, the layers within the group are simply cropped to image size, but they won't be growed to the image size, so it works kind of weirdly.

Author:  Rod [ Wed Aug 08, 2012 12:06 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

How about a layers to existing group addition?
A lot of times i will be doing some work and realize a few of my layers could have gone into a certain group (not a new one), an existing one. :)

Author:  dd [ Wed Aug 08, 2012 8:58 pm ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

Rod wrote:
How about a layers to existing group addition?
A lot of times i will be doing some work and realize a few of my layers could have gone into a certain group (not a new one), an existing one. :)


Hm, this is actually a bit more complex than it sounds, it would require some kind of interface for selecting the layers and the group, so probably can't be written as a simple gimpfu script... I might get to it at some point though, it would be useful to have.

Author:  Rod [ Thu Aug 09, 2012 8:46 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

Sweet. :)
Thanks.

Author:  looknear [ Sat Jun 10, 2017 6:19 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

Gimp 2.8.22 on ubuntu
change fonts script gives :
----------------------------------------------
Traceback (most recent call last):
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 736, in response
dialog.res = run_script(params)
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 360, in run_script
_set_defaults(proc_name, params)
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 350, in _set_defaults
gimpshelf.shelf[key] = defaults
File "/usr/lib/gimp/2.0/python/gimpshelf.py", line 84, in __setitem__
p.dump(value)
File "/usr/lib/python2.7/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle GroupLayer objects

----------------------------------------------------------------------------

like any other script that run on image with group layers.
any solution for that?
is all the above samples run only on windows version? is there a difference?

i had a script that was working a year or so ago - also on inner layers of groups. it just stopped working. and no i see none group targeting script works...

help will be much appreciated.

Author:  rich2005 [ Sat Jun 10, 2017 7:08 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

That group_chfont.py error came up not so long ago.

Ofnuts posted a fix here:
https://www.gimp-forum.net/Thread-Help- ... 60#pid2060

Two versions, a quick test and they both work here, you need to read the post for context.

Author:  Zero01 [ Sat Jun 10, 2017 7:31 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

Any idea if the 'Group Offset' script has a newer workable version? I tried it but it doesn't even create the top-level menu 'Group' item..(drop-down list)

Thanks.

Author:  looknear [ Sun Jun 11, 2017 8:06 am ]
Post subject:  Re: Group scripts (python scripts that work on layer groups)

Hi

thanks for the link to the updated script.
it is working - but it is working on the selected/active group layer only.
Is it because of redundancy in the new gimp versions? i didnt understand the technical terms of the post writer i guess.

My finding on the issue is as follow:
while trying to "drill down" on an image, to analyse all its groups and layers recursively:
on Windows version 2.8.20 - the script working fine!
On Ubuntu - gimp version 2.8.22 - It is poping up the "cant pickl" error as described before.
After downgrading ubuntu version to 2.8.16 - same error. not change

I will now try to upgrade my windows machine to 2.8.22 and to test again.
But it looks like the window and ubuntu versions are not the same.
The ubuntu version showing this error - while the windows version is doing it with no problem.
is that some type of python version differences maybe? (as this error look more like a core error)

Any thoughts and help will be appreciated. :)

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/