Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • 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
0
Question by Ionthas · Jul 13, 2015 at 01:55 PM · animationblenderblendshapes

BlendShapes with animations from Blender

I'm trying to understand how animations with BlendShapes work in Unity and Blender. I'm using Unity 5.1.1f1 and Blender 2.74.

I have a simple dancing cube with 1 animation and 2 BlendShapes. The BlendShapes are working well until I turn on the animator component. Then only the animation is played and the BlendShapes are completely ignored.

I have the following code controlling the cube.

 using UnityEngine;
 
 public class CubeController : MonoBehaviour {
 
     Animator animator;
 
     private SkinnedMeshRenderer skinnedMeshRenderer;
     private Mesh skinnedMesh;
     int blendShapeCount = 0;
 
     private MeshCollider meshCollider;
 
     [SerializeField] GameObject cube;
     [SerializeField][Range(0, 1)] float size;
     [SerializeField][Range(0, 1)] float deformation;
 
     void Awake()
     {
         animator = GetComponent<Animator>();
 
         // Using BlendShapes
         skinnedMeshRenderer = cube.GetComponent<SkinnedMeshRenderer>();
         skinnedMesh = skinnedMeshRenderer.sharedMesh;
 
         meshCollider = GetComponent<MeshCollider>();
     }
 
 
     // Use this for initialization
     void Start () {
 
         blendShapeCount = skinnedMesh.blendShapeCount;
         Debug.Log("blendshape count: " + blendShapeCount);
         if (blendShapeCount == 2)
         {
             skinnedMeshRenderer.SetBlendShapeWeight(0, size * 100);
             skinnedMeshRenderer.SetBlendShapeWeight(1, deformation * 100);
         }
 
         meshCollider.sharedMesh = skinnedMesh;
 
     }
 
 }

Here you have the exported dancing cube .fbx: https://drive.google.com/file/d/0B3ELWKyJ3vaOU0oxeXhWTFBXdEU/view?usp=sharing

Are BlendShapes with animations supported?

Thanks!

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Ionthas · Jul 14, 2015 at 07:06 AM

I found the error.

I have the following structure with two GameObjects imported directly from Blender: blendShapeTest and chest2.

alt text

If you have the Blender Mesh named as Cube (default from Blender if you used a cube as a seed shape) then it doesn't work. If you rename it to something else animations and BlendShapes work like a charm.


solution-animations.png (3.0 kB)
Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

21 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Blendshapes/Keyframes vs Animation Clips 0 Answers

Modify Blend Shapes with a Slider 0 Answers

creating a disolvable ik rig in blender for unity3D mecanim 0 Answers

Unity Partially Ignoring Blender Animation 1 Answer

Animation for rigged chest in blender does not work in Unity 0 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