HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PcpDynamicFileFormatInterface Class Referenceabstract

#include <dynamicFileFormatInterface.h>

Public Member Functions

virtual PCP_API ~PcpDynamicFileFormatInterface ()
 Empty virtual destructor to prevent build errors with some compilers. More...
 
virtual PCP_API void ComposeFieldsForFileFormatArguments (const std::string &assetPath, const PcpDynamicFileFormatContext &context, SdfFileFormat::FileFormatArguments *args, VtValue *dependencyContextData) const =0
 
virtual PCP_API bool CanFieldChangeAffectFileFormatArguments (const TfToken &field, const VtValue &oldValue, const VtValue &newValue, const VtValue &dependencyContextData) const =0
 

Detailed Description

Interface mixin that can be included by SdfFileFormat subclasses to enable dynamic file format argument generation for a file format plugin. When prim index composition encounters a payload to an asset of a file format that implements this interface, it will call ComposeFieldsForFileFormatArguments to generate arguments from the current composition context at which the payload is being added. The derived file format is on the hook for using the provided context to compute any prim field values it needs and generate the relevant file format arguments for its content.

Definition at line 47 of file dynamicFileFormatInterface.h.

Constructor & Destructor Documentation

virtual PCP_API PcpDynamicFileFormatInterface::~PcpDynamicFileFormatInterface ( )
virtual

Empty virtual destructor to prevent build errors with some compilers.

Member Function Documentation

virtual PCP_API bool PcpDynamicFileFormatInterface::CanFieldChangeAffectFileFormatArguments ( const TfToken field,
const VtValue oldValue,
const VtValue newValue,
const VtValue dependencyContextData 
) const
pure virtual

Derived classes must implement this function to return true if the change to scene description of the field named field can affect the dynamic file format arguments generated by ComposeFieldsForFileFormatArguments. This function will be called during change processing to determine whether a change to a field affects the dynamic file format arguments of a payload that a prim index depends on.

oldValue and newValue contain the old and new values of the field. dependencyContextData is the arbitrary typed data that was generated by the call to ComposeFieldsForFileFormatArguments when the payload arc was computed.

virtual PCP_API void PcpDynamicFileFormatInterface::ComposeFieldsForFileFormatArguments ( const std::string assetPath,
const PcpDynamicFileFormatContext context,
SdfFileFormat::FileFormatArguments args,
VtValue dependencyContextData 
) const
pure virtual

Derived classes must implement this function to compose prim fields using the given context and use them to generate file format arguments for the layer at assetPath. The context provides methods to compose field values at the current point in prim index composition which can be used to generate the relevant file format arguments. These arguments need to be added to the set of file format arguments provided by args.

Additionally, implementations can output dependencyContextData of any value type that will then be passed back in to calls to CanFieldChangeAffectFileFormatArguments during change processing. This can be used to provide more that context that is specific to the file format when determining whether a field change really does affect the arguments generated by a particular call to this function.


The documentation for this class was generated from the following file: