Search Unity

Is it possible to rename objects that are animated

Discussion in 'Animation' started by CarpetHead, Nov 17, 2014.

  1. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    The ability to change the path is nice but if I change a field name that is animated, I have to rebuild the animation on all the objects from scratch since I can't change the field name used.
     
    ZenUnity likes this.
  2. visca_c

    visca_c

    Joined:
    Apr 7, 2014
    Posts:
    30
    Can we have a tool where we drag & drop an animation clip (or an array or clips) to mass replace existing property name with a new one?
     
    Karsten and guneyozsan like this.
  3. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    862
    I'm at 2021.1 now, and the animation property bindings are still ruined if you rename an animated object. This seems like such a basic feature; rebind an animation property to a new target. This thread is from 2014, and somehow this was never addressed :eek:

    EDIT:
    Users have been implementing this feature on their own. But without hooking into the Animation window itself there are limits to how user friendly you can make it. The result is a workable but S***ty user experience.
    https://answers.unity.com/questions/38941/how-to-rebind-animated-variable.html
     
    Last edited: Aug 6, 2021
    Olmi, tonytopper and andersemil like this.
  4. tonytopper

    tonytopper

    Joined:
    Jun 25, 2018
    Posts:
    226
    I think we should all agree that this is a broken experience, categorically. If Unity Inc. wants the Unity share price to continue to go up, they have to fix this kind of stuff ASAP.

    The 2D Animation package is in "Release Candidate" status; it is time to fix this. Is there a self-respecting product manager that would let this go to "Release" status when this issue exists?
     
  5. KalOBrien

    KalOBrien

    Administrator

    Joined:
    Apr 20, 2021
    Posts:
    89
    Please dont add any unnecessary comments and stay on topic please.

    Regarding this thread topic, I've relayed it back to the team folks :)
     
  6. Jack_Potter

    Jack_Potter

    Unity Technologies

    Joined:
    Jun 10, 2021
    Posts:
    5
    Hi all,

    Unfortunately, this is not a feature we support in editor. However, if you are renaming properties in scripts that you know are animated one approach can be to do a simple text find and replace in *.anim files in your project using any text editor.

    Alternatively, tooling can be created to do this using the API as linked by cecarlsen.
     
  7. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    Yeah, it can be, it's just feels bad to have to do that for such a central UX issue, especially since with the limited access we have to this window every attempt to fix that will result in a poor user experience.

    If the only option you leave us is for us to fix the issues in your software, then please give us some way to do it properly.
     
    L0tan likes this.
  8. Karsten

    Karsten

    Joined:
    Apr 8, 2012
    Posts:
    187
    In 2020.3 there is a way to rename the hierarchy path in the Animation Editor, you have to click at the end of the name in the panel a bit longer holding the mousebutton down and release it , then a inputbox appears
     
    ZenUnity and khan-amil like this.
  9. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    Just tested and it works in 2021.1.12f1 too.
    Now this is good news, but raises questions :
    1) Why is it using this horrendous pattern ? Not a standad way to interact with the UI, pretty much impossible to discover until you know it exists.

    2) how can we get that after @Jack_Potter answer that looked pretty definitive. Was it added after in the end?
     
  10. Jack_Potter

    Jack_Potter

    Unity Technologies

    Joined:
    Jun 10, 2021
    Posts:
    5
    Hello, it's true you can modify the hierarchy using the animation window UI. However, this only allows you to modify the names of the gameobject referenced in the hierarchy (not including the root). If you change a script name or a script property, you cannot fix this up via the animation window.

    My understanding of the issue we are talking about is renaming a property on a script, and then fixing up the animation clips that are animating this property. In this case, the workflows I am aware of would be to either script a batch update using the API detailed above or else rename the animation clips manually via a text editor.

    Thank you for the feedback regarding this workflow, we'll take your input on board for consideration of future development.
     
    Mehrdad995 likes this.
  11. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    224
    So, I found that you cannot change the path of any component on the root. This matches what @Mecanim-Dev said "please note that the root game object name is never included in the path". This means that there is nothing to edit for root properties. That would explain why rename doesn't work on your first screenshot. On your second screenshot where you select Hips though, I don't see why it would fail.

    This is unfortunate though, as in my case I need to move the animated sprite from root to a child, and I cannot do this. I'll probably just edit the animation file as serialized text or copy/paste the sprites to the child Sprite property...

    Hint: to rename child properties, instead of clicking once, wait, then click again (double-click doesn't work), you can click then F2.
     
    DucaDiMonteSberna likes this.
  12. peteburges

    peteburges

    Joined:
    Apr 8, 2020
    Posts:
    5
    The trouble is, even when you rename objects that have been created and animated entirely within Unity (such as particle systems), it breaks your animation. I can't think of any good reason why this should be the case. This is supposed to be a creative tool, but even simple tasks like reorganising and renaming objects become tedious chores. Not everyone who uses Unity is a programmer, you know.
     
    debug_log_fixme likes this.
  13. karljessterabellera

    karljessterabellera

    Joined:
    May 16, 2022
    Posts:
    1
    For people who only renamed GameObjects tied to an Animation, but did not change the hierarchy, you can simply open the animation file in a notepad and do a "find and replace all" from there.

    For example, I have a GameObject called "jonas_prefab" in the animation, but I recently renamed it to "actor2" in the hierarchy window. The animation became invalid, but I quickly fixed it by doing what I mentioned above, letting the text editor change the multiple instances of this line:
    upload_2023-1-18_13-1-25.png

    I was working with a lot of bones and keys for this project so instead of tediously renaming them one by one in the animation window, this quick text edit finished the work in five seconds.
     
  14. DucaDiMonteSberna

    DucaDiMonteSberna

    Joined:
    Jan 18, 2018
    Posts:
    79
    And that luckily works on root properties too!
     
  15. hossenshovon1

    hossenshovon1

    Joined:
    Apr 20, 2018
    Posts:
    4
    The Best Solution, Thanks Man!
     
  16. mortoray

    mortoray

    Joined:
    Sep 14, 2018
    Posts:
    94
    I wonder how many comments on a stale thread one needs to realize there's a critically missing feature here.
     
    DucaDiMonteSberna likes this.
  17. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Have run into this issue many times, a huge pain. Clearly a common pain point.