• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by LAustralien · Sep 26, 2013 at 02:38 PM · animationblenderkeyframe

FBX blender animation file not working properly

I have read a lot of threads in the forum which relates to issues associated with importing FBX files created in Blender into Unity. However, none of those threads addresses my particular issue and I am pretty sure it is a simple solution / setting that I have missed.

My animation consists of a simple cube which crumbles into multiple pieces using the cell fracture in Blender. In effect, I have two cubes in blender: a solid cube (cube A) and a cube made of multiple pieces which crumbles as it gets affected by gravity (cube B).

My animation comprises 90 frames in total and works as follows: Frame 0 to 29: only cube A is displayed and rendered. Cube B is hidden and not displayed. Frame 30 to 90: cube A is hidden and not rendered. Cube B is displayed and rendered. This was done by inserting a keyframe in frame 30 in Blender.

The animation works perfectly in Blender. However, when exported into Unity, when the animation plays, both cubes (A & B) are always rendered. I have also tried to import the blend file into unity but I still have the same problem. I know it would probably be possible to achieve the same animation as in blender by script (i.e. making cube A inactive at frame 30 and cube b active from frame 30 onwards). The problem is that cube B is made of 200 different smaller objects so looping through each of those to make them active/ inactive would greatly affect performance.

Is there a setting I have missed when exporting from Blender? Any suggestions / help would be greatly appreciated.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Entairex1 · Sep 26, 2013 at 05:43 PM

1# Make sure you're exporting with animations properly

2# In Unity, you'd have to change animation type to LEGACY, do this by

Select animated object prefab => Click "Rig" in the inspector => change "Animation Type" from Generic to LEGACY

3# How did you make the cube "not render" in blender? by material, or by sizing it to 0?

(Sizing the cube to 0 in the animation would probably be the best solution)

Comment
MrProfessorTroll
Grako

People who like this

2 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by LAustralien · Sep 27, 2013 at 02:01 PM

Thanks for your prompt follow up. Using the same numbering as above.

"1# Make sure you're exporting with animations properly" I think this part is fine as i) I can see my animation in unity when I select the fbx file in the Project Asset and ii) I can preview the animation in the inspector window.

"2# Change animation type to LEGACY" That is an interesting one. When imported from Blender, the animation type is "Generic" by default and, as mentioned above, I can preview the animation just fine in the inspector window. However, if I select LEGACY as suggested and "Store in Root (new)" under the "Generation" pull down menu and click Apply, then my animation no longer works in preview in the inspector window for the FBX file (i.e. nothing happens when clicking play).

"3# How did you make the cube "not render" in Blender?" In Blender, in the "Outliner" window, I deselected the viewport visibility (i.e. clicked on the eye icon so that it looks closed) and set the rendering property to "false" (by deselecting the camera icon). Note that given Cube B is made of a lot of smaller objects, I used the following python script to achieve the above (note I found the script in the following Blender tutorial http://www.youtube.com/watch?v=B8S_jU6iNCQ&list=UUiqJdL1lpnQ6Ng2xyFgMMIQ)

 import bpy;
 
 for object in bpy.context.selected_objects:
     object.hide = False;
     object.hide_render = False;
     object.keyframe_insert(data_path="hide");
     object.keyframe_insert(data_path="hide_render");

By the way, the video shows the very same animation principles I am trying to achieve from 9:00 to 9:20 and 8:00 to 9:00 shows how to do it in Blender. The script part is shown around 18:00 in the video.

Comment

People who like this

0 Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Entairex1 · Sep 27, 2013 at 05:00 PM 0
Share

(Sizing the cube to 0 in the animation would probably be the best solution)

The animation is not working properly because you're animating blender-specific settings. Unity and Blender don't share properties, so the solution is to simply scale the objects you don't want to be seen to 0.

This solution actually isn't a bad one. Example: In Team Fortress 2, they do decapitation by sizing the head down to 0 and spawning a new separate head.

avatar image LAustralien · Sep 28, 2013 at 02:29 AM 0
Share

Thanks Entairex.

I did try to scale down to 0 to make the cube disappear at the right frame and it worked. The only thing is that there is a little 'flicker' in the animation when the cube is being scaled down (I scale it from 1 to 0 between frames 29 and 30). Clearly I can't see such 'flickering' in TF2 so I guess I just need to tweak my animation settings until I get the right outcome.

avatar image Entairex1 · Sep 28, 2013 at 02:33 AM 0
Share

A possible fix for that is to open up Graph Editor in blender, select the cube sizing section, press T => Constant

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Blender To Unity Animation Import Problems 1 Answer

Importing Keyframe Animation (not Bone-based Animation) 0 Answers

Animations from Blender jerky/skipping frames 1 Answer

Unity Import automatically adds unnecessary Keyframes 2 Answers

Unity Rotation In Animation Goes In Opposite Direction 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges