Hi all. Today I had my second full day at the Blender Institute with the Durian team. Find out more about the project here. I already wrote some scripts, found some bugs, been working on a big city scene, played soccer with the guys, and fed the ducks with Nathan. All in all a great start. The photo was taken by Colin Levy.
First week at the Durian Open Movie project
Wednesday, March 24th, 2010Project London Multiply Teaser
Wednesday, March 24th, 2010
The crew from Project London (which I’m proud to have been a part of) have yesterday released a brand new, awesome teaser trailer! I’m actually in this one’s credits as well. Go have a look!
A course at the SKVR
Monday, March 22nd, 2010Download from Blendswap.com
Downloadable Files
- Blu.blend (137)
Starting this April 19th I’m giving an 8 week (once a week every Monday evening) course in Blender 3D at the SKVR in Rotterdam. I believe some spots are still available right now. Also I’m giving a 3.5hr workshop there on Saturday the 27th of March. You need to reserve a seat if you want to take part. Go here for more information about that.
I created a small model that we’ll use during the Saturday workshop.
Convert to Empty
Sunday, March 21st, 2010Downloadable Files
- ConvertToEmpty_1 (256)
I just now needed this to replace a bunch of objects with empties so I can use “Dupligroups” in stead. I thought I’d publish it… but no more info for now… perhaps later. It’s meant to work in Blender 2.5
Now Blender 2.5 still isn’t stable so don’t expect it to work as is forever… I found it usefull though.
Teaching UV unwrapping
Thursday, March 18th, 2010Getting to grips with 2D to 3D
This is a simple little exercise I came up with for showing students how to convert 2D to 3D and vise versa. The idea is to not go straight to 3D, but in stead give them a hands-on task that gets the idea into their heads. It’s not a completely new thing for most students, but the relation to UV unwrapping is. And of course it is fun to try to make it challenging as well.
The example
To give my students some idea of what I expected them to do I showed them an example I made the night before class. It’s a basic svg I made in Inkscape that I printed on A4 paper.

I could have just made a single T shape to make a single cube, but since I was teaching university level students that was a bit too simple. In stead I made this, which turns into 2 cubes that are connected at a corner. The real world result that I glued together the night before class, and showed my students in the morning is below here.

The task
After showing the students my example, I provided them all with paper, rulers, pencils, glue or tape, and scissors. Then put them right to work. The task I gave them was was rather simple…
Make something more complicated than a single cube!

The results
As usual my students surprised me with their inventiveness. The range of designs they came up with was really nice. Especially the surprises and “misinterpretations” that I really didn’t see coming. All I did during the class was walk around and give some pointers.

Round up
That’s basicly all this class was. After finishing the exercise we got stuck in in Blender 3D to UV unwrap the models they had made the day before. It was a lot easier for me to teach them that technique after they had done exactly the opposite with paper (which is what this exercise is). All in all this was a fun hour to break up the week of staring at computer screens, and I’ll definitely repeat it in future.
I hope this helps you, and if you have similar fun ways of teaching your students, please let me know. I’m always looking for novel ways of getting these complex ideas into students heads.
Dolf
Selection to view cursor
Thursday, March 18th, 2010Downloadable Files
- SelToViewCursor.1.py (181)
- VertsToViewCursor.1.py (211)
This script moves your current selection to the cursor relative to the current view.
Requirements
This script is written for blender 2.45
Running the script
There are no settings for this script. It acts on your currently active object, or if you are in edit mode on the verts in your mesh.
Of course you can just open the script in your text window, but I find it’s nicer from the menus. If you added the script to your scripts folder it shows up in the Object menu of your 3d view as well so you can just select it there.

But since you may also want it to be in the mesh menu I made a second version. This second version is exactly the same as the original, but with a different header.
You can download that version by clicking here: VertsToViewCursor.1.py (put that in your scripts folder as well)
If you did you’ll find it in the Mesh menu as well

The practial use of the script
Lets give a small practical example. Say I have two suzannes in my scene like this.

They have completely different positions, but now lets say that I want them right next to each other. So I put the cursor at the position of the left monkey by doing the normal “cursor to selection” (ctrl+s).

Now if I would select the other suzanne and did a “selection to cursor” their positions would be completely identical… and that’s not what I want… so I go into side view and run the script.

And this is the result as seen from the side.

But if we go to the front view you can see they are still next to each other (the x position of the second suzanne is not influensed, since that was the view vector). And we can do this from any angle, it doesn’t have to be just the front or side.

