Author Topic: how to edit objects "hidden" under <defs>  (Read 753 times)

January 16, 2019, 05:16:19 AM
Read 753 times

pacraf

  • Sr. Newbie

  • Offline
  • **

  • 2
I have a question related to objects stored in svg file under <defs> .
they can be later multiple times located on document, including transformations.

I am trying to figure out how to edit such symbols. Please look on attached svg file.
it comes from (server folder)weather-script-preprocess.svg
*weather-script-preprocess.svg
(48.01 kB - downloaded 325 times)
https://mpetroff.net/2012/09/kindle-weather-display/

please note  that uploaded svg is already edited manually in xml editor to show one icon. if you download it from linked git repo, there will be empty place.

In linked project in a clever way of processing svg file with embedded icons (or symbols) , a final svg file is processed by python program.
All icons necessary to display are already embedded it this file, but when I open this file in inkscape, I can not fin them.
The only possible way to "see" it in inkscape, is to open xml editor , find #ICON_ONE and reaplce it't value with #blizzard for example (look for idg8483, and then deeper ICON_ONE text)
If you see this svg file in text editor - yuo will see all other icons too...

So my issue is:
1. is there a way to easy extract such <defs> hidden objects?
2. if they are shown using method described above (so visible on screen) - how can I edit them. (I mean how to impact data stored in <defs> section

  • 0.92
  • win10 32bit

January 16, 2019, 02:51:53 PM
Reply #1

Lazur

  • IC Mentor

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

  • 1,154
  • Gender
    Male

    Male
Hi.

The object stored in the defs of your file is a parent object of the clone rendered on screen.
It is a sleek solution to make objects "indestructible" and as a side effect make very small files.

There are multiple options to alter the shape of the cloud, "depends on where the wind blows from".

In the edit menu there are options for the clones. Select original doesn't work since the parent is inside the defs section.
But you can unlink the clone (Shift+Alt+D) so then you can edit it as a "normal" object -the parent won'T be linked by a href but a duplicate is created in the codes.

It is now all fine and well for editing, but what if you want to preserve the clone structure of the original after the editing?
For example "theoretically" it is possible to duplicate your original clone (Ctrl+D), unlink the duplicate (Shift+Alt+D), copy it (Ctrl+C) and selecting the original and clicking the relink to copied in the edit menu.
Then you can edit the parent on screen.
However then the clone will inherit the transformation of the original clone and also the position of the new parent can affect the result.

Question remains how to hide the parent objects for the future.
You can create a new layer and move them there, and switch the visibility of the layer off.
Other option is using the xml editor (Shift+Ctrl+X) to cut the parent and paste it into the defs section.

Using the xml editor can also make it possible to simply paste in a modified path data into the parent object in the defs.

January 17, 2019, 01:18:27 AM
Reply #2

pacraf

  • Sr. Newbie

  • Offline
  • **

  • 2
Thank you.

You nailed it. Your full answer including editing and storing them was my next question... but what to write here now?  - thank you again ;)
  • 0.92
  • win10 32bit

January 17, 2019, 03:49:51 PM
Reply #3

Lazur

  • IC Mentor

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

  • 1,154
  • Gender
    Male

    Male