« Tutorial: 2D animated eyes, “Pocoyó” style
Peaching ! »

Python is my friend…

Maloyo rigged and posedLeandro “Cesio” Inocencio and I were trying to figure out a way to set up a rig in a similar fashion than the fantastic rig from Victor Vinyals demo reel, with smooth IK/FK blending, autosnapping and UI simpleness as Pepeland’s Red Nelb.

Lots of features missing in the Blender API as well as bugs in Blender, were stopping us to get what we wanted. Fortunately, Campbell Barton and Joshua Leung were there to help coding the needed API commands and fixing the annoying bugs and we succeed at getting the smooth IK/FK blending which was the most difficult part (actually it was Joshua who provided us a sample code that put us on the right track).I finally applied all these tests and ideas into one single rig for my Maloyó Project.

You can see the rig demo here -> www.malefico3d.org/movies/maloyo_rig.avi and in YouTube.

The rig with the script that manages it can be downloaded from here (EDIT: Blend UPDATED ! 0.1c Now includes packed textures for eyes)

This uses quite a bunch of new features like Pole for IK Solver constraints (Brecht Van Lommel), many API new features (like bone.layerMask, bone.poseMatrix, etc) and recent bug fixes, so if you want to try the rig yourselves you will need an updated SVN build.

The idea of this is having a Space Handler script to catch left mouse button and show a “context sensitive” menu with options. The options are different depending on the bone you have selected and will only show up in Pose Mode.

This particular character doesn’t use any facial stuff besides the eyes I covered in a recent post, so don’t expect nothing fancy like Mancandy there.

Some instructions as to try this:

1- Enable ScriptLinks in Button Panel

2- Activate “maloyo.py” in View->SpaceHandlers in 3D Viewport.

Menu with options for IK/FK switch

Only one layer is needed for the animator to work. When you select the “wrist” bone and left click on it, a menu should pop up letting you to switch to IK as shown in the video. The “Key Arm” option will insert keyframes for all needed bones to keep the pose plus constraints used, so there is no need to insert keyframes for influences manually.

You can also select the Head bone to switch from FK and IK control systems, and select the feet bones to hide/show extra bones like toe and heel controls or “pivots”. The “pivots” are bones only useful to snap the cursor to and rotate using Cursor reference (check the video).

If you feel like testing weird experimental features you can try this patch for Blender I wrote, that lets you change the transformation reference (Pivot) automagically without having to change it manually from 3DView header as shown in this other video. EDIT:Patch was aproved and merged into trunk,just grab updated blend (0.1b) to try this feature.

That’s all, thanks also to Jason Van Gumster who I started researching this with when we were in Belgium.

This entry was posted on Tuesday, November 13th, 2007 at 10:12 am and is filed under Blender, Maloyo Project, Python, Rigger Tips. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

