Nuke binary plugins 16.1.1
 
Loading...
Searching...
No Matches
DD::Image::Authoring Class Reference

#include <Authoring.h>

Inheritance diagram for DD::Image::Authoring:
DD::Image::AuthoredValue< fdk::Vec3f > DD::Image::AuthoredValue< float > DD::Image::AuthoredValue< int > DD::Image::AuthoredValue< bool > DD::Image::AuthoredValue< T > DD::Image::AuthoringProvider

Public Types

enum  Mode : uint8_t { SetValue , NoChange , DefaultValue , Invalid }
 Possible authoring modes. More...
 
using ModeMask = uint8_t
 

Public Member Functions

 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

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 Attributes

Mode _mode
 Currently selected mode.
 
Mode _defaultMode
 Initial mode (the default)
 
ModeMask _enabledModes
 Which modes to show as authoring options (in menus, etc)
 

Friends

std::ostream & operator<< (std::ostream &o, const Authoring &)
 

Detailed Description

Provides the interface for authoring. Authoring is a USD concept, which means writing to USD layers. So, this is designed for interacting with the USD stage of the 3D system.

Member Enumeration Documentation

◆ Mode

Possible authoring modes.

Enumerator
SetValue 

Set or create the value in the USD layer.

NoChange 

Do not author the value in the USD layer.

DefaultValue 

Restore the default value in the USD layer.

Invalid 

Special value for disable/failure cases.

Constructor & Destructor Documentation

◆ Authoring()

DD::Image::Authoring::Authoring ( Mode  mode = Mode::NoChange,
Mode  defaultMode = Mode::NoChange 
)

Default ctor makes a default mode authoring control, setting the mode the same as default mode.

Member Function Documentation

◆ disable()

void DD::Image::Authoring::disable ( )
inline

Disable the authoring control (remove all enabled modes.) This leaves the current and default modes as is.

◆ setModes()

void DD::Image::Authoring::setModes ( const std::vector< Mode > &  modes)

Sets the available authoring modes. Without setting this, authoring is disabled. This will update the set mode and the default mode if the currently set mode isn't in the list of modes.

References _defaultMode, _enabledModes, _mode, and GetModeBit().

Referenced by Authoring(), and operator=().

◆ getModeIndex()

int DD::Image::Authoring::getModeIndex ( Mode  mode) const

Get the choice index of the mode (as in a dropdown,) or -1 if not in the enabled list.

References _enabledModes, and Invalid.

◆ getModeEnumFromIndex()

Authoring::Mode DD::Image::Authoring::getModeEnumFromIndex ( int  index) const

Get the enabled mode from the choice index (as in a dropdown,) or Mode::Invalid if not in the enabled list.

References _enabledModes, and Invalid.

◆ setDefaultMode()

void DD::Image::Authoring::setDefaultMode ( Mode  defaultMode)

Sets the mode that will be used by default - won't set values if the default doesn't exist in the enabled modes.

References _defaultMode, and modeEnabled().



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