Mar 2 2010

WebCam Palette

Hi folks!

This is the outcome of some experiments I’ve been doing lately using C++, Qt and OpenCV, the computer vision library. The goal of this software is rather simple, but handy!

When you launch the .exe a window is shown on your screen. Press start to open the connection to your webcam and start acquiring frames from it. Then drag selections over the webcam window to select the area, when you release the mouse button the software will calculate the selection’s average rgb pixel component and it will show it in the main small window in three separated text fields. So obviously watch out what you select to get right color there (btw the color is shown also on the top left corner of the webcam window) ;)

Why use this small piece of software? Well personally sometimes I wanted to know: which color is my sweater? Or, whoa, I like the color on this book/flower/pen/muffin etc etc, but what could it be? Well now I can find my answer with this software just putting the object in front of the webcam and selecting the region of interest. As I said is a small piece of software, but handy for any kind of graphic app, Blender shaders and materials included! :D

You can download the software here, it’s in a zip file, unpack it wherever you wish and launch WebCamPalette.exe.

WCP in action!

Yeah, before you start giving me the f%&#&ng MS supporter/developer, I can upload the sources and you can compile them yourselves on your favourite platform, however you need them to have also the OpenCV libraries compiled for the OS on which you are going to run WCP.


Feb 14 2010

The King’s death

This is just a quick post after a long time where I want to share with you my latest render done with Blender + LuxRender. I’m not very familiar with Lux, so it has been quite a good exercise for me! :D
I’ll come back to you soon with some new fancy experiment with Blender and augmented reality, so stay tuned!
Here you go with the render, “The King’s death”


Dec 9 2009

Blender and OpenCV

Hi!

I managed to have some good working interaction between OpenCV and Blender to do face tracking, using a simple webcam, in order to control a camera in the BGE. :D

For those who don’t know what is OpenCV, they will find the answers here. OpenCV is a really powerful library for real-time image processing, so I strongly recommend you people interested in that to have a look at it!

Anyway how does it work this system I developed? There are basically two components:

  • The face tracker
  • The real-time BGE camera tracking

The face tracker gets frames from the webcam and for each frame checks if there are faces in the image using the pattern file “haarcascade_frontalface_alt.xml”, where the shape is defined by a set of coordinates (a lot as you can see yourself if you open the file!) which defines face’s pattern. Beware that multiple faces can be detected, but if you are using my example they won’t work, you must use just one face. Once the bounding box of the face is found, its center and area is calculated. CenterX and CenterY are used to control the camera position on the X and Z axis, while the area is the Y, so the bigger the closer the camera gets to the center of the scene (a cube). In the .blend file the area is not used because I’m still doing some experiments to get the best usage of that value, but you can try it yourself, just play with it. :D

The face tracking works really well in almost every light condition, but I recommend to have a plain light and a good color difference between you and the background. I haven’t made yet any screen recording to show you how it works, if somebody wants to do that in the meanwhile and send me the link of the video, I’ll put it in this post. :D

Note: this example works on Linux/OSX/Windows platforms as long as the webcam is supported by OpenCV. Mine wasn’t so I had to use VideoCapture module for windows. If you are going to run it in OSX/Linux, change the part of code regarding the webcam device initialization and image capture using the OpenCV methods instead of VideoCapture ones and you are ready to go! Basically you just need a PIL image format value that can be passed computed by OpenCV.

You can find both sources and a win32 build that doesn’t need anything installed on your machine, just run it! The python script needs OpenCV installed. Once you install it you will find in the folder a Python26 subfolder with libs and DLLs. Copy them in your Python folder and that’s all, those are the python wrappers for OpenCV.

- Download BlendCV win32 binary

- Download BlendCV sources

Akta


Dec 4 2009

Bathroom project

Hi Blender guys!

I just decided to release under CC license the bathroom I made in Blender for a project I called “Bathroom project” (obvious name, isn’t it? :D )

Appliances and objects in the bathroom include textures and materials, so it’s ready to be used in your own works!

You can use everything is in the .blend file for both commercial and non commercial use, enjoy it!4

Download the .blend file


Dec 1 2009

Blender++ 1.2 released!

Hi!

I’m proud to announce you that Blender++ v. 1.2, the batch renderer for Blender, has been released today! :D

Blender++ 1.2

Blender++ 1.2

If you don’t know what is Blender++, please check it out here!

What is new in Blender++ 1.2:

- Queue support: now you can submit queues to Blender++ in a special .que file format. Check it in the Blender++ folder to see how is it done!

