Tag archives: Blender

Preserving the glitch

On Thursday 4th March I took part in the AntsArtJam at BitJam in Stoke-on-Trent. Three canvases were set up on the stage and artists were invited to get creative on them as the night went on.

Antonio Roberts (by These Ants)

Photo by These Ants

Those who know me will know that live art is not something that I’ve really done before. I’ve done a fair bit of performing, but nothing like this, so it was quite an exciting challenge.

In my performance I set out to explore how to preserve glitches. Although there are no rules or even strict definitions to terms such as databending or glitch art, to me glitches are naturally occurring errors whereas databending is the act of reproducing an error. Take, for example, my Glitches set and my Databending set on Flickr. Whereas the Databending set is quite full the Glitches set has only three items. I feel this is because it’s harder to capture naturally occurring glitches as you’re often not prepared for them.

To prepare for my performance I downloaded the two movies from the Blender Foundation (Big Buck Bunny and Elephants Dream) and used a modified version of MPEGFucker to databend them. I opened them to at least see if they could be played, but otherwise had no idea what state they were in. This was then projected onto the canvas where I began to paint it.

bITjAM (by These Ants)

Photo by These Ants

I got a few questions asking how I was actually determining what to paint. Afterall, images were zooming by at 24 frames per second, so how would I decide what colour to put where? Overall I was looking for patterns. From the five or so seconds of footage that I’d see I’d try and determine what average value best represented it.

In some ways this is a randomised process. I had only seen seconds of the glitched movie proir to the performance so didn’t know what to expect. Also, marks that I made on the canvas were determined by where my brush was, what colour was on there at the time and what was being projected. To add to this throughout the three-hour performance I didn’t really get to see any of what I was painting, due to the projection onto the canvas. I’m sure there were many occasions where I painted over the same spot many many times.

Here’s the finished product, next to work by Iona Makiola

IMG_0510 (by These Ants)

Photo by These Ants

All of the work from the night, including the video footage that I used, will be exhibited as part of The Talking Shop project in Stoke-on-Trent in the near future

Making a Disco Ball using Blender and Inkscape

Awhile back I started doing a few experiments using Blender and Inkscape together. One of my creations from this was a ball.

Blender/Inkscape Sphere (by hellocatfood)

Recently one Inkscape user created a tutorial describing how to make a disco ball directly in Inkscape. Looking back at that ball that I made it kinda resembles a disco ball, so I decided to write a tutorial on how I did it.

This tutorial assumes that you know at least something about Blender and Inkscape. If not, go look at these tutorials for Inkscape and these tutorials for Blender. As with any program, the more you use it, the better you get at it.

We’re going to need three things before we begin. First install Blender. It’s available for Mac, Windows, Linux and probably any other system you can think of. Did I mention that it’s completely free? Next, install the VRM plugin for Blender. This is a free Blender plugin that allows you to export your Blender objects as an SVG (the file format that Inkscape uses by default). I’ve discussed the usefulness of this plugin before. Lastly, install Inkscape, if you don’t have it already. I’ll be using a beta build of 0.47, which should be officially coming out within the next two weeks. If not, just grab a beta build as it’s pretty stable.

Once you’ve installed these programs open up Blender and you’ll see the cube on screen.

The cube is usually the first thing you see.

The cube is usually the first thing you see.

Depending on how best you work you may want to switch to Camera view. You can do this by either clicking on View > Camera or pressing Num0 (the 0 key on the keypad). What we now see is what the camera sees. If you were to export this as a jpg or SVG this is the angle that you’d see it from.

oooh, shiny 3D!

oooh, shiny 3D!

We need remove this cube and add a UVsphere to the screen. Right-click on the cube and press X or Del to delete it.

Bye bye cube!

Bye bye cube!

To add a UVSphere, in the main window press the Spacebar and then go to Add > Mesh > UVSphere.

Add a UVsphere

Add a UVsphere

You’ll now see another dialogue box asking you to specify the rings and segments. This is important as it’ll define how many tiles there are in your disco ball. Think of these options in this way. The segments option is like the segments of an orange and cuts through the sphere vertically. The rings option cuts through it horizontally. These diagrams might explain it better:

