Mesh Prims#
Utility functions to create polygonal UsdGeomMesh
Prims.
See UsdGeomMesh for details.
Functions#
- pxr::UsdGeomMesh usdex::core::definePolyMesh(pxr::UsdPrim parent, const std::string &name, const pxr::VtIntArray &faceVertexCounts, const pxr::VtIntArray &faceVertexIndices, const pxr::VtVec3fArray &points, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec2fPrimvarData > uvs=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a basic polygon mesh on the stage.
- pxr::UsdGeomMesh usdex::core::definePolyMesh(pxr::UsdStagePtr stage, const pxr::SdfPath &path, const pxr::VtIntArray &faceVertexCounts, const pxr::VtIntArray &faceVertexIndices, const pxr::VtVec3fArray &points, std::optional< const Vec3fPrimvarData > normals=std::nullopt, std::optional< const Vec2fPrimvarData > uvs=std::nullopt, std::optional< const Vec3fPrimvarData > displayColor=std::nullopt, std::optional< const FloatPrimvarData > displayOpacity=std::nullopt)
Defines a basic polygon mesh on the stage.
Functions#
- pxr::UsdGeomMesh usdex::core::definePolyMesh(
- pxr::UsdPrim parent,
- const std::string &name,
- const pxr::VtIntArray &faceVertexCounts,
- const pxr::VtIntArray &faceVertexIndices,
- const pxr::VtVec3fArray &points,
- std::optional<const Vec3fPrimvarData> normals = std::nullopt,
- std::optional<const Vec2fPrimvarData> uvs = std::nullopt,
- std::optional<const Vec3fPrimvarData> displayColor = std::nullopt,
- std::optional<const FloatPrimvarData> displayOpacity = std::nullopt,
Defines a basic polygon mesh on the stage.
This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.
- Parameters:
parent – Prim below which to define the mesh
name – Name of 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 vertexpoints – 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
- pxr::UsdGeomMesh usdex::core::definePolyMesh(
- pxr::UsdStagePtr stage,
- const pxr::SdfPath &path,
- const pxr::VtIntArray &faceVertexCounts,
- const pxr::VtIntArray &faceVertexIndices,
- const pxr::VtVec3fArray &points,
- std::optional<const Vec3fPrimvarData> normals = std::nullopt,
- std::optional<const Vec2fPrimvarData> uvs = std::nullopt,
- std::optional<const Vec3fPrimvarData> displayColor = std::nullopt,
- std::optional<const FloatPrimvarData> displayOpacity = std::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 bothnormals
andprimvars: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 vertexpoints – 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