And we can do this with verts in a mesh as well! Think of it as a tool to align things!
That’s it for now.. I hope it’s as usefull to you as it is to me.
Dolf
Really big render
Thursday, March 18th, 2010Downloadable Files
- ReallyBigRender.3 (453)
- ReallyBigRender.2 (220)
- ReallyBigRender.2.1 (197)
- ReallyBigRender.1 (189)
This script helps you render to sizes so large that blender can’t normally handle them.
Requirements
This script is written for Blender 2.47, but should work in older versions.
If you want to use the new Composite function you need to have a full python install and the PIL library.
You can get the PIL library here: http://www.pythonware.com/products/pil/
Running the script
The script will render to 2, 3, 4, or 5 times your original rendersize. You can select the multiplier you want from a popup window. So say your rendersettings are 800 x 600 and you select 3X multiplication, then the script will render nine images at 800 x 600. If you combine these images in your favoured image editor the end result will be a single image of 3200 x 1800 pixels. Make sure that Blender can render at your current render settings! If it can’t then it won’t render the tiles either! The tiles are rendered left to right, top to bottom and numbered as such, so 0_0 will be the left top, and 1_1 the right bottom (for a 4 tile render).
Step one, setting the filename/location to render to
The first thing you see when you run the script is a file window that comes up. Here you set what directory you want your images to be saved in. Set the filename to only the name, without the directory as in the example below.

Step two, setting the number of tiles you want (multiplier)
After the file selection window you will get a popup asking you how many tiles you want to render, as seen below here.

Step three, composite or not
If you have the PIL library installed your last option is whether you want a composite created or not.
If the script can not find the library, you will not see this option.
Be aware that the script could easily fail during this action. It all depends on how much memory PIL can use.
But even if PIL can not create your composite for you, you will still have the tiles.
The limit for my system (32bit vista) is somewhere between 15k and 20k, which is still bigger than I can render in Blender internally.

Things to know
Some texturing methods are dependant on the ‘screen’ which means they don’t work well with lens shift and this script. Try to avoid material textures mapped to “win”, and world textures with “paper” switched on.
Update: I just found out that the script won’t work if you have manually set a border. So if you have a border set to your camera… add a new/fresh camera and use that.
Example
Here I rendered cornelius at 320 x 240 pixels.

Then I ran the script, and made it render twice the size by creating the following 4 tiles.

And a much nicer example by Cujo13

He rendered this at 10.000 by 12.000 pixels, and it was used to create a mural 8.5feet by 10feet in size.
You can visit his site at http://www.greatlakesgraphics.net/
That’s all
If you have any questions or comments please contact me through the blenderartists.org forums
Enjoy macouno
Raytrace baker
Wednesday, March 17th, 2010Downloadable Files
- BRayBaker.3.5 (198)
- BRayBaker.3.3 (179)
- BRayBaker.2 (169)
- BRayBaker.1.2 (154)
- BakerChecker.1 (164)
Important information
Be aware that baking has been added to blender’s source!
This basicly means that this script has become outdated.
Find the official information about it here.
I will keep this script online, but I won’t be updating it
Blender Raytrace Baker
Originally written by macouno 31-05-2005
(current release version 16-07-2006 for blender 2.42)
This page explains a bit about what this script does and how you can use it.
Requirements
Version 3.4 is written for the blender 2.42 official release. You can still download version 3 for older blender versions (3.4 should be fine but just to be sure I left it on here) The scripts uses both the os and math modules, which means that you need a full python install.
The gui
The use and functions of the script
Top details

At the top of the gui you can read what version you are currently using.
Regular data
On the top line you can read how many mesh objects are available in the current scene. On the second line you can read what object you have selected now. On the third line you can read how many faces your current object has.
Warnings
If you don’t get the above you’ll get a message saying: No object with faces selected! Select one and press reset! Which I suggest you do ;)
Layer selection

Here you can select what layers you want to be rendered. Thus you can for instance have an object selected on layer one that you want to create a new baked texture for. But you can have the script render a higher poly version of the object on another layer.
Camera settings

In these 3 number fields you can set your basic camera settings. For normal use I advise you to keep them as is.
c-start
Sets the clipstart of your camera in the same way the Clipsta setting in your blender settings does. If you set this too small or too close to the c-dist value you may get clipping of faces.
c-dist
Sets the distance buffer from the closest vert to the camera. The script calculates the absolute minimal distance from the midpoint between the verts to the camera. This will put it right at the closest vert. But blender needs a slight buffer for it to register a face. Thus we set the camera a little bit further away. This value should be bigger than the c-start value and smaller than the c-end value.
c-end
This one’s simple… It sets the Clipend for your camera in the same way the ClipEnd can be set in your normal camera settings. The clipend must be big enough to not only reach the distance of the first vert but the furthest vert in the face… thus we like to keep it large. Set it lower for quicker renders but usually you can leave it as is.
Frame selection