Segments go vertically

Segments go vertically

Rings go horizontally

Rings go horizontally

Put the two together...

Put the two together...

The default is for both to be 32, but, if you want more tiles increase the value and if you want less decrease it. Once you’ve chosen press ok and your sphere should be on screen.

UVsphere

UVsphere

You can reposition, rotate or scale your sphere if needed. To reposition it, with the sphere selected (right-click it if it isn’t selected) press the G key. This grabs the object that’s selected and allows you to move it freely. Try moving your mouse about. This can be useful, but we’re working in a 3D environment which…er.. has three dimensions that you can move along. To move it along a set axis you can either left-click the arrows coming out from the sphere or, after pressing the G key, press the key that corresponds to the axis that you want to move it along. For example, if I wanted to move the sphere along the X axis (the red line) I’d press the G key, the the X key. Now, no matter how I move the mouse the movements of the sphere are contsrained to the X axis.

Similarly, to rotate the sphere press the R key and to scale it press the S key. The same rules about constraining it to a certain axis can still apply.

You can do things such as repositioning the camera other such trickery but for that you’ll need to learn more about Blender for that.

With your sphere now ready go to Render (at the top of the screen) and then press VRM.

The VRM options window

The VRM options window

I left the options as they are, but if you feel adventurous have a mess around. When you’re ready press the Render button and then choose the place on your computer to save it and what name to give it and finally press Save SVG. You’ll notice the egg timer appears in place of your mouse cursor to let you know that something’s happening but otherwise there’s a handy progress bar at the top of the screen.

Blender Screenshot

Open up the saved object in Inkscape and voila!

It's an SVG Sphere!

It's an SVG Sphere!

That’s the first part of this tutorial done! The next part draws upon some of my own experiments but is also taken from the original tutorial.

When you’ve opened up the sphere you’ll notice that it’s all one object. This is because all of the paths (the tiles) are grouped into one. You can ungroup it if you want but for this tutorial you don’t need to. Give your object a base a fill and stroke colour. You can do this using either the colour palette at the bottom of the screen or the Fill and Stroke dialogue (Object > Fill and Stroke or Ctrl + Shift + F).

Applying fill and stroke colour

Applying fill and stroke colour

The final step of this tutorial from me is the following. With the base colour selected we’re now going to randomise the colours but within that hue. To do this we’re going to use the randomise filter which is located in (in Inkscape 0.47) Extensions > Color > Randomise.

Leave the Hue option unchecked (unless you want a multicoloured sphere) and then press Apply.

Your finished disco ball!

Your finished disco ball!

There is of course more that you can do to make this disco ball look more realistic but take a look at the tutorial that inspired this one and come up with something of your own ;-)

Click to download the SVG

Click to download the SVG

Blending Inkscape and Blender

One of the things I’ve always wanted to do is to work on an image in a 3D environment but then export the resultant image to an svg. Being the open source nut that I am my main weapons of choice are Blender for 3D work and Inkscape for vector. These programs have their advantages and their disadvantages. The main advantage they have over many similar programs is that they’re open source and free. They’re very capable products and are used quite widely and are being actively developed. In fact, Inkscape is getting ready to release version 0.47 (I’ve used a prerelease and it’s awesome)

For my task of exporting 3D models to SVG Blender falls slightly short because it doesn’t natively support this. There are a few plugins that have attempted to offer this and do well, but sometimes crash or give unexpected output. That, and for some users going through the hassle of finding the plugin might be too much.

The disadvantage Inkscape has is it’s handling of lots of nodes. The moment you hit around 10,000 nodes the program begins to noticeably slow down. For most simple logo work this isn’t a problem, but when you come to illustration and highly detailed artwork it gets in the way. This was the main thing stopping me from using the SVG that can be generated from Blender. To test it yourself, import an SVG into Blender and then export it as an SVG using either Pantograph or VRM. You’ll notice that it is now made up of about several hundred smaller shapes.

Before Import to Blender: 11 Objects, 124 nodes

Before Import to Blender: 11 Objects, 124 nodes

