Have you ever tried to create an extensive fence or curvy hose in your Unity scene? Scabrous task: the best way to do this till now - open up your 3D editing program, load a straight object and deform it roughly to your scene. Bored from limitations on objects length due to inability to place it on hilly landscape? Now you got the solution!
SplineBend allows you to deform your object, causing it to take the form of a spline. With the help of this script you can create create perfectly bended objects directly in your Unity scene.
Add object you want to deform to your Unity scene, and add SplineScript component to it. On both sides of the object two primary markers will appear. Place the markers to the desired trajectory. In order to move the marker - highlight it by clicking and drag it the same way as an ordinary game object. To add a marker - Ctrl-right click on the line between the markers. To delete a marker - just select it and press Delete key.
You can use different marker types:
smooth automatically creates a smooth curve between two adjacent markers;
transform sets the spline direction by transform rotation and smoothness by transform scale;
beizer or beizer corner allows to configure spline manually with handles;
corner always creates sharp corners without smoothing.
This tool allows you to create object of almost any length by tiling an object - just like a texture - the object geometry will repeat itself the stated amount of times.
And besides, SplineBend allows level-designer to bind object to terrain or any other mesh with collision. Binded object would follow all terrain curves and slopes. This is extremely useful for creating roads or decals.
Advantages:
time economy and quality improvement as compared with deforming objects in 3D editor;
possibility to create roads or other long decals: see the video;
I missed totally the release of this tool …just purchased… and seem a great tool…very easy and very useful.
I think that this tool needs(and merits) more visibility!
My wishes:
Upgrade mesh supported: support of meshes with more then one material.
UV optimizing: option to mantain(o recreate) the UV mapping uniform .
Mesh optimizing: auto-removing of overlapped faces on tiling.
enhancements: Add two slot to insert a start and end mesh (not procedurally deformable…just as caps).
Thank you sjm tech and emergki for your reviews, it is good to hear that someone found this tool useful.
And thanks for suggestions - the help of feedbacks could not be overestimated.
Actually, markers are transforms. You can add cap objects as their children. If you add caps to first and final marker and set marker type to “transform” you will get exactly what is needed. But sure I will think about interface or something to create caps in a more convenient way.
Do you need just to remove overlapping faces, or to cut (slice) your mesh nicely? The first case can be done easy - but do you really need such a function? Most probably the mesh with a removed faces will look wrong…
I dont understand it clearly - is mapping lost after deforming (maybe some kind of bug - it should be maintained)? Or do you mean something like planar mapping casted from the top and verts uvs should change with vert position?
Oh, I know its a considerable limitation. I will see what I can do with it, but its not an easy enhancement.
If someone has more ideas - I would be glad to hear them. And and if you really like the tool (or maybe you dont:smile:) - do not forget to rate rate it in Asset Store.
Yes alredy done but, as you said, is not very handy and the cap object mantains rotation (needs a manual rotation to be in the right position).
example: simple wall extrusion plus 2 caps (before and after the deformation).
i mean, for example, if i’m deforming a cube and I add 2 tiles, I obtain a mesh with 2 faces overlapping (between one cube and the next one). could be nice to have a function to remove overlapping faces at the end of tuning and recreate the mesh (in this case the caps would not be necessary).
I Was thinking that deforming a mesh you deform also the uv.
Could be usefull to have a function to recreate the uv (for ex. cubed) to mantain the texture uniform.
Other little notes:
could be useful choose the axis (local x, y, z) of deformation. (now depends only by mesh data).
could be nice to deform more mesh together using the same marker paths.
add automatically a tile for each added marker.
find a way to preserve the original gameobject to come back at the begin of deformation process.
integrate a save(as obj) function to mantain the obtained mesh.
Usually Unity are very efficient and make review the next day - and this time no news for 5 days. I fixed readme and re-send for review - maybe in vain…
I just picked up this asset to use in a couple of projects.
I’m very happy so far although it would be great if the “drop to” feature could work with meshes as well as terrain. It would be awesome to be able to have a road/fence etc above a mesh and then use this tool to conform the object over it’s surface. Maybe with an option for resolution and/or smoothing over the mesh surface.
Scale at marker - allow scaling of the mesh at a marker point, for example to make a road wider at a certain point
Close spline - this would for example allow the creation of a complete race track
Random mesh - this would allow for example different rocks to be placed quickly following a spline, maybe with options for random rotation / position offset
Optimise mesh - after dropping to terrain optimise mesh, for example if a section of road is absolutely straight/flat then optimise geometry to be two triangles while retaining UV mapping
Allow editing of individual meshes (e.g. use SplineBend to quickly layout a row of barriers, then manually go in move the position/rotation of one of the meshes). Allow SplineBend to save these edits or reset.
You can assign first marker in the array of markers as the last one, so it will be in the beginning and in the end at the same time. The track should be closed.
Hm, SplineBend is not an appropriate tool for this. It does not deal with object transforms, only with meshes. But thats an idea to make a scatter plugin for unity.
Trees are my own models, they are from a game I’m working at, but unfortunately they are nor for sale… Maybe one day I’ll make a pack of trees to sell on asset store, but there will be no pines:) All rights for pones belong to my employer
Just bought this. Excellent tool but is there a way to finalise the editing so the items become separate meshes? I’m building a mobile game with a fence around the playing area, the fence is tiled 200 times and it would be nice if I could use occlusion culling as the vert count is a bit high.
Very interesting.
There’s one thing that’s not mentioned though: does it support lightmapping? (i.e. export the generated mesh)
I need this function because I plan to use it for large objects like fortress’ walls and similar.
If you make this feature, the day after I’ll buy immediately.
There are several scripts to export objects from Unity, I have 3 of these scripts that I found in the wiki and around, but I don’t know if your generated mesh is “visible” to these scripts.
Anyway, it would be nice to have this function integrated with your editor.
Unity is crashing on me when I add a Spline Bend script to the attached mesh, but only if it has a mesh collider applied. Can you please check this out, Wright?
Steps:
Import attached mesh
Add Mesh Collider
Add Spline Bend
For me, it crashes right then. Just drops back to the desktop and wants to send a crash report. Any ideas?
megmaltese, I’ll try to add lightmap support this weekend (as well as scalable markers), but it will take a couple of days for Unity to review a new version.
derkoi, I’ll make it in scope of “export to obj”, a bit later…