In this number field you can set what frame you want to render. It’s really only helpfull in case you want to render a specific frame in an animated sequence.
Uv layout

Here’s one to think hard about. When there are no uv coords available you will see a message in place of this toggle. No uv coords set! In normal modes it means that texface (edit buttons) is not enabled for this mesh. And normally this means there is not yet a uv layout to render to. In “all mesh” mode it means that one or more of your meshes do not have an available uv layout. When not selected the script will create all new uv coordinates for your mesh. The texture will be rendered onto a grid of squares. When selected the script will attempt to render to your uv layout. Be aware that if you have overlapping uv’s you will get unsatisfactory results.
Resetting

Here you have two options for resetting which are normally selected. R scn When selected the new scene that’s created for tile to image conversion is not removed. Thus if you are getting errors you can use this to see if anything went wrong there. It’s really mostly there for me to see what’s happened. When in “all mesh” mode the button will be hidden and you can see the following text. Resetting! This because your blend file would get far too messy if left on. X tiles When selected all the temporary tile images created by the script will be removed after the render is complete. For testing purposes it can be handy to see everything that got done. I can come up with other applications but as a standard leave it selected.
Estimation

When this button is selected the script will estimate optimal tile/image sizes every time you change one of their values. When you are in “all mesh” mode the button will disappear and the following text will be visible. Estimation is on! This means that reset has been switched on. This because setting tile sizes for all meshes according to the one you have selected is not practical (more on this later) You can of course swith estimation on to see what values it gives you, then switch it off and set the image size values to whatever you like.
Tile size relativity

Here you have 3 options for how you want your tile size to be calculated when estimation is switched on.
Edge length
The tile size will be calculated relative to the longest edge’s length of each face. Use this mode if you have a lot of ‘non square’ faces. Long and thin faces may not have a large area which would normally mean they get rendered quite small. In this mode that won’t be such an issue.
Face area
The tile size will be calculated relative to the face area of your mesh. If you render to an existing uv layout it calculates the maximum face area relative to the maximum uv area. Then it calculates the minimum face area relative to that. If you don’t render to an existing uv layout the maximum tile and minimum tile sizes will be calculated relative to the total area of your mesh.
Uv area
The tile size will be calculated relative to the uv layout of your mesh. If you have no available uv layout it will result in the same as a Non relative render. This mode calculates the face’s uv areas relative to the total uv area that’s available, not the total uv area that’s used.
Non relative
When tile size is non relative all your tile images are the same exact size. The difference between the total image and tile images is calculated using the total number of faces in your mesh. This is the optimal setting for rendering to a new uv grid.
Normal image sizes

Here you can set the size of your renders. There are 3 available sliders.
tile min
This slider is only available when your render to relative image sizes. It sets the absolute smallest tile that will be rendered.
tile max
In non relative render mode this slider sets the size of your tiles. In relative render mode it sets the absolute maximum size for your tiles.
image
This sets the size of the total compilation uv texture image that will be rendered.
All mesh image sizes

When you select “all mesh” mode the normal image size sliders are replaced by these 2 sliders. The size for each image will be calculated relative to the total face area of your mesh. You can still select what estimation mode you want to use. But for practical purposes we’ll let the script calculate all the tile sizes. To see what those tile sizes will be for an object leave “all mesh” mode and select that object, then press reset.
min image
The minimum size for the final uv textures.
max image
The maximum size for the final uv textures.
The render path

Here you set the path where you want the files to be saved. You need a total path and filename without extention. So you can set: c:myfoldermyfilename But not: c:myfoldermyfilename.png The extention and frame nr will be added to the filename. In “all mesh” mode the object name will be added as well. If you don’t change the frame your default final imagefile name format will look like: myfilename0001.png If you are in “all mesh” mode it will look something like: myfilenametheboject0001.png
Image types

