Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete Layer?
#1
Hi Everyone, I have been learning script-fu but have hit a roadblock.

I have a script-fu script that works perfectly except that is will not delete a layer.

Here is the script, minus the variables so that it is easy to run in a console.
The script is written to run on an image with an image id of "1" so you may need to adjust depending upon your current environment.

 ((gimp-selection-none 1)
 (gimp-item-set-visible (car(gimp-image-get-layer-by-name 1  "background" )) 1)
 (gimp-image-set-active-layer 1 (car(gimp-image-get-layer-by-name 1  "background" )))
 (gimp-image-insert-layer 1 (car (gimp-layer-new-from-drawable (car(gimp-image-get-active-drawable  1))  1)) 0 0 )
 (gimp-image-set-active-layer 1 (car(gimp-image-get-layer-by-name 1  "background copy" )))
 (gimp-image-select-color 1 0  (car(gimp-image-get-layer-by-name 1  "1.png" )) '(0 0 0))
 (script-fu-add-bevel 1 (car(gimp-image-get-layer-by-name 1  "background copy" ))  5 0 0 )
 (script-fu-add-bevel 1 (car(gimp-image-get-layer-by-name 1  "background copy" ))  5 0 0 )
 (gimp-selection-invert 1)
 (gimp-drawable-edit-clear (car(gimp-image-get-layer-by-name 1  "background copy" )))
 (gimp-item-set-visible (car(gimp-image-get-layer-by-name 1  "background" )) 0)
 (gimp-file-save 0 1 (car(gimp-image-get-layer-by-name 1  "background copy" )) "Style_A_1.png" "Style_A_1.png")
 (gimp-item-delete (car(gimp-image-get-layer-by-name 1  "background copy" ))))

Error: Procedure execution of gimp-item-delete failed 

I have tried deleting it by the id alone in the console ie (gimp-item-delete  13589 )
with the same results.

Any examples or guidance would be appreciated.

best regards
Dalton
Reply


Messages In This Thread
Delete Layer? - by DaltonCalford - 11-29-2022, 02:46 PM
RE: Delete Layer? - by Ofnuts - 11-29-2022, 06:27 PM
RE: Delete Layer? - by DaltonCalford - 11-30-2022, 03:12 PM

Forum Jump: