VectorStyler
    • Categories
    • Unread
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    FR: API for Scripting

    Scheduled Pinned Locked Moved Features and Ideas
    16 Posts 5 Posters 14.6k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      Nils @VectorStyler
      last edited by

      @vectoradmin Makes sense. Quick aside: If you ever considered to provide a python interface for the eventually coming scripting API, that would be amazing. It's imo a way better language for this kind of thing.

      1 Reply Last reply Reply Quote 2
      • S Offline
        Subpath
        last edited by Subpath

        @vectoradmin

        You already mentioned Lula and Java Script, which of the
        two is from your point of view the scripting language that
        offers the most possibilities in Vs?

        I have some (amateurish) knowledge of various scripting languages, including Lua.
        Have always enjoyed using these to automate operations.

        Lua seems to me to be a bit easier than Java Script for beginners (myself included 🙂 ).

        Bwt. while @Nils wrote this, have no knowledge in Phyton. ( yet 🙂 ).

        Win 11
        CPU: AMD Ryzen 5 9600X, 6-core.
        GPU: Nvidia Geforce RTX 5070.

        VectorStylerV N 2 Replies Last reply Reply Quote 0
        • VectorStylerV Offline
          VectorStyler @Subpath
          last edited by

          @Subpath @Nils The current architecture of VS allows the addition of scripting languages as plugins.

          Currently only Lua is implemented, but it is not public. JavaScript is certainly will be added, and from what I know Python is also possible.

          The (native) interfaces to VS are dynamic and it is easy to create / call any object or method from a scripting language, or navigate existing object hierarchies like the document.

          The main challenge is to select what interfaces to publish, and document those, this where the actual effort will be.

          N S 2 Replies Last reply Reply Quote 1
          • N Offline
            Nils @Subpath
            last edited by

            @Subpath Hey, you should pick up some python when you find some time. It's really easy to learn and a lot better for these purposes. For example: Inkscape uses it for their extensions and it works beautifully. Since VS is in most other aspects a lot better than Inkscape ( expectedly, since it's paid ), this would really widen the gap a lot.

            S 1 Reply Last reply Reply Quote 1
            • N Offline
              Nils @VectorStyler
              last edited by

              @vectoradmin I see, so I imagine the backend document structure manipulation to be similar to your typical svg xml doc..

              VectorStylerV 2 Replies Last reply Reply Quote 0
              • VectorStylerV Offline
                VectorStyler @Nils
                last edited by

                @Nils said in FR: API for Scripting:

                @vectoradmin I see, so I imagine the backend document structure manipulation to be similar to your typical svg xml doc..

                Yes, there are properties to get/set, collections to iterate over. Properties can get a bit more complicated, but otherwise it is a typical document object structure.
                Except the structure is not strictly defined. A lot of plugins participate and bring their own data / properties / features.

                1 Reply Last reply Reply Quote 1
                • S Offline
                  Subpath @VectorStyler
                  last edited by

                  @vectoradmin

                  thanks, interesting

                  Win 11
                  CPU: AMD Ryzen 5 9600X, 6-core.
                  GPU: Nvidia Geforce RTX 5070.

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    Subpath @Nils
                    last edited by Subpath

                    @Nils

                    I know that Inkscape have Python as Scripting Language
                    also use Inkscape from time to time. Like the Spray Feature in Inkscape.
                    I will have a look at it when I have some time

                    Win 11
                    CPU: AMD Ryzen 5 9600X, 6-core.
                    GPU: Nvidia Geforce RTX 5070.

                    1 Reply Last reply Reply Quote 0
                    • VectorStylerV Offline
                      VectorStyler @Nils
                      last edited by

                      @Nils @Subpath BTW: the VS document can be saved in JSON or XML format (it is a variation of the same vstyler format), by setting JSON or XML in Document Setup -> File -> File Format field.

                      The resulting file can then be used with any JSON or XML tool. But, no documentation on the content

                      S 1 Reply Last reply Reply Quote 2
                      • S Offline
                        Subpath @VectorStyler
                        last edited by

                        @vectoradmin

                        interesting, but it's out of my league. I have dealt with html once, but it's been a looong time 🙂 .

                        Win 11
                        CPU: AMD Ryzen 5 9600X, 6-core.
                        GPU: Nvidia Geforce RTX 5070.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post