How to get 2D-shapes as named vector-graphics from each meshobject?

Hi
I’m searching for a workflow to get named 2D-shapes from all meshobjects of one scene, exported in one SVG-file (Scalable Vector Graphics).
The goal is to select items in a webapp.
The rendering would be overlayed by the SVG to select one item.

See here:
hover-5

In this example I made each SVG by hand in Afinity Designer.
But I’m looking for an automated workflow.
Because one turnaround has 12 images and I need one SVG for each image.
If I would have 100 items per image, I would have to draw 1200 items by hand :slight_smile:

The 2D-shapes in the svg-vector-graphic have to be named by its 3D-objectname to identify them.

This Blender-Script basically is great for this:

But its drawback is, that it renders the viewport instead of the renderframe.
Thus overlaying rendering by the svg-vector-graphic does not match.

How would you automate this task?

Thanks in advance.

Kind regards
Alain

Example of a rendering/SVG pair:

In Blender:

if it’s just masks that you need I imagine some automated export of black and white pictures, and then vectorizing them, would be easy and good enough… in Blender use compositor and some ID and naming changes via some script, then batch vectorize your masks in inkscape, it shouldn’t be difficult at all

with the svg export script it could be done -maybe- but I guess you need objects clipping each other in your masks, that’s not going to work easily with it

tell me if you have not solved it and want to run some test

I’ve been thinking at a similar method:
Just giving each object a different color and rendering masks with object-color, then vectorize it in inkscape. The color-code would then be the id of the 2d-shape.