Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 baba · May 30, 2014 at 11:29 PM · curvecurves

How do i redraw an entire curve with the mouse (as opposed to one single keyframe redraw)?

When editing an animation curve in unity curve editor, what happens is that the mouse selects one single keyframe that you can then move around across both x and y axes. This means that you can only modify one single keyframe at a time with one mouse drag.

I would like to: 1- be able to modify keyframes values only across the y axis (up down but no change in position left right) so that the modify key frame keeps its original x axis value no matter what. 2- Be able to drag my mouse pointer across multiple keyframes and have them modify their Y axis values accordingly. In effect redrawing the curve with my mouse pointer as if with virtual a pen.

How could I achieve that? Is there a setting somewhere I can change? Or Should I implement my own curve editor (if yes how?)?

I declare my curve this way:

 public AnimationCurve _pitch;

and I populate it this way:

  int T = 100;
     ks = new Keyframe[T];
     int i = 0;
     while (i < ks.Length)
         {
             ks[i] = new Keyframe(i, Mathf.Sin(2* Mathf.PI/T *i) );
             i++;
         }
     _pitch = new AnimationCurve(ks);
Comment
Add comment · Show 4
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 tw1st3d · May 30, 2014 at 11:37 PM 0
Share

What is wrong? What's not happening? What IS happening?

avatar image baba · May 31, 2014 at 06:11 AM 0
Share

@tw1st3d I have edited my post to answer your comment. Hopefully it makes sense. It is visually simple but hard to describe by words.

avatar image Jeff-Kesselman · May 31, 2014 at 05:19 PM 0
Share

What you are asking for is not a functionality of the editor, so yes you will have to implement it yourself.

The process of taking a set of points and drawing a curve that passes through them is known as http://en.wikipedia.org/wiki/Curve_fitting. It is non-trivial math and may not always give you the results ou expect.

Start that that wiki page, then google "curve fitting" for more information.

avatar image baba · May 31, 2014 at 08:08 PM 0
Share

@jeff $$anonymous$$esselman I do not actually need curve fitting i.e I do not need any post processing of my values once they are modified. And I do not need any processing to modify them either as I only want the mouse pointer y-values to be the new values. Just straigth one to one mapping. Not doing any computing. How do I implement my own curve editor with mouse click drag detection?

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

22 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

Related Questions

Text along a curve 2 Answers

AnimationCurve, how can i know when the end of the curve has been reached? 3 Answers

how to use t variable in the bazier curve 2 Answers

Custom inspector curves similar to the 'Audio Source' volume/pan/spread Curves 0 Answers

Easing .curves 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