22 Responses to “Python is my friend…”

  1. Sergeant Oreo Says:
    November 14th, 2007 at 1:03 am

    Wow, that is so cool! This will make posing so much easier!
    Now to learn to animate… ^_^

  2. endragiri Says:
    November 14th, 2007 at 1:03 am

    Wow, I looking forward to your rig-set-up, I have all rig by Daniel (Pepeland) and explored what he have done and share with our community. Now maloyo look more simple.

  3. endragiri Says:
    November 16th, 2007 at 12:33 am

    gracias Cloudio

  4. funktioncurve Says:
    November 17th, 2007 at 7:22 pm

    Wow that is my dream come true on the functionality and general great stuff I have always dreamed of from rigging in Blender how do i go about getting hold of the same functionality for my version of Blender i loves it :)

  5. oblenob Says:
    November 22nd, 2007 at 3:41 pm

    I downloaded the .blend but I cant find the textures

  6. malefico Says:
    November 22nd, 2007 at 11:07 pm

    oblenob: download latest blend (0.1c) with packed textures for eyes and eyes control ready for action.

  7. Martín Says:
    December 19th, 2007 at 10:15 am

    Sos groso, sabelo. Te mando un abrazo desde Córdoba, y se viene la comunidad de Blender con olor a peperina, así que les hacemos un lugar pa cuando quieran pasarseeee!

  8. tedi Says:
    December 19th, 2007 at 3:26 pm

    Eyes: as I read, you used images plus a “monitor” shape. Wouldn’t it be nearly as effective (and easier to setup, too) to use a slightly extruded mesh and shapekeys? (purely theoretical question)

    Or was there a special reason to use 2d images instead?

  9. malefico Says:
    December 19th, 2007 at 4:31 pm

    tedi: using textures for the eyes is a requirement, as it is the look/style of pocoyo. The monitor I use is actually a mesh with shapekeys (used as bone). Using directly a mesh for rendering the eyes, just doesn’t look the same.

  10. subdivmaniac Says:
    December 21st, 2007 at 9:27 am

    Cool work dude! Love it!

    Can we discuss about rigging in blender, ’cause i want to know lot more about python scripting. I have experience in l-script (lightwave), and just interesting to develop more in blender.

    See ya!

  11. cyberspark Says:
    December 24th, 2007 at 10:21 am

    Hi. i have a question about …..How to set up bone for animate an eye …. i down load your Model with eye’s texture and play with bone that control the eye. i try to look at your example (maloyo) but still not understand how to set the Eye like you(Maloyo)
    I like this style but ..don’t know how to… Would you explain step by step about set the eye like Maloyo.

  12. cyberspark Says:
    December 24th, 2007 at 11:08 am

    so sorry i did not read your tutorial ….i understand everything clear …. no more video tutorial
    Thank you

  13. johnmoran Says:
    December 27th, 2007 at 11:45 pm

    I’m sorry, I don’t understand this…it’s a page of script, right? How do I open that in Blender, and how is it easier than a link to just download a .blend file?

  14. malefico Says:
    December 28th, 2007 at 8:59 am

    johnmoran: No it’s not. If you click on the link above YOU WILL DOWNLOAD A FULL RIG. The script is included in the blend, and it adds functions to some of the bones of the rig. You can modify the script and load it as a TEXT FILE in the Text Editor in Blender. READ the last part of the script to see how you can adapt it to your own rigs.

  15. johnmoran Says:
    January 1st, 2008 at 3:23 am

    Hi - I’m sorry..but still, when I click the link, I only get a very (very) long series of text-code: no download occurs. Does this have to be for windows or something maybe? I’m really so interested to see this rig, but I can’t find a .blend file (…safari browser, macOSX).

    Can anyone tell me why this is? I’d appreciate a lot to understand this :(

  16. johnmoran Says:
    January 1st, 2008 at 3:45 am

    Oh - I got it! :) (right click, download link to desktop - sorry, i’m not used to that)

    THANK YOU for the rig!!!

  17. Buba Says:
    February 18th, 2008 at 5:31 pm

    Hello Malefico,

    this is simply amazing. Recently one friend of mine lent me Animators Friendly Rigging DVDs (you can see one example rig here http://www.wizcg.com/Wip/pirate/rigv5.wmv) I recommend it to you too. And now I see these advanced techniques are quite possible in Blender.

    I believe that new pyConstraints in SVN will help to progress with this as well. I hope that in near future we will be able to have easy IK/FK smooth blending/switching, squash&stretch rigs.

    Please do you have any tip regarding some python script (pyConstraint) that enables IK spline creation in Blender?

    Thank you very much.

  18. malefico Says:
    February 19th, 2008 at 8:29 am

    Buba, thanks for sharing the video :) It’s pretty much the same rig as Vinyals’ rig I was referring I took as inspiration for my own. I haven’t been working on updating this guy for quite some time, waiting for some bugs to be fixed. Now that apparently they were fixed, I’ll give it a try at space switching, and get the IK/FK switch for the legs which I couldn’t so far. About IK spline creation I don’t know any scripts that can do that, sorry !

  19. Harryabreu Says:
    June 29th, 2008 at 8:03 pm

    Sorry but before post here I send 2 e-mail for plumiferos.
    What happen with The movie I want to understand.
    Because I never hear anything more since you finished the work.
    If possible tel me anything.
    Tank you.

  20. Christian Says:
    September 23rd, 2008 at 11:29 am

    Hi to all

    First of all your work is really impressive. And now to reason why we write you. We want to give young talented and creative people the chance to distribute their movies worldwide and make it more well-known.

    Our company Vidimensio LTD is offering stereoscopic 3D solutions for 3D theaters.
    We are searching for stereoscopic 3D content for licencing and distribution.
    Our goal is to offer the animated movies of your community on our website and webshop and if there is a customer interested in buying it we negotiate a contract between the author and the customer. So this could be a win-win-situation for both, the author and us. So we are in a role like an intermediator. And this is a chance to distribute your work in a wider area and to make them more popular. That’s an unique chance! We also place a link of the author at his work, so everbody who is interested in the film could visit the author’s website, maybe also for new orders.
    I would like to point out that we ONLY need stereoscopic 3D films/content, thats means 3D material rendered of two perspectives in two files, which can be watched i.e. on the 3D DLP TV.

    Thanks!
    Best Regards!
    Christian Fencz
    Vidimensio LTD
    Web.: http://www.vidimensio.com
    eMail: fencz@vidimensio.com

  21. Stefan Andersson Says:
    February 19th, 2009 at 10:22 am

    This is a rig I have to test! I love the design, and my daughter just love Pocoyo.. so I think I need to make some animations with this one to amuse here :)
    Thanks for the contribution!

    regards
    stefan andersson

  22. Rajiv Mudgal Says:
    April 17th, 2009 at 11:40 pm

    I need to try out this rig, Looks fantastic
    Thanks for sharing
    regards
    Rajiv

Leave a Reply


malefico’s spot is proudly powered by WordPress
Entries (RSS) and Comments (RSS).