Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

MegaCache - Object & Particle Sequence Playback [Released]

Discussion in 'Assets and Asset Store' started by SpookyCat, Dec 28, 2014.

  1. planetmatrix

    planetmatrix

    Joined:
    Dec 8, 2015
    Posts:
    38
    @SpookyCat
    did you get chance to test my request?

    We are desperately hoping for it to work

    Thanks
     
  2. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Submitted an update to the Asset store and our webstore. The makes MegaCache fully compatible with Unity 5.5. We have also changed the material importer so that it will now make a material with the Standard shader instead of the old legacy shader. An error window was added if you tried to import an OBJ file which contains something other than quads or tris and for the particle playback components you can now import additional files and choose to either replace or add to the particle data already present. And finally we did write a custom exporter for 3ds max 2017 for particle exporting, the script version works fine but we did have a customer who had a very complex and large particle system to export and the script version of the exporter was very slow, but for most cases the script works just fine.

    Changes in v1.20
    • Added option to Particle Playback that is data is already loaded you can choose to add to or replace.
    • Made a custom exporter plugin for 3ds max 2017 for faster exporting of large particle systems.
    • OBJ Material importer will now create Standard Shader materials instead of Legacy shaders.
    • Added an error message when trying to import an OBJ file which contains faces with more than 4 sides, the OBJ importer only supports quads and tris.
    • MegaCache now fully compatible with Unity 5.5
     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Another quick update. MegaCache now supports 3d rotations for particles. We also optimized the particle playback a little which will mean if you have any particle animations that use rotations you will need to re import the particle cache file for the rotations to be correct. We also fixed a bug in the particle playback systems if your particle animation had more than 1000 particles per frame and error would happen, the system now correctly uses the max particle value calculated during import. And we also added a progress bar for particle playback import.

    Changes in v1.21
    • Optimized particle playback, which will need you to re-import any particle files if rotation is used.
    • Fixed maxparticles not being used for Playback particles, so if you had more than the default 1000 particles per frame you would get an error.
    • Changed particle importer so it supports prt files with ',' for decimal points.
    • Added support for 3d rotation of particles in Unity 5.4 and later.
    • Added Progress bar for particle playback importing.
     
  4. shawww

    shawww

    Joined:
    Sep 30, 2014
    Posts:
    43
    Hey Chris,

    Just bought the asset, looks great – seems to crash in 5.5 whenever I try to scrub/go to a point in the animation via the inspector. Plays back fine on autoplay, but it's frustrating as hell. Is there a quick fix?

    PS my cat's name is Spooky, so there's that.
     
  5. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @shawww - That's a bit odd was using it in 5.5 over the weekend and not having any problems, could you possibly submit a support ticket at our website letting me know the steps you are taking and the version of Unity so I can test it here.
     
  6. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted a small update to the Asset Store this makes MegaCache fully Unity 5.6 compatible, we also fixed a small bug in the 3d rotation of particles and we also change the various importers so they no longer use StringReader which has a bug in Mono meaning it is very very slow at reading Unix line endings in files, the stringreader as been replaced with our own version which has no problems with Unix/Max/PC line endings so if you were having very slow imports on OBJ or particle cache files then please do update.

    Also we have written a custom exporter for 3ds max now instead of a maxscipt which makes exporting faster for very large sequences and also supports 3d rotation of particles. This beta exporter is available for 3ds max 2015, 2016 and 2017. Please submit a support ticket if you need the exporter. No exporter is needed for Maya as MegaCache supports Maya .pda files.

    Changes since v1.21
    • MegaCache now fully compatible with Unity 5.6
    • Changed various importers to work around the Monobehaviour bug for StringReader making importing of files with Unix line endings very very slow.
    • Fixed a small bug in the 3d rotation of particles in Particle Pro component that could cause an exception on first play.
     
  7. kirby85

    kirby85

    Joined:
    Apr 17, 2017
    Posts:
    5
    I have a particle simulation in Maya that I need to bring into Unity, but the website says the Maya exporter is still in beta.

    Is the Maya exporter stable yet?

    If so, is MegaCache cheaper than using bones for each particle?

    More importantly, does it run on mobile?
     
    Last edited: Apr 17, 2017
  8. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @kirby85 - The Maya exporter is available and works fine, not had any reports of any problems. I am not sure what you mean by using bones for each particle? What do you mean there? MegaCache works on all platforms but as with any asset there is a CPU cost so how many particles are you trying to animate?
     
  9. kirby85

    kirby85

    Joined:
    Apr 17, 2017
    Posts:
    5
    400-800
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    That is a very low amount so would work fine on mobile devices, though I still don't know what you mean when you say using bones for each particle, what is it you are trying to do with bones?
     
  11. kirby85

    kirby85

    Joined:
    Apr 17, 2017
    Posts:
    5
    That was a last resort if MegaCache didn't work. Basically what I mean by bone is FBX baked animation (typically bones/dummies). Particle simulations in Maya don't bake to FBX, unless some scripting is done to add a keyframable mesh to the position of the particles. Sounds like MegaCache will do the job though. :)
     
  12. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    OBJ playback is very fast and faster than skinned meshes especially on mobile and if you want to use more than the low limit of bones per vertex but comes at the cost of using more memory so bare that in mind. Playback of 400 - 800 particles will also be very fast as that is quite a low number but again it will depend on what the particle is ie a mesh or a large quad will have an impact on mobile.
     
  13. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted a small update to MegaCache. This makes MegaCache full Unity 2017 compatible, we also stopped the time value from changing in the editor if Animate was turned on on an OBJ cache component. Also fixed a slowdown that was happening if you dragged the time value with an Image source for an OBJ cache object due to the way the Unity Undo system works. Added an option to not have 3d rotations on particles in case you don't need it. And a few other fixes.

    Changes since v1.23
    • MegaCache made fully Unity 2017 compatible.
    • Sopped animated system from animating in edit mode.
    • Fixed slowdown caused by Unity Undo system when dragging Time bar in OBJ Cache in Unity 5 and 2017
    • Added option to Particle controller to use 3d rotations or not. Turn off if you just need single axis rotations.
    • Fixed a problem with importing materials.
    • Fixed an exception that could happen with Particle Playback if there was an empty frame or a frame only a single particle
    • Added Max File option to Particle playback, check this box if rotation direction and positions do not match the source, reimport your file afterwards.
     
    MikeUpchat likes this.
  14. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    Hi, just updated to v.1.23 and having an issue with importing OBJ (same issue in previous version).
    MegaCacheOBJ: can't load OBJ sequence if "map_Kd" in MTL file has no value, or no MTL files are used (obj files only). Even when "Load Material" not checked. As a stopgap hack in MegaCacheOBJImport.cs I commented out line 480~485, and can at least import (without materials of course).
     
  15. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    If you can submit a support ticket at our website and if you can include a link so we can download the series of OBJ files you are using we can take a look. Though if there is no value for map_Kd then that line should not be in the OBJ file in the first place, which OBJ exporter are you using?
     
  16. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    Thanks, I'll submit a ticket on your website. I'm using Brekel Point Cloud. If there is an issue with his exporter, he'll probably fix it for us if you can help me narrow down what the problem is exactly.
     
  17. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Its an easy fix to change the importer to check that there is a filename I will add that in for the next update, but in theory the OBJ file exporter should not be adding that line to the OBJ file.
     
  18. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    Hi, we wanted to be able to include OBJ cache files in our asset bundles, rather than just a path to the file. We made a few simple edits to MegaCacheOBJ.cs and got that working by renaming the cache files to use ".bytes" file extension then add public TextAsset variable to MegaCacheOBJ.cs. We can then load the asset using MemoryStream (instead of FileStream).
    For our use case this works well, but is there a preferred way to use cache files and asset bundles?
     
  19. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @ModuLight - I think you are the first person to want to use the system with Asset bundles, if you can submit a support ticket at our website with the changes you have made I will take a look and see about adding the changes. I think to date most people have just made a prefab out of the object with the Cache data on and just used that, is there a reason you need to directly include OBJ files?
     
  20. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    Thanks, I'll send my code updates via your website.
    We want to include the cache within the bundles for these reasons:

    1: it's easier to manage the files and distribution if everything needed in the bundle is included.

    2: AssetBundles use a manifest to make sure dependencies are also loaded, which wouldn't happen with just a path to an OBJ cache

    3: If the OBJ cache files are included in the bundle, they can be used immediately after the bundle has loaded, rather than having to download OBJ cache after the bundle.

    4: asset bundles are cached by unity, so once we've downloaded the bundle (with OBJ cache), the next time we start the game we can load fast from the unity cache, rather than a fresh OBJ cache download every time.

    ... basically all the benefits of using assetBundles.
     
  21. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    sorry, maybe I didn't understand your comment correctly:
    "most people have just made a prefab out of the object with the Cache data on and just used that"

    Do you mean by using an "Image" rather than "File" in the MegaCacheOBJ editor?
    Can we use Image on a prefab, then include the prefab in an assetBundle? That would indeed be simpler than my method.
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted a small update to the Assetstore for MegaCache, this sees a couple of changes to the OBJ importer namely fixing an error if your OBJ file has no filenames for its texture maps and also the OBJ importer now works with negative indexes in the faces section.

    Changes in v1.28
    • Updated OBJ file importer to be able to handle negative indices.
    • Changed OBJ material importer so you wont get an error if Material texture map fields are empty in the OBJ file.
     
  23. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Another quick update that improves the sequence importing in that you no longer need to set a split character or set the Format value it will just work, so this fixes issues some users were having with numbers in the file names or multiple split characters.

    Changes in v1.29
    • Changed file sequence importers to work without need for split character or format number, so now works correctly.
     
  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted an update to the Asset Store, this brings support for vertex colors to the OBJ Cache playback, the OBJ file importer has been updated to support vertex color data either in the 'v' chunk or in the more usual 'vc' chunk. You will need a Vertex shader that uses vertex color data to see the colors, and a very simple shader is included for testing. Note the color data will playback in the Mesh mode we have not yet added support for color data in the Image or Image File modes, that will come in the next update.

    Changes in v1.30
    • Added Vertex Color support to the OBJ importer, either in the 'v' data or the separate 'vc' channel.
    • Removed a Debug statement.
     
  25. jillianhm

    jillianhm

    Joined:
    Feb 11, 2017
    Posts:
    1
    I'm having some issues importing a point cloud with Mega Cache. I'm importing a .ply file, but nothing shows up. Or if I try to load frames, the frames will load for ages. Any tips?
     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    If you can submit a support ticket at our website and if you could include a link to download a test set of files we can test that out for you.
     
  27. freedom4d

    freedom4d

    Joined:
    Sep 6, 2017
    Posts:
    1
    Thanks for this great asset! I have used it for our project and it is really helpful! I meet a problem that when load obj sequence, only one texture of the sequence is loaded, and it seems that all frames use the same texture. My sequence is generated not by Maya or other 3D software, where every obj file has a different texture. how to solve this problem to make every obj has its correct texture? it due to any wrong import option ?
     
    Last edited: Sep 10, 2017
    gio_987654321 likes this.
  28. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @carbzhang - Sorry for the delay in replying but we just don't get the notifications for a new post in forum threads. It is much better to go to our website and submit a support ticket there.
     
  29. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted a small update to the Asset store, this now makes the various sequence importers work with filenames that only have numbers in them. We also removed a Debug message when importing OBJ file sequences and fixed a bug in Unity 5.6 and 2017 where points for Point Cloud data were not being shown.

    Changes since v1.30
    • MegaCache OBJ seq import now works if the file names are just numbers.
    • MegaCache Point Cloud seq import now works if the file names are just numbers.
    • MegaCache Point Cloud XYZ seq import now works if the file names are just numbers.
    • Removed a debug log message when importing an OBJ sequence.
    • Fixed a bug in the Point Cloud systems on Unity 5.6 and 2017 where the points were not being shown.
     
  30. steffanPL

    steffanPL

    Joined:
    Oct 9, 2014
    Posts:
    40
  31. Lirra

    Lirra

    Joined:
    Jun 11, 2015
    Posts:
    1
    @SpookyCat
    Hello, I got a question regarding to Point Clouds in Unity. .csv and .xyz files don't load in my project. There is always an error message telling me: "FIleNotFoundException: Could not find file ...". I tried different ways of loading these files (like creating a StreamingAsset or a normal folder). Even loading them from the desktop didn't work out.

    I'm new to this, so I got no idea how to fix this. I want to create a small project with point cloud which can be used in virtual reality. So far I didn't find any helpful solutions, documentations or tutorials.
    I hope you can help me?
    Thanks in advance!
     
  32. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @Lirra - That sounds odd we have a lot of people using the Point Cloud feature in MegaCache and not had any reports of it not being able to load a file, if you could submit a support ticket at our website and outline the steps you are taking so we can see what might be happening.

    @steffanPL - Sorry I missed your post, MegaCache will playback point clouds from Brekel but the files will need to be in a format MegaCache can read, the example files you uploaded are a binary .bpc format which I don't know the file format for, but if you used one of the other export options then it will work.
     
  33. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    @SpookyCat, heads up that MegaCache 1.32 in Unity 2017.2.0f3 is throwing an error about the web player being obsolete in MegaCacheOBJ.cs
     
  34. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @ModuLight - Thanks for that will get that changed in the next update.
     
  35. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    There is a new update available in the asset store. This brings a fix for PLY files that do not contain any color data, and also if no color data is present we have slightly optimized the playback. MegaCache is now fully compatible with Unity 2017.2 and Unity 2017.3.

    Changes in v1.33
    • Fixed issue if importing PLY file with no color data.
    • Optimized playback of Point Cloud if no color data present.
    • MegaCache made fully compatible with Unity 2017.2
    • MegaCache made fully compatible with Unity 2017.3
    • Removed warnings in Unity 2017 and later regarding webplayer.
    • Fixed missing materials in demo scene in Unity 2017
     
  36. ShamanUY

    ShamanUY

    Joined:
    Sep 23, 2014
    Posts:
    6
    Hello, I have a question
    Am I able to import a .mc animation to Unity using this asset?
    I have a Cinema4D animation that was exported with .mc and a .xml file for animations. Is it possible for me to import the animation with this asset?
    Thanks
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    @ShamanUY - Our MegaFiers asset supports the import and playback of .mc Geom Cache files, or you could use MegaCache if you exported the frames to an OBJ file sequence. Geom Cache playback is better as gives more control and uses less memory.
     
  38. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685

    True Clouds being used with our Mega Cache asset to make a Nuclear explosion, easily fast enough for Mobile use as well.
     
    umcherrel and MikeUpchat like this.
  39. LaserSaber

    LaserSaber

    Joined:
    Jul 20, 2010
    Posts:
    11
    I am having trouble getting a .ply sequence to import. I can import a single file one at a time using the add new frames to existing list feature, but when I try to load the first frame in the list as a sequence it only loads the selected file. My files are named 000.ply, 001.ply, 002.ply. Any help would be much appreciated.
     
    Last edited: Feb 21, 2018
  40. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Just submitted an update to the Asset Store, this makes MegaCache compatible with Unity 2018, also fixes a small issue in the .prt file importer and adds support for import Maya .pda files in the Particle Playback component. Also MegaCache is currently in the Madness sale along with some of our other Assets.

    Changes in v1.35
    • Fixed an issue in the .prt particle importer caused by a difference in the old 3ds max script based exporter and the newer max plugin.
    • MegaCache now fully compatible with Unity 2018
    • Added support for Maya PDA sequence import to the Particle Playback system.
     
    MikeUpchat likes this.
  41. DamirS

    DamirS

    Joined:
    Aug 28, 2013
    Posts:
    19
    Hi all,

    i am trying to stream a mc cache on android. But i cant get it working. What should be the runtime folder ? Anyone here who can help me out ?

    yours
    Damir
     
  42. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    210
    Does Megacache works with Alembic files?

    Is it possible to deform an animation (say a water splash) at runtime?
    My purpose is to create minor variations of the same simulation.
     
  43. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    I have just submitted an update to the asset store which adds support for 32 bit vertex indices so you can now import and playback meshes with more than 65535 vertices per frame. We also made MegaCache fully compatible with Unity 2018.1 and 2018.2 and fixed an issue with mesh import if you didn't import the materials. Please note the Asset store review process now seems to be taking weeks for any updates as opposed to the few hours or day it used to take so not sure how long it will be before Unity actually accept the update.

    Changes in v1.36
    • If Load Materials option off meshes will now import with the correct number of submeshes allowing you to add your own materials.
    • Added beta support for 32 bit indexes allowing meshes to have more than 65535 vertices.
    • MegaCache made fully compatible with Unity 2018
     
  44. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    143
    Hello
    A qick question : is megacache a part of megafiers?
     
  45. coldpizzapunk

    coldpizzapunk

    Joined:
    Aug 20, 2014
    Posts:
    30
    On a Mega Cache Obj Script in the Data Source | File option. What is the Runtime Folder input for? I didn't see it referenced in the documentation. Maybe I overlooked a section that describes it.
     
  46. t_kaniatobe

    t_kaniatobe

    Joined:
    Nov 19, 2014
    Posts:
    6
    Hey,

    Just started using megacache to bring in some clothing .obj sequences from Marvelous designer. Everything seems to be loading in correctly. I'm having one problem with the animation playback though. it seems like megacache is pausing a frame every 3rd(or so) frame. I'm trying to perfectly sync the animation to a human character. This frame update problem is creating a flickering effect where the character model will clip through the clothing every few frames.

    Any ideas on how to fix this would be greatly appreciated!
     
  47. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    There have been a few updates not mentioned here, mainly keeping MegaCache up to date with new Unity releases but we have also made some improvements to the Import system for the various file formats, most important of which is they now all work with CultureInfo so commas as decimal points in European countries now work correctly.

    Changes since v1.36
    • Updated all importers to work correctly with ',' and '.' as deciaml points.
    • MegaCache made compatible with Unity 2020
    • Fixed bug with texture importing if texture filenames had './' at the beggining.
    • MegaCache made compatible with Unity 2019.1
     
  48. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    A new version is in the Asset Store, I somehow managed to leave some testing logging messages and stuff in the last update that was causing an exception on importing .xyz cloud files and also generally slowing down some parts of the system. So if you are using version 1.40 please do an update to sort those issues out.
     
  49. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    Small update in the Asset Store now, have added Multi Threaded playback as an option to the PointCloudXYZ system so if you have a lot of points this can add a nice little spped up to the system. Also added a check to stop the PointCloud being updated if the frame hadn't changed, so if your point cloud is not animating or animates at a speed where multiple frames are the same data then virtually no CPU time will be used by MegaCache, just the general time used by the Unity Particle system to render the points.

    Changes in 1.42

    • Added a Multi Threaded option to Point Cloud XYZ playback that reduces CPU usage
    • Added a check to Point Cloud XYZ playback so particles are only updated if the frame changes as opposed to happening every frame.
    • Removed some debug code that was causing an exception when trying to import .xyz files.
    • Also removed some logging code that was slowing a few things down.
     
  50. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,685
    A small update to MegaCache is available, this fixes an issue that was introduced when Unity made changes to its mesh system where it would skip empty submeshes on a mesh which would effect the material order. This would only be an issue with OBJ sequences where there was a frame in the seq which didn't use a material. MegaCache now adds a zero size tri for any such empty submeshes so sequences will render correctly. Also MegaCache is fully comaptible with Unity 2021 and 2022

    Change in v1.43
    • MegaCache now works correctly with OBJ sequences that use unique materials per frame.
    • MegaCache compatible with Unity 2021
    • MegaCache compatible with Unity 2022