Wobbly Rick Sanchez

So I saw this earlier today:


And I figured, since I already have a model of Rick’s head that I did a few months back, I’m gonna try and replicate this using Armory. Been wanting a little project to get my feet wet and I reckon this’ll do just fine. No idea how I’ll do it yet, or how long it’ll take, but I figure I’ll give it a shot. I’m happy to receive help along the way.

Here’s what I got so far:

Wish me luck.


Ok, so I think the first thing I wanna implement is having the eyes follow the mouse cursor. At this point all I did was set up some constraints between Rick’s head/eyes and an empty object to control them, with varying degrees of influence (see video below).

The challenge now is to set this up with logic nodes or some scripting, so I’ll be exploring those next. At this point I’m open to suggestions on how to pull this off, though I’m committed to getting it figured out on my own if need be. As others may have pointed out, it would be great if Armory did support constraints like this out of the box.

Thanks to @Simonrazer 's logic nodes tutorial, I was able to understand how they work a little better and implement the mouse follow feature for Rick. I’ll provide the .blend file here for reference, but basically I have the head and eyes each parented to empties, so that the head can turn on one axis, and the empty another. The rotation is done by getting the mouse coordinates, and subtracting half of the window size, and multiplying it by a tiny number so that it doesn’t rotate too wildly. Relying on window size means I can’t get a good implementation with the fullscreen option, so I’ll need to figure that out. But anyway, here’s what things are looking like now:

And here’s the .blend file if any of you are interested:

Rick.blend (1.7 MB)

Gonna take a break for the holidays and get back at this sometime next year, so I hope all of you have a good holiday and a happy new year.


you should add subsurface.

@sans-iccal I already did by the ‘third’ post…can’t you tell? :stuck_out_tongue_winking_eye:

Hmm, then is it the lighting that looks off? maybe an HDRi would make it look better.

@sans-iccal Maybe. Right now I’m focused on getting that cloth-sim functionality like in the Morty example above (and boy do I have my work cut out there, if you have any suggestions on that I’m all ears), then I’ll worry about what it looks like.

I was playing around with a simple project that achieved more or less that elastic mouse dragging effect. It required some changes to ammo.js and haxebullet and some minor changes to armory itself. Still didn’t create pull requests for those topics yet…
If you’re interested I can share what I did by next weekend with some explanation on how to get it working.

1 Like

@donalffons That would be great, would love to see your implementation! Thanks :smile:

@donalffons On a related note, I found this cloth addon written using the numpy library, I wonder if any of this can be applied with haxe/kha, have you seen this?

I will definately share what I did. I just want to give some instructions on how to make it work and I will not have time before the weekend to do that.

I saw this video too, on Blendernation. Awesome, what this guy is doing in Blender. I guess that’s the beauty of open source…

I’m by no means an expert in Haxe/Kha/Armory, but here is what I learned: For physics simulation, currently Armory is using haxebullet, which is just a wrapper for AmmoJS (if you’re targeting the web) or the Bullet Engine (if you’re targeting C/C++). AmmoJS on the other hand is just a port of Bullet to Javascript (through EMScripten - basically you feed EMScripten the Bullet C sources and an .idl Interface Definition Language file and it spits out javascript code - that’s witchcraft in my opinion). Currently, not all functions of Bullet are supported by AmmoJS. And not all functions of AmmoJS are supported by haxebullet. And not all functions of haxebullet are supported through the Armory GUI :slight_smile: . But it’s dead simple to add in the missing things. So, if you are just looking for a very powerful soft body physics engine, I think Armory is very well founded.
If you want to port the python code of the Addon into haxe (and javascript and C++), then, good luck :slight_smile: . I guess, anything is possible, right :slight_smile: ?!

1 Like

First of all, I pushed a couple of pull requests for haxebullet and armory. @lubos I hope, I didn’t screw anything up, as I’m not so familiar with git. Let me know if you see any problems with those requests.

Here is an example of my simple “Drag Skin” trait: http://bit.ly/2DJQLRt (Download Sources: http://bit.ly/2rL8P8a ).

By the way, I spent almost no time on optimizing the parameters.

There are two main problems:

  1. Currently, you cannot attach two meshes together, therefore they eyes and eyebrows don’t get pulled
  2. Combining everything into one mesh also doesn’t work, because then armory freaks out and everything gets black and spiky
  3. I think this currently only works for HTML targets. Last time I checked, the C++ export was broken.

I will create an issue for problem 2 on github (edit: here it is). I think it would be the easiest to implement. Maybe @lubos knows how to fix this.


The latest fix from @lubos makes it possible to combine his eyebrows and drool into the head mesh, so that everything moves as it should: http://bit.ly/2Fnsmxc (Sources: http://bit.ly/2DRO27v)
At the moment that’s just a quick and dirty test… Also, performance is quite slow, but this could be fixed by decreasing the poly count. Some fixes to the mesh and some parameter optimizations would help make it prettier. JFYI, these are the most important parameter settings in the haxe trait:

Edit: See here for desriptions of most parameters.

The eyes remain unsolved, since they are separate objects… I see two ways to get them to work properly

  1. Combine the eyeballs into the head mesh and implement the pupil movement through animated textures (i.e. manipulating the texture coordinates)?!
  2. Keep the eyeballs as separate objects but make them rigid bodies and somehow connect them to the head mesh.

I feel option 1 should be easier…

1 Like

Happy the fix helped. This is madness, completely awesome!

1 Like

Holy crap @donalffons, you rock dude! And @lubos, total legend.

Looking back at the Adult Swim example with Morty, it does look like it’s all a single mesh, and I think they achieve the eye movement in some other way, probably with moving a texture around. I probably overcomplicated matters with multiple objects, not to mention having the subdiv modifiers on there. In any case, I can’t wait to get stuck into the work you guys did, this is rad!

@Blood_and_Chrome hope it’s helpful as a starting point. Looking forward to seeing your results!

1 Like

@donalffons Ok, finally had a chance to get back to this, work got in the way. I went ahead and combined everything into a single mesh. Only trouble at the moment is after giving the new object the drag face trait, when I go to run in the browser, the screen stays black. Any ideas on what I might have done wrong? Here’s a link to what I’ve got so far:

Rick.blend (2.0 MB)

1 Like