Wednesday, 15 August 2012

Cheesey 70s lens flare with the Blender Compositor

I rendered out something I was working on and realized that I had got the lighting wrong. the material I was trying was quite reflective and during the animation the material burned out - I had over exposed hotspots. While I considered what I was going to do about the lighting I realised that what it really needed to make it look authentic was lens flare.

I thought I would try it in Aftereffects as I'm always conning myself that I will oneday learn Aftereffects, but the tutorials for that were either very bad or involved buying an expensive pluggin. Not doing that! So I returned to Blender. Most of the tutorials for Blender involved meticulously choreographing lens flares by hand and I wanted something automatic and easy. Also I was quite happy with smudgy anamorphic style lens flare rather than beautiful blobby nikon lens flare. So I decided to do it myself using the compositor.




Now with my 70s star filter node set up my humdrum dual control assembly suddenly becomes a luxurious and desirable item. Why not use it on all your renders ;)

The node set up is here:
enjoy

Friday, 27 July 2012

Android looses sync with hotmail over exchange - Now maybe workround

Not really a Blender post. Yesterday I did a hard reset on my Galaxy S2 because the calendar was empty, the email app had a circle thing going endlessly round and round and my contacts had lost the nice pictures I had set for them.

Doing a factory reset is a little tedious as you have to reinstall the apps and set everything up etc.

Well this morning it has happened again. So this is getting serious. Googling this problem it seems it has existed since 2010 which is even more worrying.

I am not using Gmail because I have been using Outlook for years and like the workflow. I am now trying doing everything using Hotmail; using the Outlook hotmail connector and android sync over exchange. My old SPV C500 windows phone worked seemlessly with outlook, not something that can be said for Android. The hideous Kies software that comes the phone can sync with outlook. you will start to find any contact with anything in the Business field multiply and the calendar sync was rubbish. Used googles calendar sync for a while. My favourite moment is when I try and sync the memos on a freshly reset machine with the notes on Outlook; Kies will delete the notes in Outlook because they have been deleted on the phone. Ggggrrrrreaaaat!

So this morning I shall try to get the phone up and running with out a factory reset. I tried removing the hotmail account from the calendar yesterday but that didn't work. If this is going to happen most days I need a quick solution.


So I removed the account under settings/account and sync and restarted the phone. and set up the account again.

username: joebloggs@hotmail.com
password: *****
domain
server: m.hotmail.com
ssl: checked
receive certificates: checked

It takes a while to sync everything

Doing some reading while it syncs it looks like it could be a bug from the recent update from 4.0.3 to 4.0.3 (no other info given). That was a week or so a go so I don't know why it would suddenly start happening. Any looks like the 4.0.4 update will fix the problem when it finally arrives. It's going to be a pain to have to do this everyday.

Well removing and replacing the account seems to work. The colour has changed (I liked the nice orange) and you have to do Clear Calendars in the Agenda Widget if you use it before selecting the exchange calendar again.

Think I've found it!!!! The corruption seems to occur when the battery is fully charged and the battery full notification appears in the notification bar. So the workround until the update is don't charge your phone to the max until the update arrives.... :/

Looks like it may well be a microsoft problem.. look here

http://answers.microsoft.com/en-us/windowslive/forum/hotmail-sync/why-is-hotmail-not-syncing-correctly-on-my-mobile/f1768cab-2818-4637-90a3-b6f00e1e4500?page=1&tm=1341158876259
and log your details

months later:
I am now testing a Jelly Bean Rom and things seem to be working OK. Will post Jelly Bean solution soon.
See new post  here http://blenderboydiaries.blogspot.co.uk/2012/09/hotmail-exchange-android-and-jelly-bean.html

Saturday, 16 June 2012

Getting OpenCV to work on Ubuntu 10.10

I wanted my face tracker working on my Ubuntu box. It uses Ubuntu 10.10 as anything later seems to crash ( and I hate the dock thing on any operating system ). I had the 64bit version installed and I had read that this can cause problems with some python libraries that are not written for 64bit.
The main thing was the cv2.so (which is the linux equivalent of the cv2.pyd used in windows) was not being compiled and so the openCV stuff I had written in Blender for windows would not work.

So I reinstalled 10.10 32bit version and followed the tutorial here for installing openCV. http://opencv.willowgarage.com/wiki/InstallGuide%20:%20Debian . After a long time it had installed and the cv2 file was created. I had read that there were some problems with video texture on 2.49b but having downloaded the 32bit version for python 2.6 it seems to work OK.

