mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
304 lines
11 KiB
Plaintext
304 lines
11 KiB
Plaintext
#usda 1.0
|
|
(
|
|
"""
|
|
Copyright © 2020 Apple Inc.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
This file describes the USD Interactive schemata for code generation.
|
|
"""
|
|
subLayers = [
|
|
@usd/schema.usda@,
|
|
@usdGeom/schema.usda@
|
|
]
|
|
)
|
|
|
|
over "GLOBAL" (
|
|
customData = {
|
|
string libraryName = "usdInteractive"
|
|
string libraryPath = "pxr/usd/usdInteractive"
|
|
string libraryPrefix = "UsdInteractive"
|
|
string tokensPrefix = "UsdInteractive"
|
|
}
|
|
) {
|
|
}
|
|
|
|
class "Preliminary_AnchoringAPI"
|
|
(
|
|
inherits = </APISchemaBase>
|
|
customData = {
|
|
token apiSchemaType = "singleApply"
|
|
}
|
|
doc = """
|
|
API schema that specifies that the prim and its children should be
|
|
placed relative to a detected plane, image, or face.
|
|
|
|
When applied to a prim, this API schema allows the runtime to determine
|
|
the transform of that prim and its children independently from its
|
|
parent transform.
|
|
|
|
\\section Anchor Layering
|
|
|
|
When one or more anchorable prims are defined beneath another anchorable
|
|
prim, each anchorable prim will be positioned independently and the
|
|
positions of its non-anchorable children will be located relative to it.
|
|
|
|
\\note
|
|
Due to the independent nature of anchorable prims, it is recommended
|
|
that each anchorable prim be placed at the top level of your content.
|
|
This also helps make it clear that each subtree has its transform
|
|
independently calculated by the runtime.
|
|
"""
|
|
)
|
|
{
|
|
uniform token preliminary:anchoring:type (
|
|
allowedTokens = ["plane", "image", "face", "none"]
|
|
doc = """
|
|
Defines the type of anchoring for the prim. This is a required
|
|
property for this schema.
|
|
|
|
plane: The content will be placed along the normal and the center of
|
|
the detected plane.
|
|
image: The content will be placed along the normal and center of the
|
|
detected image.
|
|
face: The content will be placed along the normal and at the center
|
|
of the detected face.
|
|
none: The content will not be anchored. This is equivalent to not
|
|
applying the anchoring API schema to a prim at all.
|
|
"""
|
|
)
|
|
|
|
uniform token preliminary:planeAnchoring:alignment (
|
|
allowedTokens = ["horizontal", "vertical", "any"]
|
|
doc = """
|
|
Specifies the kind of detected plane the prim and its children
|
|
should be placed relative to. This property is only active if the
|
|
anchoring type is "plane".
|
|
|
|
horizontal: Horizontal planes include floors, tables, ceilings, and more.
|
|
vertical: Vertical planes include walls, doors, windows, and more.
|
|
"""
|
|
)
|
|
|
|
rel preliminary:imageAnchoring:referenceImage (
|
|
doc = """
|
|
Specifies the kind of detected image reference the prim and its
|
|
children should be placed relative to. This property is only active
|
|
if the anchoring type is "image".
|
|
|
|
\\note
|
|
This should point to a prim with the type "ReferenceImage".
|
|
"""
|
|
)
|
|
}
|
|
|
|
class Preliminary_ReferenceImage "Preliminary_ReferenceImage" (
|
|
doc = """
|
|
Defines an image anchoring reference, which includes the image and its
|
|
physical width.
|
|
"""
|
|
inherits = </Typed>
|
|
)
|
|
{
|
|
uniform asset image (
|
|
doc = """
|
|
The image to which this prim should be placed relative to. This
|
|
should point to an image. This property is only active if the
|
|
anchoring type is "image".
|
|
|
|
\\note
|
|
In a USDZ, the only valid image types are png and jpeg (any of the
|
|
multiple common extensions for jpeg).
|
|
"""
|
|
)
|
|
|
|
uniform double physicalWidth = 0.0 (
|
|
doc = """
|
|
Specifies the physical, real-world width, defined in centimeters to
|
|
avoid unit changes due to composition, of the image to which this prim
|
|
should be placed relative to. This property can be used as a reference
|
|
for AR runtimes to determine the approximate image size to look for
|
|
and anchor this content to. This property is only active if the
|
|
anchoring type is "image".
|
|
|
|
\\note
|
|
This property is not affected by its transform hierarchy as it
|
|
describes a physical width in the real world.
|
|
|
|
\\note
|
|
The height is not required because it can be determined based on the
|
|
aspect ratio of the image.
|
|
"""
|
|
)
|
|
}
|
|
|
|
class Preliminary_Behavior "Preliminary_Behavior" (
|
|
doc = """A Behavior encapsulates a set of triggers and their associated actions."""
|
|
inherits = </Typed>
|
|
customData = {
|
|
string className = "Preliminary_Behavior"
|
|
}
|
|
)
|
|
{
|
|
rel triggers (
|
|
doc = """
|
|
List of \a Trigger prims that will execute the list of \p actions.
|
|
"""
|
|
)
|
|
rel actions (
|
|
doc = """
|
|
List of \a Action prims that are performed when elements of \p triggers
|
|
are executed. These actions are executed serially. @see GroupAction
|
|
"""
|
|
)
|
|
uniform bool exclusive = false (
|
|
doc = """
|
|
Determines whether this behavior can be executed exclusively to other
|
|
behaviors.
|
|
Valid values are:
|
|
- true: If a trigger in this behavior is executed, other exclusive
|
|
behaviors will stop performing their actions.
|
|
- false: Other actions in other behaviors can run concurrently
|
|
with this behavior. (Default)
|
|
"""
|
|
)
|
|
}
|
|
|
|
class "Preliminary_Trigger" (
|
|
doc = """A Trigger represents an event that when executed, causes an *action*
|
|
to be performed.
|
|
Triggers can be executed by:
|
|
- User input: e.g. a tap gesture
|
|
- Scene state: e.g. proximity to the camera
|
|
- Programmatically: e.g. as a result of application state or other event
|
|
This is the base class for all Behavior triggers.
|
|
"""
|
|
inherits = </Typed>
|
|
customData = {
|
|
string className = "Preliminary_Trigger"
|
|
}
|
|
)
|
|
{
|
|
uniform token info:id (
|
|
doc = """The id is the identifier for the type or purpose of the trigger.
|
|
E.g. TapGesture, ProximityToCamera
|
|
The value of this id is interpreted by the runtime implementation of the
|
|
behavior system.
|
|
"""
|
|
)
|
|
}
|
|
|
|
class "Preliminary_Action" (
|
|
doc = """An Action is performed when a *Trigger* is executed.
|
|
Performing an action is how a Behavior modifies the state of the scene dynamically.
|
|
For example, an action might start an animation playing, change the transform
|
|
of an *Xformable*, or start looping audio.
|
|
|
|
This is the base class for Behavior actions"""
|
|
inherits = </Typed>
|
|
customData = {
|
|
string className = "Preliminary_Action"
|
|
}
|
|
)
|
|
{
|
|
uniform token info:id (
|
|
doc = """The id is the identifier for the type or purpose of the action.
|
|
E.g. Impulse, Group
|
|
The value of this id is interpreted by the runtime implementation of the
|
|
behavior system.
|
|
"""
|
|
)
|
|
uniform token multiplePerformOperation= "ignore" (
|
|
allowedTokens = ["ignore", "allow", "stop"]
|
|
doc = """Defines how this action handles a request be performed again while
|
|
already running.
|
|
Valid values are:
|
|
- allow: Perform the action again, effectively restarting it.
|
|
- ignore: Ignore the perform request, and continue running the current action.
|
|
- stop: Stops the current action.
|
|
"""
|
|
)
|
|
}
|
|
|
|
class Preliminary_Text "Preliminary_Text" (
|
|
doc = """Defines 3D extruded text geometry in the scene"""
|
|
inherits = </Gprim>
|
|
)
|
|
{
|
|
string content = "" (
|
|
doc = """
|
|
Text contents. This string may include line breaks which will be honored.
|
|
"""
|
|
)
|
|
string[] font (
|
|
doc = """
|
|
An array of font names. They will be traversed in order and the first one that matches an
|
|
available font will be used. If no font matches exactly the behavior is undefined, although
|
|
there may be some attempt to find a related font. The font name string contains the family
|
|
and any styling attributes.
|
|
"""
|
|
)
|
|
float pointSize = 144.0 (
|
|
doc = """
|
|
Font size in points.
|
|
"""
|
|
)
|
|
float width (
|
|
doc = """
|
|
Width (X) of the text bounding rectangle in scene units. Must be positive. Is ignored
|
|
if wrapMode is set to singleLine.
|
|
"""
|
|
)
|
|
float height (
|
|
doc = """
|
|
Height (Y) of the text bounding rectangle in scene units. Must be positive. Is ignored
|
|
if wrapMode is set to singleLine.
|
|
"""
|
|
)
|
|
float depth = 0 (
|
|
doc = """
|
|
Extrusion depth (Z) in scene units. Must be non-negative. The geometry is visible from
|
|
both sides even for a zero extrusion depth.
|
|
"""
|
|
)
|
|
token wrapMode = "flowing" (
|
|
allowedTokens = ["singleLine", "hardBreaks", "flowing"]
|
|
doc = """
|
|
Hint about the intent of the text flow.
|
|
singleLine: The entire content is a single line
|
|
hardBreaks: The content contains line breaks and no other line breaking is allowed
|
|
flowing: The content can flow in the bounds by adding line breaks
|
|
"""
|
|
)
|
|
token horizontalAlignment = "center" (
|
|
allowedTokens = ["left", "center", "right", "justified"]
|
|
doc = """
|
|
Placement of each line relative to the bounding rectangle.
|
|
left: Left-align each line
|
|
center: Center-align each line
|
|
right: Right-align each line
|
|
justified: Left-align each line, and add spacing between words to right-align also, if possible
|
|
"""
|
|
)
|
|
token verticalAlignment = "middle" (
|
|
allowedTokens = ["top", "middle", "lowerMiddle", "baseline", "bottom"]
|
|
doc = """
|
|
Vertical placement of the text.
|
|
For a single line the alignment is relative to font features:
|
|
top: ascender
|
|
middle: center of capital letters
|
|
lowerMiddle: center of lowercase letters
|
|
baseline: baseline
|
|
bottom: descender
|
|
For multi-line text the alignment is relative to the bounds:
|
|
top: lines aligned with the top
|
|
middle, lowerMiddle: lines together with equal space above and below
|
|
baseline, bottom: lines aligned with the bottom
|
|
"""
|
|
)
|
|
}
|