- Command line: you can now use Blender++ without opening the GUI at all! This means that if you can remotely access to your machine (i.e. with Putty) you can just start your renders using the following sintax:

  • queue render: brend95.exe queue_file q 1 t app_folder
  • single frame render: brend95.exe blend_file f frame_number t app_folder
  • animation render: brend95.exe blend_file a start_frame end_frame t app_folder

Where t is number of threads you want to use (remember that Blender uses from 1 to 8 maximum threads) and app_folder is the path to the blender.exe file. Moreover if you are using the OSX or Linux version just change brend95.exe with “python brend95.py”

- Baked data support: fluids and soft-bodies/cloth baked data is rendered as long as it’s pre-baked in Blender before launching Blender++.

- Threads support: you can decide how many threads Blender will use to render your blend file or queue (max. 8)

- Bug fixes

If you find some bug please report it to me and I’ll be happy to help you out providing a patch :D

You can download Blender++ 1.2 from sourceforge.

Akta


Nov 22 2009

Blender Conference 2009 – Immersive Worlds

Hi! :D

Just a quick post, I spent the whole week-end trying to rip the video about my talk in Amsterdam during the BC 2009 available on the De Balie website ( http://debalie.nl ). So here it is the presentation, hope you enjoy it!

Akta


Oct 28 2009

Halloween test!

Hello Blender friends,

today I wanted to try quickly some ideas about using the cloth modfier to give more realism to static meshes. So it’s not a big artwork (I made it in 30 mins more or less), but I’m quite satisfied about the result. Since Halloween will be in few days, what could have been better than the classic ghost? :D

If you want to know how to achieve this effect just drop me a line and I can post the .blend file or maybe make a quick tutorial. ;)

Halloween ghost

Halloween ghost

Akta


Oct 27 2009

Blender Conference 2009 – Report

I wish I had a laptop in my brain from where to share every single thing I saw and learnt in my first BC to share that with you guys, unfortunately I can just write a sort of final report on what this experience has been for me.

If you are Blender fans, you must go there. It’s impressive to see how many people love this open-source tool and how much close you can feel to them even though you met them only few minutes before. It’s like everybody there has been your friend since the childhood, there’s feeling between people, a kind of magic friendship in the air which lives under the same flag, Blender.

Besides the human aspect of the conference, where I had the chance to meet really cool people that I knew just because their tutorials or articles on the web (like Sebastian König, Andrew Price, Anfeo and all the italian Blender community), I must say that the quality of the conference was extremely high. This from several points of view: artistic, scientific, organizational.

Artistically speaking I’ve never seen such a good quality artworks made by Blender users. I was especially impressed by the Durian concept art sketches made by the french artist David Revoy. His epic fantasy style really astonished me. Also the Suzanne Award Festival was great. It took me some time before I could decide for whom I was going to vote.

Blender as a tool for scientific applications was an important aspect of this conference. It really showed the endless possibilities that the software can offer also to the scientific community, beyond the artistic one.

Dolf, Anja and Anna. Three words to express the same concept: organization. Without them all of this wouldn’t have been possible, so thanks! :D

Personally I feel really satisfied. The feedback I got from the talk was much more than I expected, people were really excited about the idea of having emotions in games and they come up with several interesting possible applications. I thank them for their support and as I promised my aim for the next year is to release a full game which uses biosignals in realtime :D

If you are interested in paper and abstract, you will find them soon on blender.org, as well as the video of my talk.

If you want another point of view of this conference, I recommend to visit Andrew’s website BlenderGuru , you can find there an article and a lot of cool stuff like tutorials, tips and articles about Blender!

Marco

David Revoy


Oct 12 2009

Blender++

Update!

I’m actually proceeding really fast with the version 1.2 of Blender++. So far here it is what has been included:

  • Queue support. You can now submit as many render as you want. Start and end frame for each blend file is customizable
  • Threads used. You can select how many threads you want to use in your rendering process. This is really helpful when you’re using your machine and don’t want it to be stuck on the rendering (of course you need at least a dual core or better :D )
  • Bug fixes

What needs to be done still:

  • Pause rendering
  • Remote job submission
  • Remote machine shutdown (in case you don’t have access to it :) )

Baked data works fine in your renders as long as you have it baked somewhere and the path is specified in your .blend file. At the moment I’m busy also with the Blender Conference in which I’ll present a new project about games, but I’m quite confident to have 1.2 by the end of this month!

———————————————————————————————————————–

During my spare time I had the chance to develop this handy software which can be used to run background renders with Blender both for single frames or animations. I know that there was already a software calle Fast F12 from super3boy, however even if his idea was brilliant, I didn’t like several things:

  • It’s not opensource
  • It’s only for Wndows
  • It runs using the .NET Framework 3.5, included in Vista but needed if you have Win XP

