Unity Point Cache export, plugin 'MegaFiers' problems.

Hi, Everyone.

This is a problem that has been recently discovered, discussed with the developer from MegaFiers themselves - at length, and seemingly fixed with a very recent update to their plugin on 26/01/13 following our interaction. Notably a fix to the plugin to detect:

“…[an] odd pivot offset happening possibly due to the flex modifier, [it has been] rewritten [to correct the] point cache vertex remapping system to attempt to detect such offsets and adjust the data for it.”

However, I am still unable to get it to work using my tools/versions of 3DsMax 2013/Unity 4.0.1f2 (non-pro).

I will try to describe the problem, give a few hypotheses, and finally summarise.

Background:
We needed to import a very simple mesh with an animation from Max > Unity. Upon research we found that Unity does not support many of Max’s modifiers, in particular vertex animations, unless (to my knowledge) the meshes are boned, or are aided by a Unity plugin involving point cache files.

Please watch the YouTube video here to make the method I used below easier to understand.

The Problem:
We followed the video to the letter, however, at the point of loading the pc2 file no green/yellow Gizmo appears, nor does the ‘Memory:’ at the bottom of the Mega Point Cache rollout. Therefore the point cache file does not seem to load and thus we get no animation.

I used a simple box to test the plugin (Param: 50,50,50 - L:5, W:5, H:5):

  1. Create box in 3Ds Max,
  2. Add twist modifier, twist 180* at Frame 100,
  3. Add Point Cache modifier,
  4. Click ‘New…’, select/create a pc2 file,
  5. Click ‘Record’,
  6. Export ‘Box001’ as .fbx,
  7. Create Unity scene,
  8. Import box .fbx (Uncheck Optimize Mesh - as recommended by MegaFiers dev),
  9. Add Box001 to scene,
  10. Add ‘Modify Object’,
  11. Add ‘Point Cache’ (leaving Mapping Adjust unselected ),
  12. Click ‘Import PC2’,
  13. Result = no animation loaded, no ‘Gizmo’ appears.

Hypotheses:
The pc2 file was sent to MegaFiers for testing - which worked. Therefore we can [99%] rule out a pc2 file problem.
Our .fbx file was sent to MegaFiers also, however, it did not work when they tested it:

“… [the] fbx file does not work right, something about it must be confusing Unity on importing, try my fbx and see if that works. If it does then there must be some setting in your fbx export that upsets Unity on import.”

I have also tested their .fbx, but with no success.

Summary:
We need to import a very simple mesh with vertex animation from Max > Unity, preferably using point cache files (pc2). We have the MegaFiers plugin that we wish to utilise. After a lot of correspondence with MegaFiers devs we can assume that the plugin now works following a recent rewrite of their plugin, but the specific conditions are as of yet unidentifiable. It works for them, but not for us under seemingly identical conditions.

Thank you in advance for your input.

Tom (3D Artist/Animator/Modeler)

We found the problem, it was a malformed PC2 output from 3DS Max 2013, when they moved over to Unicode they forgot to fix the code that writes PC2 files so the ‘POINTCACHE2’ header was actually being written as 'P O I N T C A C H E 2 " so the importer didn’t recognise it. Autodesk have issued updates for Max 2013 that fix this, so make sure you have installed an update if you want to use Max 2013 and PC2 files.

Thanking you awesomely!

The pc2 file you sent worked straight away.

Nice.

Howdy CommUnity,

I’ve been trying to get point cache to work for quite some time now and have finally figured out a successful workflow of getting a point cache animation from Maya to Unity. Since the developer uses 3ds Max to demonstrate how to get the animations into Unity (and briefly at that), I decided to record and share my process.

The step-by-step instructions below are directed toward Maya 2013 x64 to MegaFiers v2.52+ users (i.e. ‘.mc’ file-type import to Unity):

  1. Make sure what you want imported into Unity has been ‘Combined’ into a single mesh. In my case it was an exploding crate made up of 65 pieces, but one single mesh after combining.
  2. Make sure that the vertices of all animated parts do not overlap with other vertices. In my case I transformed the faces between the pieces to leave 0.01 units of space.
  3. Export your mesh like normal as an FBX . You don’t need to bake the animation in the FBX since the animation is derived from the ‘.mc’ (or Maya Cache) file, so leave the ‘Animation’ option unchecked. In my case I was using nDynamics, passive colliders, and nCloth to simulate my exploding crate, however all I want in my FBX is that single combined mesh which animates in Maya.
  4. Select that same mesh that has been combined and is animates within Maya.
  5. Select ‘Animation’ from the ‘Main Menu Bar’ drop-down.
  6. Click on ‘Geometry Cache’ and then click on the options box next to ‘Create New Cache’.
  7. Under ‘Cache directory:’ locate in which directory you want to create your new ‘.mc’ file.
  8. Under ‘Cache name:’ Give the ‘.mc’ file you’re about to create a name.
  9. Under ‘File distribution:’ it is imperative that you make sure ‘One file’ is selected!
  10. Under ‘Cache time range:’ select ‘Starte/End’ and manually enter your start frame and end frame.
  11. Click the ‘Create’ button.
  12. Now that you have your ‘.mc’ cache file, you now have everything you need.
  13. In Unity, import your FBX and bring it into your scene.
  14. Attach the ‘Mega Point Cache’ MegaFiers script to your object. MegaFiers ‘Mega Modify Object’ script should automatically attach itself, but if it doesn’t, you’ll need to attach that script first.
  15. In the ‘Mega Point Cache’ parameters, set your ‘Map Tolerence’ to something low. In my case it was ‘0.00000001’. This value may need to be messed with if your animation still appears to have merged vertices.
  1. Click on the ‘Import MC’ button and locate the cache you baked out of Maya.

That’s it! Any questions with this process, let me know.

Rory