Hi,
I’m loading SVG files which are then extruded.
In my SVG loader function I’m extracting the shape fill color using: const fillColor = path.userData.style.fill;
from in-line SVG styles to be able to designate the corresponding extruded object’s color.
I’m making my SVGs in Illustrator CC 2021.
I have 2 questions.
if I use non-in-line styles in my SVG ( css at top of xml) is there a way to similarly extract that?
if that’s not possible and I can’t extract a custom style from the top css ie: shapeCategory(a grouping style) then instead of getting path, can I get grouped paths? I haven’t seen in the docs or convos how to get <g>, then it’s contents.
ok so when i use “Export > Export As >” and select SVG like i always do in illustrator,
i usually use “Inline Style” for styling export preferences.
when i use “Internal CSS” i’ll get the following code: (example:)
i’ve searched for where that style tag info is stored, and one place i found it is in the svg’s xml tree through the ‘data’ that the SVGLoader supplies is
data.xml.ownerDocument.all[2].childNodes[0];
I know that that path’s source could change for different ways any xml would be generated (ie different export types or author’s structure)
i’m sure there’s a proper way around getting to that directly though. can’t find it.
any ideas?
i also can’t figure out how to use “#text” in anything variable-wise if i want to extract that syle info into an object in order to use in the mesh’s and objects i make from the svg data.
any help would be great in trying to understand this.
thanks