Giter Club home page Giter Club logo

Comments (11)

ziegenberg avatar ziegenberg commented on May 24, 2024 3

At the moment, Inkscape Script Extensions are one of three types:

  1. Input, providing translation from a file format to SVG
  2. Output, providing translation from SVG to a format
  3. Effect, taking in SVG, changing it, and then outputting SVG

Effects need a GUI.

Looking at the future architecture, the possibility of a headless Inkscape still seems to be something of the future. And looking at the current state of the roadmap, splitting backend / GUI frontend is also still in the works. They also want to develop a new plugin/extension system.

I'm afraid, this issue will remain open for quite a while.

from inkscape-applytransforms.

Klowner avatar Klowner commented on May 24, 2024

A quick glance at the documentation tells me this is likely possible, and sounds to me like a nice addition 👍

from inkscape-applytransforms.

ziegenberg avatar ziegenberg commented on May 24, 2024

The id of the extension should be available as a verb. Calling inkscape -g --verb com.klowner.filter.applytransform --verb FileSave --verb FileClose --verb FileQuit test.svg works just fine for me to open a file, apply the transformation, save and close the file and to quit Inkscape.

Use inkscape --verb-list to get a list of all available verbs. This includes all extensions.

Please tell me if I'm missing the point.

I was using Inkscape 1.0.1.

from inkscape-applytransforms.

ziegenberg avatar ziegenberg commented on May 24, 2024

I guess this can be closed then?

from inkscape-applytransforms.

Klowner avatar Klowner commented on May 24, 2024

@ziegenberg yep! thank you again.

from inkscape-applytransforms.

alerque avatar alerque commented on May 24, 2024

While the trick with using the filter ID as a verb is appreciated, I don't think it goes far enough to warrant closing this issue.

This filter still assumes that a full GUI has been launched. I don't think it really needs it for anything and it does work with --verb com.klowner.filter.applytransform, but it does not work in batch mode with no GUI. There are certainly other Inkscape functions that require the GUI to be running to function, but I don't see why this would need to be one of them. I can't use this yet in automation sequences without providing a whole X environment to start Inkscape in.

Please consider adding a proper verb that can be used without a GUI and re-ope this issue to track the progress and notify others when someone contributes such a thing.

from inkscape-applytransforms.

Klowner avatar Klowner commented on May 24, 2024

apologies, @alerque. re-opened.

from inkscape-applytransforms.

ziegenberg avatar ziegenberg commented on May 24, 2024

Verbs require a GUI, says the current manual: https://inkscape.org/doc/inkscape-man.html

Note that the --verb command requires a GUI.

What you're probably looking for are actions. But I haven't found any documentation yet, that says that extensions can provide actions.

I will try that, as soon as I'm back at a PC.

from inkscape-applytransforms.

alerque avatar alerque commented on May 24, 2024

No worries. I wasn't aware of the fundamental difference between verbs / actions. Also it seems to be a bit of a moving target because everything used to be verbs (actions are new as I recall) and some of them required GUI and others didn't. If it turns out to be impossible I'll understand (Inkscape is not well setup for this) but if it is possible it would be appreciated.

from inkscape-applytransforms.

jtojnar avatar jtojnar commented on May 24, 2024

This might be fixed by https://wiki.inkscape.org/wiki/index.php?title=GSoC_2021_Verbs_to_Gio::Actions (https://gitlab.com/inkscape/inkscape/-/merge_requests/3328)

from inkscape-applytransforms.

f-necas avatar f-necas commented on May 24, 2024

I've tried to use verbs to remove transforms but it didn't worked :
command : inkscape -g --verb com.klowner.filter.apply_transform --verb FileSave --verb FileClose --verb FileQuit test.svg

Everytime it closes the document before executing the transformation. It works when I remove --verb FileSave --verb FileClose --verb FileQuit, but it needs an user action this way.

Environment 1 :
Windows 10
Inkscape 1.1.1 (3bf5ae0d25, 2021-09-20)

Environment 2 :
Ubuntu 20.04 (WSL2)
Inkscape 1.1.1 (1:1.1+202109281949+c3084ef5ed)

Is it still working by your side ?

EDIT

While waiting for better actions documentation for extensions, Here is a working command for Inkscape 1.1 :
inkscape -g --verb "com.klowner.filter.apply_transform;FileSave;FileClose;FileQuit" test.svg

from inkscape-applytransforms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.