Search Unity

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

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

  1. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Excellent, look forward to seeing a video of that working :) Yeah someone else pointed out the channel 9 error, it has been fixed for the next release. Thanks for that, and keep going :)
     
  2. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I am trying to use this example from the Megafiers docs:



    public class MakeModObject : MonoBehaviour
    {
    GameObject target;
    MegaModifyObject modObj;
    MegaBend bendMod;
    float angle = 0.0f;

    void Make()
    {
    if ( target )
    {
    modObj = target.AddComponent<MegaModifyObject>();
    bendMod = target.AddComponent<MegaBend>();
    modObj.MeshUpdated(); // Call this after all modifers have been added
    }
    }

    void Update()
    {
    angle += Time.deltaTime;
    bendMod.angle = angle;
    }
    }


    But I get this error:

    Assets/BendScript.cs(1,30): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing a using directive or an assembly reference?
     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Do you have a:
    At the top of the file?
     
  4. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Sorry but I just copied the example from the docs exactly.
     
  5. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Arr yes, I see, the code examples on the web site do kinda assume a little knowledge of using c# with Unity, so just add a 'using UnityEngine; at the very top of your file and it will find MonoBehaviour :)

    The web page has been updated :)
     
  6. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I can code in javascript (Unityscript). Trying to use a javascript example generate more errors because I would have to put the Megafiers scripts in Standard Assets but then it would be a mess to update your tool, so I am trying to use C#...

    Tested and it doesn't work...The mesh with the script does nothing, and no error messages now.
    ( I had to make target var public but it doesn't fix it)

    What is wrong?
     
    Last edited: Apr 9, 2012
  7. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    There isn't anything wrong :) The code snippet was meant as a guide to show how you add a MegaModifyObject component and then how you add a modifier and tell the system. Try this instead.
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. public class MakeModObject : MonoBehaviour
    4. {
    5.          MegaModifyObject    modObj;
    6.          MegaBend            bendMod;
    7.          float               angle = 0.0f;
    8.  
    9.          void Start()
    10.          {
    11.                  modObj = gameObject.AddComponent<MegaModifyObject>();
    12.                  bendMod = gameObject.AddComponent<MegaBend>();
    13.                  modObj.MeshUpdated();   // Call this after all modifers have been added
    14.          }
    15.  
    16.          void Update()
    17.          {
    18.                  angle += Time.deltaTime;
    19.                  bendMod.angle = angle;
    20.          }
    21. }
     
    Last edited: Apr 9, 2012
  8. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I am trying to convert that to bulge modifier but it doesn't work.

    This is my code:

    Code (csharp):
    1.  
    2.  
    3. using UnityEngine;
    4.  
    5. public class MakeBulgeModifier : MonoBehaviour
    6. {
    7. MegaModifyObject modObj;
    8. MegaBulge bulgeMod;
    9. float amount = 0.0f;
    10.  
    11. void Start()
    12. {
    13. modObj = gameObject.AddComponent<MegaModifyObject>();
    14. bulgeMod = gameObject.AddComponent<MegaBulge>();
    15. modObj.MeshUpdated(); // Call this after all modifers have been added
    16. }
    17.  
    18. void Update()
    19. {
    20. amount += 50.0f*Time.deltaTime;
    21. bulgeMod.Amount.x= amount;
    22. bulgeMod.Amount.y= amount;
    23.  
    24. if (amount>200.0f)
    25. amount=0.0f;
    26.  
    27. }
    28. }

    I am trying to do a pulsating hearth...
     
  9. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Would you be testing it on the sphere object by any chance? If so you wont see any change with the Bulge on a sphere as the way the bulge is calculated is to try and get the axis to match a sphere based on the amount, so if you start with a sphere then there is nothing to do.
     
  10. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Then what modifier do you recommend for a pulsating effect on a low poly sphere?
     
  11. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Well probably best if you just tried them in the editor and see which one gives a result you like, you could still use the Bulge if you have a little offset for example, of the squeeze, or the stretch one, I really would just add them and play with them in edit mode to find one you like. Also is there a reason you are adding the modifier via script instead of adding it in the editor etc, you could then animate the params much easier using the Unity animation system instead of coding an animation.
     
  12. Burve

    Burve

    Joined:
    Feb 12, 2011
    Posts:
    139
    Hi,

    How can I open (import) mor file (with morph data from MAX) during runtime (using code and not editor "Import Morph File" button) ?

    I can easy do that in edtor, but I want to add my fbx with AssetBundle and I need to add my mor file after project already running and I don't have editor there :(

    I am using MegaMorph.cs for modification of my game object with mor file.

    Thanks
     
  13. artonator

    artonator

    Joined:
    Sep 12, 2009
    Posts:
    69
    This looks great, I have fews questions for mega shapes and mega shapes pro.

    Can I make halls in the middle of the shape? like windows or donuts ?
    can I lock UVs in local space so that it stretches when I move CVs around?
    When mega shape pro will be available?

    Thank you,

    Arthur.
     
  14. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    @Alexlvan - Currently you cant, wasn't expecting anyone to want to load .mor files at runtime I have to say, there is no reason why the loading methods can't be moved over to the main classes or a new static mor loader class be added to do such functionality, I will put it on the list, but in theory if you are feeling brave you just need to copy the code over.

    @artonator - I do plan on allowing the use of multiple splines to allow things like holes to added easily to meshes, as with MegaFiers the first release of MegaShapes will be at a lower price and lots of updates will then follow with the price going up a little when I have everything in that I have initially planned. As for UV's there are two options for uv mapping either physical UV's which use physical sizes to determine uv mapping so as you move knots the mapping stays in place or normal UV's so that the mapping stretches to fill the shape, and obviously things such as scaling, rotation and offsets can be controlled. I was hoping to have it out by now but have got a little behind so a load of support, and doing the new tutorial demo scene for the new series of videos detailing each modifier in the system. But that is nearly done and I can put the finishing touches to the first release of shapes, I will probably do a couple of videos showing some of the features of the loft first as well.
     
  15. artonator

    artonator

    Joined:
    Sep 12, 2009
    Posts:
    69
    Thank you for your answere.. I am doing some proto typing for my next project and I think mega shapes will be a great tool to have. Can`t wait.... do you have a plan for mega -fiers and mega shapes bundle offer?
     
  16. droderick

    droderick

    Joined:
    Aug 25, 2008
    Posts:
    169
    Can't wait for megashapes pro too! keep up the amazingness Chris!
     
  17. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    SpookyCat,

    We're working on getting the Page Flip working in one of our Mobile apps, and i've followed the video tutorial, but when i get to the add pages section and add the Page Flip modifier to my page, the pages become 1 pixel thick. Everything else seems to work fine.. unfortunately when i run it theres no page turning at all... which i'm thinking is related to the super tiny pages.

    Any thoughts on that?
    Cheers
    Bryan
     
  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    The current page flip modifier will flatten any mesh so that is expected behavior, one of these days I will revisit the page and book system and do a much better page turner using a couple of bend modifiers a bit like the scroll and carpet video. As for no page turning, tricky to say what could be causing that, if you have followed all the steps in the video it should be working, if you want to email me the scene I can have a look and see what is missing.
    Chris
     
  19. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Sure, i can email it now... whats the best contact email to hit you up at?
     
  20. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Has the next update been submitted yet, looking to play with the auto sync for morph anims?
     
  21. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    It will be any day now, it was delayed a tiny bit by the desire to add a system that allows for objects that have modifiers applied to be easily copied in the scene, either in the editor or via scripting at run time, this will make the system a lot easier for people to use who want to have lots of independently deforming or morphing objects in the scene.

    Another system that I am adding is the ability to attach an object to a deforming mesh and have it stay in place as the mesh deforms around it, so useful if your character is carrying something or has a backpack, or eye objects in a morphing head or for attaching cameras or lights that need to move with the mesh as it changes shape. So hopefully these two new systems will make up for the slight delay in the next update.

    Also finally got the new demo scene for the new set of tutorial videos ready to go so can get started on a detailed modifier by modifier series showing the effect of each param on a mesh.

    Chris
     
  22. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    With the Megafiers plugin and the Tidy Wave Mesh, for example, you can make your racing track. By using the "Bend" parameter on the block, you can have all the angles you need for the curves :



    6R
     
  23. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    hello

    I just bought the megafiers and since I'm a modelling n00b I have some basic questions:

    1. I created a default unity cube and tried to spherify, this didn't work and I'm assuming it's because the cube doesn't have enough polygons and megafiers does not increase the polygon count, is this correct?
    2. If yes, Is there a way to increase the poly count on a cube with the unity editor or with your tools somehow?

    Many thanks for this great modifier system!
     
  24. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    This will be awesome! - just need facial hair to morph with the head now ;)

    Can't wait for the update, great work Chris!
     
  25. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    @Anadin - That is something that could be done, I will have a play with that.

    @iddqd - The system uses the vertices in the object so trying to spherify a square will not get you very far or any other modifier, the more vertices the better the effect usually. There are systems in the asset store to create primitives, and I am doing a system for that as well but its not hard to knock up basic shapes in any 3d editor and export them.

    And just done a little teaser image for the demo scene Tony and I have done for the new videos on the system.
     
  26. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    thanks for your answer, SpookyCat.
    I found a primitives package on the asset store.
     
  27. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    In 3ds Max Morpher, slider value can go to negative -100, affecting vertexes opposite way. Does megafiers support this? I've tried
    UseLimits = true
    Min = -100
    Max = 100
    but still only positive values works
     
  28. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    I did for some reason limit it to to 0 to 100, not sure why I will look at removing the limit and have it working between the set min and max values in the next release.
     
  29. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey spooky, i've been wondering about your tool and how I would have to use Objs for the morphs... now when I do morph targets, I create the heads for the morphing (just like a 3d App), would it be possible for this tool to read the blendshapes from a FBX file? I really don't want my projects filled with OBJs that I will not be using :)
     
  30. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Just at the moment I don't have the time to write an FBX importer though it would be handy I must admit. If you aren't using a 3d package that has the moprh exporter available for it and you do have to use OBJ files the obj files don't need to be part of the project as once they are loaded to the morph and the morph built the data is part of the object. Which 3d package are you using?
     
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Oh ok... I am using XSI... and I am also wondering if i have to import the whole body obj, or just the heads that make up my morphs...?
     
  32. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Could somebody possibly give me some hints on how to achieve the following.

    I would like to create a bridge(at runtime) like this:


    But it should be constructed from one piece with a slightly smoother bend, where the two pieces meet.

    I would have thought i could use one platform (I created one on blender with 4 subdivisions), stretch it on both sides and bend it in the middle. But whatever i tried, i couldn't get the desired results. Possibly I'm using the wrong modifiers? Or perhaps I need to construct my initial prefab differently (out of three parts)? Or would it be better to use Megashapes?

    Many thanks for any tips.
     
  33. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
  34. droderick

    droderick

    Joined:
    Aug 25, 2008
    Posts:
    169
    awesome! definitely one of the top 5 things i've seen in Unity! Strong work Chris and Team!!!
     
  35. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Great work brothers...very cinematic. Was hoping for a flyby thumbs up!
     
  36. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Thank you both :) Thumbs up would be a nice little touch, maybe I will get Tony to do something like that as part of the morph/point cache video.
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    @iddgq - Sorry I missed your post, I would think you would be best served by using the World Path Deform modifier on a nicely segmented platform, you could then slide it along to any point on the curve you liked. You could also look at the Curve Deform modifier if it is only a 2d deformation you need.

    This sort of thing is what is going to be very easy with the upcoming MegaShapes pro system.
     
  38. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
  39. Patapouffe

    Patapouffe

    Joined:
    Apr 3, 2010
    Posts:
    88
    Nice, but my 2008 macbookpro runs it so slow I can't really try it, plus some of the shaders are really glitchy on my computer (they have black dots on them). It would be cool if you could pick quality settings or have a separate less intensive version maybe. The graphics are really nice, but to be honest I don't really care if they are beautiful or not, I just want to try rotating the cameras to have a better feel for what is possible. The movie gives you an idea of what it can do but its not like a demo where you can really test it yourself.

    Anyways, it looks wonderful ! Keep up the good work !
     
  40. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Yeah you will quite a current system, it has a few post effect shaders and Shader 3.0 main materials. I will add a reduced effects version when I get some spare time but it was just meant as a private test bed and wasn't for public consumption but we thought we would just put it out for a bit of fun so don't really want to spend more than the few days we have already spent on it :)
     
  41. Germy76

    Germy76

    Joined:
    Dec 1, 2010
    Posts:
    31
    SpookyCat,

    Looking forward to using your system. Having some trouble though. When I add the Mega Modify Object script to my object I get this error -- Instantiating mesh due to calling MeshFilter.mesh during edit mode. This will leak meshes. Please use MeshFilter.sharedMesh instead.
    UnityEngine.MeshFilter:get_mesh() -- am I missing something?

    Thanks!
     
  42. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    I really am going to have to add this to the FAQ and put a message in the system, this a false error that Unity gives to any system that edits meshes in Edit Mode, so things like ezGUI, RageSpline etc all get the same thing, it doesnt happen at runtime and the error doesnt mean anything in Edit Mode so rest assured nothing is wrong, nothing is being leaked and everything is right with the world :)
    Chris
     
  43. Germy76

    Germy76

    Joined:
    Dec 1, 2010
    Posts:
    31
    Much obliged, sorry for stupid questions :D
     
  44. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Nothing stupid about the question, a great red error is not normally something to ignore. FAQ updated :)
     
  45. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    The latest version of MegaFiers v1.85 has just been submitted to the Asset Store this version brings two new beta modifiers in the dynamic water and the webcam displace modifiers. It also sees improvements to the Morph and Point Cache animation systems that now allow you to automatically sync the animations to the current playing Unity Animation clip. Some handy tools have also been added such as a Mesh Deep copy so you can create a new version of a mesh object and apply modifiers without it changing the original, and also a Copy Objects tool so if you have an object with a lot of modifiers on you can copy it using the new tool and have a totally separate entity, before the Unity mesh reference system would not allow you to do this. This will also be useful for users who have trouble with the prefab system and will allow them to work around duplicating an object in the scene with a function call.

    I will be doing some videos to show off how to use the new features very soon.

    Complete list of changes to v1.85:

    • Modify Object component automatically added when adding first modifier

    • Added a public LoadFile() method to point cache editor to allow for files to be loaded via scripts.

    • Added a point cache instance script to allow for easy instancing of point cache objects without overheads of data storage.

    • Knot handles etc orientation bug fixed.

    • Physical UV generation works for shape meshes now

    • Added linked update option to Morph Animator so can link morph animation playback to current animation.

    • Added Play on Start option to Morph Animator

    • Added beta version of dynamic Water modifier

    • Added webcam version displacement modifier

    • Added linked update option to Point Cache Animator so can link moprh animation playback to current animation.

    • Added Play on Start option to Point Cache Animator

    • Added a Mega Copy Mesh so you can use a mesh with different modifiers on without interference.

    • Check added to MegaShape DrawGizmo to limit number of segs used to display to avoid slowdown.

    • Number of channel Morph Anim helper supports increased to 20

    • Added MegaAttach system to allow objects to be linked to a point on a deforming objects surface.

    • Added a MegaCopyObject system to allow you to make copies of objects with ot without MegaFier components on that will work independently.
    Edit: Just been pointed out to me that there is a typo in the MegaMorphAnim.cs file, line 102 and 131 the 9's should be 8's. Fixed that and will submit a new version after I have done a video or two.
     
    Last edited: Apr 23, 2012
  46. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Updated to v. 1.85
    Several errors about duplicated scripts in the Scene Test are generated in the editor and also this one:
    Assets/Mega-Fiers/Scripts/MegaFiers/Modifiers/MegaRopeDeform.cs(14,16): error CS0246: The type or namespace name `MegaSoft2D' could not be found. Are you missing a using directive or an assembly reference?

    EDIT: The update have messed up my project. How is this possible?
    The pro water 4 has been affected, dissapearing.
    I have reinstalled my project with a back up and it is solved...
     
    Last edited: Apr 23, 2012
  47. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Arr yes I moved two files that were in the wrong folder to the MegaFiers script folder so if you are updating then you will need to delete the ones that are in the MegaFier Test Scene/Scripts folder which should be RopeDeform CurveDeform and RopeDeform. That is something that could be improved in the Asset Store system to automatically remove files that are no longer in the Asset when it's installed, it does mean that if an reorganizing goes on you can be left with duplicates.

    As for MegaSoft2D can not be found, it is certainly there in the package, can you see the MegaSoft2D.cs file in the Project?
     
  48. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Ok fixed the typo and did a further tidy up of files in the wrong place, the idea was while a modifier or feature was in Beta it would be in a separate folder and be moved over when it was no longer Beta, but the whole Asset Store system doesn't do any tidying up of files that are not in the folders so duplicates are left, for any duplicate left after this install remove the offending file from the MegaFier Test Scene/Scripts folder. I will no longer put beta systems in separate folders so this doesn't happen again. You wont get any problems if it a fresh import only if updating a project.

    Also bare in mind the Dynamic Ripple and webcam displace modifier are beta, there are issues and unfinished code and likely some missing error checking.

    v1.86

    • Channel 8 and 9 typos in MegaMorphAnim fixed.

    • Some source files were in the wrong place so have been moved, if you get errors about duplicated names delete the dup files from the MegaFier Test Scene/Script folder
     
    Last edited: Apr 23, 2012
  49. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    Oh no!, I am getting this


    Assets/Mega-Fiers/MegaFier Test Scene/Scripts/NearestPoint.cs(56,79): error CS0246: The type or namespace name `KDTree' could not be found. Are you missing a using directive or an assembly reference?


    I have removed and re-imported MegaFiers a couple of times, any ideas?
     
  50. anadin

    anadin

    Joined:
    Oct 28, 2005
    Posts:
    98
    OK, I change the if false at the beginning of kdtree.cs to if true, it all works :)