Moreover what I wanted from this software was a kind of remote control of it. For example, let’s say I start my animation render at home and then I go to the office. At some point I’d like to know the status of the rendering, so I access to my Blender++ server via mobile phone or desktop client and see how is it going. Maybe I want to stop the render for some reason or start a new one. This was not possible with Fast F12, but now it’s included in Blender++.

Summarizing here what we have in this 1.1 version:

  • Background render (single frame/ animation)
  • Progress bar and status bar to have an idea on what’s going on and some render infos
  • Internal server that can be configured and to which we can access to check the render status and stop the job if needed
  • Possibility to set the Blender binary path in case it’s in a different folder than the default
  • Multiplatform support (Win, OSX, Linux)
Blender++ running on Ubuntu Jaunty

Blender++ running on Ubuntu Jaunty

Blender++ was developed entirely in Python and needs wxPython 2.8.1 or higher in order to run on Linux and OSX. For Windows binaries are available so no need to install python on your machine.

What should be done next:

  • Queue support. Now just one job at time can be started
  • Remote job submitting. I have to figure out a couple of things, but should be really easy
  • Show preview, either on the local machine or remote
  • Any suggestion? :D

Of course the source code is available as well for download. Here on sourceforge you can find all the stuff you need, please if you find any bug leave me a message. Comments and critics are really welcome as well :D

Right now you can download:

  • Blender++ (1.1)
  • Blender++ Net Client (1.1). This is a demo client that shows you how you can access to a Blender++ server from a remote machine. Beware that if your network is behind a NAT it won’t work if you try to access from outside the network!
  • Blender++ mobile client. It’s made in Python as well, so you need a Nokia S60 2nd edition or higher phone to run it. You need to install Python as well on your phone, google PyS60 for more infos.

That’s all, hope you enjoy it ;)

ps: now there are only Windows binaries on sourceforge, in the evening I’ll put the source code plus OSX and Linux versions. I need to get back home first :P

pps: I’m back home, Linux and OSX versions are available now! Remember that Python 2.6 and wxPython 2.8.1 or higher is required to run Blender++

Blender++ project page on SourceForge


Sep 27 2009

Endorphin and Blender

Hi guys!

I’ve not been that active lately because I’m  really busy with work, personal stuff and the Blender Conference (oh yeah, I got my talk accepted and I’ll be there presenting it! :D ). Today I’m gonna talk about Endorphin and how to import BVH data from it in Blender. Browsing the web I noticed that there are not so many useful info about the workflow, actually I found just a couple of posts on blenderartists.org where somebody had problem with BVH data exported from Endorphin, but nothing more..

Well basically I had the same big problem with which I’ve been playing around the whole weekend. If you export the animation from Endorphin as BVH and import it in Blender, you will notice how the animation plays smoothly and everything looks in place. But if you try to check the rest pose of the armature, you will find out that is a weird pose, actually nonsense. This implies that parenting it to a mesh will give you an non-sense output as well, nor vertex painting will work! Don’t be desperate! Actually there is an easy way to go around it :D

First step: create your simulation in Endorphin, then export it as BVH

Second step: open Blender, import your BVH file as Empties, not as Armature! Now you will have plenty of empties flying around your 3D view when playing the animation. Now there are two things you can do before importing your character: you can either clean up the empties leaving only the very essential ones that will be used in the IK constrains in your armature or you can leave as they are. This would give a better resolution if your armature has a lot of bones. Personally 10-15 empties were enough for me :)

Third step: import your character! You need to position it as more precise as possible to the empties. This means that joints and empties have to be in the same place otherwise the animation will not be so nice to see :D First add two constrains to the armature root, which is usually in the hip. One IK solver and one copy location. Both to the empty which represents the hip in the simulation imported from endorphin. After that for each couple (bone, empty) add just an IK solver to the bone which has as a target the right empty generated from the BVH. Don’t use the tail! And chain length in some parts has to be changed to 1, lower legs and forearms for example, but you need to know something about rigging to do this. I have no time to explain it here right now :D

Fourth step: tweak and enjoy the final result!

Hope this helped, I’m actually really happy about results I’m getting right now. Oh and I forgot to mention that since all the other contrains, especially IK solvers, were taken in account in the endorphine simulation (for instance knees etc..) you can clear them from the character’s armature.

Here you have the blend file from a quick experiment I made (15 minutes)
Endorphin Blender test
Here it is another experiment I made

Marco