inkscapeblendertext

After Blender import: 2264 objects with 6792 nodes

This makes colouring or modifying the shape really hard. Sometimes, in Inkscape you can just highlight all of the shapes, go to Path > Union (Ctrl + Shift + +) to combine them all but sometimes it makes it all disappear.

Luckily there is a technique to get this to work. If you import an SVG be sure to apply the Ninja Decimate modifier to the shape and drag the Ratio slider down (thanks to heathenx for this tip). Please note that this only work if you shape is a mesh, so hit Alt + C and convert your shape to a mesh.

If you’re working with text you may notice that after you’ve applied the Decimate modifier and dragged the slider down all of your text looks… crap.

screenshot_15_01:24:52

This is because the modifier is treating the text as a whole shape and thus reducing the face count of the whole combine shape rather than treating each character as an individual shape. You need to separate them. To do this, in Edit mode (hit TAB to get there) hit P (don’t do this in normal mode. It runs the Blender game engine and will most likely crash Blender).

Separate menu

Separate menu

From the Separate menu choose All Loose Parts and now each character is an individual shape. Now, if you run the Decimate modifier on each individual character you have a lot more control over its final appearance.

After Modifications: 324 objects, 972 nodes

After Modifications: 324 objects, 972 nodes

I exported the text to an SVG using VRM but you can do so using that script, Pantograph or the 3D Polyhedron extension in the Render extension menu in Inkscape. Here’s another render showing exactly why you might want to go through this procedure:

70 objects, 36601 nodes

70 objects, 36601 nodes

After basic modification (text from an upcoming project)

After basic modification, 4042 nodes (text from an upcoming project)

The Decimate modifier has its limits. Where a human would simply combine two big triangular faces into a rectangle the modifier sometimes misses this and just over-complicates things and sometimes completely destroys a shape. This is where I ask the Blender community for assistance. Is there a script to easily reduce the face count of an object?

I think native SVG export is something that Blender should work towards in the future. There’s just too many possibilities and opportunities!

More Blender Renders

Since my last post about using Blender with vectors I’ve explored taking vectors into it and then exporting jpegs. Below is an image I stated creating awhile back in Inkscape but never finished.

Click for full size

Click for full size

This is what it looks like after I’ve taken it into Blender and messed around with it a little bit

Render from Blender. Click for full size

Render from Blender. Click for full size

Pretty snazzy! I’ve still got a bit of composition techniques to figure out, but once I do I think I might take my vectors into Blender more.

Blender renders

For the past month or two I’ve been getting my head around Blender to do some 3D modelling. It’s a tough program to learn, but with the aid of some very useful tutorials and strong community support I feel I’m getting somewhere!

As well as using Inkscape to make vectors I want to explore the possibilities of using Blender to render 3D models as vectors. There’s so many benefits of this approach as long as it works. To do this I’ve tried out to vector rendering scripts written in the python programming language, VRM and Pantograph. VRM was easy to install – just dropped the file in the scripts folder – but Pantograph was a bit more problematic. If you’re going to install it make sure you have the right Python libraries installed! Here’s the original Blender output:

Original file rendered in Blender

Original file rendered in Blender

I’m getting some reflection off of my surface, but I’ll work on that another time.

Here’s the results of rendering a simple 3D snake model in Pantograph:

Pantograph render of a snake

Pantograph render of a snake

The Pantograph render produced the smoothest results by far. When taking it into Inkscape the final drawing is separated into several groups. For the snake you had a group for the outline, the silhouette and the wireframe. Depending on the complexity of your model you may want to delete the mesh. The only problem I’ve encountered is separating objects. Pantograph likes to merge to objects together, thus limiting editing capability. Still, you could always do most of the editing in Blender itself

Render from VRM

Render from VRM

This render using VRM reminds me a lot of the old Playstation/Sega Saturn graphics. You could subdivide all of the faces to get it smoother (set smooth has no effect on it), but it’d take forever to render and you’d end up with an unnecessarily large vector (.svg) file. Still, using VRM is useful for relatively simple objects. You could even combine the two renders!