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 FU_JPS · Oct 25, 2018 at 01:41 PM · animationtimeline

How do you get curve values on an animation clip playing from a timeline?

How do you get curve values on an animation clip playing from a timeline?

Specifically, I have a timeline with a track that plays a series of animation clips in sequence for my scene's main camera. These animation clips contain a floating point curve for the camera's field of view, but I can't figure out how to access this curve in script. I can see the curve in the Animation window so I know it's there. I first tried Animator.GetFloat, but it always returns 0 for the property in question; then I came across this thread on the Feedback forum from 2015 where user Guessmyname says:

If you want to call get/set parameter functions on an AnimatorControllerPlayable you need to call them on the Playable not the Animator; the Animator's Get/Set parameter functions are for it's runtimeController, which needs to be null for it to playing Playables.

However, first of all I can't find any GetFloat function related to Playables when I search for it in the script API documentation; and secondly, I'm really confused how to get the playable that the timeline is playing on my camera's Animator in the first place. I can get the playableGraph, and from there I can see methods to get outputs and root playables - but looking at the documentation for the classes, interfaces, and extension functions, I can't find anything that appears to take the name of a curve and return a float value from it.

For my current scenario I am trying to set the field of view for my camera, but for future use I would love to know a general solution that works for any float curve in an animation clip played from a timeline. As a last-resort workaround I am considering asking the animators to add a dummy object to their Maya scenes and output the field of view values (etc.) to its position.

I am using Unity version 2018.2.7f1.

UPDATE

I just now learned from someone in another company working on the same project that as of 2018.2 Unity now supports importing the camera's focal length directly from Maya if "Physical Camera" is enabled, although I am still yet to find this information in the official documentation. The script documentation for Camera.FocalLengthToFOV lists a sensorSize parameter, so, not being familiar with all of Maya's camera-related parameters, I foolishly assumed this was related to VR headsets.

However, while this solves my immediate problem, I still don't have an answer for my question in general: how does one retrieve values from arbitrary curves by name from an animation clip playing from a timeline? The camera's field of view is not necessarily my only use case.

Comment
Add comment · Show 1
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 FU_JPS · Oct 26, 2018 at 08:40 AM 0
Share

On an unrelated note, is there a way to insert blank lines between paragraphs on this site's flavor of $$anonymous$$arkdown? All my paragraphs are squished together...

0 Replies

· Add your reply
  • Sort: 

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

244 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 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 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 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 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 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 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 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 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 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 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 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

Timeline: play different animations by hitting different triggers with different colliders 2 Answers

Timeline: gameObject animation is played differently 1 Answer

How can I make the animation timeline more intuitive ? 0 Answers

How to make a model move during timeline in Cinemachine. 0 Answers

Can the animation editor create local rotational data? 3 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