Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Re: Script Mod Requests

Mon Feb 29, 2016 1:58 am

Hi All.

Robert - to me You are a master (eg. Arrowscreator.py or Workflow_setup.py - is an outstanding demonstration of what can be done in Python - and for me a model to further amateur science programming).

I have a request for You.
As for SVGpage 0.5 for Windows (currently for me beyond the knowledge of Python) - if this is to be done?
http://gimpchat.com/viewtopic.php?f=9&t=11778#p186024

Akovia - I renew the suggestion of Robert - can You share here for the Linux version?

Re: Script Mod Requests

Mon Feb 29, 2016 4:21 am

In version 0.3 I added what I planned:

- Check Folder Inkscape;
- Delete file for Output directory.


PS. Temporarily (?) Without taking into account guidance of Robert (maybe sometime - this is for me difficult and requires more time .... )
PPS. As for the name of the path - does anyone know how to force Python to accept specific characters (letters) national?


Edit (17-03-206): newer version in the post (# 31)

Re: Script Mod Requests

Mon Feb 29, 2016 7:38 am

rob_brz1 wrote:Have you shown your work to 'MareroQ'?

MareroQ wrote:Akovia - I renew the suggestion of Robert - can You share here for the Linux version?

I'm really not sure what you are asking. All I did was change the directory from C:/TEMP to
(PF_DIRNAME, "outputFolder", "Output directory to save:", "/home/akovia/.local/share/Trash/"),

As far as a better way than manually entering it, there is a trash specification for Linux if you can access the variable
$XDG_DATA_HOME/Trash

or maybe something with tempfile.mkstemp?
https://docs.python.org/2/library/tempfile.html

I really want to help but feel I'm missing something here.

Re: Script Mod Requests

Mon Feb 29, 2016 7:51 am

MareroQ wrote: As for the name of the path - does anyone know how to force Python to accept specific characters (letters) national?


I would think it would be easiest to generate path names from the plugin and not rely on stripping out bad characters.
Path-1
Path-2 etc...

This would make the plugin bullet-proof and not have to rely on a scheme to remove invalid characters, which may produce duplicate names to worry about.

Re: Script Mod Requests

Wed Mar 02, 2016 9:43 pm

Hi MareroQ,
MareroQ wrote:PPS. As for the name of the path - does anyone know how to force Python to accept specific characters (letters) national?

Since my locale is not pure ASCII characters I have this problem also, you already have the solution for the translation in version 0.3 (line 2: # -*- coding: utf-8 -*-) only thing missing is for Windows file system which don't use 'utf-8' (Linux do), usually I encode or decode with Python the name of file or folder. But ASCII filename or folder are no problem.

Also I am reporting a bug in your version 0.3, replace (PF_DIRNAME, "ink", ...), by something like
Code:
        (PF_FILENAME, "ink", "Inkscape filename:", "/"),

Re: Script Mod Requests

Thu Mar 03, 2016 4:24 am

Thanks Robert.

I looked at Your plugin autosave_a.py (# for Windows file system and # Internationalization) - works great.
I tried to decode and encode in my plugin - but probably something I'm doing wrong and it does not work.

PS. What are the chances of SVGpage-0.5.py for Windows?

Re: Script Mod Requests

Thu Mar 03, 2016 8:34 am

Hi MareroQ,
We learn more by our mistakes than our success.
For your question about 'SVGpage': the answer depends of your interest (not mine) of having it balance against your time estimate to obtain.

Re: Script Mod Requests

Sun Mar 06, 2016 7:09 pm

Since it seems that MareroQ is willing to share the blame with me :) ; I have attached here my work, to date, on is plug-in.
Should work with Linux, exec. permission needed, Windows and have a beginning of translation. The folder and file-name are my default for Windows, to be change.
If interested and you have 'Inkscape', unzip this archive in your user plug-ins folder for GIMP.

Re: Script Mod Requests

Mon Mar 07, 2016 4:34 am

Hi Robert.

You are excellent. :yes
I just had to abandon further work beyond my knowledge. :oops:

Re: Script Mod Requests

Mon Mar 07, 2016 9:38 am

Hi,
MareroQ wrote:...
I just had to abandon further work beyond my knowledge. :oops:

That was contrary to my goal when writing post (#28) since knowledge is extensible and you and 'akovia' earn it.
But there still can be bugs and more knowledge.
I'm no spring 'chick' so looking for replacement!

Take care, Robert

Re: Script Mod Requests

Thu Mar 10, 2016 3:20 pm

Hi,
In the attachment an armouring for input file-name and folder. Also the file-names and folders are from my Linux and Windows.
For the adventurous I have included in folder 'experimental' a version of 'gimpfu.py' that try to address one pet peeve that I, believe, share with MareroQ: the one 'shot' nature of 'gimpfu.py'. With it in your user plug-in folder you have to push the 'Cancel' button to terminate if no GIMP error happens. A push on the 'OK' button when in non-push state should produce another cycle.

You can open a '.pot' file with a text editor, it does not produce a '.mo' file essential for translation, but can be use for correcting the English or/and produce a '.po' file. For doing so use the 'msgstr' under 'msgid'.

Edit: The attachment is now the package version 0.4 of 'Gimp_to_Inkscape'. Contains at the root one file 'Gimp_to_Inkscape.py' and two folders: 'experimental' and 'locale' which have something for translation organize the same way as the previous package 0.3.
To have access to this plug-in after its installation, you right-click on a path (vectors) layer in the 'path dialog', near the end of the just open window you should see its handle: 'Connection to Inkscape &...'.
Since one of the first goal, to my understanding, it's to continue work on vectors initiated in GIMP by transferring it to Inkscape for further development and back.
Please report any bug, found in it, within this thread for a month (from now 2016/03/17).

Edit (2016/06/16) : 'render' should work now if the top layer is a group-layer. Made some other improvements, see the 'History' at the beginning if you open the plug-in, while I was looking at it.

Re: Script Mod Requests

Fri Mar 11, 2016 3:27 am

Your new gimpfu.py is sensational in the idea :tyspin - very useful for recurring activities (but with modified parameters) - preview the effect in the window! :coolthup (Dream: a would add another option "undo" would not need to use the Ctrl + Z).
A small suggestion: if you add even a scroll bar (because now the dilemma - which gimpfu use)?

Topic: alt-drag and non-scrolling plugins
http://gimpchat.com/viewtopic.php?f=9&t=13714#p186121

Re: Script Mod Requests

Fri Mar 11, 2016 2:06 pm

Hi,
MareroQ: Thanks for trying this 'gimpfu.py'. Your idea of an 'undo' button (for the last cycle) seems a necessity for the preview aspect :cool .
Did you make a photo montage to have it on 'Gimp_to_Inkscape' UI?

To explain my purpose.
Changing the comportment of 'gimpfu.py' is disruptive, unlike changing the way the UI is displayed (arakne, jazzon), as a pygimp plug-in writer I like stability.
Should view this as concrete ideas for GIMP version 3.0, when the plug-in API should change; since it should be progress.

Re: Script Mod Requests

Sat Mar 12, 2016 4:11 am

Hi Robert

- For "Undo" is a dream (so photomontage);

- I added a new option: Open svg modified in Inkscape? (although it is possible that a better option would be to open svg as layer or as a choice open as a new image - but I tried again, unsuccessfully);

- For the translation - I use Poedit - but for me it is for Python plugins will not work for Windows (the only case I know of the possibility of translation is arakne-path-shape-creator8.py);

- Added Your gimpfu.py joined with jazzon scrollbar (experimental).


Edit (17-03-206): newer version in the post (# 31)

Re: Script Mod Requests

Sat Mar 12, 2016 10:53 pm

Hi MareroQ,

- Was not sure.

- When you are satisfied with the additions, gives me a holler then.

- I use 'Poedit' too but for Linux, transfer the translation to Windows and it works!

Re: Script Mod Requests

Sun Mar 13, 2016 1:25 am

Hi Robert.

- On the translation: it's my fault :geek - I added Gimp_to_Inkscape.mo file to the directory ... / share / locale / ... instead of the home directory ... / plug-ins / locale ...
Now it works!

- The new option - open svg (as a new layer or as a new image), you can help in the code? (the last time - on SVGpage.py for Windows is not longer count - lack of interest by others - although I do not think they know what they are missing :ninja ).
Attached standalone plugin (open svg as layer.py) - but adapted (probably in error :oops: ) in Gimp_to_Inkscape does not work.

Regards

Re: Script Mod Requests

Sun Mar 13, 2016 8:14 pm

Hi,

- Happy that your translation problem are over (I favour, like you realize, the 'user or /home' over the 'administrator or /' for two reasons: 1) less writing hassle, 2) less likely to be messed with during a GIMP update)

- I look at that and make it work, for open as a new render layer, in 'Gimp_to_Inkscape' with the help of your stand alone plug-in; but was not able to make it works in a more direct way. I have very little experience with SVG file in GIMP so it still in a rough state.

Edit: see the attachment for what I have done for now (2016/03/15) .
By.

Re: Script Mod Requests

Tue Mar 15, 2016 12:20 pm

Hi Robert.

This is what I wanted to (unsuccessfully) to achieve.

Now, as I look at Your code it seems simple and obvious - but I have not found a solution for many hours.

Thank You for Your help and code - again something I learned from You.

Now it is more than vectors - so I suggest you change the name in the menu:
of "Vectors to Inkscape & ..." on "Connection to Inkscape & ...
Robert - if You agree to such a change?

As for me, this is the final version.

Re: Script Mod Requests

Tue Mar 15, 2016 3:07 pm

Hi akovia and MareroQ,

The name change make sense and initially it was your baby.

The rough state mentioned in my previous post was mainly cause by the rendered size proposed.
Not to be embarrassed, it took me a day :oops: to realize that 'run_mode=RUN_INTERACTIVE' argument made the 'file_svg_load()' function overlook the 'width=height=0' arguments in it!
It is only obvious after you realize.

In a couple of day this will be included in an edited package attachment to former post #31.

Note: you can have a kind of preview by raising one step in the 'undo history dialog'.

Hoping that is to your satisfaction, Robert.

Re: Script Mod Requests

Wed Mar 23, 2016 8:26 pm

Hi,

'Gimp_to_Inkscape' version 0.4 works OK with GIMP-2.9.3, which I have.
Was wondering if somebody has tried it on GIMP-2.6, which I don't have any-more?
Post a reply