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 Thomas-Bousquet · Mar 13, 2018 at 03:41 AM · timelineclip

Force a timeline clip to a fixed duration

Hi, I am making a new clip for the timeline and it makes no real sense for it to be 'resizable', so I would like to give it a fixed length based on an asset given as a parameter.

I've tried setting the clip duration in the CreateMixer function of the track, but the user can change this by dragging the clip's right side border.

How would i go about doing this?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by seant_unity · Mar 13, 2018 at 11:19 AM

Unfortunately there is no mechanism in place to prevent the user from being able to resize the clip.

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

Answer by Thomas-Bousquet · Mar 13, 2018 at 01:50 PM

I understand. I think it would be a cool feature to support in the future :)

As 2nd best option, I would like to emulate the AudioClip behavior which set it's proper length when being created; with the resize control 'sticking' a bit at the 'native' duration of the clip. I couldn't find any documentation about this, do you have any pointers?

Comment
Add comment · 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 seant_unity · Mar 13, 2018 at 02:24 PM 1
Share

In your clip's playable asset, you can override the duration property from PlayableAsset. This will set the clip length when using the 'ResetEditing' function. If the sub asset isn't assigned yet, then it won't set the initial length correctly, but should give you the same sticking behaviour as AudioClip.

This is something that specifically looking at to improve in 2018.2, to better support custom track drag and drop, and initial clip length.

avatar image Thomas-Bousquet seant_unity · Mar 14, 2018 at 04:57 AM 0
Share

Thanks, it works really neatly :) I'm linking to a past answer from the forum which details this solution. https://forum.unity.com/threads/set-playable-duration-in-code.483085/#post-3144555 For anyone who's not sure, this goes in the class that inherits from PlayableAsset. (Thanks to PeryB for the correction)

avatar image PeryB Thomas-Bousquet · May 10, 2018 at 06:13 AM 1
Share

It's actually in the one that inherits from PlayableAsset

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

76 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

Related Questions

How to reference a TrackAsset or PlayableAsset 2 Answers

How to get the Track and the Clip of a Timeline? 1 Answer

How to get a track from a timeline from a playable director? 1 Answer

Peculiar Bleed-through of Exposed References on different Timeline Tracks 2 Answers

Clip offset do not work in the Timeline, What am I doing wrong? 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