Component to SVG

Hello,
is there any way to export whole juce::Component to svg file that can be imported in Blender or anything like that?

I want to make 3d render of my plugin and it looks like the best way would be to have SVG version of it and then use it in app like Blender. Am I right?

For any help great thanks in advance.

Best Regards

Whether this is the best way to get your graphics into Blender I don’t know. But if you’re on macOS, it is possible to render juce::Graphics vector graphics into a .pdf file as I explained in a post a few years ago. The .pdf can then be imported into InkScape and stored as svg. I use this to create vector pdf screenshots to use in pdf manuals.

Here’s a link to the thread:

1 Like

Hmm… Actually I am also not sure if SVG is the best choice to export to Blender. I am totaly new in Blender, and my friend told me about SVG. But great thanks for your explanation with PDF. I will try it.

But actually I have problems with your solution. It is probably because I am not familiar with “.mm” files. I am not sure how to use it. So from your file “OSXPDFRenderer.mm” I copied all code to “*.cpp” file. And then I get error because in “OSXPDFRenderer.mm” there is include from “OSXPDFRenderer.h”. But your header file is named “LowLevelOSXPDFRenderer.h”. So I am not sure if it is mistake in “OSXPDFRenderer.mm”. Or I am doing something wrong.

But when I changed #include "OSXPDFRenderer.h" to:
#include "LowLevelOSXPDFRenderer.h"

there is still error because #include "juce_mac_CoreGraphicsContext.h" ca’t be found.

Could you give some advice how to use it properly?

Great thanks in advance for any help.

The file needs to be a .mm as it contains obj-c++. Actually just the #import directive I think…
Anyway don’t worry about using a .mm file it basically just tells the compiler how to handle compilation and allows to mix c++ and obj-c. The header file should just be named OSXPDFRenderer.h… sorry about that.

I also had to adapt to a JUCE change and adjust the #include to:

#include "juce_graphics/native/juce_mac_CoreGraphicsContext.h"