Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Plane primitive to UsdGeom. #1819

Merged
merged 4 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pxr/usd/usdGeom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pxr_library(usdGeom
motionAPI
nurbsCurves
nurbsPatch
plane
pointBased
pointInstancer
points
Expand Down Expand Up @@ -86,6 +87,7 @@ pxr_library(usdGeom
wrapMotionAPI.cpp
wrapNurbsCurves.cpp
wrapNurbsPatch.cpp
wrapPlane.cpp
wrapPointBased.cpp
wrapPointInstancer.cpp
wrapPoints.cpp
Expand Down
121 changes: 121 additions & 0 deletions pxr/usd/usdGeom/generatedSchema.usda
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,127 @@ class Cone "Cone" (
)
}

class Plane "Plane" (
doc = """Defines a primitive plane, centered at the origin, and is defined by
a cardinal axis, width, and length. The plane is double-sided by default.

The axis of width and length are perpendicular to the plane's axis:

axis | width | length
----- | ------ | -------
X | z-axis | y-axis
Y | x-axis | z-axis
Z | x-axis | y-axis

"""
)
{
uniform token axis = "Z" (
allowedTokens = ["X", "Y", "Z"]
doc = """The axis along which the surface of the plane is aligned. When set
to 'Z' the plane is in the xy-plane; when axis is 'X' the plane is in
the yz-plane, and when axis is 'Y' the plane is in the xz-plane.

\\sa UsdGeomGprim::GetAxisAttr()."""
)
uniform bool doubleSided = 1 (
doc = """Planes are double-sided by default. Clients may also support
single-sided planes.

\\sa UsdGeomGprim::GetDoubleSidedAttr()"""
)
float3[] extent = [(-1, -1, 0), (1, 1, 0)] (
doc = """Extent is re-defined on Plane only to provide a fallback
value. \\sa UsdGeomGprim::GetExtentAttr()."""
)
double length = 2 (
doc = """The length of the plane, which aligns to the y-axis when axis is
'Z' or 'X', or to the z-axis when axis is 'Y'. If you author length
you must also author extent.

\\sa UsdGeomGprim::GetExtentAttr()"""
)
uniform token orientation = "rightHanded" (
allowedTokens = ["rightHanded", "leftHanded"]
doc = """Orientation specifies whether the gprim's surface normal
should be computed using the right hand rule, or the left hand rule.
Please see for a deeper explanation and
generalization of orientation to composed scenes with transformation
hierarchies."""
)
color3f[] primvars:displayColor (
doc = '''It is useful to have an "official" colorSet that can be used
as a display or modeling color, even in the absence of any specified
shader for a gprim. DisplayColor serves this role; because it is a
UsdGeomPrimvar, it can also be used as a gprim override for any shader
that consumes a displayColor parameter.'''
)
float[] primvars:displayOpacity (
doc = """Companion to displayColor that specifies opacity, broken
out as an independent attribute rather than an rgba color, both so that
each can be independently overridden, and because shaders rarely consume
rgba parameters."""
)
rel proxyPrim (
doc = '''The proxyPrim relationship allows us to link a
prim whose purpose is "render" to its (single target)
purpose="proxy" prim. This is entirely optional, but can be
useful in several scenarios:

- In a pipeline that does pruning (for complexity management)
by deactivating prims composed from asset references, when we
deactivate a purpose="render" prim, we will be able to discover
and additionally deactivate its associated purpose="proxy" prim,
so that preview renders reflect the pruning accurately.

- DCC importers may be able to make more aggressive optimizations
for interactive processing and display if they can discover the proxy
for a given render prim.

- With a little more work, a Hydra-based application will be able
to map a picked proxy prim back to its render geometry for selection.

\\note It is only valid to author the proxyPrim relationship on
prims whose purpose is "render".'''
)
uniform token purpose = "default" (
allowedTokens = ["default", "render", "proxy", "guide"]
doc = """Purpose is a classification of geometry into categories that
can each be independently included or excluded from traversals of prims
on a stage, such as rendering or bounding-box computation traversals.

See for more detail about how
purpose is computed and used."""
)
token visibility = "inherited" (
allowedTokens = ["inherited", "invisible"]
doc = '''Visibility is meant to be the simplest form of "pruning"
visibility that is supported by most DCC apps. Visibility is
animatable, allowing a sub-tree of geometry to be present for some
segment of a shot, and absent from others; unlike the action of
deactivating geometry prims, invisible geometry is still
available for inspection, for positioning, for defining volumes, etc.'''
)
double width = 2 (
doc = """The width of the plane, which aligns to the x-axis when axis is
'Z' or 'Y', or to the z-axis when axis is 'X'. If you author width
you must also author extent.

\\sa UsdGeomGprim::GetExtentAttr()"""
)
uniform token[] xformOpOrder (
doc = """Encodes the sequence of transformation operations in the
order in which they should be pushed onto a transform stack while
visiting a UsdStage's prims in a graph traversal that will effect
the desired positioning for this prim and its descendant prims.

You should rarely, if ever, need to manipulate this attribute directly.
It is managed by the AddXformOp(), SetResetXformStack(), and
SetXformOpOrder(), and consulted by GetOrderedXformOps() and
GetLocalTransformation()."""
)
}

class "PointBased" (
doc = """Base class for all UsdGeomGprims that possess points,
providing common attributes such as normals and velocities."""
Expand Down
1 change: 1 addition & 0 deletions pxr/usd/usdGeom/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ TF_WRAP_MODULE
TF_WRAP(UsdGeomCube);
TF_WRAP(UsdGeomCylinder);
TF_WRAP(UsdGeomSphere);
TF_WRAP(UsdGeomPlane);
TF_WRAP(UsdGeomPointBased);
TF_WRAP(UsdGeomMesh);
TF_WRAP(UsdGeomNurbsPatch);
Expand Down
Loading