FnUsdAbstractionLib 0.6.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
usg::Schema Class Reference

#include <Schema.h>

Inheritance diagram for usg::Schema:
usg::ShaderSchema usg::CoShaderSchema usg::LightShaderSchema usg::SurfaceShaderSchema

Public Member Functions

 Schema (const SchemaDescription &pluginDescription, const SchemaPropertyList &properties, const fdk::KeyValueMap &metadata=fdk::KeyValueMap())
 
const char * schemaName () const
 Name of the shader class without any leading pluginPrefix() or trailing pluginSuffix().
 
virtual const TokenbaseTypeName () const
 
virtual void getSourceTypes (TokenSet &types) const
 
virtual ShaderSchemaasShaderSchema ()
 

Static Public Member Functions

static const SchemaDescriptionfind (const char *schema_name)
 Find a SchemaDescription by schema name and optional source-type - NOT the plugin .so filename!
 

Static Protected Member Functions

static Schemacreate (const char *schema_name)
 

Protected Attributes

std::unique_ptr< ShaderSchemaHandle, void(*)(ShaderSchemaHandle *)> _pImpl
 

Friends

class SchemaBuiltinParser
 

Detailed Description

Schema class creates SchemaDesc definitions stored in the registry.

Constructor & Destructor Documentation

◆ Schema()

usg::Schema::Schema ( const SchemaDescription pluginDescription,
const SchemaPropertyList &  properties,
const fdk::KeyValueMap &  metadata = fdk::KeyValueMap() 
)

The shader class name is taken from the SchemaDescription::schemaName(), so the subclass must pass its SchemaDescription.

Member Function Documentation

◆ baseTypeName()

virtual const Token & usg::Schema::baseTypeName ( ) const
inlinevirtual

Return the base schema type string used to determine the handling of property types and where to support source types. Only a few are currently supported: 'UsgSchema' schema describes a set of properties for a generic Prim, the default. 'UsgShader' schema describes a ShaderSchema, which has specific property type restrictions

Reimplemented in usg::ShaderSchema.

◆ getSourceTypes()

virtual void usg::Schema::getSourceTypes ( TokenSet &  types) const
virtual

Get the set of additional source types to create for this Schema. Currently only used for ShaderSchema subclasses. An example of an additional source type would be 'glslfx'. Default implementation does nothing.

◆ asShaderSchema()

virtual ShaderSchema * usg::Schema::asShaderSchema ( )
inlinevirtual

Reimplemented in usg::ShaderSchema.

◆ create()

static Schema * usg::Schema::create ( const char *  schema_name)
staticprotected

Create a Schema singleton instance based on a shader class name or an existing shader plugin description. This should only be called during SchemaDescription ctor.



©2025 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk