Nuke binary plugins 16.1.1
 
Loading...
Searching...
No Matches
DD::Image::AuthoredValue< T > Class Template Reference

Helper class for a Knob-stored value with authoring options. More...

#include <GeomOpKnobs.h>

Inheritance diagram for DD::Image::AuthoredValue< T >:
DD::Image::Authoring

Public Member Functions

 AuthoredValue (const AuthoringSettings &settings=AuthoringSetNoChangeDefaults())
 
 AuthoredValue (const T &val, const AuthoringSettings &settings=AuthoringSetNoChangeDefaults())
 
 AuthoredValue (const T &val, const T &schemaVal, const AuthoringSettings &settings=AuthoringSetNoChangeDefaults())
 
 AuthoredValue (const T &val, const T &schemaVal, const char *attribName, Mode mode=Mode::NoChange, Mode defaultMode=Mode::NoChange)
 
 AuthoredValue (const T &val, const T &schemaVal, const usg::Token &attribName, Mode mode=Mode::NoChange, Mode defaultMode=Mode::NoChange)
 
void InitGeomAuthorMode (Knob_Callback f)
 
bool provideValuesEnabled (const Knob *knob, const OutputContext &) const override
 
int providerSourceType (const Knob *knob, const OutputContext &) const override
 
bool isDefault (const Knob *knob, const OutputContext &) const override
 
bool isAnimated (const Knob *knob, const OutputContext &) const override
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &oc) const override
 Returns the schemaValue.
 
void provideStringValue (std::string &value, const StringKnobI *knob, const OutputContext &oc) const override
 Returns the schemaValue.
 
 AuthoredValue (const AuthoringSettings &settings)
 
 AuthoredValue (const AuthoringSettings &settings)
 
void provideStringValue (std::string &value, const StringKnobI *knob, const OutputContext &oc) const
 
void provideStringValue (std::string &value, const StringKnobI *knob, const OutputContext &oc) const
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *arrayKnob, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *, const OutputContext &) const
 
std::vector< double > provideValues (const ArrayKnobI *, const OutputContext &) const
 
- 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.
 

Public Attributes

value
 Current authored value.
 
schemaValue
 Fallback value if not authored.
 

Protected Attributes

int32_t _nElements
 Derived when InitGeomAuthorMode() is called.
 
usg::Token _attribName
 Authored attribute name.
 
- 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)
 

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
 
- 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)
 

Detailed Description

template<typename T>
class DD::Image::AuthoredValue< T >

Helper class for a Knob-stored value with authoring options.

Member Function Documentation

◆ InitGeomAuthorMode()

template<typename T >
void DD::Image::AuthoredValue< T >::InitGeomAuthorMode ( Knob_Callback  f)

Important - must call this to attach to Knob during knobs() call. Note that since this only assigns during makeKnobs() only the Node firstOp's copy of this class will have the authoring and value provider assigned. Authoring mode will default to 'NoChange' and the value provider enabled.

Referenced by DD::Image::ImageableAndModelKnobs::knobsWithoutGroup(), DD::Image::ColorKnobs::knobsWithoutGroup(), DD::Image::MeshKnobs::knobsWithoutGroup(), and DD::Image::SlrRenderOptionsKnobs::knobsWithoutGroup().

◆ provideValuesEnabled()

template<typename T >
bool DD::Image::AuthoredValue< T >::provideValuesEnabled ( const Knob knob,
const OutputContext oc 
) const
override

Enabled when in NoChange mode (no authoring enabled) so that Knob is disabled for editing and displays the schema default value.



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