It is currently Tue Sep 15, 2026 3:18 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Having trouble with a script
PostPosted: Sat Dec 07, 2024 10:39 pm  (#1) 
Offline
GimpChat Member

Joined: Jun 29, 2015
Posts: 7
a person on this board wrote me a script and ive since changed the computers OS from windows to linux mint and am now having trouble getting the script to work can someone tell me how to get it to work ive posted the script as it was writen as i backed it up before switching OS

(script-fu-register
"script-fu-Terra-visible-to-mult-layr"
"Visible to mult layer"
"Add layer from visible, set it to multiply mode"
"Jon Tait (at request of Terra at http://gimpchat.com)"
"Jon Tait (jontait2 at http://gimpchat.com)"
"2015-06-30"
"RGB* GRAY*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)

(script-fu-menu-register "script-fu-Terra-visible-to-mult-layr" "<Image>/Filters/Terra/")

;********

(define
(script-fu-Terra-visible-to-mult-layr
inImage inDrawable
)
(let*
(
(multLayer (car (gimp-layer-new-from-visible inImage inImage "mult layer")))
)
(gimp-image-undo-group-start inImage)

(gimp-image-insert-layer inImage multLayer 0 -1)
(gimp-layer-set-mode multLayer MULTIPLY-MODE)

(gimp-image-undo-group-end inImage)
(gimp-displays-flush)

);end let*
);end define


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: Having trouble with a script
PostPosted: Sun Dec 08, 2024 12:17 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 859
Location: SEA - South East Asia
Out of the blue...
Which GIMP? if it's GIMP 3 RC1/GIMP 2.99.xx, your script might need some little changes, be in the plugin folder with the right to be executed as program
Also if it's an indexed image this script is for RGB and Gray scaled image

_________________
Patrice


Top
 Post subject: Re: Having trouble with a script
PostPosted: Sun Dec 08, 2024 4:00 am  (#3) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2614
It could be that the Mint Gimp 2.10 does not have the compatibility switch enabled.

There is one parameter that uses the old syntax.

Vary rarely (so-far for me) a script-fu is easy to edit for Gimp 3.0 - this is one. A single parameter to change, and it works with both Gimp 2.10 and Gimp 3.0

Attachment:
layermode.jpg
layermode.jpg [ 129.87 KiB | Viewed 2779 times ]


script attached, works here but as usual no guarantees.


Attachments:
terra.scm [835 Bytes]
Downloaded 51 times
Top
 Post subject: Re: Having trouble with a script
PostPosted: Sun Dec 08, 2024 8:58 am  (#4) 
Offline
GimpChat Member

Joined: Jun 29, 2015
Posts: 7
its 2.10 is what im using and i tried your script and got it in the scripts folder and refreshed and it still didnt work you mentioned a compatiablity mode how do i turn that on ive never used an RC version of software so i dont know if i want to try that while im still getting used to linux


Top
 Post subject: Re: Having trouble with a script
PostPosted: Sun Dec 08, 2024 1:40 pm  (#5) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2614
I do not think I can help much. I do not think it is a backward compatibility issue, probably the version of Gimp 2.10 (from repo / flatpak / someting else)

Attachment:
works-here.jpg
works-here.jpg [ 112.86 KiB | Viewed 2724 times ]


This is a Mint 21.3 Virginia (1) It is the default Gimp 2.10.30 from the Mint repo.
I can start Gimp from a terminal (2) with:
gimp --pdb-compat-mode=on

...and that is working here. (3) ...but it works anyway.

Maybe if you give a few more details of Mint version and Gimp version someone will have an answer.


Top
 Post subject: Re: Having trouble with a script
PostPosted: Sun Dec 08, 2024 2:06 pm  (#6) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4554
Location: Canada
I don't know what happens when you have 2 scheme files since you said you copied rich's file into scripts but didn't mention removing the other one.

If scheme fu version doesn't work, try python fu
Unzip attached file, toss in your GIMP's plug-ins folder, set the file to be executable (you have to make executable on Linux).
It'll be available under Python-Fu/A Terra menu item.
#!/usr/bin/env python
# Author: Tin Tran
# Created On: 2024.12.04
# Add visible layer
# Set to multiply mode
# Revisions:
# 0.1 Initial Version
from gimpfu import *
import os
import math
import time
def terra(image,layer):
    multLayer = pdb.gimp_layer_new_from_visible(image,image,'mult layer')
    pdb.gimp_image_insert_layer(image,multLayer,None,0)
    pdb.gimp_layer_set_mode(multLayer, LAYER_MODE_MULTIPLY)
register(
    "python_fu_terra",
    "Creates Multiply Visible Layer",
    "Creates Multiply Visible Layer",
    "author name",
    "copyright name",
    "2024.12.08",
    "A Terra",
    "RGB*",      # Alternately use RGB, RGB*, GRAY*, INDEXED etc.
    [
    #INPUT BEGINS
    (PF_IMAGE, "image", "Image", None),
    (PF_DRAWABLE,   "layer", "Drawable", None),
    #INPUT ENDS
    ],
    [],
    terra,
    menu="<Image>/Python-Fu")

main()

# Below is all the example input types for INPUTS for the plug-in which can be cut and pasted into #INPUT BEGINS section and edited to taste (found online years back that I didn't want to constantly look up)
# Since GIMP is free anyways, I thought it would be handy here for me to CUT and PASTE, CHANGE, USE.
#           (PF_INT, "p0", "_INT:", 0), # PF_INT8, PF_INT16, PF_INT32  similar but no difference in Python.
#           (PF_FLOAT, "p02", "_FLOAT:", 3.141),
#           (PF_STRING, "p03", "_STRING:", "foo"),  # alias PF_VALUE
#           (PF_TEXT, "p04", "TEXT:", "bar"),
#           # PF_VALUE
#           # Pick one from set of choices
#           (PF_OPTION,"p1",   "OPTION:", 0, ["0th","1st","2nd"]), # initially 0th is choice
#           (PF_RADIO, "p16", "RADIO:", 0, (("0th", 1),("1st",0))), # note bool indicates initial setting of buttons
#           # PF_RADIO is usually called a radio button group.
#           # SLIDER, ADJUSTMENT types require the extra parameter of the form (min, max, step).
#           (PF_TOGGLE, "p2",   "TOGGLE:", 1), # initially True, checked.  Alias PF_BOOL
#           # PF_TOGGLE is usually called a checkbox.
#           (PF_SLIDER, "p3", "SLIDER:", 0, (0, 100, 10)),
#           (PF_SPINNER, "p4", "SPINNER:", 21, (1, 1000, 50)),  # alias PF_ADJUSTMENT
#           # Pickers ie combo boxes ie choosers from lists of existing Gimp objects
#           (PF_COLOR, "p14", "_COLOR:", (100, 21, 40) ), # extra param is RGB triple
#           # PF_COLOUR is an alias by aussie PyGimp author lol
#           (PF_IMAGE, "p15", "IMAGE:", None), # should be type gimp.image, but None works
#           (PF_FONT, "p17", "FONT:", 0),
#           (PF_FILE, "p18", "FILE:", 0),
#           (PF_BRUSH, "p19", "BRUSH:", 0),
#           (PF_PATTERN, "p20", "PATTERN:", 0),
#           (PF_GRADIENT, "p21", "GRADIENT:", 0),
#           (PF_PALETTE, "p22", "PALETTE:", 0),
#           (PF_LAYER, "p23", "LAYER:", None),
#           (PF_CHANNEL, "p24", "CHANNEL:", None),  # ??? Usually empty, I don't know why.
#           (PF_DRAWABLE, "p25", "DRAWABLE:", None),
#           # Mostly undocumented, but work
#           (PF_VECTORS, "p26", "VECTORS:", None),
#           (PF_FILENAME, "p27", "FILENAME:", 0),
#           (PF_DIRNAME, "p28", "DIRNAME:", 0)
#           # PF_REGION might work but probably of little use.  See gimpfu.py.



Attachments:
File comment: zipped terra.py file
terra.zip [1.62 KiB]
Downloaded 50 times

_________________
Image
Visualize your and others dreams coming true.
Top
 Post subject: Re: Having trouble with a script
PostPosted: Tue Dec 10, 2024 8:55 am  (#7) 
Offline
GimpChat Member

Joined: Jun 29, 2015
Posts: 7
i switched it from flatpak to system package and got the script to work thank you everyone for your help


Top
 Post subject: Re: Having trouble with a script
PostPosted: Fri Dec 13, 2024 6:29 am  (#8) 
Offline
New Member

Joined: Dec 13, 2024
Posts: 2
It is frustrating when one has a problem with a script, but it can be a great learning experience. Break the problem down into smaller parts and check for errors or bugs step by step. Use online resources, forums, or advice from others who may have faced similar issues. Troubleshooting is a very important skill that improves with practice! :cool


Top
 Post subject: Re: Having trouble with a script
PostPosted: Fri Dec 13, 2024 9:42 am  (#9) 
Offline
GimpChat Member

Joined: Apr 11, 2024
Posts: 311
Such a comment does not really help!


Top
 Post subject: Re: Having trouble with a script
PostPosted: Fri Dec 13, 2024 5:47 pm  (#10) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4554
Location: Canada
I think gimpchat is being attacked by AI writers.

_________________
Image
Visualize your and others dreams coming true.


Top
 Post subject: Re: Having trouble with a script
PostPosted: Sat Dec 14, 2024 3:26 am  (#11) 
Offline
GimpChat Member

Joined: Apr 11, 2024
Posts: 311
That's my feeling, too.


Top
 Post subject: Re: Having trouble with a script
PostPosted: Sat Dec 14, 2024 4:07 am  (#12) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
trandoductin wrote:
I think gimpchat is being attacked by AI writers.


More like spammers. Random stuff to get enough posts/karma to be able to post links. Like they have always done, but instead of copy-pasting other posts, they generate the text with AI. Many of these on G-F.n too, but besides the dummy posts there are other criteria.

_________________
Image


Top
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group