The '''StaticMesh''' component is used to load a static mesh asset from the Uri specified in `URL`
The '''StaticMesh''' component is used to load a static mesh asset from the Uri specified in `URL`
Generally, you will not need to use this component directly, as it is created automatically when importing a new mesh, or when baking a [[:Category:Components:Assets:Procedural Meshes|Procedural Mesh]]
Generally, you will not need to use this component directly, as it is created automatically when importing a new mesh, or when baking a [[:Category:Components:Assets:Procedural Meshes|Procedural Mesh]] using the Sync Method <code>BakeMesh()</code>
<!--T:2-->
<!--T:2-->
Line 16:
Line 16:
{{Table ComponentFields
{{Table ComponentFields
|URL|Uri| The Uri pointing to the .meshx asset to be loaded
|URL|Uri| The Uri pointing to the .meshx asset to be loaded
|Readable|Bool|
|Readable|Bool| Whether this component's data can be read via protoflux.
}}
}}
<!--T:3-->
<!--T:3-->
== Sync Delegates ==
{{Table ComponentTriggers
|RecalculateNormals:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false|Will recalculate all of the vertex normals on the mesh.
|RecalculateNormalsMerged:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Recalculates this meshes vertex normals which effects shading.
|RecalculateTangentsSimple:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Recalulates mesh tangents which affect shading. Simple mode.
|RecalculateTangentsMikktspace:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Recalcates mesh tangents which affect shading. This is Mikkspace which is defined by UnityEngine's definition.
|RecalculateBlendshapeNormals:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Recalculate the normals of blendshape data.
|RecalculateBlendshapeNormalsMerged:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Recalculate the normals of blendshape data. Merged mode.
|RecalculateBlendshapeTangentsMikktspace:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Recalculate the normals of blendshape data in Mikktspace.
|FlipNormals:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false|Flips the vertex normals of the mesh (used to fix issues with shadows being on the lit side of a mesh)
|ReverseWinding:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false|Reverses the vertex winding order of the mesh (used to fix issues where mesh is "inside out")
|MakeDualSided:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false|Duplicates all vertices on the mesh, but with an inverted winding, which allows it to be seen from both sides.
|ConvertToFlatShading:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false|Duplicates all shared vertices on the mesh, so that the vertex normals for a given face can be perpendicular, resulting in a faceted (or "flat") look.
|MergeDoubles:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Merges all the vertices in the exact same place on the mesh.
|StripEmptyBlendshapes:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Strips blendshapes from the mesh that don't move any vertices.
|MergeBlendshapes:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Merges the blendshapes and returns a task that will complete in the future with a boolean.
|StripBlendshapeNormals:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Gets rid of per shapekey normal data
|StripBlendshapeTangents:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Gets rid of per shapekey tangent data.
|TrimBoneWeightCount:[[Type:Func`2|Func`2]]<[[Type:Int|Int]], [[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`2|Func`2]]<[[Type:Int|Int]], [[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Reduces the amount of bones allowed to be weighted to a mesh per vertex.
|ConvertToConvexHull:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| creates a Convex Hull Mesh from this mesh. Which a good analogy is wrapping the mesh in plastic wrap for a new shape.
|ConvertToPointCloud:[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`1|Func`1]]<[[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Creates a mesh that is a cloud of points using the vertices of this mesh.
|TranslateUVs:[[Type:Func`3|Func`3]]<[[Type:Float4|Float4]], [[Type:Float4|Float4]], [[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|[[Type:Func`3|Func`3]]<[[Type:Float4|Float4]], [[Type:Float4|Float4]], [[Type:Task`1|Task`1]]<[[Type:Bool|Bool]]>>|false| Transforms the mesh UVs around.
|ResaveMesh:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Resaves the mesh recieved on the client to the cloud. can fix syncing issues with other users.
|RecalculateNormals:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|RecalculateNormalsMerged:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|RecalculateTangentsSimple:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|RecalculateTangentsMikk:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|RecalculateBlendshapeNormals:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|RecalculateBlendshapeNormalsMerged:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|RecalculateBlendshapeTangentsMikk:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|FlipNormals:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|ReverseWinding:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|MakeDualSided:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|ConvertToFlatShading:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|MergeDoubles:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|StripEmptyBlendshapes:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|MergeBlendshapes:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|StripBlendshapeNormals:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|StripBlendshapeTangents:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Use above function instead.
|TrimBoneWeightCount:[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Type:Int|Int]]>|[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Type:Int|Int]]>|true| Use above function instead.
|ConvertToConvexHull:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Converts the mesh to a convex hull.
|ConvertToPointCloud:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Converts the mesh to a point cloud.
|GetBoneList:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Creates a dialog that shows the bone list.
|GetBoneData:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Creates a dialog that shows the bone data.
|ScaleUVs:[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Component:FloatTextEditorParser|FloatTextEditorParser]]>|[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Component:FloatTextEditorParser|FloatTextEditorParser]]>|true| Scales the UVs by the recieved size.
}}
== Usage ==
== Usage ==
Attach to a slot, provide a <code>URL</code> and insert into a [[Component:SkinnedMeshRenderer]] or [[Component:MeshRenderer]]. Don't forget the [[Material]](s).
{| class="wikitable" style="font-size:10pt;"
! colspan="2" style="background: lightblue; font-size:10pt;" | Custom UI Elements
| Will generate a new asset and URL, without destroying or modifying the previous one.
|-
| Recalculate Normals
| Will recalculate all of the vertex normals on the mesh.
|-
| Recalculate Normals (Smooth Shading)
|
|-
| Recalculate Tangents (Mikktspace)
|
|-
| Recalculate Tangents (Simple)
|
|-
| Flip Normals
| Flips the vertex normals of the mesh (used to fix issues with shadows being on the lit side of a mesh)
|-
| Reverse Winding
| Reverses the vertex winding order of the mesh (used to fix issues where mesh is "inside out")
|-
| Make Dual Sided
| Duplicates all vertices on the mesh, but with an inverted winding, which allows it to be seen from both sides.
|-
| Convert to Flat Shading
| Duplicates all shared vertices on the mesh, so that the vertex normals for a given face can be perpendicular, resulting in a faceted (or "flat") look.
|-
| Convert to Convex Hull
|
|-
| Convert to Point Cloud
|
|-
| Merge Doubles
|
|-
| Strip Empty Blendshapes
|
|-
| Strip Blendshape Normals
|
|-
| Strip Blendshape Tangents
|
|-
| Get Bone List
|
|-
| Get Bone Data
|
|-
| Trim Vertex Bone Weights To <i>X</i>
| Trims the number of bones affecting any vertex in the mesh to 1, 2, 3 or 4 Bones.
|-
|Scale UVs
|Multiplies the texture coordinates of the mesh by the given value.
The StaticMesh component is used to load a static mesh asset from the Uri specified in `URL`
Generally, you will not need to use this component directly, as it is created automatically when importing a new mesh, or when baking a Procedural Mesh using the Sync Method BakeMesh()