Author Topic: Schneider TGML editor with sh..ty editing capabilities  (Read 892 times)

March 13, 2019, 01:21:07 AM
Read 892 times

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Anyone has a good tips in creating SVG files for TGML editor in Inkscape? Whatever I create in Inkscape, has always some issue when SVG is imported into TGML.
TGML is a graphic editor for building managements systems made for/on Schneider solutions. It is almost programming utility with really crappy raster/vector graphic editing capabilities.
Doesn't offer export to SVG functionality which would help greatly. TGML creates source which looks like SVG source (at least the way objects are defined because header and footer are different) but even if I move the important parts of tgml graphic source into svg file it won't display - it even looks like it doesn't exist beside that svg files are just bigger and Inkscape doesn't remove the garbage on save.
TGML is more compatible to SVG files which are created under Adobe Illustrator CS6 (also not 100%) but I don't have AI for my use, and i personally don't like AI - it's basic editing capabilities (moving, transform, vertex modifications and more) are much worse than what Inkscape offers in my opinion.
Any tips would be helpful.

PS: flatten transformation for any object probalby would increase compatibility but Inkscape doesn't offer such feature and popular addon doesn't work with 0.92 (or 0.91) like it should.
  • 0.92.3
  • Win7x64

March 13, 2019, 06:18:30 AM
Reply #1

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
You're already using 'Save as... > Plain SVG'? And have everything as paths, no grouping, saving transforms 'optimized'?

March 13, 2019, 08:52:15 AM
Reply #2

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Plain SVG format doesn't change anything, file looks simpler but all transformations are still in file, not flattened.
It is sometimes really tiring to force TGML to accept Inkscape's SVG properly.
  • 0.92.3
  • Win7x64

March 13, 2019, 09:44:00 AM
Reply #3

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Transformations are removed if:

- everything is a path
- you move the paths to trigger a recalculation

March 13, 2019, 01:48:12 PM
Reply #4

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
If you had resized your page it adds a transformation.
Create a new layer atop, select all, cut and paste to new layer -delete original layer (Ctrl+A, Ctrl+X, Ctrl+Alt+V).
Guess if there was only a root layer it'd take the xml editor to remove its transformation before pasting the cut paths back.

March 13, 2019, 03:08:52 PM
Reply #5

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
<ellipse
       id="ellipse24"
       style="fill:#1a1a1a"
       ry="1.375"
       rx="0.3449999988"
       cy="-40.02699661"
       cx="-21.97298622"
       transform="scale(-1)" />

How to flat something like that?

And how to get rid of this:
<Rectangle /><Polygon /><Polygon /><Polygon /><Polygon /><Group><Path /><Rectangle /></Group><Ellipse /><Path /><Group><Translate /><Path /><Path /><Path /><Path /><Path /></Group><Group><Translate /><Group><Translate /><Ellipse /><Ellipse /></Group><Group><Translate /><Ellipse /><Ellipse /></Group></Group></Group><Group><Translate /><Group><Translate />

I have used an option to remove bad sets of parameters (ask and remove) and remove names. Inkscape left such garbage in file.
  • 0.92.3
  • Win7x64

March 13, 2019, 03:19:03 PM
Reply #6

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
There is a deep ungroup option in Extensions/Arrande/Deep Ungroup...
After running that, select all (Ctrl+A), and convert everything to path (Ctrl+Shift+C).

If you had texts, you need to ungroup those too after (Ctrl+Shift+G).

Select all again (Ctrl+A) and nudge nodes as described above (pressing the -> and <- arrow keys one after another).

If it all worked out right, the bottom indication on screen should read >>"..." objects selected of type: path on layer "root"<< or something similar. Paths only, no texts/groups/ellipses/polygons/rectangles etc. and hopefully no layers.
If that's still on like "layer1", then follow the steps in my previous post.

To finish it up save as plain svg (inkscape is still using a vertically flipped coordinate system).


Theoretically your file could still have some remaining transformations on like gradient fills/pattern fills/filters or could also contain clipping/masking.
My guess it'd be easier organising these suggestions into a flowchart.

