Unity megafiers Vertex Animation

Source: Internet
Author: User
Tags dashed line modifiers

    using the Megafiers plugin allows unity to support the playback of vertex animations. The official video tutorials are as follows:


Here is a simple test using the following environment:
    • Blender 2.72
    • Unity 4.5.4
    • Megafiers 2.74
Create objects and animations first open blender, the default will contain a cube, below the cube to make a simple animation, let it rotate in 1~100 frame, 101~250 frame to do the scaling, making the method can refer to the tutorial "kind simple animation."
  1. Confirm that the cube is in the "selected" state surrounded by an orange-yellow bounding box;
  2. Use the mouse to drag the green current frame indicator line to the 1th frame;
  3. Press the keyboard I key in the user view to execute the Insert Keyframe command;
  4. In the popup menu, select the second item " rotation ";
  5. Use the mouse to drag the green current frame indicator line to the 100th frame (you can see the 1th frame just near the number of a yellow vertical bar);
  6. In the user view, press the keyboard R key, perform the rotation command, there is a dashed line connected to a double-arrow mouse;
  7. Immediately after pressing the keyboard Z key, a vertical bar appears, defining that the cube can only be rotated along the z axis;
  8. Immediately after the keyboard input 180 return to the car, completed the cube cube along the z axis 180 degrees of operation;
  9. In the user view, under the keyboard I key, execute the Insert Keyframe command again;
  10. Still select " rotate " in the popup menu;
  11. You can see that there is a yellow vertical line near frame 100th.
  12. Now click on the left mouse button and press the play button below the screen (or press the alt+a of the keyboard);
  13. You can see the cube rotation, the entire animation from the 1th frame to the 100th frame, the next animation is to continue to maintain the final state unchanged;
  14. Then follow the similar steps above to complete the zoom animation from frame 101th to frame No. 250, insert the keyframe menu to select " scale ", and execute the Zoom command as SZ3;
  15. Save As " Cube.blend "document;
  16. Export to an . MDD file (you need to check the MDD format first in "User settings ..." → "Import-export").
The animation is done like this:

Import objects and animations then animate the vertices in unity, open unity, install megafiersPlugin, create a new scene that will" Cube.blend"File into the assets folder. Then drag the imported cube prefab into the scene, as shown here:

Through the menu "Component" → "Modifiers" → "Point CacheTo add the vertex cache component. (The description of these parameters can be found in the official website "Point Cache")
ClickImport MDD"Import just the MDD file, the import completes automatically sets the cycle time of the animation"Loop Time”。 Then change the loop mode "Loop ModeForLoop", Mixed Mode"Blend ModeForReplace", drag" Time, you can view the animated frame at this time in editor mode, as shown in:

Finally tick "animated, run the game to automatically play the animation, as shown in the following:

Control animation playback Next control play the specified animation section, let it play the rotation animation by default, the button click Control Play Zoom Animation. Select the Cube object,Add the vertex cache animation component via the menu "Component" → "Modifiers" → "point cache Animator". (the description of these parameters can be found in the website "point CacheANimator")Click "Add clip" To add 2 clips, Rotation and scale respectively, with frames of 0~99 and 100~249, with a speed of 1 , loop as Loop , as shown in:

Now running the game, you can see that the cube has been spinning animation. Create a new script to hang on top of the cube with the following code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
usingUnityengine;
usingSystem.Collections;

PublicclassTest:monobehaviour {

PublicMegapointcacheanimator Anim;

voidOngui ()
{
if(GUI. Button (NewRect (Screen.width- -,0, -, -),"Zoom"))
{
if(Anim = =NULL)
{
Anim = getcomponent<megapointcacheanimator> ();
}
Anim. Playclip ("Scale");
}
}
}
Click the button and you can switch to play zoom animation. The effect is as follows:


remark:The first time you try to use this plugin, there may be errors or improper use, please also point out, so as not to mislead.
References:1. Section 1.1.6 kind simple animation (Try-anim) http://wiki.ubuntu.org.cn/index.php?title=Blender2.5x-2.6%E5%AE%8C%E5%85%A8%E6%95% 99%e7%a8%8b_1.1.6&variant=zh-cn2. Website point Cache Introduction http://www.west-racing.com/mf/?page_id=13353. Website Point Cache Animator Introduction http://www.west-racing.com/mf/?page_id=1802

Unity megafiers Vertex Animation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.