Tell us about your experience with Sprite Shape

Hi,
I’m writing some custom timeline tracks and clips. I added a serialized field to store my Spline data.
While selecting my custom clip I would like to use the SpriteShapeEditorTool to edit the spline data.
I want to do this without having any SpriteShapeRenderer in the scene (they’ll be added procedurally at runtime).

The problem I have is that SpriteShapeEditorTool is internal and I haven’t found any way to enable the SpriteShapeEditorTool other than having a selected gameobject with the SpriteShapeController component opened in the inspector. But I want to be able to edit the spline from within my clip.

Is there any way I can reuse some of the spriteShape spline editor tool code in my custom clip or any other scriptable object?

Years later and I finally found the reason for the odd behavior of Sprite Shape spline editing regarding the grid snap settings. Note: since then the Grid Snap settings were moved from Edit menu to Scene view toolbar (Grid and Snap must be enabled in the bottom-left menu).

It does take both clicking on the magnet icon to Toggle Grid Snapping and the “Snap to Grid” checkbox in the arrow sub-menu of that same button, but completely differently from a standard game object translation (and from Polygon Collider shape editing).

Game Object behaviour:

  • Toggle Grid Snapping off, Snap to Grid off: no snapping
  • Toggle Grid Snapping off, Snap to Grid on: no snapping
  • Toggle Grid Snapping on, Snap to Grid off: always snap to grid intervals relatively to initial position
  • Toggle Grid Snapping on, Snap to Grid on: always snap to absolute grid, no matter the initial position

Polygon Collider shape vertex move behaviour:

  • Toggle Grid Snapping off, Snap to Grid off: no snapping
  • Toggle Grid Snapping off, Snap to Grid on: no snapping
  • Toggle Grid Snapping on, Snap to Grid off: always snap to grid intervals relatively to initial position
  • Toggle Grid Snapping on, Snap to Grid on: always snap to grid intervals relatively to initial position
    (Snap to Grid is ignored)

Sprite Shape spline vertex behaviour:

  • Toggle Grid Snapping off, Snap to Grid off: no snapping
  • Toggle Grid Snapping off, Snap to Grid on: snap to absolute grid when close to a grid node
  • Toggle Grid Snapping on, Snap to Grid off: no snapping
  • Toggle Grid Snapping on, Snap to Grid on: always snap to absolute grid, no matter the initial position

The new behavior “snap to absolute grid when close to a grid node” is convenient but generally speaking, the behavior is not consistent with the other ones. The fact that some snapping is applied even when Toggle Grid Snapping is off is also surprising (I myself didn’t understand how to disable it at first, only found the Snap to Grid option later).

Suggestion to Unity devs: It would be better to follow the existing behavior (renaming existing options if you think they’re not clear enough, such as Absolute/Relative snap instead of “Snap to grid” if you prefer) and add a new option “Only snap when close to grid (or relative grid)” to add the new behavior (it would also unlock it for all the other types of entities).

Finally, Polygon Collider edit should honor Snap to Grid (absolute snap).

This way, users have consistent snapping behavior for all types of entities that can be translated, and they can freely pick their options: activate snapping, enable absolute snapping, enable snapping only when near node.

It’s the biggest piece of garbage ive ever seen in my life, and that’s saying something, since I’ve also worked with terrain grass

The outline always rotates. There should be an option so that the outline at the bottom is nor rotated. Imagine the sprite shape to be representing the area for a forest. The bottom outline should be the trunks. But the way it works now, the trunks will be rendered rotated upside down. You have to create a vertically flipped version of the same sprite and use that, which is not a viable option to duplicate all your sprites!