omni::connect::core::definePolyMesh

Defined in omni/connect/core/MeshAlgo.h

pxr::UsdGeomMesh omni::connect::core::definePolyMesh(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::VtIntArray &faceVertexCounts, const pxr::VtIntArray &faceVertexIndices, const pxr::VtVec3fArray &points, carb::cpp::optional<const Vec3fPrimvarData> normals = carb::cpp::nullopt, carb::cpp::optional<const Vec2fPrimvarData> uvs = carb::cpp::nullopt, carb::cpp::optional<const Vec3fPrimvarData> displayColor = carb::cpp::nullopt, carb::cpp::optional<const FloatPrimvarData> displayOpacity = carb::cpp::nullopt)

Defines a basic polygon mesh on the stage.

Attribute values will be validated and in the case of invalid data the Mesh will not be defined. An invalid UsdGeomMesh object will be returned in this case.

A “Subdivision Scheme” of “None” is authored to ensure that the Mesh is not treated as a subdivision surface. For this reason there is no support for authoring subdivision surface attributes during definition.

Values will be authored for all attributes required to completely describe the Mesh, even if weaker matching opinions already exist.

  • Face Vertex Counts

  • Face Vertex Indices

  • Points

  • Extent

The orientation of the Mesh is assumed to be “Right Handed”. The winding order of the data should be reversed in advance if that is not the case.

The “extent” of the Mesh will be computed and authored based on the points provided.

The following common primvars can optionally be authored at the same time using a PrimvarData to specify interpolation, data, and optionally indices or elementSize.

  • Normals

  • Primary UV Set

  • Display Color

  • Display Opacity

Normals are authored as primvars:normals so that indexing is possible and to ensure that the value takes precedence in cases where both normals and primvars:normals are authored. See UsdGeomPointBased for details.

The primary uv set will be named based on the result of UsdUtilsGetPrimaryUVSetName(). By default the name is “st” but can be configured by extension. See UsdUtils Pipeline for details.

Parameters
  • stage – The stage on which to define the mesh

  • path – The absolute prim path at which to define the mesh

  • faceVertexCounts – The number of vertices in each face of the mesh

  • faceVertexIndices – Indices of the positions from the points to use for each face vertex

  • points – Vertex positions for the mesh described in local space

  • normals – Values to be authored for the normals primvar

  • uvs – Values to be authored for the uv primvar

  • displayColor – Values to be authored for the display color primvar

  • displayOpacity – Values to be authored for the display opacity primvar

Returns

UsdGeomMesh schema wrapping the defined UsdPrim