FnUsdAbstractionLib 0.6.0
|
#include <SchemaProperty.h>
Public Member Functions | |
SchemaProperty () | |
Default ctor builds an empty (invalid) SchemaProperty. | |
SchemaProperty (int category, Value::Type type, const char *name, const Value &value, size_t arraySize=0) | |
SchemaProperty (int category, Value::Type type, const char *name, const Value &value, const fdk::KeyValueMap &metadata) | |
SchemaProperty (int category, Value::Type type, const char *name, const fdk::KeyValueMap &metadata=fdk::KeyValueMap()) | |
SchemaProperty (int category, Value::Type type, const char *name, const Value &value, size_t arraySize, const fdk::KeyValueMap &metadata, const fdk::KeyValueMap &hints, const fdk::StringList &options) | |
SchemaProperty (const SchemaProperty &) | |
If const property reference is valid any localized property data is NOT copied. | |
SchemaProperty & | operator= (const SchemaProperty &) |
virtual | ~SchemaProperty () |
Dtor in implementation required for std::unique_ptr to work. | |
bool | isValid () const |
True if SchemaPropertyHandle has either a valid reference or contains localized property data. | |
operator bool () const | |
const std::string & | getName () const |
Property's identifer name. | |
virtual std::string | getFullName () const |
Property's identifer name with any additional namespace modifiers. | |
const std::string & | getType () const |
Value::Type | getValueType () const |
Value::Type | getSdfValueType () const |
bool | isReference () const |
True if SchemaPropertyHandle is bound to const property reference. | |
bool | isOverriden () const |
True if SchemaPropertyHandle contains localized property data. | |
bool | isOutput () const |
Is this property an output? | |
bool | isArray () const |
Is property an array type? | |
bool | isDynamicArray () const |
Is this property's array type dynamically-sized? | |
int | getArraySize () const |
const Value | getValue () const |
void | setValueTime (const fdk::TimeValue &time) |
Assigns a time to the value stored in the property, for animating overrides. | |
fdk::TimeValue | getValueTime () const |
fdk::KeyValueMap | getMetadata () const |
bool | isConnectable () const |
bool | canConnectTo (const SchemaProperty &output) const |
void | print (std::ostream &) const |
Print the name, type and default value to stream. | |
SchemaProperty (SchemaPropertyHandle *handle) | |
Assigns _pImpl and takes ownership of handle. For internal use only! | |
SchemaPropertyHandle * | impl () |
const SchemaPropertyHandle * | impl () const |
Protected Attributes | |
std::unique_ptr< SchemaPropertyHandle, void(*)(SchemaPropertyHandle *)> | _pImpl |
Friends | |
std::ostream & | operator<< (std::ostream &o, const SchemaProperty &b) |
Attribute prototype that is used on the Schema prim prototypes.
This is the generic front end to a ShaderProperty without any shader-specific specializations, however under the hood the SchemaPropertyHandle class is really a 'ShaderPropertyHandle' class. The only difference is supporting the additional notion of the 'LocalProp' category that's explicitly not an unconnected input and does not get the 'inputs:' namespace prefixed to the property's name. ie a local property is normally just an InputProp with no connection and an assigned value, but we want to avoid 'inputs:' namespace so we're clearly delineating LocalProp as a distinct property category.
This allows us to extend the ShaderProperty plugin interface for Prim definitions using the same mechanism that's being used for shaders, specifically for supporting light and camera materials that have both a Prim and material/shader component.
TODO: allow overrides to be applied directly to the property rather than handling it as part of a ShaderDesc. If we do that we need to change the precedence rules in ShaderPropertyHandle.
usg::SchemaProperty::SchemaProperty | ( | int | category, |
Value::Type | type, | ||
const char * | name, | ||
const Value & | value, | ||
size_t | arraySize = 0 |
||
) |
Simple ctor for input properties and no extras. Populates the localized (overriden) property copy. If 'arraySize' is not specified (0) and 'value' is an array type then 'value' is queried for the array size and 'arraySize' ignored.
usg::SchemaProperty::SchemaProperty | ( | int | category, |
Value::Type | type, | ||
const char * | name, | ||
const Value & | value, | ||
const fdk::KeyValueMap & | metadata | ||
) |
Simple ctor for input properties with metadata. Populates the localized (overriden) property copy.
usg::SchemaProperty::SchemaProperty | ( | int | category, |
Value::Type | type, | ||
const char * | name, | ||
const fdk::KeyValueMap & | metadata = fdk::KeyValueMap() |
||
) |
Simple ctor for typical property with metadata and no default value. Populates the localized (overriden) property copy.
usg::SchemaProperty::SchemaProperty | ( | int | category, |
Value::Type | type, | ||
const char * | name, | ||
const Value & | value, | ||
size_t | arraySize, | ||
const fdk::KeyValueMap & | metadata, | ||
const fdk::KeyValueMap & | hints, | ||
const fdk::StringList & | options | ||
) |
Ctor with all params exposed. Populates the localized (overriden) property copy. If 'arraySize' is not specified (0) and 'value' is an array type then 'value' is queried for the array size and 'arraySize' ignored.
const std::string & usg::SchemaProperty::getType | ( | ) | const |
Return the type name string assigned to the property. This should match the list of recognized Value::Types but it's possible the type name may be something unrecognized, and the Value::Type will be Invalid.
Value::Type usg::SchemaProperty::getValueType | ( | ) | const |
Return the property Value::Type enumeration, only valid if type name is a recognized type.
Value::Type usg::SchemaProperty::getSdfValueType | ( | ) | const |
Return the converted type from GetType() into a SdfValueTypeName as a property Value::Type enumeration. Only valid if type name is a recognized type.
int usg::SchemaProperty::getArraySize | ( | ) | const |
Gets this property's array size.
If this property is a fixed-size array type, the array size is returned. In the case of a dynamically-sized array, this method returns the array size that the parser reports, and should not be relied upon to be accurate. A parser may report -1 for the array size, for example, to indicate a dynamically-sized array. For types that are not a fixed-size array or dynamic array, this returns 0.
const Value usg::SchemaProperty::getValue | ( | ) | const |
Returns the value from the reference or localized (overriden) assignment.
Check isReference() or isOverriden() to determine if the property is being used as a reference or a localized override.
fdk::TimeValue usg::SchemaProperty::getValueTime | ( | ) | const |
Returns the assigned time the value represents, for animating overrides. If not set this returns the default time.
bool usg::SchemaProperty::isConnectable | ( | ) | const |
Whether this property can be connected to other properties.
bool usg::SchemaProperty::canConnectTo | ( | const SchemaProperty & | output | ) | const |
Return true if this property can be connected an output (isOutput()=true) property, and the data types are compatible.
©2025 The Foundry Visionmongers, Ltd. All Rights Reserved. |