We’re happy to share that SpriteShape is now available for preview. SpriteShape is a sprite layout or world building tool that provides the ability to tile sprites along the path of a shape based on given angle ranges. Additionally the shape can be filled with a tiling texture.
The main feature of the SpriteShape is the powerful combination of a bezier spline path with the ability to tile Sprites adaptively or continuously while automatically switching Sprites assigned to given angles.
Take a look at the manuals and try out the samples. We’d like to know what you think, so please reply to this post or create a new one to tell us about your experience with this feature.
Tell us how this fits into your workflow or enhances your project? What worked smoothly? And what didn’t?
Thanks for the feedback. This has already been fixed and will be available in next beta (2018.1 b12).
Collision and Rendering mesh are generated using different tessellation algorithms. Hence there maybe slight differences in generated geometry at low/medium levels. Please file a bug if required.
To modify angles, you could edit them directly in Inspector for each Angle Range.
You can also specify multiple sprites for an angle-range. You may then modify SpriteIndex property to select a specific sprite for control-point
Looks great! Any chances of extending the bezier spline deformation so it could be used for animating/deforming 2d characters aswell?
Rayman legends uses a bezier patch deformation technique for their character animation/rigs. You get that nice deformation instantly for free without the need to manually paint skin weights in a 3d software:
I am getting a crash when I roll a ball (circle collider) over a SpriteShape. I have included a screepcap below to show exactly what the SpriteShape collider looks like.
When rolling the ball along there, sometimes it crashes in seconds, sometimes it takes 5 minutes, but it will always crash. Built to Windows.
I’m not sure how to explain this, but I noticed that if I create a new sprite shape profile and add a sprite on top but not on bottom, any created shape will disappear when the camera moves down
Also, I honestly think the offset slide should be for the sprites not the fill texture.
Sometimes the user may want the collider to go over the sprites he set up. Specially for ground surfaces and the collider offset will just not be efficient if your shape isn’t a flat surface
I think there could be a bug with BoundingBox generation. Could you please submit a bug with a sample scene/project ? We will try to fix at the earliest.
We will take a look at this. Thanks for the feedback.
I am playing around with SpriteShape, but was wondering how I could go about accessing/modifying different points on the Spline via script? I tried looking at the Scripting API, but my tinkering so far has led to no results. I would appreciate any tips that could point me in the right direction!
Is the spline editor used in this tool available as a separate component / is it possible to create my own without having to actually reeimplement in some major way? I’d love to use it as a general tool. It could even be used to implement “meta-friezes”, as UbiArt calls them (which are basically multiple friezes (smartsprites) driven by a single spline).
Is there a keyboard shortcut/global setting to toggle Edit Spline? First thing I noticed was how much it bothers me to have to click my way out of the scene view to enable it.
Is it possible to move multiple selected points at once? I feel like I’ve already done it, but now it doesn’t seem to work and I’m thinking it might be a bug. Edges between selected points are not highlighting either, if they’ve ever done that.
Also, some suggestions on improving the workflow
Shift+clicking to a add new point on cursor position. Ferr2D does it and it seems to make quite a lot of sense, although I have not used it yet. That is to say, I know it is possible and not being able to do it makes me uncomfortable.
Shortcuts to change point modes (if possible, one that pops up a context menu in cursor position with all point related settings)
Esc my way out of Edit Spline to allow selection of another object. The only way I’ve found how to do this currently is switching tools, which is not really that bad, but because I like the Rect Tool better to work in 2D I find it quite annoying to use since it is bound to T. I’d very much like it better if I could just Esc back to my last selected tool.
I’ll probably come up with some more questions / suggestions as I test it, but so far, I like very much what I’ve seen. Please, keep it up!
You can access the controlpoints data through SpriteShapeController’s spline member. A simple sample to animate points below :
…
void Update ()
{
var spriteShapeController = GetComponent<SpriteShapeController>();
var spline = spriteShapeController.spline;
for (int i = 0; i < spline.GetPointCount(); ++i)
{
Vector3 pos = spline.GetPosition(i);
pos.x = pos.x + (Random.Range(-0.01f, 0.01f));
pos.y = pos.y + (Random.Range(-0.01f, 0.01f));
spline.SetPosition(i, pos);
}
}
…
Also the source of SpriteShape package is usually located here :
C:\ProgramData\Unity\cache\packages\staging-packages.unity.com\com.unity.2d.spriteshape@1.0.9-experimental
Yes, it is possible. Also each Angle Range can take upto 8 sprites and its possible to toggle between these sprites at a control point. See the gif attached.
Will take a look. Also shortcut key for Toggle Point Mode is ‘M’ and to toggle Sprite Index is ‘N’
Please select all the points and use Shift+Drag.
Thanks for the feedback.
As stated above, please use Shortcut key M.
Will take a look and see how this changes workflow.
Multiple SpriteShape equivalents being driven by the same curve.
Oh. Funny, I though I’d tried bashing through the entire keyboard. Well, I was very sleepy by that time. Thanks!
Wow, that sounds very counter-intuitive for me. Is there a UX/Technical reason as to why it’s necessary to hold Shift while doing it instead of just having the points selected and dragging one?
Thanks for the attention!
Also, I’m sorry if I’ve been sounding too bratty about this. It’s just that this is a tool of major importance for me, so I’m very much worried about it being consolidated in a less than perfect manner. It’s already very good, but it could easily be better and I’m sure other people might have some nice ideas about it as well.
Ah, I see. Thanks for the suggestion. We will investigate adding this in a native way. However you can already add such functionality using custom scripting that mirrors the Spline for the second object. Please find a sample script just for demonstration attached.
We are definitely looking for ways to improve and add features that makes using SpriteShape easier. Please feel free to post your suggestions/ideas/comments