It is currently Fri Aug 28, 2026 12:49 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Plugin stop on a computer but not on the other
PostPosted: Fri Apr 19, 2019 1:47 am  (#21) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
MareroQ wrote:
@Jean-Marc68.
- you can not call another skript-fu from the skript-fu (this is understandable because only one can act actively),
- python plugin can not call another Python plugin (and I do not understand it),


Definitely not true for python:

#!/usr/bin/env python
import os,sys
from gimpfu import *

def caller(image):
    gimp.message('Caller script on image "%s"' % image.name)
    pdb.python_fu_called(image,"signature to prove call")
   
register(
    'caller',"Test python script call","Test python script call","me","me","9999","Test python script call","*",
    [
        (PF_IMAGE, "image", "Input image", None),
    ],
    [],
    caller,
    menu="<Image>/Test",
)
   
main()       

and
#!/usr/bin/env python
import os,sys
from gimpfu import *

def called(image,signature):
    gimp.message('Called script on image "%s" with call signature: "%s"' % (image.name,signature))
   
register(
    'called',"Test python script call (called, don't use)","Test python script call (called, don't use)","me","me","9999","Test python script call (called, don't use)","*",
    [
        (PF_IMAGE, "image", "Input image", None),
        (PF_STRING, "signature", "Signature", None)
    ],
    [],
    called,
    menu="<Image>/Test",
)
   
main()       


Attachment:
py2pycall.zip [834 Bytes]
Downloaded 138 times


Script-fu can be different (yes, AFAIK there is one single executor process), even though in that case why are the script-fu's added in the procedure browser if they cannot be used? But also AFAIK they are all in the same workspace (you can have function name clashes between script-fu's) so you can likely call their main function directly.

_________________
Image


Top
 Post subject: Re: Plugin stop on a computer but not on the other
PostPosted: Fri Apr 19, 2019 6:01 am  (#22) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2648
Location: Poland
Your example is the execution (RUN_NONINTERACTIVE) of a command from one plugin(caller) through the other (called) - in the default settings.

Test python script call Warning
Caller script on image "sample_lena.xcf"

Test python script call (called, don't use) Warning
Called script on image "sample_lena.xcf" with call signature: "signature to prove call"


For me, it would be interactive if I could enter my parameter (Signature)- but called running from caller it works only in the background
and nothing changes with:
pdb.python_fu_called(image,"signature to prove call")
on:
pdb.python_fu_called(image,"signature to prove call",run_mode=RUN_INTERACTIVE)

I think we understand what to expect from an interactive activity.

_________________
Image


Top
 Post subject: Re: Plugin stop on a computer but not on the other
PostPosted: Fri Apr 19, 2019 9:38 am  (#23) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
These two are about your statement that says:
Quote:
- python plugin can not call another Python plugin (and I do not understand it),


Now if you want to call them with RUN_INTERACTIVE it works only if the image parameter is None, but then it won't go very far after collecting the parameter value in the dialog because you can set the image in the dialog either. You can open a bug:)

_________________
Image


Top
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group