User:Thijshijsijsjss/Pen Plotting Panache/3D Movie/Blender

From XPUB & Lens-Based wiki
< User:Thijshijsijsjss‎ | Pen Plotting Panache‎ | 3D Movie
Revision as of 21:59, 7 August 2025 by Thijshijsijsjss (talk | contribs) (Add notes to go from blender to plotter)

Working on the pen plotted 3D movie, it is becoming clear that a great hurdle is the contents: I don't want this to be a tech demo. [plotter.vision] -- what I have been using so far -- is great, but does not help in this regard: it's constraint of only panning, zooming and rotating, i.e. not allowing models to be animated, makes any scene quickly feel like a showcase. As the movie would be anaglyph 3D, working with colors is difficult too. So, what could be it?

First: writing two scripts

First, I was most worried about the manual labour required for a movie. In short, there are 4 main steps, each very laborious:

  1. Creating the frames
  2. Preparing the frames to be ready to plot
  3. Plotting the frames
  4. Processing the plotted frames

Creating the frames is decently fun, and plotting is an inevitability for this project. So, while warming up to the project again, I decided to spend some time on the preparation of the frames. This led to two scripts: one for merging all SVGs downloaded from plotter.vision, and one to space all these frames. These scripts I wrote with Processing, because it's fast, allows for SVG manipulation using native objects, and most importantly because I am decently familiar with it.

Why is this on the blender page? You'll see.

I have never used Blender

Using Blender

The goal with Blender is twofold:

  1. Allow for more intricate animations to be made
  2. Automize the creation of frames (point 1 in the laborious tasks above)

I want to note that even though some labor is delegated to the computer, the process does still feel hand crafted. Not only is animating in blender a hand made practise for someone unfamiliar like myself, also does it require a lot of bespoke tools to create by hand. More on that in a bit.

To setup my project, I use the following settings. This is the order in which I found out about them, and the order in which I set them:

Tool > Render Enging > EEVEE (necessary for Freeline SVG)
Tool > ☑ Freestyle SVG (creates the SVG edges)
Output > ☑ Stereoscopy (we want 3D)
Output > output > Views > views format > Atereo 3D
Output > output > Views > stereo mode > Anaglyph 3D
View Layer > ☑ Freestyle > ☑ As render pass
Edit > Preferences > Get Extensions > Search for 'Freestyle SVG exporter'
Render > ☑ Freestyle SVG export

Now, creating an animation and rendering it with ctr+f12, my selected output folder is populated with:

  • a bunch of pngs, one for each frame, that I quickly delete
  • an (animated) svg with all frames

Formatting Blender output for plotting

Restructuring

The Blender output is a mess. It contains many nested layers, each frame is an 'arbitrary' number of paths, and, most importantly, it is ordered by frame. Why is this a problem? Eventually, we will plot these frames, and we want to have 1 pass of blue and one pass of red. So, we will need to restructure the file. Luckily for us, the Blender output is predicable. So, I have written a program that can restructure any Blender output into the desired by-color structure.

Notes for THIJS: 
    1 place blender output in blender_to_inkscape/data
    2 name it input.svg
    3 run the program to create output.svg

Spacing

Moreover, it is quite the work to position all frames, expecially since the red and blue components of them are now no longer grouped. So, we write another program to pass over the restructered SVG and spaces the frames accordingly.

Notes for THIJS: 
    1 locate the input file (e.g. ../blender_to_inkscape/output.svg)
    2 in the code, set the number of columns (4 by default)
    3 in the code, set the dimensions (1920x1080 by default)

Inkscape

Notes for THIJS: 
    1 Open template.svg
    2 Drag the output of inkscape_to_grid into the template file
    3 Set the width to 260 (with the width-to-height ratio locked)