Nuke binary plugins 16.1.1
 
Loading...
Searching...
No Matches
DD::Image::AuthoringProvider Class Referenceabstract

#include <SceneOpI.h>

Inheritance diagram for DD::Image::AuthoringProvider:
DD::Image::Authoring

Public Member Functions

 AuthoringProvider (Knob *knob, uint64_t componentId)
 
bool provideValuesEnabled (const Knob *knob, const OutputContext &) const override
 True when the knob is not in authoring set mode and there is a source Xformable prim.
 
int providerSourceType (const Knob *knob, const OutputContext &) const override
 
bool isDefault (const Knob *, const OutputContext &) const override
 
bool isAnimated (const Knob *knob, const OutputContext &) const override
 
void provideValues (double *values, size_t nValues, const ArrayKnobI *arrayKnob, const OutputContext &) const override
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const override
 
- Public Member Functions inherited from DD::Image::Authoring
 Authoring (Mode mode=Mode::NoChange, Mode defaultMode=Mode::NoChange)
 
 Authoring (const AuthoringSettings &settings, Mode mode, Mode defaultMode)
 Create an authoring control for a knob using specific settings and modes.
 
 Authoring (const AuthoringSettings &settings)
 Create an authoring control for a knob using specific settings.
 
Authoringoperator= (const AuthoringSettings &settings)
 Copy a set of settings.
 
bool enabled () const
 Is authoring control enabled?
 
void disable ()
 
void enable (ModeMask modes=AllModes())
 Enable the authoring control by setting the enabled mode mask.
 
ModeMask enabledModes () const
 Return the mask of enabled modes.
 
std::vector< ModegetModes () const
 Returns a list of enabled authoring modes, otherwise an empty list.
 
std::vector< const char * > getModeNames () const
 Return a list of enabled authoring mode names, otherwise an empty list.
 
void setModes (const std::vector< Mode > &modes)
 
bool modeEnabled (Mode mode) const
 Return true if mode is in the enabled set.
 
void enableMode (Mode mode)
 Enable a mode.
 
void disableMode (Mode mode)
 Disable a mode.
 
int getModeIndex (Mode mode) const
 
int getModeIndex (const char *name) const
 Get the choice index from a named mode, or -1 if not in the enabled list.
 
Mode getModeEnumFromIndex (int index) const
 
void setDefaultMode (Mode defaultMode)
 
Mode getDefaultMode () const
 Gets the authoring mode that will be used by default.
 
Mode getMode () const
 Returns the current authoring mode.
 
int getModeIndex () const
 Gets the choice index of the current authoring mode (as in a dropdown.)
 
const std::string & getModeName () const
 Returns the current authoring mode's name.
 
bool setMode (Mode mode)
 Sets the authoring mode, returning false if mode is not in enabled list.
 
bool setModeFromIndex (int index)
 Sets the authoring mode from a choice index, returning false if not in enabled list.
 
bool setMode (const std::string &name)
 Sets the mode from a mode name, returning false if not in enabled list.
 

Static Public Member Functions

template<typename T >
static void CopyValue (const T *valIn, double *valOut)
 Convenience to extract a value from one sample.
 
template<typename T >
static void CopyValue (const T *valInA, const T *valInB, float t, double *valOut)
 Convenience to extract a value from two samples, with interpolation support.
 
- Static Public Member Functions inherited from DD::Image::Authoring
static constexpr ModeMask SetValueBit ()
 
static constexpr ModeMask NoChangeBit ()
 
static constexpr ModeMask DefaultValueBit ()
 
static constexpr ModeMask NoModes ()
 
static constexpr ModeMask AllModes ()
 
static const std::vector< std::string > & GetModeNames ()
 Returns the available authoring mode names.
 
static const std::string & GetModeName (Mode mode)
 Returns the name of the authoring mode from the type.
 
static ModeMask GetModeBit (Mode mode)
 Returns the corresponding mask bit for the mode.
 
static Mode GetModeEnumFromName (const char *name)
 Returns the authoring mode type from the mode name string.
 
static Mode GetModeEnumFromName (const std::string &name)
 

Protected Member Functions

virtual SceneOpI_sceneOpI () const =0
 Return the scene op owner of this provider. Must implement.
 
virtual void _update (bool enable, const usg::Prim &prim, uint64_t version)
 
virtual bool _isProviderEnabled () const =0
 Subclass can enable or disable depending on component. Must implement.
 
virtual void _getDefault (double *values, size_t nValues) const =0
 Fill values with the appropriate default for the component. Must implement.
 
virtual bool _isDefault () const =0
 Return true if the source component is at its default.
 
virtual bool _isAnimated () const =0
 Return true if the source component is an animating attribute.
 
virtual bool _provideValues (double *values, size_t nValues, const ArrayKnobI *arrayKnob, const OutputContext &) const =0
 Subclass implemention of provideValues(). Must implement.
 

Protected Attributes

uint64_t _componentId
 Which component to provide.
 
usg::Attribute _sourceAttrib
 Primary attribute to provide data from.
 
- Protected Attributes inherited from DD::Image::Authoring
Mode _mode
 Currently selected mode.
 
Mode _defaultMode
 Initial mode (the default)
 
ModeMask _enabledModes
 Which modes to show as authoring options (in menus, etc)
 

Friends

class ndk::SceneOpNode
 

Additional Inherited Members

- Public Types inherited from DD::Image::Authoring
enum  Mode : uint8_t { SetValue , NoChange , DefaultValue , Invalid }
 Possible authoring modes. More...
 
using ModeMask = uint8_t
 

Detailed Description

Uses a component identifier to specify which part of the schema/Op is to be provided. Using an identifier is easier to manage than making individual provider subclasses for each component provider.

Constructor & Destructor Documentation

◆ AuthoringProvider()

AuthoringProvider::AuthoringProvider ( Knob knob,
uint64_t  componentId 
)

Assign the component id, whos meaning is determined by the subclass. This can be an enum or a hash from a Token.

References DD::Image::Knob::setAuthoring().

Member Function Documentation

◆ provideValues()

void AuthoringProvider::provideValues ( double *  values,
size_t  nValues,
const ArrayKnobI *  arrayKnob,
const OutputContext context 
) const
override

Returns the values to be displayed in the output knob. First checks if the scene data evaluator needs to be run, then calls the subclass _provideValues().

References _getDefault(), _provideValues(), _sceneOpI(), and DD::Image::SceneOpI::sceneOpNode().

◆ _update()

virtual void DD::Image::AuthoringProvider::_update ( bool  enable,
const usg::Prim &  prim,
uint64_t  version 
)
inlineprotectedvirtual

Update any local parameters from the source prim. Version number changes when the source scene changes.



©2026 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com