Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 JimG · Jul 02, 2011 at 01:25 AM · animationweights

Weighted Pose Animations without Blending

I have a facial model exported from a 3D modelling package with several animation poses (smile, open, pucker, blink, etc.). I need to be able to combine these poses with weights and without any Unity blending from frame to frame. The weights don't have to add to one. For example, I might have a weight of .5 for 'open' and .75 for 'blink'. Each pose animation consists of 5 identical frames with bones rotated and/or translated to give that pose. I need to be able to change the weights on a frame by frame basis without Unity "helping" smooth things out. I've tried using layers, but with a fixed set of weights, I still get

Failing an easy way to do this, is there a way to get at the guts of an animation (bone rotations, translations, etc.) and create a new animation on the fly with my own calculated values?

Thanks for any insight you can provide!

Comment
Add comment · Show 5
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 JimG · Jul 02, 2011 at 11:58 AM 0
Share

Okay, after a lot more reading and searching it looks like what is needed is to make each pose animation a two frame animation with the neutral pose as the first frame and the pose itself as the second frame. Then, each pose is placed in its own layer and the blend$$anonymous$$ode of the animation is set to Additive. Then, the normalizedTime is set to 1.0, the wrap$$anonymous$$ode is set to ClampForever. Then, using the weight for each layer as the weight of the pose, you get nice additive poses. I have some sliders that I use to adjust the weights to play with combining the poses. Also, you need to enable the neutral pose each Update as well.

avatar image Waz · Jul 02, 2011 at 12:12 PM 0
Share

You should answer your own question, as the approach in you comment is correct (except perhaps the bit about enabling the neutral pose every Update, that shouldn't be necessary), and works for you.

avatar image Bunny83 · Jul 02, 2011 at 12:56 PM 0
Share

@Warwick Allison: Well, if all animations are additive you need at least one "absolute" animation. Otherwise the relative change will add up each frame and will result in strange motions.

@JimG: Your approach is how you can do it, just some hints:

  • Animation.Play does only reset the animation-time to 0 and set enabled to true.

  • Crossfade does the same, but moves the weight from 0 to 1 (slowly).

  • You can control all those properties on your own .enables, .time, .weight, .speed, ...

  • You can sample an animation state at any time you like by calling Animation.Sample().

  • Additive animations are not affected by layers. Only when it comes to Play or Crossfade since they stop all animations an the same layer. You can put all additive animations on one extra layer.

avatar image winxalex Bunny83 · Jun 22, 2016 at 10:10 AM 0
Share

Could you check this question http://answers.unity3d.com/questions/1206428/how-weights-of-2d-blending-are-calculated.html

avatar image JimG · Jul 02, 2011 at 06:25 PM 0
Share

@Bunny83: Thanks for the info. I changed it to all be in the same layer without any problems. There should be a better example of using Additive somewhere. The leaning one from Unity leaves a lot to be desired.

@Warwick Allison: Yeah, very interesting effect if you don't set the neutral pose each frame. Face just explodes as Additive animations keep accumulating.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Dreamora · Jul 02, 2011 at 04:42 AM

Bones are just transforms in the hierarchy you can modify however you want.

Its also possible to change the weights, the Mesh class as well as other relevant aspects on the renderer give you full access to whatever you need to use it. Generally unity does not smooth things out, it interpolates stuff over its define amount of time. So if something is too smooth / long I would check the timing

Comment
Add comment · Show 1 · 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 JimG · Jul 02, 2011 at 12:00 PM 0
Share

The thing is that I want the time to be just a single frame, so that the image is static unless the weights change. I was able to figure it out, though.

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

6 People are following this question.

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

Related Questions

Making characters strike poses when hit? 2 Answers

How can i make vertex influences works the same as in maya? 0 Answers

Changing AnimationState weights does screw up Crossfading.. 1 Answer

Creating keyframes from poses in the scene view (with pictures for clarity) -1 Answers

Is it possible to blend Animations in a way similar to Blendshapes? 1 Answer


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