It is currently Thu Jul 04, 2024 4:58 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Group scripts (python scripts that work on layer groups)
PostPosted: Tue Aug 07, 2012 8:49 am  (#1) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
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.


Last edited by dd on Tue Aug 07, 2012 9:51 am, edited 4 times in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Group Offset (python script)
PostPosted: Tue Aug 07, 2012 9:39 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks dd i was wondering when you were going to write another plug-in. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Group scripts
PostPosted: Tue Aug 07, 2012 9:50 am  (#3) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Thanks. I made another one.


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Tue Aug 07, 2012 10:18 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
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.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Tue Aug 07, 2012 11:48 pm  (#5) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
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.


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Wed Aug 08, 2012 12:06 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
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. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Wed Aug 08, 2012 8:58 pm  (#7) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
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.


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Thu Aug 09, 2012 8:46 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Sweet. :)
Thanks.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Sat Jun 10, 2017 6:19 am  (#9) 
Offline
New Member

Joined: Jun 10, 2017
Posts: 2
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.


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Sat Jun 10, 2017 7:08 am  (#10) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2438
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.

_________________
Image


Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Sat Jun 10, 2017 7:31 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 06, 2017
Posts: 204
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.


Last edited by Zero01 on Sun Jun 11, 2017 9:44 am, edited 1 time in total.

Top
 Post subject: Re: Group scripts (python scripts that work on layer groups)
PostPosted: Sun Jun 11, 2017 8:06 am  (#12) 
Offline
New Member

Joined: Jun 10, 2017
Posts: 2
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. :)


Top
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Scripts that don't work properly

5

No new posts Attachment(s) Scripts don't work anymore with Gimp 2.10.20

10

No new posts Attachment(s) John Lakkas scripts and plugins do not work

6

No new posts Attachment(s) Can someone please convert these two python scripts for Gimp 2.99.19

10

No new posts Shortcuts to 2.10 documentation re: Layer & Layer-group modes

0



* Login  



Powered by phpBB3 © phpBB Group