This one should be easy. You can select three image types.
PNG
Targa
JPG
Do not use jpg if you want to render with an alpha channel. I advise you to use PNG since it’s lossless but not as huge as Targa.
Rendermodes
There are three render modes available.
All faces
All faces of your current mesh will be rendered
Selected faces
Only the selected faces (in face mode) will be rendered. Be aware that when you render in this mode to an existing uv layout it will also create the copies of this face needed for seamlesnes. So your image may look strange but it will be correct.
All meshes
All the mesh objects in this scene will be rendered. Reset of scene will be enabled. Estimation will be enabled. To uv layout rendering will only be possible if all your meshes have a uv layout assigned. The image sliders will be set to minimum and maximum total image.
Bottom menu
Here you have 3 options:
Run the script
Will start the rendering of your tiles.
Reset
Will try to reaquire the mesh you have selected. Will recalculate relative rendersizes relative to the total image size.
Exit
Exits the script.
Do’s and dont’s
Pitfalls and things to do before using the script
There is a flaw in the windows dirname function when you haven’t saved your current file before. This only impacts the script if you set a relative render path. So if your renderpath was //render It may print out ./render To solve it… either just type in the full path or save your blend file (and reopen the script). The bug is solved now (so I’m told) so if you have something more current than 2.37 this should be fine. The script will get errors if you have loose verts floating around in your mesh. For finding these problems I wrote the Mesh Checker script. Also you may want to run the script on a copy of your object. This because in regular mode (not original uv) it changes all the object’s uv coordinates. I advise against using specularity! The camera angle is different for each face so it’ll never match!
Straight edges and long faces
In the example on the left you can see the model on the left and the created uv layout on the right. As you can see the blue face only uses a small portion of the square part of the uv layout it resides in. Thus as a rule of thumb… try to make your faces as square as possible. In the example on the right you can see a small white edge in the black circle. On the right you can see that that’s where the uv image borders on the white background. This is because we’re using a true ortho camera straight in front of the face. It’s not an error in the script. All I can do is advise you to use rounded or beveled objects as much as possible. Or try to set a background color that matches your object somewhat
See through faces
If after rendering when you enter textured view mode you see slightly transparent faces like above. This means some faces are set with an alpha drawmode. To fix it select them all in face select mode (f) and click on the copy drawmode button in your edit buttons (texture face tab).
A nice example

I rendered this texture in a half hour. The tiles are only between 20 x 20 and 40 x 40 in size and I let it render relative to face area. Rendering this model shadeless with a high osa only takes around 2 seconds now… that’s a lot quicker than the 5 minutes it would take to raytrace it every time.
That means that after baking I can render my model 150X faster!

This is a figure by Sketchy… also baked ;) If anyone else has some nice examples that they want to show, please send them to me.
That’s all for now.
Enjoy
Dolf
Getting python to work on Xampp
Wednesday, March 17th, 2010I spent most of today (Dec 14 2009) messing around trying to get xampp to interpret python scripts. Usually xampp only works with php, at least on my windows system (windows 32 bit vista). But since I’m developing something for a python server I needed to get it to work.
I read a lot, found a heap of documentation about mod_python (mod_python.so), and only after half a day found out that that’s really not a very nice solution. And I already had python 2.5 installed as well. mod_python seems nice, and has a lot of links to it on google, but it’s overkill/weird and rarely needed.
So, if you’re like me, and have python & xampp installed on your system (and your pythonpath set in the environment variables), and need .py files to work… just do this.
Configuring the server
In the httpd.conf file for your apache installation (part of xampp) add the following all the way at the bottom. In my case the httpd.conf can be found here: C:\xampp\apache\conf
# # For Python # AddHandler cgi-script .py ScriptInterpreterSource Registry-Strict
Display clean text code for copying
# # For Python # AddHandler cgi-script .py ScriptInterpreterSource Registry-Strict
Configuring the python script
Then in the top of the python script on your server, it already knows it should be python, but it doesn’t know yet where the python program is. So as the very first line in your python scripts on the server you have to say where python is installed. In my case that looks like this
#!C:/Python25/python.exe
Display clean python code for copying
#!C:/Python25/python.exe
Enabling index.py
Of course it’s nice to have index.py files work just like index.php ones as well. So I added index.py to the following bit in the httpd.conf
# # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml index.py </IfModule>
Display clean text code for copying
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml index.py
</IfModule>
That’s it
Now .py files are also interpreted by python on a xampp installed apache server, just like .php. I hope that helps you as much as it dit me, and maybe saves you some time.
Dolf
Project cursor
Wednesday, March 17th, 2010Downloadable Files
- ProjectCursor_3 (225)
Blender 2.5 is at this point still highly experimental, so this script may well change.
This script places the cursor at the intersection of the vertex normals of selected vertexes.
Requirements
This script is written for blender 2.5 and is currently highly experimental.
Usage
Place the script in your .blender/scripts/op/ folder and when you reload the scripts using F8 or reopen Blender you can add the tool in the Tool shelf.
I will add more information when Blender 2.5 becomes more stable. For now you can see the previous version for details on what the script does.
Dolf




































