Export paths similar to ofn-export-layers.py - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: Export paths similar to ofn-export-layers.py (/Thread-Export-paths-similar-to-ofn-export-layers-py) |
Export paths similar to ofn-export-layers.py - Krikor - 04-08-2021 Hi, Is there a plug-in similar to ofn-export-layers.py but that unlike this would export the paths instead of the layers? I want to export the customs fonts paths to use with fontForge. The only way I know is to export each path one by one. Thx. RE: Export paths similar to ofn-export-layers.py - Ofnuts - 04-08-2021 Can you wait a couple of hours? Edit: it appears that in the regular export path file dialog, there is a selector that lets you export all the paths: [attachment=5843]
However all the paths end up in the same file, so I'll finish the script RE: Export paths similar to ofn-export-layers.py - Krikor - 04-08-2021 (04-08-2021, 05:12 PM)Ofnuts Wrote: Can you wait a couple of hours? I can expect a lot more than that. I was thinking that this would not be possible or feasible. Ofnuts thanks for your attention! RE: Export paths similar to ofn-export-layers.py - Ofnuts - 04-08-2021 (04-08-2021, 07:48 PM)Krikor Wrote:(04-08-2021, 05:12 PM)Ofnuts Wrote: Can you wait a couple of hours? I didn't think either but a quick check showed that there was an API call to export a path so it was easy to adapt ofn-export-layers. ofn-export-paths at the usual place. If you can think of some path characteristic that can be usefully included in the file name, just ask. RE: Export paths similar to ofn-export-layers.py - Krikor - 04-09-2021 (04-08-2021, 09:30 PM)Ofnuts Wrote: I didn't think either but a quick check showed that there was an API call to export a path so it was easy to adapt ofn-export-layers. Perfect! The option to export All paths or Only visible paths provided the plug-in with greater versatility (I think there is no such option in ofn-export-layers.py), so I see this as a bonus! I think that if it were possible to add a pattern to the file name based on an alphabetical order it would be welcome. Almost similar to what the plug-in is already doing with the options: numUp0, numUp1, numDown0, numDown1. Only in this case it would be from 'a' to 'Z', and it would completely replace the path name. For example: For the paths: Selection, Selection #1, Selection #2, ..., Selection #52 (Bottom to top).
Alphabetically it would be (with the removal in the initial name of the path): a.svg, b.svg, c.svg, ..., Z.svg.
Alphabetically it would look like: Z.svg, Y.svg, X.svg, ..., a.svg. The order being: a - b - c - d - e - f - g - h - i - j - k - l - m - n - o - p - q - r - s - t - u - v - w - x - y - z - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z I don't know how hard it would be to implement this suggestion, but the time savings it would give to those who are creating typography would be huge. Thx a lot! RE: Export paths similar to ofn-export-layers.py - Ofnuts - 04-09-2021 Why don't you name the paths that way and use {name}? What is the problem you are trying to solve? RE: Export paths similar to ofn-export-layers.py - Krikor - 04-09-2021 (04-09-2021, 06:26 AM)Ofnuts Wrote: Why don't you name the paths that way and use {name}? What is the problem you are trying to solve? Because with {name} part of the path name is kept. If the path name is already in the correct format (a, b, c, etc.); so using {name} is enough. [attachment=5848] But depending on how the path is generated or if it is created individually, then there is a need to change the name of each path one by one before applying the plug-in; Or later, changing the name of the files, but as the icons of the svg files do not display a preview of the image (unlike .jpg, png, etc.) this would require a lot of attention. But ok, the plug-in looks great, thanks a lot! RE: Export paths similar to ofn-export-layers.py - Krikor - 04-24-2021 Hi, It would be possible; and if so, how could i add a separator between the indexed number and the total number in the file name generated by the parameter: {numDown1: 03d} {count}? I tried something like {numDown1: 03d} {"-" count} and {numDown1: 03d} {- count}, but it didn't work. The intention is to create a separator for the generated names like: 001127 002127 003127 ... 127127 to something like 001-127. etc. Thx in advance! RE: Export paths similar to ofn-export-layers.py - Ofnuts - 04-24-2021 (04-24-2021, 03:58 PM)Krikor Wrote: Hi, Of course, but the - separator isn't part of the format specifications, so just put it outside the braces {numDown1:03d}-{count}. The pattern is a string where what is between {} is replaced by values, but whats is outside the {} is used literally. You can use a pattern like: Path {numDown1} of a set of {count} paths. PS: You likely want to avoid the leading space in your : 03d formats. |