It is currently Fri May 24, 2013 8:49 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 10:22 pm  (#1) 
Offline
Gimp Scripts Editor
User avatar

Joined: Feb 18, 2011
Posts: 1569
Location: Australia
I have been left with these layers.

Image

And I'd like to delete the "Brouillard uni" layer before displaying the image with (gimp-display-new img)
Could somebody help me with the correct procedure as Wilbur does not like anything I have tried.

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 

 Post subject: Re: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 10:27 pm  (#2) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 2094
Location: Gimpville
Have you tried gimp-image-remove-layer?

Code:
(gimp-image-remove-layer img layer_name)

_________________
Image


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 10:36 pm  (#3) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 4957
i am looking the PB from gimp 2.7.3.
it says that "gimp-layer-delete" is deprecated and to use instead " gimp-item-delete" that has as argoment the id of the "item"

EDIT
Ninja posted, but Gnu-Tux should know better and anyway better 2 options then none :mrgreen:

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 11:28 pm  (#4) 
Offline
Gimp Scripts Editor
User avatar

Joined: Feb 18, 2011
Posts: 1569
Location: Australia
I tried (gimp-image-remove-layer img "Brouillard uni") but wilber said invalid type to argument 2

_________________
Image


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 11:30 pm  (#5) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5506
Location: Somewhere in GIMP
The standard method of deleting a layer doesn't work?

Image

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 11:43 pm  (#6) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 2094
Location: Gimpville
Graechan wrote:
I tried (gimp-image-remove-layer img "Brouillard uni") but wilber said invalid type to argument 2

You need to use the pointer variable name (let* statement) you defined in the script , rather than the textual name in your layers dialog. You may have to save it so you can point back to it later and delete it.

_________________
Image


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Tue May 31, 2011 11:49 pm  (#7) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 4957
@ O
Graechan is asking how delete a layer in a script-fu

@Graechan
because bruillard uni is the layer name but not the layer ID
I didn't like much script fu also for this type of obstacles, ...you cannot just order to delete the "top" or, the "bottom" layer or the active layer...first you have to recover the ID assigned by gimp to the layer...that has no relation with the layer name


But..sorry i forgot how to, i only remember that was explained in one of the script fu tutorial by FencePost on http://www.gimpdome.com

@Gnu Tux
Ninja posted again ! :lol
Still i believe the layer name passed as paramether instead then the layer ID remain a problem

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Profile  
 

 Post subject: Re: How to delete a layer in script-fu
PostPosted: Wed Jun 01, 2011 1:38 am  (#8) 
Offline
Gimp Scripts Editor
User avatar

Joined: Feb 18, 2011
Posts: 1569
Location: Australia
Fencepost wrote of using the "car" command to assign a layer ID so I tried this.

(set! activelayer (car (gimp-image-set-active-layer img "Brouillard uni")))

But i still get the same error on this command

_________________
Image


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Wed Jun 01, 2011 1:49 am  (#9) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5506
Location: Somewhere in GIMP
PhotoComix wrote:
@ O
Graechan is asking how delete a layer in a script-fu
:oops: Oh, my, how embarrassing. Forget I did that. Sheesh!

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
 Post subject: Re: How to delete a layer in script-fu
PostPosted: Wed Jun 01, 2011 1:51 am  (#10) 
Offline
GimpChat Member

Joined: Oct 06, 2010
Posts: 2688
Layer IDs are like definition variables (no quotes). Look at the define variables, and then look at the let* statements. You'll see layers being referred to things like:

text-layer

In this case, GnuTux pointed out that there is a let* statement that defines this layer and he suggested you use the procedure he recommends with that layer variable not the layer name. Make sense?

_________________
You cannot do a kindness too soon because you never know how soon it will be too late.

~Ralph Waldo Emerson


Last edited by mahvin on Wed Jun 01, 2011 2:32 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: 2-ton and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login   * Subscribe to RSS Feed


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group