Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] Mega-Fiers. A mesh deformation system - RELEASE

Discussion in 'Assets and Asset Store' started by SpookyCat, May 18, 2011.

  1. paul.harden

    paul.harden

    Joined:
    Aug 8, 2011
    Posts:
    5
    @malzbier: It seems to be an asset store issue, click on the arrow at the right of "import" button and choose "download"..
    It should update the package.. It worked for me.
     
  2. S0ULART

    S0ULART

    Joined:
    Jun 14, 2011
    Posts:
    131
  3. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Hi there

    So excited about the .pc2 format, but alas, from maya, no dice: Here is the error message:

    IndexOutOfRangeException: Array index is out of range.
    MegaPointCache.LinearRel (.MegaModifiers mc, Int32 start, Int32 end) (at Assets/Scripts/MegaFiers/Modifiers/MegaPointCache.cs:74)
    MegaPointCache.Modify (.MegaModifiers mc) (at Assets/Scripts/MegaFiers/Modifiers/MegaPointCache.cs:135)
    MegaModifiers.ModifyObject () (at Assets/Scripts/MegaFiers/Modifiers/MegaModifiers.cs:288)
    MegaModifiers.ModifyObjectMT () (at Assets/Scripts/MegaFiers/Modifiers/MegaModifiers.cs:601)
    MegaModifyObject.Update () (at Assets/Scripts/MegaFiers/Modifiers/MegaModifyObject.cs:137)

    Will you help track it down?
     
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I am delighted to report that pc2 from blender works. When exporting the pc2 from Blender, I need to untick the 'Convert to Y-up' option. And I export the model from blender using fbx with default options (although I am unticking 'Include Animation' but not sure this makes any difference)
     
  5. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Thanks BigSky I needed a Maya user, looks like I need to add the auto remapping code into the point cache system as every 3d package seems to use different coordinate systems, was hoping there was a standard but seems not, I will get that done. The errors you are getting there basically means it couldnt map the data so the arrays are empty, I thought I put a check in for that, I will fix that now. If you could send me a test fbx and the pc2 file I will make sure I get the mapping working for Maya users as well :)

    And elbows the fix I will do above should mean you dont have to worry about ticking any boxes for export it should all just work like the morph system does :)

    And soulart, MegaFiers can do some parts of that cool video, the undulating plane, using noise and ripple and wave modifiers can get you a nice ocean surface but the flow stuff is not doable that needs a different system (oddly enough it is another one of my projects using RealFlow with Unity but not showing anything on that just yet :) )

    Chris
     
  6. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Here is the maya exported stuff for you SC.
     

    Attached Files:

  7. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
  8. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Dont think you can, there is a link at the end of the video but no download.

    As for the Maya issue, I have done the auto mapping but it seems Max does pc2 files as either local space or world space, and for the system to be useful local space is what is needed but other packages only use world space from my limited research so far, so you need to do the export of the .pc2/.mdd data with the source object mesh origin at 0,0,0 in the editor then the exported data will effectively be local space. There will be a new version in the asset store later today with the auto mapping included so you wont have to worry about what is up and different coordinate systems etc the importer will deal with all of that for you.
    Chris
     
  9. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    In blender the pc2 exporter has an option 'Export into Worldspace' which is unticked by default, and which I left unchecked during my testing.
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Version 1.57 submitted to the store, changes are:

    • Added weight param for Additive blend on Point Cache modifier

    • Added weight param for Additive blend on Vertex Cache modifier

    • Added support for .mdd files to Point Cache Modifier

    • Auto mapping of vertices for importing point cache files
     
  11. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    @SpookyCat I see you added .pc2 file importer as well, nice work! Great looking tool you have here.
     
  12. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    At the risk of sounding like a squeaky wheel - the new version of the pc2 format is still not working. I really want to avoid the overkill of buying point oven (or a pc, or max) so I can get this working, and so HERE is a link to the python docs for mayas pc2 file conversion, and HERE is a link to the .mel version of the same thing.
    When I tried importing with the new megafiers version (1.57), it failed.

    EDIT: - Got it working - with a bit of a ducking and weaving workflow in maya - zeros, no history, new geometry, using geocaching instead of ncloth - I'll post how if anyone else is interested in maya.

    EDIT2: Yes, it's working, but there's a strange behavior where the object's shading disappears - like camera clipping - as if the normals are reversed when the camera gets too close/looks at a certain angle. I tried recalc normals, and also with a 2 sided shader, but no dice - I can see the wireframe fine, but no shading.
     
    Last edited: Sep 22, 2011
  13. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    I am very interested in this one, but I would like to ask if there are any youtube videos of Mega-fier working on iOS?

    I know on the website it says it works for both Android and iOS, but I like to see a few videos of its performance on mobile platforms before I decide on it. I am a bit worry about the performance it would have on iOS and if its unacceptably slow than it would be a waste of $150.
     
    Last edited: Sep 22, 2011
  14. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    BigSky, could you send the fbx and pc2 files again so I can see what might be going on, I will look at getting a trail of Maya today as well so I can investigate properly.

    I am de Bawass, I currently dont own any mobile devices so I have had to rely on a friend to do the testing on an Android device, the question of performance though does come down to which device and the mesh complexity of the item you need to deform, if you can give me a guide as to what you are looking to do and the number of verts etc I can see if my friend can get me some performance info.

    There may of course be someone here that has used the system on iOS or Android and can report back their findings.
    Chris
     
  15. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Yeh, that's just what I want to know, basically, a scene with a total of around 7,000 triangles (or 12,000 vertices), with around 4-6 low polygon (600 triangles) animated entities (characters) using bulge, FFD, and ripple. I am targeting 2G iDevices but this requirement could move up to iPhone 3GS very soon.
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Fine, it looks too good to ignore any longer. Some questions:

    What is the performance like on ios?

    Is there any excessive garbage collection?

    Thanks!

    Chris, if you have a spare android you can probably install unity pro trial on a spare PC and get android out for 30 days to help you test it a bit! :)
     
  17. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Thanks for your dedication and your sleuthing Spooky Cat, here's a deforming sphere, plus the .pc2 file. If you need anything else, just shout.
     

    Attached Files:

  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Thanks for the file BigSky will be looking at that later :)

    Got a trail of Maya so I am looking at adding support for the Maya cache format, that should then give us the complete set .pc2, .mdd and .mc unless anyone knows of yet another point cache format :)
    Chris
     
  19. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Sorry HippoCoder I missed your post in there. There is no garbage collection, I tried to make sure that nothing was being allocated on the fly in any of the systems and during my profiling tests I have yet to see any dark red spike.

    As for performance on ios, there are people who have bought the system for iphone and I have only heard one complaint about performance and that was for the old morpher, the morpher has seen a massive improvement in perfomance being up to 30 times faster and with the system being able to use multiple cores now modern phones should see even better performance.

    I did a test a while back on a friends android (not top spec one) and a 4000 vertex mesh with a Bend modifier (which is a complex one) was taking 26ms. Something like a morph or point cache would be a lot faster than that. I really do need to get my self sorted out with a tablet or something so I can do some proper tests, benchmarks and videos. I was going to get a Galaxy tablet but they got banned :(
    Chris
     
  20. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Can anyone explain why when I export a polygonal object from Maya to FBX I get no vertex data? Spent an hour so far just trying to get a simple pyramid to export :(

    Edit: Restarted Maya and all is fine :)
     
    Last edited: Sep 22, 2011
  21. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    BigSky, thanks for the file yes that works fine, the disappearing you are seeing is because you don't have RecalcBounds turned on and as that animation moves the mesh points a long way the culling system is using the original bounds data to clip the object from the scene, so just check the RecalcBounds box and it wont disappear.

    And the 'strange shading' is due to Unitys RecalNormals system, you will need to select the 'Mega' mode for normal recalc to stop the seam appearing. You need to select that mode before any deformation is applied to the mesh as it uses exisiting normal data to generate the smoothing info.

    On another note I have the Maya .mc files parsing but the local data in the mc files seems to be moved compared to the exported base mesh. My maya skills are zero at the moement so struggling to find info such as pivot points or even how to generate .mc files :)
    Chris
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Update, just figured out creating geom caches in Maya and the .mc files are working for me so looks like next release will have Maya .mc cache support.
    Chris
     
  23. namoricoo

    namoricoo

    Joined:
    Apr 14, 2011
    Posts:
    534
    Looks like I'm gonna pick up a copy of your product later on this week. I have a clear vision of how I want to use it in my next game.
     
    Last edited: Sep 22, 2011
  24. ShreddinPB

    ShreddinPB

    Joined:
    Aug 18, 2011
    Posts:
    79
    SpookyCat, id love to see more maya support.. Im pretty much all maya. I have to work in Max once in a while at my job and it is probably the most painfull thing I have to do lol
     
  25. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I do hope to get around to doing a Maya exporter soon, was looking earlier hoping to find a nice friendly python exporter example I could borrow, but no luck so far :)
     
  26. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Hey Spook, I just started playing with megafiers for the first time in months and noticed you added megashapes... that was the thing with the crash boundaries, right? Did you ever make any documentation on how to use it?
     
  27. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Arr it isnt the whole MegaShapes it is just the Spline part so it could be used by Path Deform. I have been working on the crash barrier system and that will be coming along probably in a separate asset quite soon.

    Just submitted v1.58 to the store with support for Maya .mc files. I have only been able to do simple tests so would be interested to hear if there are any issues with it :)
    Chris
     
  28. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Wonderful news about the .mc addition - I'll test it till it breaks ;) . And, feeling a bit a bit of a nana about recalc bounds, but great to see the cache working - incredible addition! Now for maya blends, splines, paths, particle caches...
     
    Last edited: Sep 22, 2011
  29. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    A note on the .mc files, they should be a single file and use local space values, the output can be float or doubles though. If the file sizes get big the Point Cache modifier does do interpolation so you can try reducing the keys you export until you get a happy medium.
    Chris
     
  30. droderick

    droderick

    Joined:
    Aug 25, 2008
    Posts:
    169
    Was wondering if anyone could review my workflow for working with the PointCache modifier with C4D. Here are my steps:

    1. Make a cube and make it editable
    2. keyframe a few PLA
    3. add a point cache tag to the cube
    4. select the point cache tag, press calculate.
    5. save the point cache tag.
    6. export model as fbx.
    7. import model into unity
    8. create instance of model in unity
    9. add 'modify object' "point cache modifier"
    10. locate/load saved point cache file

    from here, when i play the scene, shouldn't my animation play?

    edit: just tried again and am getting an error.
    "ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length.
    System.BitConverter.PutBytes (System.Byte* dst, System.Byte[] src, Int32 start_index, Int32 count)
    System.BitConverter.ToSingle (System.Byte[] value, Int32 startIndex)
    MegaUtils.ReadMotFloat (System.IO.BinaryReader br) (at Assets/Scripts/MegaFiers/MegaUtils.cs:151)
    MegaPointCacheEditor.LoadMDD () (at Assets/Editor/MegaFiers/MegaPointCacheEditor.cs:51)
    MegaPointCacheEditor.OnInspectorGUI () (at Assets/Editor/MegaFiers/MegaPointCacheEditor.cs:268)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
    UnityEditor.InspectorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)"

    any ideas?
    thx much
    d
     
  31. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Hi There
    That looks an odd one, could you send the fbx and cache file so I can have a look, kinda looks like the cache file has been truncated.
    Chris
     
  32. lake0801

    lake0801

    Joined:
    Sep 23, 2011
    Posts:
    1
    Great news!
    You were also talking about a possible bridge and as I'm doing my stuff in Max, I was wondering about that.
    How could it work ? Will you release it ?
    yann.
     
  33. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @lake0801 By bridge do you mean an exporter for Max?

    While getting the weight stuff working I added the first of a physics based modifier to MegaFiers, a simple rubber type modifier for adding nice secondary motion to characters or objects. Areas and weights are defined by vertex colors so more than one type of material can be applied to a mesh. Anyway a video shows it better.
    [video=youtube;1T1nFZtkvro]http://www.youtube.com/watch?v=1T1nFZtkvro
     
  34. droderick

    droderick

    Joined:
    Aug 25, 2008
    Posts:
    169
    Hi Chris,
    I've attached the c4d file, fbx export and the point cache file. thanks for looking into it.

    d
     

    Attached Files:

  35. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Hi Droderick
    The mdd file in there doesnt seem to be a proper mdd file, seems to have a header of some kind on it with the first two 4 byte chunk ids being "QC4D" and "geoc" whereas the first value in a correct mdd file is a motorola int saying how many frames are stored in the file. Does Cinema4D give you any options when you export mdd?
    Chris
     
  36. droderick

    droderick

    Joined:
    Aug 25, 2008
    Posts:
    169
    Hi chris,
    So with c4d, there don't seem to be any specific options for exporting point cache data (PCD). I've done some poking around on the web and it appears that c4d may not be exporting .dmm files when I save PCD. There appear to be a number of dmm exporters/writers out there, but i have yet to find a workflow that will gel with Unity. Will post a solution if/when i get it. Thanks again for such a rocking tool. It is truly mega.
    daniel
     
  37. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    the rubber modifier is yet another awesome addition to MegaFiers!!! and very useful due to its vertexColor support. 2 questions regarding that:

    #1: is there any plan to extend this new vColor blending support to other modifiers, like ripple, etc? would make most of them even more useful.

    #2: many/most modern 3D apps can support multiple vCol layers. Is there any way/plan to support meshes with multiple vCol layers? We often use 1 vCol layer for prebaked environmental/scenery shadows(using a vertex lit shader to achieve this); It looks great, consumes a lot less memory(no lightmap texture needed), and doesn't call for an additional lightmap channel in the shader. This isn't usually the case for our actors, mostly our scenery, items that we enjoy using Mega-Fiers on :). In these cases, it would be very beneficial if we could still have one vertexColor layer acting as our virtual shadowMap(as described above), and another acting as our "blending values" for the rubber modifier.... and to top it off, if other modifiers add support for vCol blending, then we could have one vCol layer for the rubber modifier, one cVol layer for the ripple modifier, and another vCol layer for the bend modifier. A dev can dream, cant he/she ;-).
     
  38. holyjewsus

    holyjewsus

    Joined:
    Mar 7, 2011
    Posts:
    624
    Could the vertex colors be changed at runtime using one of the unity assets for vertex painting? Would these vertex painting extensions change the materials for the mega-fiers physics weighting?
     
  39. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just submitted the new version to the Asset store with the rubber modifier, managed to speed it up a lot from first test and added more options so you can define params such as stiffness and damping in each direction, and also a threshold value to help you fine tune the weights and you can visually see the weights in the editor.

    The color based weights will be finding its way into all the modifiers so you can define regions of effect for everything, look out for that soon. I do also plan on adding some kind of system to allow defining of weights inside of Unity just need to figure out a nice way of doing it.

    Trouble with multiple color layers is getting the data into Unity, Unity only supports one level of vertex colors so it would need exporters for different packages again, so I think going with a way of authoring weights inside Unity will be better.

    So yes the colors could be changed at runtime using vertex painters.
    Chris

    Changes in v1.59:

    • Fixed bug where morph wasnt updating when channel percent to zero.

    • Fixed bug where morphed object could vanish if all channels were set to 0 percent.

    • Added Rubber modifier.
     
  40. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Here is a question that might be silly but I will throw it out there anyway.

    I've been experimenting with taking fluid simulation meshes from blender into Unity. Blender .obj exporter will output a separate file for each frame of the animation. I know I can't use this with the morpher, because the number of vertices etc does not remain constant. So I've been loading every mesh in as a different unity game object, and then activating deactivating these in sequence in order to animate. This actually works better than I was expecting, although sometimes the framerate inside the editor drops quickly when in play mode ( VBO total in stats window rapidly increases). I don't have this problem when running a built executable version. But there are some other annoying aspects working with this method, such as if I want to change the material then I have to do it for every frame.

    So, I was wondering whether there is any potential for scripting equivalent functionality but using a different method. And seeing as Mega-Fiers is so wonderful at so many other things, I thought I would ask here first.
     
  41. holyjewsus

    holyjewsus

    Joined:
    Mar 7, 2011
    Posts:
    624
    Great!
     
  42. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Hey - Just reading up on the Alembic Point Caching System from Sony Pictures and ILM. Looks like it will get support from all the major softwares (Maya 2012 SAP the first, I think). Perhaps you might include it as another point cache file?
    The physics rubber thing is truly awesome!
     
  43. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Interesting format, I was thinking about adding a system to one of my other assets for playing back complete meshes, I will investigate the format.
    Chris
     
  44. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    New version submitted with a couple of bug fixes, nothing major, v1.62:

    • Tidied scene up and removed unused materials.

    • Fixed null reference error when an imported spline had no animations.

    • Fixed melt modifier to stop -ve melt amounts being used.

    • Fixed normals getting altered if normal mode is Mega and user selects 'reset mesh info' by right clicking the modify object bar in the inspector.
     
    Last edited: Sep 26, 2011
  45. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just noticed a wee bug in the latest version (1.62) if you apply a rubber modifier to a mesh with no colors you will get an error at line 125 in MegaRubber.cs, so in case anyone gets this error before the next update is ready to fix it you just need to change the line
    Code (csharp):
    1. if ( mod.cols != null || mod.cols.Length > 0 )
    to
    Code (csharp):
    1. if ( mod.cols != null [B][/B] mod.cols.Length > 0 )
    Chris
     
  46. zipper

    zipper

    Joined:
    Jun 12, 2011
    Posts:
    89
    Is there an easy way to sync the imported morpher animation with animation clips specified when you import an fbx model?

    For example:
    Import an fbx model.
    Specify run, walk, idle1, idle2 frames.
    Throw it on stage.
    Add the Mega-Fier morph scripts.
    Import morph info.
    Sync to animation clips?

    I guess what i'm looking for is when i say OB.Play("idle1"); I want the proper morph info to play as well. I am probably missing something simple.

    zipper
     
  47. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Hi Zipper
    That shouldn't be too hard to do, would probably just need a little watcher script to check the animation state of the object and then set the time from that in the morph animation, you would probably need to set the anim info in the script to match the imported animations but all simple stuff. I will have a look later at doing a helper script to show how it might be linked together.

    New version submitted that fixes the bug mentioned above as well as:

    • Added a stiffness channel to rubber so vertex colors can define areas of stiffness on a rubber object.

    • Changed rubber modifier so a mesh with no colors will have no effect.

    • Added a 'None' weight channel.
     
  48. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Speedy work by the peeps at Unity means latest version in the Asset store now :)
     
  49. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Any uh.. news on Mega-Fiers running on iOS youtube video? :D
     
  50. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    has anyone been able to get the UVTiles modifier to work on recent updates? it looks like its updating in the inspector, but I dont see any updating of the field-values in the tiles/offset fields for that objects shader? P.S. my texture is 2048 x 2048

    And if possible, it would be great to have the ability to choose between looping the traditional way, first to last, and also via ping-pong too, if its not too much trouble to include that functionality. :) Thank for everything @SpookyCat
     
    Last edited: Sep 28, 2011