Lego Fluid Effect

20/02/2015

I released a new video on youtube last week (inspired by this), the first in nearly a year. I think I can safely say it went down rather well, getting featured on BlenderNation, which helped it gain 10,000 views in just a few days.

As usual, this project went on longer than I wanted, growing from an idea of just showing the actual fluid part to deciding that it needed some context, meaning I felt I should add some type of scene, rather than just some bricks in blank space. I thought I should at least show the bricks appearing (I managed to resist having a submarine surface, I'll leave that for another day ;) ), and to have them appearing from somewhere I added a brick pile.

Annoyingly, the 'build up' part' was actually more challenging than the fluid as I had a few problems rendering. The build up is done with particles that are affected by an 'explode' modifier, and despite displaying correctly in the viewport, the render would only read a few frames of the particle cache before getting 'stuck' and no longer update. I presume this is a bug and not a dependancy graph issue as it's only the render which doesn't work, but narrowing down the problem to a small enough sample to be able to submit it as a bug may be challenging.

I tried several python solutions to try and get the frames to update properly, such as using a script to render each frame individually (with various pieces of code intended to update the scene between frames) or even generating a new blend file for each frame, each one offset by one frame, which another script would then render. None of these solved the refresh problem. It was annoying, because the build up obviously wasn't the main part of the video, but it was holding everything up, which made me question if I shouldn't include it in favour of a quicker release. I decided I had spent too much time on it already to not include it so I pushed ahead with my 'last-resort' method. The brute force, feel my wrath, this-is-definitely-going-to-work-and-nothing-will stop-me method.

Every project usually has several fallback solutions, when the easiest "Click one magic button and it works! Yay!" solution doesn't work you fallback to the next possible method, all the way down to "I'm going to have to do this frame by frame, aren't I". Normally it never gets to the last one, there are enough fallbacks that one ends up working, but unfortunately, in this case their were no other solutions to fall back on.

I knew that if I updated the current frame manually it would then render that frame correctly... Which meant...I would have to update, render and save every frame by hand. For 70 frames.

Now, it didn't turn out quite that bad, I realised that if I saved out a new blend file for each frame I could at least get a script to render all of those blend files, and with shortcuts and the 'increment file name' feature it only took a few minutes. But that doesn't make it fun. And less fun when you realise after saving all 70 files that the texture paths are relative and the locations of the blend files have just changed...

Suffice to say, this isn't exactly an acceptable method for a tutorial (which will follow in a few weeks). "Bye the way, don't want to worry you, but we're going to be doing it all by hand" probably wouldn't go down too well. Both viewers and I expect that the tutorial is going to offer some kind of shortcut to the method. Otherwise, what's the point in the tutorial? We can all look at something and go "Well, sure, I could probably do it by hand, placing different objects on different frames" (or animating on each frame or whatever technique is necessary for that effect), but who would want to?

Now, even if I did manage to report and get it confirmed as a bug, the fix wouldn't be in an official release of Blender for a few weeks. So I'll have to investigate another method. I have a few ideas and it's not uncommon for a few methods to get tweaked or changed inbetween the teaser video and the full tutorial. Looking at something afresh a few weeks after the initial video release helps that.

I also had someone ask if it could do fire so I had a play around with that too. Or at least particles, as this method currently requires a mesh to work:

It's certainly satisfying having a successful video release, it makes all the difficulties completely worth it. On one hand it's a bit weird to see my technique out 'in the wild', with some people already putting it to use, and on the other it's nice to see that it garnered so much interest, becuase that's never guaranteed.

Though it is a bit annoying that people aren't always completely clear that they got the technique from someone else and end up recieving praise for their 'creativity'. It doesn't matter too much though, ultimately other people's lego fluid videos will end up acting as an advert for the tutorial I release.

And anyway, they haven't quite worked out all my secrets ;)

Ray.