All MegaShapes will have some common values in the inspector and these are shown below, they allow you to alter how the splines are shown in Unity and also alter animation data or manually input position data. The common params can be hidden by click the ‘Common Params’ foldout. Paramaters specific to base spline shape will be shown after these common params.
Inspector Interface
The inspector for the common params for splines is shown in the image on the right.
Add Knot
Click this button to add a new knot just after the currently selected knot, if no knot is selected the new knot will be inserted at the beginning.
Delete Knot
Delete the currently selected knot.
Match Handles
If the tangent handles are out of alignment and a smooth transition through the point is required select the knot and then click this to match tangents.
Load
If you use 3ds Max you can use the MegaShapes exporter to export your Shapes from Max and load them complete with any animation data into Unity.
Load SXL
If you have the exporter for Max or Maya then this will load a shape file in the SXL format which is an XML based format.
AutoCurve
If you have been dragging points around and you click this it will attempt to normalize the curve to get the curve as smooth as possible, note this will change the shape of your curve in most cases.
Reverse
Sometimes it is required to have the spline go the other way, say if you are using one of the path following scripts, so clicking this will automatically reverse the spline for you.
Apply Scaling
If you have applied scaling to the spline in the Unity transform you can apply that scaling directly to the knot and handle values and have the scale value reset to 1, this will effectively recalculate the length of the spline taking the scaling into account so again if you are using the path follow scripts the distance value will make more sense being a real distance instead of a scaled one.
Import SVG
You can import SVG files in as splines by clicking this and selecting the SVG file.
Cursor
Controls the position of the editing cursor along the spline, if you add new knots they will be added at the cursor position.
Import Scale
Scaling factor for spline when importing.
Axis
When you create a shape such as a circle or star then it will be created in the XZ plane with an up axis of Y, if you want it to be create in another plane you can choose the up Axis here. This will change the whole spline.
Curve
If your shape has multiple splines you can select the one you are currently editing with this slider.
Colors
When drawn splines use two colors and you can define those here.
Vec Col
Color of the line from the handles to the knot.
Knot Size
Size of the knot.
Step Dist
Length of each piece of curve when drawn, make smaller to show smoother curves.
Do Late Update
Normalized Interp
Set to on to use an interp spline that takes distance into account making for more constant step.
Draw Handles
Display the handles or not.
Draw Knots
Display the knots or not.
Draw Spline
Display the curve or not.
Lock Handles
When on moving one handle will automatically update the other giving smooth results or keeping corner angles the same etc, turn off to have different in and out tangents.
Auto Smooth
If this option is on the system will try and keep the curve smooth as you add, delete or move knots and handles.
Handle Type
You can choose to edit the splines using position handles or free handles, on some systems position handles can slow the editor down if so try the free handle option here.
Labels
Show the spline knot numbers on the spline.
Hide Wire
If the spline has been turned into a mesh you can choose to hide the wireframe overlay of the polygons.
Animation Inspector
Animate
If the curve was imported and had animation data turn this on to play it. If this option is checked the animation params will be visible.
Time
Current time of the animation playback.
Loop Time
Length of animation
Speed
Playback speed
Loop Mode
Animation loop mode:
- Loop
- Clamp
- PingPong
Outline Spl
If you have pressed the ‘Outline’ Button then the system will create a new spline which you can offset from the original, if you have multiple outline splines in a shape you can choose the one to adjust with this slider and the outline value below will effect that spline .
Outline
The amount to outline by.
Make Mesh
You can at any time choose to turn your spline into a mesh with the option to fill it in, or to extrude shapes such as tubes, box or flat ribbon along it. If you check this box then more options will open up in the inspector and these are shown below in the meshing secion.
Spline Data Inspector
This part of the inspector allows you to manually input data for knots as well as see the length of the spline and other data.
Closed
Check this to turn the shape into a closed shape.
Length
This is a read only value that shows the current length of the spline.
Knots
Shows and allows you to manually input the positions of the knots for the spline.
Fill Meshing Options
Mesh Type
This controls which type of mesh is generated from the spline, Fill, Tube, Bx or Ribbon.
Pivot
You can control the position of the pivot in the created object by changing these values.
Calc Tangents
Turn this on if you are using shaders that require tangents for the mesh, ie bump mapping.
Gen UV
If you want to apply textures to the generated mesh you need to turn this on to generate UV mapping. You can control the UV mapping with the UV values below.
Doubled Sided
If you are creating a flat shape you may want it to be double sided, if so turn this on.
Height
The amount to extrude the filled in mesh, his allows you to give some depth to the created filled in mesh.
Use Height Crv
You can use a curve to describe the height to extrude around the mesh.
Height Curve
The curve that defines the height to extrude along the spline.
Height Off
You can control the starting point for the height curve on the spline to make adjusting it easier.
Top Mat
The material to use for the top of the filled in mesh.
Bot Mat
The material to use on the bottom of the filled in mesh.
Side Mat
If the mesh has been extruded then this is the material to use for the side.
Physical UV
If this is checked the UV coordinates will be calculated from the size of the mesh.
UV Offset
Change the UV mapping offset for the top and bottom uvs.
UV Rotate
Rotate the UVs for the top and bottom.
UV Scale
Scale the UVs for the top and bottom.
UV Offset1
Chage the UV mapping offset for the side uvs.
UV Rotate1
Rotate the side UVs
UV Scale1
Scale the side UVs
Tube Meshing Options
Pivot
You can control the position of the pivot in the created object by changing these values.
Calc Tangents
Turn this on if you are using shaders that require tangents for the mesh, ie bump mapping.
Gen UV
If you want to apply textures to the generated mesh you need to turn this on to generate UV mapping. You can control the UV mapping with the UV values below.
Start
The starting position along the spline to start making the mesh.
Length
The Length along the spline to turn into a mesh.
Rotate
Rotate the tube mesh around the spline.
Sides
The number of sides to the tube.
Radius
The radius of the tube.
Offset
Offset from the spline to the centre of the tube.
Strands
How many strands to make, can be used to make ropes etc.
Strands Radius
The radius to the centres of the strands.
Twist
If there is more than one strand then you can twist them like a rope, this is the amount of twist to apply.
Start Twist
The start twist value.
UV Offset
Offset used to position the uv mapping.
UV Tile X
How many times to scale the X axis of the UV mapping
UV Tile Y
How many times to scale the Y Axis of the UV mapping
Cap
If the tube is not on a closed spline and the length is not 0 then you can choose to close of the ends of the tube.
Up
The Up axis, if you get twisting of the mesh try changing this value.
Mat
The material to use for the mesh.
Box Meshing Options
Pivot
You can control the position of the pivot in the created object by changing these values.
Calc Tangents
Turn this on if you are using shaders that require tangents for the mesh, ie bump mapping.
Gen UV
If you want to apply textures to the generated mesh you need to turn this on to generate UV mapping. You can control the UV mapping with the UV values below.
Start
The starting position along the spline to start making the mesh.
Length
The Length along the spline to turn into a mesh.
Rotate
Rotate the box mesh around the spline.
Box Width
Width of the box.
Box Height
Height of the box.
Offset
Offset from the spline to the centre of the tube.
Strands
How many strands to make, can be used to make ropes etc.
Strands Radius
The radius to the centres of the strands.
Twist
If there is more than one strand then you can twist them like a rope, this is the amount of twist to apply.
Start Twist
The start twist value.
UV Offset
Offset used to position the uv mapping.
UV Tile X
How many times to scale the X axis of the UV mapping
UV Tile Y
How many times to scale the Y Axis of the UV mapping
Cap
If the tube is not on a closed spline and the length is not 0 then you can choose to close of the ends of the tube.
Up
The Up axis, if you get twisting of the mesh try changing this value.
Mat
The material to use for the mesh.
Ribbon Meshing Options
Pivot
You can control the position of the pivot in the created object by changing these values.
Calc Tangents
Turn this on if you are using shaders that require tangents for the mesh, ie bump mapping.
Gen UV
If you want to apply textures to the generated mesh you need to turn this on to generate UV mapping. You can control the UV mapping with the UV values below.
Start
The starting position along the spline to start making the mesh.
Length
The Length along the spline to turn into a mesh.
Width
Width of the ribbon.
Axis
The axis to make the ribbon on.
Rotate
Rotate the ribbon mesh around the spline.
Segs
How many segments across the ribbon.
Offset
Offset from the spline to the centre of the tube.
Strands
How many strands to make, can be used to make ropes etc.
Strands Radius
The radius to the centres of the strands.
Twist
If there is more than one strand then you can twist them like a rope, this is the amount of twist to apply.
Start Twist
The start twist value.
UV Offset
Offset used to position the uv mapping.
UV Tile X
How many times to scale the X axis of the UV mapping
UV Tile Y
How many times to scale the Y Axis of the UV mapping
Cap
If the tube is not on a closed spline and the length is not 0 then you can choose to close of the ends of the tube.
Up
The Up axis, if you get twisting of the mesh try changing this value.
Mat
The material to use for the mesh.
Controlling Shapes from Script
There is a complete API for building and using splines from script and you can find the help page for that Here.
Video of Meshing Options
Small video guides to the basic meshing options in MegaShapes.
You must be logged in to post a comment.