Jun 8 2010

LiveMesh! 2.0 – Teaser

Hey guys!

Just a small teaser for all of you :D

Since over 2500 of you have downloaded LiveMesh! 1.0, that really motivated me to proceed fast with the development of version 2 :D . Right now I’m working on UV data from the OBJ file into OpenGL, the results so far are really promising, check the video! After UV mapping will be done I’m planning to create an interface for the application where you can customize the params in real time (transform data, marker, objects, lights etc..) and finally I got a great idea on how to export animation data in a fast and easy way, no pain at all for you people! However it’s still an idea, I can’t tell how much will work until I start implementing it :P

Enjoy the video and stay tuned for the next updates ;)

Akta


Jun 3 2010

LiveMesh! 1.0

Hey Blender folks!

I just released this small piece of software which I find quite cool. :D

LiveMesh! is an augmented reality application using Wavefront objects (which Blender can export until version 2.49b) and a pattern to show your 3D model in a live camera stream. How does it work?

Without going too much into details, the software reads frames from the webcam stream and at any step tries to find the pattern in the current frame. If the marker is found, geotric transformations are calculated and the object is drawn according to the pattern position, rotation and scale. The software was written in C, I used the ARToolkit library to detect the pattern and calculate its transformation data, then the drawing part is handled with OpenGL. I wrote a simple obj reader which gets the vertices informations and display them overlaying the video stream.

UPDATE: NOW THE APPLICATION IS AVAILABLE ALSO FOR WINDOWS! :D

Since this software is going to be used in a funded project, I can’t release the sources right now, but as soon as the project will be over I’ll release them, promise! Of course you can ask me things on how to do this and that, but I can’t release any code, unless you’ll find me a new job! :D

Enjoy this first version, simple but cool I think! Many people on the web were asking how to use 3D models in augmented reality, here you have now your small piece of software ;) Right now just the mesh is exported, but in version 2 which is already under development, texture and material object data will be exported as well!

So stay tuned and enjoy the video below with LiveMesh! in action!

LiveMesh! Win32 LiveMesh OSX

Akta


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


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 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


Jun 22 2009

Object and laser tracking in Blender

Hi!
Before being on holidays I wanted to complete this other personal project using my favourite two toys: Python and Blender :D
Today I’ll show you how to get with cheap technology such as a webcam, a pen and a laser, cool things like object tracking in the BGE. Of course when you don’t have enough money to buy awesome (and really expensive..) hardware, then you go with software solutions.
First of all, what’s object tracking? For those who don’t know it yet, it’s a “is the process of locating a moving object (or several ones) in time using a camera. An algorithm analyses the video frames and outputs the location of moving targets within the video frame.” (from Wikipedia) So basically, it’s like the computer is able to see and detect moving objects. There are many approaches to this, I used laser lights and color-tracking. Somehow color-tracking is simpler, but my plan is of course to do full motion tracking in the future. :D Unfortunately I couldn’t use OpenCV because my webcam was not supported, so I used Videocapture to get PIL data from the webcam, Python Imaging Library (PIL) to handle the matrix and sockets to communicate internally with Blender. Why sockets? Read my previous post :)
Laser tracking is simpler, however you can’t have depth which restricts movements in the BGE to two dimensions. On the other hand tracking objects is good if you want to have a full 3D interaction. How do you get the depth? Just checking the size of the bounding box area, when it gets bigger it means the object is closer and viceversa. Another important concept in this is the threshold. You need some time to tune it in order to get a perfect tracking. Spheres are the easiest to track since the shape doesn’t change if you rotate them. I didn’t have any sphere, so I used also a red d20 from my dungeons and dragons kit :D
Anyway, stop talking, enjoy the video and if you have question post it below ;)
Sources will be available in a couple of days, I need to clean them up a bit from test code and write also some comments. If you are interested in another cool thing about webcams and BGE check this video made by Nathan Letwory, one of the Blender’s coder living here in Finland who I never had the pleasure to meet, but just exchange a couple of emails :D

Sources available! :D Click here to download them!

Akta

Edit: look at what Mike Pan did using BlenderTrack, amazing and brilliant idea. I was actually wondering how to head track using this script, but Mike was faster and smarter than me :D
Enjoy his video and let’s see what comes next!


Jun 11 2009

N95 accelerometer with Blender

Hi, after one busy week I managed to release this first simple demo that shows you how to use the n95 accelerometer as an input device in Blender :D The application is structured in this way:

  • Mobile client, a python script which reads the accelerometer data and sends it via bluetooth to the pc
  • A server that runs on your pc and shares the data with the BGE through a local UDP non-blocking socket
  • A Blender script which handles the cube rotation in the BGE using the n95 accelerometer’s data

Why did I use a local socket? Sometimes I experienced some lag using pyserial in Blender, so to avoid that my idea was to use a non blocking socket. With this approach I had a smooth game running in Blender without any lag.

What do you need to run this? A Nokia N95, a PC/Laptop with a BT connection and Blender of course! :D You need to install PyS60 on your Nokia phone from here. Download both PythonForS60_1_4_5_3rdEd.sis and PythonScriptShell_1_4_5_3rdEd_unsigned_testrange.SIS you need to sign the ScriptShell otherwise the accelerometer data won’t be retrieved by the script due to security reasons of Nokia phones. You can sign it from https://www.symbiansigned.com/app/page using “Open signed online”. I’m going to put the source code of what I did really soon, I want to improve a little bit some part of the code to make it more stable. However even though the scenario I present in this video is really simple, it’s a way to show you how Blender is really powerful (besides modeling, animating, composing, whatever :D ), Python is really one the strongest features that Blender has, since it makes the possibilities of interaction with other apps, device etc,  endless. :) Try for example to imagine the N95 as a joypad for a Blender game WipeOut style (I personally hate WipeOut, but somebody may love it :D ).

So enjoy the video and if you have feedbacks, questions, comments, feel free to ask!

Edit: sources available! Click here to download blender95!

Akta


Mar 11 2009

WIP – Blender Multiplayer Game

Well, in my spare time (it’s not that much unfortunately because my job steals 90% of my time in this period) I’m working on a simple multiplayer game using Blender and of course python to create the classes server and client that will be used to share realtime data such as positions, rotation etc. among the players. I’m thinking about Pong as baseline for my game, however some changes may happen due to a couple of things that I need to verify! :D
For now enjoy this amazing tutorial about arrays in Blender, really useful sometimes to achieve nice effects as shown in this video :D