Search Unity

Feature Request Multi-Select editing and Auto-Name for 2D Sprite Editor

Discussion in '2D' started by Rechronicle, May 6, 2022.

  1. Rechronicle

    Rechronicle

    Joined:
    Dec 14, 2017
    Posts:
    32
    This feature probably has been asked multiple times, but...

    • Select 2 or 3 slices and modify their Pivot all at once.
    • Select 2 or 3 slices and name them immediately into Idle_0, Idle_1, Idle_2. Auto-suffix?

    That's all!
     
    mynamepfd and karliss_coldwild like this.
  2. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Thank you @Rechronicle for your feedback. Yes, this has been a highly requested feature and a very valid one too. We understand how supporting multi-selection can help speed up users' workflows when it comes to multi-pivoting, batch-renaming, multi-trimming etc.

    The team is looking at improving the Sprite Editor so every feedback helps. So keep them coming!
     
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    Having something like that builtin would be nice. For inspiration here is the functionality in my current editor script to speedup doing such actions.
    upload_2022-5-12_17-1-26.png
    Pivot actions should be more or less obvious. Size modification ones either adjust or set the position of edges relative to pivot position while keeping pivot position relative to texture fixed thus allowing to perform trimming operations.

    Input is based on selection in project window. Thus allowing to modify sprites from multiple textures at the same time.
     
  4. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Hey thanks @karliss_coldwild, this is really interesting! I'm curious what's the difference between the three pivot buttons - Shift pivot, Set pivot, Sync pivot?

    Probably a silly question. I'm imagining if I had say, five textures selected in my project window, and I keyed in X:10, Y:10 and hit Shift pivot. Am I also technically setting the pivot of these five textures and in doing so syncing all five pivot points?
     
  5. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    Shift pivot -> moves the pivot of each sprite relative to previous position
    pivot[i] = old_pivot[i]+V2(x, y)
    , the numerical values of pivot in selected sprites don't need to be identical. This is useful if you have already previously assigned pivot to multiple sprites and want to change it's logical position, for example from bottom of feet to the middle of body.
    If all the sprites had same dimensions and logical positioning of drawn object, set pivot could also be used for adjustments. But that's not always possible. The sprite dimensions and logical positioning may differ due to various situations: the sprites where exported from animation software with tight packing setting, sometimes it's impractical to pad them to same size(imagine character swinging huge cartoony weapon one sprite very tall and one very wide), sprites being identical size within texture but trimmed within unity sprite editor for the purpose of optimizing packing, frames having same size within each animation but different size across different animations, animation (like jump or lunge forward) drawn with some inherent movement to help artist visualize it but for gameplay and coding reasons drawn movement being replaced by scripted movment.

    Set pivot -> assigns entered numbers to all the selected sprites.
    pivot[i] = V2(x, y)
    . This is useful during initial setup, assuming all the sprites have same rectangle size and logical positioning.

    Sync pivot-> copies pivot position from first sprite to the rest of sprites.
    pivot[i] = pivot[0]
    . Workflow with this one is that you position pivot for one of the sprites with mouse in the sprite editor and afterwards click sync pivot. Same could be done with "set pivot", but this command saves you a few clicks and need to type pivot coordinates by hand.
     
    Last edited: May 27, 2022
    Xiangting_Su likes this.
  6. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Hey @karliss_coldwild thank you for breaking it down for me! This makes a lot of sense. I can imagine Shift Pivot being very handy in such situations when the Sprites are of different sizes. Also Sync Pivot makes a good time-saver alternative to Shift Pivot too.
     
  7. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    I second this idea!
    I'm currently in the process of changing the pivot point of 150 sprites from center to bottom center and cannot help but think that there has to be another way to do something like this in bulk. Any work on the sprite editor would be much appreciated!