Importing an animated flag

Hi

I have made an animated flag in Blender 2.57. I simply used a wind force to push on a plan with cloth physics. In Blender worked all fine, but when I import it into unity I can only see the flag, but it isn’t animated. I have already read that I made in Blender a simulation and not an animation. I don’t know if there is any way to make this “simulation” to an animation.
I hope you can help me.

Normally what you would do is cache the simulation and bake it as animated geometry when working in mixed pipeline environments, however last time I checked Unity didnt support animated/baked vertices. I may be incorrect about this, so please do some research in order to get a confirmation on this.

How can I bake the flag as animated geometry in Blender?
Unity still doesn’t support animated/baked vertices, but I found a Morph Target Script which “solves” this problem http://forum.unity3d.com/threads/15424-Morph-Target-Script .

Read up on this: http://wiki.blender.org/index.php/Doc:Manual/Physics/Clothes

Don’t know how you’re going to import that data to Unity though…

It still doesn’t work :confused: .
I cloud bake the animation, but when I import it into Unity, it’s still not animated…
So it isn’t possible to import baked vertices. Or does anyone have an other idea?

Like I said before, by default Unity doesn’t import animated vertices. The geometry moves only when skinned to a bone or bone system.
If it were me with this problem, I would use Softimage’s ICE to create a custom rig, create a simulation, and then bake the sim to the custom rig’s FK bone structure, then finally export it all as FBX into Unity, it would be very easy in that 3d package. That would work, but I don’t know how you’re going to do that in Blender, sorry.

Essentially, you need to find a way to create a simulation, bake the sim to a bone system that is skinned with your flag object, then get it to Unity. Again, it’s very easy and straightforward with the right tools…with Blender you get what you pay for unfortunately.

Thats so awesome. Is this a plugin or something you developed? I like how you took advantage of .pc2 to bring this into Unity and make it read the animation data. Are you selling this or is it something proprietary to your studio/in-house?

If that becomes too much hassle (Or you cant afford megafiers) this waving flag shader might come in useful, unzip and put both files where you keep your shaders, you might have to fiddle with the shader to get what you want but i found it very useful, cant remember where i got it from, was off this board though, so thanks to them

691527–24889–$wavingflag.zip (3.42 KB)

It is a tiny part of my MegaFiers mesh deformation, morphing and animation system, it is on the Asset store more info can be found at http://forum.unity3d.com/threads/89750-Mega-Fiers.-A-mesh-deformation-system-RELEASE

To give SpookyCat credit where deserved, the megafiers system, from what ive seen, is absolutely brilliant with a few tools that could be indispensable if i could afford such things. The recently added point cache, morph targets etc, all great stuff

That’s truly badass, probably the coolest thing I have ever seen a developer do with Unity, congrats on the amazing work. At only $150 it’s a steal, are you sure you should be selling it so cheap? Personally I would charge 3-4 times that much, at least. Great job, I’m sure I’ll find that plugin useful at some point as it would save so much time and energy.

I’m at work and can’t see the megfiers flag and this isn’t to detract from that at all,
but why couldn’t the OP use the cloth simulator in Unity for a flag?
I don’t think it’s Pro only, is it?
I have used it and like it.

The user can indeed use the cloth, it purely was an example of using a point cache file for collapsing a complex animation to a very quick playback in Unity, having said that the playback of the flag is well under 1ms of cpu time whereas proper cloth is a lot more. But as I said it is there as an alternative for bringing in a very complex mesh animation and playing it back with as low a cpu overhead as possible.

Every time i’ve tried to do a cloth simulation its become a juddery mess

Of all these i think the flag shader i attached is probably the cheapest (If also the cheapest looking) but its nice to know theres plenty of ways of doing it

I think Megafiers is a good option, simple because of the support for pc2. Lots of high end VFX programs use PC2 to transfer data between mixed pipelines, making it a huge asset in game development with Unity. Honestly, I think SpookyCat is the only developer here that truly understands that, as sadly I don’t think the Unity community as a whole truly understands the goldmine SpookyCat has brought to the table with this pc2 plugin. Anyone with experience working with highend simulations with ICE, Lagoa, Houdini, etc. will immediately see the incredible potential here for creating amazing effects in that can be brought into Unity. SpookyCat has basically opened a Pandora’s box (in the best way possible) and few Unity developers, if any, have noticed.This is why I said earlier that the plugin is so cheap, only $150. Honestly, this software fixes a major pipeline handicap that Unity still suffers from, and it should be worth 4-5 times what SpookyCat is charging, if not more.
Congrats on the amazing plugin Spooky, I hope that more devs take notice of you amazing contribution and start realizing the amazing new power you have given them with Megafiers.

I bought megafiers last week.
Of course the flag animation using megafiers is super!
Here’s my little flag made out of Unity cloth.
I wanted only enough breeze to unfurl the flag but not make it seem like there’s too much wind.

What he just said, along with a few other bits and pieces that I think are great stuff, i’m saving my pennies for this, the stuff that can be done pretty much boggles the mind

Added support for .mdd files as well now so Cinema 4D users etc can use the system.

holy cow…you’re really going all out. You know even ZBrush supports mdd files…