Onwards and upwards
L

Thursday, 14 June 2012

The woman who married a pig

My film is now available for viewing in its entirety - enjoy




See 'The Woman Who Married a Pig' at
the 14th Hiroshima International Film Festival
August 23-27 2012

Monday, 4 June 2012

Head / Face tracking with Blender - the easy way

HA! Theres nothing easy about this (I haven't even got it working yet!   It Works!)

If you're like me ( and you did follow 'the easy way' title) you don't want to get into really deep programming because, like me, you're not very good at it.

So I have been trying to get face tracking working with the Blender Games Engine (in fact this is my third attempt) and I have hit no end of problems. The problems are around software and library versions.

The person to be most helpful is Akta ( see http://www.aktasway.com/blog/blender-and-opencv/ ) and Akta is kind enough to give away a little demo system which sadly does not work on my computer; but he also gives the original python scripts so I stand a chance of getting it going. Akta's demo is compliled for Python 2.6. He includes 'pyd' files (sort of python dlls) for OpenCV (which does all the clever face stuff. and PIL (python image library). But anyway it doesn't work.

Ashid (http://www.ashsid.sk/wp/?p=174&lang=en-us ) who wrote the marvelous VideoTexture for 2.48 (I still consider this the best (Windows only) and produces beautifully smooth output with an camcorder) has come up with a better version of the VideoTexture for Blender 2.62 using the python VideoCapture library ( and theoretically it should work for 2.49b)
But there is already a VideoTexture for Blender 2.6 I hear you cry! Yes, but a) it is not as good as Ashid's for windows because it uses FFMPEG and b) I can not actually find anywhere about using it with a webcam. The manual mentions it and then fails to mention how to do it.

So first, I tried Blender 248 with videotexture. It uses Python 2.5 so does not work with Atka's code :(

Next, tried Blender 2.63 (why not do it for the latest version I thought). 2.63 uses Python 3.2 and openCV has not been compiled for 3.2! (I did try 'ctypes for opencv' but that didn't work. )

So lastly I am trying Blender 2.49b. It uses Python 2.6 :) BUT, I am using Windows 7 pro 64BIT . Does this mean I have to install Python 2.6 64bit? (which I have). Does this mean I need 64bit versions of the libraries (which don't exist)? Can I install both 32 and 64bit versions of Python?

So I worked on and now its working though its a bit flakey (not anymore)

In the end I used the cv2.pyd library from opencv 2.41 to both capture the video and do the face detection. I don't think I need any other libraries. Blender 249b 32bit and Python 2.6.
I used bytefish's example here http://www.bytefish.de/wiki/opencv/object_detection . The lbpcascade_frontalface.xml detection scheme is a little primative (no eyes or head angles but is suppose to be faster.
 
And without any more a do here it is - Blend file

ONLY WORKS WITH BLENDER 2.49b!
(I use Windows 7 - it may work in Mac or Linux but not tested)
(update - tried on Ubuntu 10 and there seem to be some pretty horrible issues with numpy)

You must have

   
you need the cv2.pyd and lbpcascade_frontalface.xml in the same directory as the Blend file.
The cv2 and lbpcascade_frontalface.xml files are part of opebCV from http://opencv.willowgarage.com/wiki/ version 2.41.
   
You will also need a webcam attached. (you can have more than one webcam see the Start.py file in the text editor)

To use press P and to end press ESc

Results vary greatly on lighting conditions and camera quality

enjoy, L

If you find this useful or it doesn't work for you please leave a comment - as I have no idea

Wednesday, 9 May 2012

How to move a Rigify Rig

Once you've got as far as skining your rig and you're weight painting you kind of think, 'Hey nearly there!' and then you try and move the rig how you want so you can do the weight painting and find it doesn't really do what you want.. or anything much... Has all this time you've spent been wasted!

no

It's just not intuitive at all. The main confusing thing is that there are two sets of controls for each limb and they are the same shape as each other and on top of each other. Great. sooo....


On layer 20 of your blend file (not bone layer 20, but normal layer 20) you will find all the meshes used for the control bones and you can change them, either to make them easier to access (because your model has fat legs), or because you want to tell them apart.

For the uninitiated there are two types of control bones in the rig: FK (forward kinematics) bones -  these are like moving the joints of a doll and each limb receives the rotation of the joint nearer the body. Then there are IK bones (inverse kinematics) where you move the extremity and all the other bones move to fit they best way they can between the extremity and the body.

For the arms and the legs there is an IK bone which is about the most useful control bone for the limb. It is the same shape and position as another control bone which is the most mystifying of the limb. If you don't know what your doing you will select either at random and the limb will either move or it won't.


In the picture (we are looking at the meshes on layer 20) you will see the mesh used for the shape of the left foot control bone WGTfoot_IK.L Hidden behind it is WGTfoot.L. We want to make the useful bone different so we can select it easily and not be confused. I stuck a triangle bit at the front of the IK bone to make it easier to select.


You need to do the same with the hands as well. The 'rig hand_IK.L' control bone is just on top of the wrist and also cunning on top of the 'rig hand.L' bone. So I'm going to change it. The mesh on layer 20 is called WGThand_IK.L.


Now my hand IK bone has a nifty handle to separate it from the other bone. If you move these IK bones about, the limbs move... sort of

If we look at the arm we can see that the non IK control can come away from the arm.



The IK control is still above the wrist but the non IK or 'FK' (forward kinematics) control has move south along with the other controls we would normally associate with moving the arm.

So here is how it works. With the FK/IK (hand_ik...) slider set to 1.00 (see picture below) the IK control bone will contol the arm. To be more exact the arm will follow the controller bone but you can not rotate the controller bone so the hand will end up in some pretty strange positions.


If you move the FK/IK slider to 0 then the arm will move back over the other set of controller bones. Now you can move the arm about in the normal way; setting each bone one by one.

By pressing the Snap IK-FK button (bottom one) the IK control bone will move into exactly the same position as the FK bones. If you press the Snap FK-IK button then the FK bones will move to the position of the IK bones. So, if you have the FK/ IK slider up to 1.00. you can press Snap FK-IK to bring the FK control bones to the position of your arm. Move the non IK control bones to a new postion, and then press Snap IK- FK to move the arm to the new position.

Oh and by the way! There are some other IK bones which are influenced by the slider in the same way.



It is interesting to note that the Rig Main Properties sliders and buttons are the same for the set of controls (that was crap explanation). IE. the FK/IK slider is the same slider whether you see it when the IK control bone is selected or the non IK bone is selected.


If you have a non IK control bone selected then there is an extra slider.. Isolate Rotation. This works if the FK/IK slider is set to 0. Basically id Isolate Rotation is set to 0 and you tilt the body the arms will tilt with it. With Isolate Rotation at 1 the arms will keep there current orientation from the shoulder even if the body is tilted.

I think thats enough for now. Its the same from the legs pretty much. Once you've mastered these animation can begin.

Related Posts


How to weight paint a Rigify model

This has been quite labourious and I am not finished by any means.
(If you've not done weight painting before find some simple tutorials to get some practice before trying this)

I'm not sure I can recommend the automatic weights. It seems to give quite a low influence to the parts of the mesh you want and has a small influence over everywhere else. The result is you have to go over the whole model removing the unwanted influence from each bone and strengthening it where needed.

First things first. What to Weight paint?

It seems that in earlier versions of Rigify you needed to select a hidden layer of bones to parent them to the mesh. Now you don't, but you do need to unhide them for weight painting.


This gives you an extra set of boans which the mesh is actually boned to (it is not connected to the control bones). Remember 'Envelopes' should be unchecked as weight painting uses Vertex Groups.



You can see the new set of bones is much like the original rig we used to set up Rigify but for some reason we have two bones for each section of each major limb. (dunno why, but they both have an influence created under automatic weights.)

Secondly, you need to reduce any subdivision modifier on your model to just about 0. Weight painting seems to be a lot slower in 2.6 than it was in 2.49b and you need all the help you can get. Also, make sure that the Armature modifier is the first modifier in the modifier stack for the Model (ie. above subsurf). this seems to speed things up a bit.

Now you can spend ages weight painting everything - good luck and drink lots of tea.

Weight painting fingers is nigh impossible and needs to be taken into acount when making the model. Disregard the position of the legs and fingers in the Rigify initial rig and have the legs and fingers spread to reduce you problems later.

nice tip: See face Selection Masking here http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Weight_Paint#Face_Selection_Masking
Next - How to move the arms and legs about.... not as easy or straight forward as it sounds.

Related Posts 
How on Earth do you use Rigify in Blender 2.6?
How to move a Rigify Rig