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

#include <Authoring.h>

Public Types

enum class  Mode { Set , RestoreDefault , NoChange }
 Possible authoring modes. More...
 

Public Member Functions

 Authoring (Knob *knob, const AuthoringSettings &settings)
 
 Authoring (const Authoring &)=delete
 Don't allow copy constructor however, knob pointer shouldn't be copied.
 
Authoringoperator= (const AuthoringSettings &settings)
 Copy a set of settings.
 
int getIndex (Mode mode) const
 
Mode getMode (int index) const
 
std::vector< ModegetModes () const
 
void setModes (const std::vector< Mode > &modes)
 
void setDefaultMode (Mode defaultMode)
 
Mode getDefaultMode () const
 Gets the mode that will be selected by default.
 
std::vector< std::string > getModeNames () const
 
std::string getModeName () const
 Returns the authoring mode name.
 
Mode getMode () const
 Returns the authoring mode type.
 
bool setMode (Mode mode)
 
bool setMode (int mode)
 
bool setMode (const std::string &name)
 

Static Public Member Functions

static Mode getMode (const std::string &name)
 Returns the authoring mode type from the name.
 
static std::string getModeName (Mode mode)
 Returns the name of the authoring mode from the type.
 

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

enum class DD::Image::Authoring::Mode
strong

Possible authoring modes.

Enumerator
Set 

Set or create the value in the USD layer.

RestoreDefault 

Restore the default value in the USD layer.

NoChange 

Do not author the value in the USD layer.

Constructor & Destructor Documentation

◆ Authoring()

DD::Image::Authoring::Authoring ( Knob knob,
const AuthoringSettings settings 
)

Create an authoring control for a knob using specific settings

Parameters
knob
settings

Member Function Documentation

◆ getIndex()

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

Gets the choice index of the mode (as in a dropdown)

Parameters
modeto get the choice index for
Returns
index of the mode or -1 if there isn't one

◆ getMode()

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

Gets the mode from the choice index (as in a dropdown)

Parameters
indexthe choice number to get the mode for
Returns
the mode it corresponds to for this knob

◆ getModes()

std::vector< Authoring::Mode > DD::Image::Authoring::getModes ( ) const

Returns the available authoring mode types if authoring is supported, otherwise an empty list.

◆ 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.

◆ setDefaultMode()

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

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

◆ getModeNames()

std::vector< std::string > DD::Image::Authoring::getModeNames ( ) const

Returns the available authoring mode names if authoring is supported, otherwise an empty list.

◆ setMode() [1/3]

bool DD::Image::Authoring::setMode ( Mode  mode)

Sets the authoring mode from the type. Returns true if successfully set, otherwise false, e.g. if the mode is not a supported authoring mode by the Node (Op).

References DD::Image::Knob::changed(), and DD::Image::Knob::force_new_undo().

Referenced by setMode().

◆ setMode() [2/3]

bool DD::Image::Authoring::setMode ( int  mode)

Sets the authoring mode from the integer. Returns true if successfully set, otherwise false, e.g. if the integer cannot be converted to a valid authoring mode.

References getMode(), and setMode().

◆ setMode() [3/3]

bool DD::Image::Authoring::setMode ( const std::string &  name)

Sets the authoring mode from the name. Returns true if successfully set, otherwise false, e.g. if the string is not a valid authoring mode name.

References setMode().



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