Search Unity

Question How To Custom Track Menu Name?

Discussion in 'Timeline' started by EP-Toushirou, Jan 6, 2021.

  1. EP-Toushirou

    EP-Toushirou

    Joined:
    Nov 19, 2019
    Posts:
    40
    Such like Clip Attribute: DisplayName("xxxx")

    Can I Custom Track Menu Name?

    Thanks.
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Looks like you are looking for this.
     
  3. EP-Toushirou

    EP-Toushirou

    Joined:
    Nov 19, 2019
    Posts:
    40
    hello this link is only about TimelineAction

    what I actually want to say is the Track Asset Menu Name upload_2021-1-7_13-6-50.png

    Thank you.
     
  4. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Right..
    Well you can't change the builtin ones, but you can use DisplayName with tracks.

    And if you insert a '/' in the path, you can override the menu category.

    [DisplayName("MyMenu/MyTrack")]


    It's not ideal, and we plan to change it so that you can override the menu item directly, but for now, that's your best bet.
     
  5. EP-Toushirou

    EP-Toushirou

    Joined:
    Nov 19, 2019
    Posts:
    40
    oh Thank you! DisplayNameAttribute is ok, I use 1.3.6 before, after update to 1.4.5, it's ok, when 1.4version will be vertified?
     
  6. EP-Toushirou

    EP-Toushirou

    Joined:
    Nov 19, 2019
    Posts:
    40
    hello,but I think it's not perfect, i make a namespace(such as MyCustomTrack) on my class, but when I use [DisplayName("TextTrack")], finally show in the menu is "MyCustomTrack/TextTrack", and I don't want show the namespace when I use DisplayAttribe, I want to fully override it.
    Thank you very much.
     
    AnomalusUndrdog likes this.
  7. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    We know.

    Due to other things that we have released before, we will need to make a breaking change to Timeline in order to release a new Attribute to do this. So it may take a bit of time for us to get there.
     
    Last edited: Jan 13, 2021
  8. EP-Toushirou

    EP-Toushirou

    Joined:
    Nov 19, 2019
    Posts:
    40
    Thanks.
     
  9. Psyaryu

    Psyaryu

    Joined:
    Jun 19, 2020
    Posts:
    3
    I was searching around and didn't find a direct solution, but since a TrackAsset is a ScriptableObject. I just changed the name property of the asset and it updated in the TimelineAsset. I dynamically change the value based on the configuration on the TimelineAsset.

    If you don't need to dynamically change the value, you can click on the name on the TimelineTrack and it will become editable.

    Commenting in case a lost developer stumbles here! If there is a more appropriate way please let me know!