Conform Meshes#
Key: conformMeshes
The conform meshes operation runs before merge. Within each merge boundary it makes the
meshes compatible with each other, so that meshes merge would otherwise keep apart, or merge while losing data,
are merged.
Meshes are grouped as merge groups them, using the same mergePoint and considerMaterials arguments, but
ignoring the differences listed below. A mesh is only changed to match the meshes in its own group. Differences that
keep groups apart, for example subdivisionScheme, orientation, purpose, applied schemas, a UV set st1 or
st2 on only some meshes, normals on only some meshes when they are not generated, or the material when
considerMaterials is on, are logged and left alone. The other merge grouping arguments are assumed to be at
their defaults.
It makes these changes, and logs each one:
Normals or UVs that some meshes of a group have and others lack are generated for the others, with
generateNormalsandgenerateProjectionUVsat their default settings. Nothing is generated when no mesh of the group has them, as the meshes merge as they are. The projected UVs fill the gap so the meshes merge, they are not authored to suit a textured material. Normals are only generated when the meshes’subdivisionSchemeisnone, as USD says normals should not be authored on a subdivision surface, which computes its own. An unauthoredsubdivisionSchemeiscatmullClark. A mesh has normals ifnormalsorprimvars:normalsis authored on it. Generated normals are written toprimvars:normals, andmergecombines them with thenormalsattribute of other meshes, each face keeping its own normals.A UV set named
ston some meshes andst0on others is renamed to the name most of the meshes use (stif the counts are equal). Generated UVs take that name and are not counted. A mesh whose bound material reads its UV set by name, through aUsdPrimvarReader_float2, keeps that name, and when all such meshes use the same name the other meshes are renamed to it. A material that picks its UVs another way, for example by texture coordinate index, is not checked.A primvar that some meshes have and others lack is added to the others as a constant value, taken from
primvarDefaultsor else zero for numbers and empty for strings and tokens. A missingdisplayColoris filled with 0.18 grey and a missingdisplayOpacitywith 1. A default that does not fit the primvar’s type, including a number outside the type’s range,infornan, is logged and not used.Where
doubleSideddiffers, it is set to true on every mesh in the group. A single-sided mesh therefore shows its back faces after the merge.
Meshes that still lack normals or UVs that others in the group have, because they were not generated, are only renamed,
filled and set double-sided to match each other, as merge keeps them apart from the rest.
It also logs, and leaves alone, the differences within a group it cannot reconcile: primvars with the same name but a
different value type, primvars of a type merge cannot combine or with an element size above 1, a mesh that has both
st and st0, a UV set that cannot be renamed because its material reads it by name, its values or indices have
time samples, or it is authored in a layer other than the edit target, UVs that some meshes lack when generateUVs is
off, normals that some meshes lack when generateNormals is off or the meshes are subdivision surfaces, and normals or
UVs that could not be generated for a mesh.
merge still keeps such meshes apart, or drops the primvar.
Recommended pipelines#
conformMeshes then merge.
Starting configurations#
Make every mesh under the stage mergeable:
[{"operation": "conformMeshes"}, {"operation": "merge"}]
Arguments#
Meshes to Conform#
Optional list of prim paths to consider
Name:
meshPrimPathsType:
[string]Default Value:
[]
Generate Normals#
Generate normals for meshes that lack them when other meshes in the same merge boundary have them. Normals are not generated for subdivision surfaces, only for subdivisionScheme none
Name:
generateNormalsType:
boolDefault Value:
True
Generate UVs#
Generate UVs for meshes that lack them when other meshes in the same merge boundary have them
Name:
generateUVsType:
boolDefault Value:
True
Primvar Defaults#
Values to give a primvar on the meshes that lack it, as name=value, for example tint=0.5,0.5,0.5. A primvar with no default gets zero, or empty for strings and tokens
Name:
primvarDefaultsType:
[string]Default Value:
[]
Merge Boundary#
The boundary of where to merge meshes, for example, only merge meshes within a model
Name:
mergePointType:
intDefault Value:
0Enum Values:
0: Stage7: Root Prim8: Parent Prim1: Parent Xform9: Original Prim2: Kind: Assembly3: Kind: Group4: Kind: Component5: Kind: Model6: Kind: Subcomponent
Keep Materials Separate#
Whether separate mesh prims will be created for each material that can be merged. When off, meshes with differing materials can be merged under a single mesh prim using GeomSubsets for each material.
Name:
considerMaterialsType:
boolDefault Value:
False