March 14, 2019, 12:55:24 AM
Reply #7

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
...
Paths only, no texts/groups/ellipses/polygons/rectangles etc. and hopefully no layers.
...
To finish it up save as plain svg (inkscape is still using a vertically flipped coordinate system).

Are these tips related to Your expiriences with TGML editor, or to my second question about flattening transformations?
I would like to save some regular objects as regular objects, especially polygons used to animation. Paths definition are really twisted.
Guess inkscape doesn't offer a feature to incorporate transformations directly to object.

About paths and TGML, i noticed the program has issues with paths with hole inside. If I don't use "union" on such path each time i touch
it in inkscape (even simple move operation or copy), TGML is displaying holes as additional paths placed near main path.
More permanent solution brings function "simplify CTRL+L" (no more additional paths after moving object or cloning) but i can only use it on rectangle like surfaces because simplify changes curves in path. Weird is paths created in AI with holes cut out doesn't have such issues.

About Plain SVG - it would be good to have it as a default setting, i don't want to "save as" each time i want to save a file.

One additional question - any time i open file created in older inkscape, i get notification to make a conversion (90-96 DPI). Anytime i open corrected file in older inkscape there is no notification that older inkscape needs to convert anything (it converts because newer inkscape will again nag me about 90 dpi issue). Is this really so important to nag about conversion, not just do it?
  • 0.92.3
  • Win7x64

March 14, 2019, 03:44:06 PM
Reply #8

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Haven't used the mentioned software just had some experience with the transformation problem.
Tried to make some animated svg-s and the transformations messed up entirely a simple rotation. And in addition chrome dropped some svg features so not even they render them as the svg was intended.
Found it much safer to use a morph animation of a path where nodes are relocated in each keyframe and the renderer interpolates the intermediate steps.
You can set in the preferences wether to use absolute or relative movements to describe a path.

As far as I can tell the pre 0.91 versions worked at 90 dpi and there wasn't a proper indication on the user unit relative to the viewbox?  Or the viewbox vs the document width/height? Not sure at this point, may Moini correct me.
Personally I made drawings both of which were px based with intentional on screen use and technical drawings with real word units. So even if I find that popup annoying, it does a good job.
(What bothers me though is how css chose 96 dpi as a default. 90 was much easier to calculate with; 100 or 120 would both have been perfect. Instead we have an "inverted" 69, which is 2*2*13. Even 72 dpi was more convenient for that matter -2*2*2*3*3.)

March 17, 2019, 01:28:31 PM
Reply #9

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Don't know what svg-s is, the animation in TGML is done by 2 methods - built in mechanism in which You add extensions to objects and by java code (DOM or whatever it is called). Built in mechanism offers simple functions, more complicated things can be done only with java code (or javascript).
Let's leave animation case for now.
I just made some tries and found out:
- the groups of objects are quite good tolerate, but transformation for groups are not tolerate at all. So I can rotate objects after enter group, select all and make a rotation, but i can't rotate group as a group.
- matrix transformation are totally ignored by TGML.
Popular addon "apply transform" really works flattening transformations but ... it creates matrix transformation instead of different transformations and matrix can't be flattened by it.
Few modification adding to object very often complete as one matrix which I can't get rid of. Matrix doesn't work in TGML so the result looks like disaster.
Deep ungroup creates matrixes as well, so ...
Saving SVG as optimized or clean doesn't help to get rid of matrixes. Now i need to check what will happen if i save SVGs with matrixes in Illustrator.

EDIT: flatten transformation in Illustrator gets rid of all matrixes, and makes SVG usable in TGML ...
EDIT2: but also objects lost its origin - all were replaced with paths, which wasn't my intention. I quite understand the matrix idea, it is a part of standard, it makes the code smaller, maybe not convenient for manually editing of SVG or animating objects with scripts but ...
I have checked Affinity Designer and it also creates matrix transformations and flats objects with transforms into paths. I am pretty sure new Illustrator CC will do this also with matrixes, where older version CS6 probably didn't use them much.
« Last Edit: March 18, 2019, 06:12:20 AM by Krzysztof »
  • 0.92.3
  • Win7x64