Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    228
    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:
    24
    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:
    725
    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:
    110
    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

    Unity Technologies

    Joined:
    Apr 20, 2021
    Posts:
    88
    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:
    182
    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:
    172
    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
     
    khan-amil likes this.
  9. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    182
    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:
    197
    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.
     
  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.
     
unityunity