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

#include <SceneOpI.h>

Inheritance diagram for DD::Image::SceneOpI:
DD::Image::GeometryProviderI DD::Image::ConstrainOpI DD::Image::AxisSceneOp DD::Image::CameraSceneOp DD::Image::LightSceneOp

Classes

class  Description
 

Public Types

enum  {
  TIME , PARENT_T , PARENT_R , PARENT_S ,
  XFORM_ORDER , ROT_ORDER , TRANSLATE , ROTATE ,
  SCALE , UNIFORM_SCALE , SKEW , PIVOT_T ,
  PIVOT_R , LAST_XFORM_PARAM
}
 Which component of an AxisVals to provide.
 
enum  { PARENT_XFORM , PARENT_SCOPE , PARENT_NONE }
 Parent prim creation modes.
 

Public Member Functions

 SceneOpI (fdk::AxisDirection defaultOrientAxis=fdk::AxisDirection::Z_PLUS)
 
virtual AxisOpgetAxisOp ()=0
 
AxisSceneOpasAxisSceneOp ()
 Convenience to cast this interface's Op to an AxisSceneOp.
 
CameraSceneOpasCameraSceneOp ()
 Convenience to cast this interface's Op to a CameraSceneOp.
 
LightSceneOpasLightSceneOp ()
 Convenience to cast this interface's Op to a LightSceneOp.
 
virtual int32_t sceneInput () const
 
virtual GeomOpsceneInputOp () const
 Return the sceneInput() input cast to a GeomOp, if possible. Default returns null.
 
virtual SceneOpIparentInputSceneOp () const
 Return the AxisOp::parentInput() input cast to a SceneOpI, if possible. Default returns null.
 
virtual SceneOpIconstrainInputSceneOp () const
 Return the AxisOp::constrainInput() input cast to a SceneOpI, if possible. Default returns null.
 
SceneOpNodeI * sceneOpNode () const
 Return the custom node owner.
 
virtual const usg::Token & primarySchemaType () const =0
 
virtual usg::TokenArray getAppliedApiSchemaTypes () const
 
virtual const usg::Path & primPath () const
 Prim path to create/edit.
 
virtual const usg::Token & parentPrimCreateType () const
 
virtual usg::Path buildBasePrimPath () const
 
virtual const char * primPathFilter () const
 
bool readFromSceneEnabled () const
 Is the read from scene mode enabled?
 
bool sourcePrimEnabled () const
 Returns true if there's a valid scene input prim to extract data from.
 
const usg::Path & sourcePrimPath () const
 Prim path in source scene to read.
 
const SceneOpNodeI::ConfigParamsparams () const
 Returns the shared node configuration params.
 
const SceneOpNodeI::SceneDatasceneData () const
 Returns the shared node scene data.
 
const usg::StageRef & sourceStage () const
 Stage the prim data will be extracted from, if valid.
 
const usg::Prim & sourcePrim () const
 Prim that data will be extracted from, if valid.
 
const AxisValsSet * transformCache () const
 
const SceneOpNodeI::SharedDatasharedData () const
 Returns the shared node data.
 
void SetAuthoringProvider (Knob_Callback f, uint64_t componentId)
 Assigns the AuthoringProvider to the last created or stored knob.
 
void SetAuthoringProvider (Knob_Callback f, Knob *knob, uint64_t componentId)
 Same, but with a knob specifier for a compound knob to supply, if needed.
 
void SetAxisKnobAuthoringProvider (Knob_Callback f)
 
void addAuthoringProvider (Knob *k, AuthoringProvider *provider)
 Add a value provider to the node shared list, which takes ownership of allocation.
 
AuthoringProvidergetAuthoringProvider (Knob *k) const
 Retrieve an authoring provider by Knob.
 
const AuthoringProviderKnobMap & getAuthoringProviderKnobMap () const
 
KnobopKnob (const char *name) const
 
virtual void addImportOptionKnobs (Knob_Callback f)
 
virtual void addXformExtractOptionKnobs (Knob_Callback f)
 
virtual void addExportOptionKnobs (Knob_Callback f)
 
virtual void addDisplayOptionsKnobs (Knob_Callback f)
 Adds the OpenGL display option controls.
 
virtual void addLocalParentXformKnobs (Knob_Callback f, bool addSyncOptions=true)
 
virtual void addLocalXformKnobs (Knob_Callback f, bool addSyncOptions=true)
 
virtual void addTransformKnobs (Knob_Callback f, bool addSyncOptions=true)
 
virtual void addConstrainOptionsKnobs (Knob_Callback f)
 Adds the constrain option knobs.
 
virtual void addExtraFrontPanelKnobs (Knob_Callback f)
 
const char * localParentTranslateKnobName () const
 
const char * localParentRotateKnobName () const
 
const char * localParentScaleKnobName () const
 
const char * localAxisKnobName () const
 
const char * worldMatrixKnobName () const
 
KnobgetLocalParentTranslateKnob () const
 Return the internal 'local_parent_translate' XYZ knob.
 
KnobgetLocalParentRotateKnob () const
 Return the internal 'local_parent_rotate' XYZ knob.
 
KnobgetLocalParentScaleKnob () const
 Return the internal 'local_parent_scale' XYZ knob.
 
Axis_KnobI * getLocalAxisKnob () const
 Return internal 'transform' Axis_Knob for set/get internal local transformation.
 
ArrayKnobI * getWorldMatrixKnob () const
 Return internal 'world_matrix' Array_Knob.
 
virtual void setReadOnlyLocalParent (bool readOnly)
 Make read only the knobs the translate/rotate/scale knobs for the local parent xform.
 
virtual void setReadOnlyLocalXform (bool readOnly)
 Make read only the knobs in the local xform section.
 
void KnobDefinesGeometry (const Knob_Closure &f)
 
void KnobModifiesAttribValues (const Knob_Closure &f)
 
GeometryProviderIasGeometryProvider () override
 GeometryProviderI: Allow subclasses to gain access to sibling functions.
 
fdk::Hash geometryComposeState () override
 GeometryProviderI: Returns the compose state of the exportLayer.
 
fdk::Hash geometryEditVersionState () override
 GeometryProviderI: Returns the edit state of the exportLayer.
 
bool geometryStateVaries () override
 
bool canProvideGeometryStage () const override
 GeometryProviderI: Provides a fully constructed usg::Stage via buildGeometryStage().
 
bool canProvideGeometryFor (const usg::Token &purpose) const override
 
void buildGeometryStage (usg::StageRef &stage, const usg::ArgSet &requestArgs={}, const fdk::TimeValueSet &sampleTimes=fdk::TimeValueSet()) override
 
void writeScenePrimsToLayer (usg::LayerRef &layer, bool appendTo, const fdk::FrameValueSet &times)
 
- Public Member Functions inherited from DD::Image::GeometryProviderI
virtual GeometryProviderIasGeometryProvider ()=0
 
virtual OpgetGeometryProviderOp ()=0
 
OpgetGeometryProviderOp () const
 Same as getGeometryProviderOp() but const.
 
virtual fdk::Hash geometryComposeState ()=0
 
virtual fdk::Hash geometryEditVersionState ()=0
 
virtual bool geometryStateVaries ()=0
 
virtual usg::LayerRef buildGeometryLayer (bool appendTo=false, const fdk::TimeValueSet &sampleTimes=fdk::TimeValueSet())=0
 
virtual usg::LayerRef getGeometryLayer (const fdk::TimeValueSet &sampleTimes=fdk::TimeValueSet())
 
virtual bool canProvideGeometryStage () const
 
virtual bool canProvideGeometryFor (const usg::Token &purpose) const
 
virtual void buildGeometryStage (usg::StageRef &stage, const usg::ArgSet &requestArgs, const fdk::TimeValueSet &sampleTimes=fdk::TimeValueSet())
 
virtual usg::StageRef getGeometryStage (const fdk::TimeValueSet &sampleTimes=fdk::TimeValueSet())
 
- Public Member Functions inherited from DD::Image::ConstrainOpI
 ConstrainOpI (fdk::FrameValue referenceFrame, fdk::AxisDirection defaultLookAxis=fdk::AxisDirection::Z_PLUS)
 
 ConstrainOpI (DD::Image::Op *op, fdk::AxisDirection defaultLookAxis=fdk::AxisDirection::Z_PLUS)
 
void knobs (Knob_Callback f, Op *op)
 
int knob_changed (Knob *k, Op *op)
 
const char * input_label (char *buffer) const
 Returns the input label for the current constrain mode.
 
const char * constraintKnobName () const
 
const char * orientAxisKnobName () const
 
const char * rotateXKnobName () const
 
const char * rotateYKnobName () const
 
const char * rotateZKnobName () const
 
const char * strengthKnobName () const
 
const char * applyTranslateKnobName () const
 
const char * applyRotateKnobName () const
 
const char * applyScaleKnobName () const
 
const char * maintainOffsetFrameKnobName () const
 
const char * maintainOffsetKnobName () const
 
const char * setMaintainOffsetFrameToCurrentKnobName () const
 
ndk::ConstraintMatrixParams getConstraintParametersFromKnobs (const OutputContext *context=nullptr) const
 
fdk::TimeValueSet getNeededInputTimes (const fdk::TimeValueSet &requestedTimes) const
 Returns the times we need from inputs given the times that have been requested.
 
ndk::ConstraintMode getConstraintType () const
 Gets the constraint type from the constraint knob.
 
bool constraintMaintainOffset () const
 

Static Public Member Functions

static std::string localAxisXformOpName (const Op *op)
 Returns the name of the local axis xformOp for the xform given by Op.
 
static std::string localParentXformOpName (const Op *op)
 Returns the name of the local parent xformOp for the xform given by Op.
 
- Static Public Member Functions inherited from DD::Image::GeometryProviderI
static void BuildStage (usg::StageRef &stage, const usg::ArgSet &requestArgs, const OpGraphLocation &geometryProviderOp, const fdk::TimeValueSet &sampleTimes)
 
static void BuildStage (usg::StageRef &stage, const OpGraphLocation &geometryProviderOp, const fdk::TimeValueSet &sampleTimes)
 Same as buildStage(OpSet) but with no request args.
 
static void BuildStage (usg::StageRef &stage, const OpGraphLocation &geometryProviderOp, const fdk::TimeValue &sampleTime)
 Same as buildStage(OpSet) but with only one sample time.
 
- Static Public Member Functions inherited from DD::Image::ConstrainOpI
static fdk::AxisDirection GetLookAxis (int lookAxisIndex)
 

Protected Member Functions

virtual AuthoringProvider_createAuthoringProvider (Knob *k, uint64_t componentId)
 
virtual fdk::Hash buildSourceSceneState (const fdk::Hash &hash)
 
virtual void getExtractKeyRange (SceneOpNodeI::SharedData &data, fdk::TimeValue &firstKey, fdk::TimeValue &lastKey)
 
virtual bool extractSceneData (SceneOpNodeI::SharedData &data, const fdk::TimeValueSet &addlSampleTimes=fdk::TimeValueSet())
 
virtual void extractSceneXformData (SceneOpNodeI::SharedData &data, AxisValsArray &axisValsSamples, bool &isDefaultXforms, const fdk::TimeValueSet &addlSampleTimes=fdk::TimeValueSet()) const
 
virtual AxisVals getXformDataAt (SceneOpNodeI::SharedData &data, const OutputContext &context) const
 
virtual void _validateTransforms (bool for_real, ndk::XformParameters &outputXformParams)
 
virtual void _buildLocalTransforms (const ndk::XformComponents &xformComponents, fdk::Mat4d &preConstraintXform, const ndk::ConstraintMatrixParams &constraintParams, ndk::XformParameters &finalLocalXforms) const
 
virtual bool _buildConstraintParams (AxisOp *constrainSourceOp, const ndk::XformComponents &xformComponents, fdk::Mat4d &preConstraintXform, ndk::ConstraintMatrixParams &constraintParams) const
 
virtual bool _getLocalParentTransformAnimation (fdk::TimeValueSet *keyTimes=nullptr, int32_t *nAnimatedExpressions=nullptr, int32_t view=-1) const
 
virtual bool _getLocalTransformAnimation (fdk::TimeValueSet *keyTimes=nullptr, int32_t *nAnimatedExpressions=nullptr, int32_t view=-1) const
 
virtual const ndk::XformComponents & _getSceneOpTransformComponents () const
 Return the transform components built _validateTransforms().
 
virtual ndk::XformComponents _getSceneOpTransformComponentsAt (const OutputContext &context) const
 Calculate the transform components at a specific OutputContext.
 
virtual const fdk::Mat4d & _getSceneOpInputParentTransform () const
 Return the input parent transform built in _validateTransforms().
 
virtual fdk::Mat4d _getSceneOpInputParentTransformAt (const OutputContext &context) const
 Calculate the input parent transform at a specific OutputContext.
 
virtual const fdk::Mat4d & _getSceneOpLocalParentAxisTransform () const
 Return the local parent axis transform built in _validateTransforms().
 
virtual fdk::Mat4d _getSceneOpLocalParentAxisTransformAt (const OutputContext &context) const
 Calculate the local parent axis transform at a specific OutputContext.
 
virtual const fdk::Mat4d & _getSceneOpParentTransform () const
 Return the total local parent transform built in _validateTransforms().
 
virtual const fdk::Mat4d & _getSceneOpLocalAxisTransform () const
 Return the local axis transform built in _validateTransforms().
 
virtual fdk::Mat4d _getSceneOpLocalAxisTransformAt (const OutputContext &context) const
 Calculate the local axis transform at a specific OutputContext.
 
virtual const fdk::Mat4d & _getSceneOpLocalTransform () const
 Return the total local transform built in _validateTransforms().
 
virtual fdk::Mat4d _getSceneOpWorldTransformAt (const OutputContext &context) const
 
void _sceneOpResetTargetState ()
 
void _sceneOpUpdateScenePrimState (const DD::Image::Hash &newOpEditVersionHash)
 
void _appendKnobToDefineGeometryTarget (Knob *k)
 
void _appendKnobToModifyValuesTarget (Knob *k)
 
virtual int _sceneOpKnobChanged (Knob *k, int32_t callAgain)
 
usg::LayerRef buildGeometryLayer (bool appendTo, const fdk::TimeValueSet &sampleTimes) override
 
virtual void _createParentPrims (usg::LayerRef &layer, const usg::Path &basePrimPath)
 
virtual void _writeScenePrims (usg::LayerRef &layer, bool appendTo, const fdk::TimeValueSet &times=fdk::TimeValueSet())=0
 
virtual void _writeTransformOps (usg::LayerRef &layer, usg::XformablePrim &xformable, bool appendTo, const fdk::FrameValueSet &times=fdk::FrameValueSet())
 
bool writeKnob (const char *knobName, const fdk::FrameValueSet &times, usg::Prim &outputPrim, const usg::Token &targetPropertyName, usg::Value::Type targetPropertyTypeHint) const
 
bool writeKnob (const char *knobName, bool ignoreDefaultTest, const fdk::FrameValueSet &times, usg::Prim &outputPrim, const usg::Token &targetPropertyName, usg::Value::Type targetPropertyTypeHint) const
 
bool writeKnob (Knob *knob, bool ignoreDefaultTest, const fdk::FrameValueSet &times, usg::Prim &outputPrim, const usg::Token &targetPropertyName, usg::Value::Type targetPropertyTypeHint) const
 Same but with a Knob*.
 
bool writeKnob (const ArrayKnobRefList &knobRefs, bool ignoreDefaultTest, const fdk::FrameValueSet &times, usg::Prim &outputPrim, const usg::Token &targetPropertyName, usg::Value::Type targetPropertyType) const
 
bool writeInputOpAsAssetPath (int32_t input, const fdk::FrameValueSet &times, usg::Prim &outputPrim, const usg::Token &targetPropertyName) const
 Write an input Op connection as an AssetPath, typically for texture sources.
 

Static Protected Member Functions

static bool BuildConstraintParamsAt (const SceneOpI *sceneOp, const OutputContext &context, const ndk::XformComponents &xformComponents, fdk::Mat4d &preConstraintXform, ndk::ConstraintMatrixParams &constraintParams)
 

Protected Attributes

ndk::XformComponents _xformComponents
 Transform components.
 
fdk::Vec3d _localParentTranslate
 Local-parent translation knob value.
 
fdk::Vec3d _localParentRotate
 Local-parent rotate knob value.
 
fdk::Vec3d _localParentScale
 Local-parent scale knob value.
 
SnapKnobs _snapKnobs
 Snap menu options.
 
bool _applyConstraintToParent
 Snap/constraint is applied to the local parent, not the local axis.
 
DD::Image::Hash _parentHash
 Does parent path or transform need to be updated?
 
DD::Image::Hash _constrainHash
 The hash for the constrain input set in validate().
 
WorldMatrixProvider_worldXformProvider
 'world_matrix' output knob - valid ONLY on firstOp()!
 
SceneOpNodeI * _sceneOpNode
 Node owner, set by SceneOpNode.
 
- Protected Attributes inherited from DD::Image::ConstrainOpI
Knob_constraintKnob
 
Knob_lookAxisKnob
 
Knob_strengthKnob
 
Knob_rotateXKnob
 
Knob_rotateYKnob
 
Knob_rotateZKnob
 
Knob_applyTranslateKnob
 
Knob_applyRotateKnob
 
Knob_applyScaleKnob
 
Knob_maintainOffsetFrameKnob
 
Knob_maintainOffsetKnob
 
Knob_setMaintainOffsetFrameToCurrentKnob
 
int _constraint
 
fdk::AxisDirection _lookAxis
 
bool _rotateX
 
bool _rotateY
 
bool _rotateZ
 
double _strength
 
bool _applyTranslate
 
bool _applyRotate
 
bool _applyScale
 
bool _maintainOffset
 
float _maintainOffsetFrame
 

Friends

class ndk::SceneOpNode
 

Detailed Description

Provides the transformable scene Op standard transform knobs with prim edit functionality. This interface is only intended to be attached to AxisOp subclasses and there are a number of assumptions to that effect, such as the getAxisOp() method.

This interface contains a local transform matrix and an optional local-parent transform matrix which are normally filled in by Knobs. The local-parent enables an arbitrary parenting hierarchy to be decomposed and contained within the AxisOp subclass allowing the node to be disconnected or disassociated from a parenting network or scenegraph. The node is thus effectively localized and can be copied, pasted into other scripts, etc.

Member Function Documentation

◆ getAxisOp()

◆ sceneInput()

virtual int32_t DD::Image::SceneOpI::sceneInput ( ) const
inlinevirtual

Return the node input to use for the scene source, usually a GeomOp. -1 indicates an internal scene source with no input connection. Default implementation returns -1.

Reimplemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

◆ sceneInputOp()

virtual GeomOp * DD::Image::SceneOpI::sceneInputOp ( ) const
inlinevirtual

Return the sceneInput() input cast to a GeomOp, if possible. Default returns null.

Reimplemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

◆ parentInputSceneOp()

virtual SceneOpI * DD::Image::SceneOpI::parentInputSceneOp ( ) const
inlinevirtual

Return the AxisOp::parentInput() input cast to a SceneOpI, if possible. Default returns null.

Reimplemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

Referenced by buildBasePrimPath().

◆ constrainInputSceneOp()

virtual SceneOpI * DD::Image::SceneOpI::constrainInputSceneOp ( ) const
inlinevirtual

Return the AxisOp::constrainInput() input cast to a SceneOpI, if possible. Default returns null.

Reimplemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

◆ primarySchemaType()

virtual const usg::Token & DD::Image::SceneOpI::primarySchemaType ( ) const
pure virtual

Return the name of the primary USD schema this node is handling. For example usg::GeomTokens.types.Camera, or usg::lux::LuxTokens.types.DistantLight. Must implement.

Implemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

◆ getAppliedApiSchemaTypes()

virtual usg::TokenArray DD::Image::SceneOpI::getAppliedApiSchemaTypes ( ) const
inlinevirtual

Returns a list of additional named schema APIs this node is handling. For example a LightSceneOp would likely apply usg::lux::LuxTokens.types.LightAPI and optionally usg::lux::LuxTokens.types.ShapingAPI.

Default implementation returns an empty array.

Reimplemented in DD::Image::LightSceneOp.

◆ parentPrimCreateType()

virtual const usg::Token & DD::Image::SceneOpI::parentPrimCreateType ( ) const
inlinevirtual

Return the prim type to create for missing prims. Default implementation returns the value of the 'parent_prim_type' knob.

Referenced by _createParentPrims(), and buildBasePrimPath().

◆ buildBasePrimPath()

usg::Path SceneOpI::buildBasePrimPath ( ) const
virtual

Return the full path of the -primary- prim and all its parents created by this node. This is the 'top' prim where any child prims are rooted under.

For example if this is an AxisOp it's typically a single Xform prim, but a CameraOp or LightOp may have additional prims after the main Xform (ie for a stereo camera rig) so this connection point needs to be explicitly identified.

Retrieve the base prim name by calling name() on the returned path.

Base class implementation

Reimplemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

References buildBasePrimPath(), getAxisOp(), DD::Image::Op::nodeName(), parentInputSceneOp(), parentPrimCreateType(), and primPath().

Referenced by buildBasePrimPath(), DD::Image::CameraSceneOp::buildCameraSchemaPrimPath(), DD::Image::LightSceneOp::buildLightSchemaPrimPath(), and DD::Image::AxisSceneOp::buildXformSchemaPrimPath().

◆ primPathFilter()

virtual const char * DD::Image::SceneOpI::primPathFilter ( ) const
inlinevirtual

Return the default filter string to apply in the prim path knob. Default is a filter for Xforms.

Reimplemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

◆ transformCache()

const AxisValsSet * DD::Image::SceneOpI::transformCache ( ) const
inline

Pointer to cache of extracted transforms, if valid and non-empty. The cache is updated by the SceneOpNode during Op configuration -prior- to Op::knobs(store-main) being called.

Referenced by getXformDataAt().

◆ SetAxisKnobAuthoringProvider()

void SceneOpI::SetAxisKnobAuthoringProvider ( Knob_Callback  f)

Assigns AuthoringProviders to the last-created AxisKnob component knobs using the standard component Ids for local TRS.

References SetAuthoringProvider().

Referenced by addLocalXformKnobs().

◆ getAuthoringProviderKnobMap()

const AuthoringProviderKnobMap & SceneOpI::getAuthoringProviderKnobMap ( ) const

A map of Knobs that have authoring providers created for them. This can be used to globally turn the authoring controls or providers on an off without having to scan through the Knobs list on the Op.

References _sceneOpNode.

◆ opKnob()

Knob * SceneOpI::opKnob ( const char *  name) const

Convenience to get a Knob from the Op this interface is attached to. Same as 'getAxisOp()->knob(name)'.

References getAxisOp(), and DD::Image::Op::knob().

Referenced by getLocalAxisKnob(), getLocalParentRotateKnob(), getLocalParentScaleKnob(), getLocalParentTranslateKnob(), getWorldMatrixKnob(), and setReadOnlyLocalXform().

◆ addImportOptionKnobs()

virtual void DD::Image::SceneOpI::addImportOptionKnobs ( Knob_Callback  f)
inlinevirtual

Add prim import control knobs. Default implementation calls _sceneOpNode->addImportOptionKnobs() which creates knobs during the f.makeKnobs() phase, it does not store into any Op vars. Access the knob data via the SharedData.

Referenced by DD::Image::CameraSceneOp::knobs(), and DD::Image::LightSceneOp::knobs().

◆ addXformExtractOptionKnobs()

virtual void DD::Image::SceneOpI::addXformExtractOptionKnobs ( Knob_Callback  f)
inlinevirtual

Add transform decomposition control knobs. Default implementation calls _sceneOpNode->addXformExtractOptionKnobs() which creates creates knobs during the f.makeKnobs() phase, it does not store into any Op vars. Access the knob data via the SharedData.

Referenced by DD::Image::CameraSceneOp::knobs(), and DD::Image::LightSceneOp::knobs().

◆ addExportOptionKnobs()

virtual void DD::Image::SceneOpI::addExportOptionKnobs ( Knob_Callback  f)
inlinevirtual

Add prim export control knobs. Default implementation calls _sceneOpNode->addExportOptionKnobs() which creates knobs during the f.makeKnobs() phase, it does not store into any Op vars. Access the knob data via the SharedData.

Referenced by DD::Image::CameraSceneOp::knobs(), and DD::Image::LightSceneOp::knobs().

◆ addDisplayOptionsKnobs()

void SceneOpI::addDisplayOptionsKnobs ( Knob_Callback  f)
virtual

◆ addLocalParentXformKnobs()

void SceneOpI::addLocalParentXformKnobs ( Knob_Callback  f,
bool  addSyncOptions = true 
)
virtual

◆ addLocalXformKnobs()

void SceneOpI::addLocalXformKnobs ( Knob_Callback  f,
bool  addSyncOptions = true 
)
virtual

Adds the front panel local-axis transform knobs. If addSyncOptions is true the import-sync options are added.

References _sceneOpNode, _snapKnobs, _xformComponents, DD::Image::Axis_knob(), and SetAxisKnobAuthoringProvider().

Referenced by addTransformKnobs().

◆ addTransformKnobs()

void SceneOpI::addTransformKnobs ( Knob_Callback  f,
bool  addSyncOptions = true 
)
virtual

◆ addExtraFrontPanelKnobs()

void SceneOpI::addExtraFrontPanelKnobs ( Knob_Callback  f)
virtual

Adds additional front-panel knobs. Called before addTransformKnobs(). Base class adds nothing.

Reimplemented in DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

◆ KnobDefinesGeometry()

void SceneOpI::KnobDefinesGeometry ( const Knob_Closure &  f)

Use this method if the Knob's value will affect the output scenegraph topology by adding/removing Prims or Attributes, or by changing their names or paths in the output scenegraph.

If the knob is just changing the contents of an existing attribute rather than explicitly creating that attribute, use KnobModifiesExportedAttribValues() instead.

◆ KnobModifiesAttribValues()

void SceneOpI::KnobModifiesAttribValues ( const Knob_Closure &  f)

Use this method if the Knob's value is changing the contents of an existing attribute in an output prim.

Referenced by DD::Image::LightSceneOp::addScanlineRenderFalloffKnobs(), DD::Image::LightSceneOp::addScanlineRenderMaskingKnobs(), and DD::Image::LightSceneOp::addScanlineRenderShadowKnobs().

◆ asGeometryProvider()

GeometryProviderI * DD::Image::SceneOpI::asGeometryProvider ( )
inlineoverridevirtual

GeometryProviderI: Allow subclasses to gain access to sibling functions.

Implements DD::Image::GeometryProviderI.

◆ geometryComposeState()

fdk::Hash SceneOpI::geometryComposeState ( )
overridevirtual

GeometryProviderI: Returns the compose state of the exportLayer.

Implements DD::Image::GeometryProviderI.

References _sceneOpNode, DD::Image::Op::editVersionHash(), getAxisOp(), and DD::Image::Op::validate().

◆ geometryEditVersionState()

fdk::Hash SceneOpI::geometryEditVersionState ( )
overridevirtual

◆ geometryStateVaries()

bool SceneOpI::geometryStateVaries ( )
overridevirtual

GeometryProviderI: Return true if this SceneOp varies in time, which could be from a constraint input or local transform knobs animating. Note that the parent Op connection is not considered since it does not affect this SceneOp's local transforms.

Implements DD::Image::GeometryProviderI.

References _sceneOpNode, DD::Image::Op::editVersionHash(), getAxisOp(), and DD::Image::Op::validate().

◆ canProvideGeometryStage()

bool DD::Image::SceneOpI::canProvideGeometryStage ( ) const
inlineoverridevirtual

GeometryProviderI: Provides a fully constructed usg::Stage via buildGeometryStage().

Reimplemented from DD::Image::GeometryProviderI.

◆ canProvideGeometryFor()

bool SceneOpI::canProvideGeometryFor ( const usg::Token &  purpose) const
overridevirtual

GeometryProviderI: Return true if the AxisOp this is attached to should provide geometry for the given purpose. SceneOps usually do not generate renderable geometry like meshes, so by default if purpose is usg::GeomTokens.overlay then return true, otherwise false.

Reimplemented from DD::Image::GeometryProviderI.

◆ buildGeometryStage()

void SceneOpI::buildGeometryStage ( usg::StageRef &  stage,
const usg::ArgSet &  requestArgs = {},
const fdk::TimeValueSet &  sampleTimes = fdk::TimeValueSet() 
)
overridevirtual

GeometryProviderI: Provide the cached exported stage. The cached stage is only created when this method is called. If the cached stage has the same composeState as the exporter then buildGeometryLayer() is called with any additional sample times but the cached stage itself is left untouched. stage is then set to the exporter's cached stage.

Reimplemented from DD::Image::GeometryProviderI.

References DD::Image::GeometryProviderI::buildGeometryStage().

◆ writeScenePrimsToLayer()

void SceneOpI::writeScenePrimsToLayer ( usg::LayerRef &  layer,
bool  appendTo,
const fdk::FrameValueSet &  times 
)

Write prims this SceneOp generates to an external layer, ignoring the SceneOp's state.

This method is assumed to be called from a separate object which owns the Layer and is handling the allocation and clearing of the layer & clearing any attributes.

layer is assumed to have been created, configured and valid. The list of sample times is a request to the SceneOp and is not guaranteed to result in those exact time samples in the output layer. For example a Knob may not be animated and will only set the default sample, or the keyframes being output are sparse.

References _writeScenePrims().

◆ _createAuthoringProvider()

AuthoringProvider * SceneOpI::_createAuthoringProvider ( Knob k,
uint64_t  componentId 
)
protectedvirtual

Subclass implementation of SetValueProvider to create the correct AuthoringProvider subclass and store in the SceneOpNode. Default implementation creates an AxisValsProvider.

Reimplemented in DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

Referenced by DD::Image::CameraSceneOp::_createAuthoringProvider(), DD::Image::LightSceneOp::_createAuthoringProvider(), and SetAuthoringProvider().

◆ buildSourceSceneState()

virtual fdk::Hash DD::Image::SceneOpI::buildSourceSceneState ( const fdk::Hash &  hash)
inlineprotectedvirtual

Called by SceneOpNode when determining the global source scene state hash. Subclasses can implement this to take any additional values into consideration when determining extractor state, like local knob values, but must careful not to include possibly animating values like Op::hash().

Note that is assumed to be called on the firstOp() and not any specific OutputContext, so all Knob value queries should to be done directly on a Knob and must avoid relying on Op::knobs() storing into local Op variables.

This should always be called from the main thread.

Base class does nothing.

Reimplemented in DD::Image::CameraSceneOp.

◆ getExtractKeyRange()

void SceneOpI::getExtractKeyRange ( SceneOpNodeI::SharedData data,
fdk::TimeValue &  firstKey,
fdk::TimeValue &  lastKey 
)
protectedvirtual

Retrieve the first/last range of keyframes for all prim attributes that will be extracted from. If there are no keyframes (no animation) then set the first/last keys to fdk::defaultTimeValue(). This special value helps a provider quickly determine there are no animated values and thus speed up value retrievals.

Default implementation retrieves any xform attribute keyframes, or if none sets the first/last keys to fdk::defaultTimeValue().

◆ extractSceneData()

bool SceneOpI::extractSceneData ( SceneOpNodeI::SharedData data,
const fdk::TimeValueSet &  addlSampleTimes = fdk::TimeValueSet() 
)
protectedvirtual

Extract the scene data that needs to be cached or processed for the entire scene range. Usually called by SceneOpNode updateSourceSceneData() when the source scene state changes. This should always be called from the main thread.

Important note: the particular Op instance this method is called on is unimportant as the data created by this method is intended to be shared by all sibling Ops. One random Op instance will be called for each configuration change (a stage, prim path or input change) so avoid storing any local data into this Op instance.

Not all prim data needs to be cached if cheap to retrieve from USD, however a good example of expensive data is extracting and decomposing transform matrices which need to be euler filtered over the entire scene. In these cases it's cheaper to do the processing all at once and cache the result.

Default implementation calls extractSceneXformData() and returns true.

References DD::Image::SceneOpNodeI::SceneData::axisValsSet, extractSceneXformData(), DD::Image::GeometryProviderI::getGeometryProviderOp(), DD::Image::SceneOpNodeI::SceneData::isDefaultXforms, DD::Image::Op::nodeName(), DD::Image::AxisVals::print(), DD::Image::SceneOpNodeI::SharedData::sceneData, sourcePrimEnabled(), sourcePrimPath(), and sourceStage().

◆ extractSceneXformData()

void SceneOpI::extractSceneXformData ( SceneOpNodeI::SharedData data,
AxisValsArray &  axisValsSamples,
bool &  isDefaultXforms,
const fdk::TimeValueSet &  addlSampleTimes = fdk::TimeValueSet() 
) const
protectedvirtual

Default implementation extracts the transform info by decomposing the parent and local matrices and runs a euler filter to remove flips, caching the resulting data for the PrimValueProviders to later retrieve. This work is only done when the stage contents change, either via recomposition or layer/stage edits.

References DD::Image::AxisVals::ApplyEulerFilter(), DD::Image::AxisVals::enableParentXformVals(), DD::Image::SceneOpNodeI::ConfigParams::eulerFilterEnable, DD::Image::AxisVals::extractFromMatrix(), getLocalAxisKnob(), DD::Image::SceneOpNodeI::ConfigParams::localExtractEnable, DD::Image::SceneOpNodeI::SharedData::params, params(), DD::Image::SceneOpNodeI::ConfigParams::parentCombineEnable, DD::Image::SceneOpNodeI::ConfigParams::parentExtractEnable, sourcePrimPath(), and sourceStage().

Referenced by extractSceneData().

◆ getXformDataAt()

AxisVals SceneOpI::getXformDataAt ( SceneOpNodeI::SharedData data,
const OutputContext context 
) const
protectedvirtual

Retrieve the transform data for a single time sample at OutputContext. Assumes that extractSceneData() has already been called to first perform any global scene data processing and any caches are ready to be read from.

Default implementation retrieves the AxisVals from the transform cache and does any required interpolation.

References DD::Image::AxisVals::GetAxisValsAtTime(), DD::Image::AxisVals::parentR, DD::Image::AxisVals::parentS, DD::Image::AxisVals::parentT, DD::Image::AxisVals::rotate, DD::Image::AxisVals::scaling, DD::Image::AxisVals::setToDefault(), transformCache(), and DD::Image::AxisVals::translate.

◆ _validateTransforms()

void SceneOpI::_validateTransforms ( bool  for_real,
ndk::XformParameters &  outputXformParams 
)
protectedvirtual

Call this from owner (Axis)Op's implementation of Op::_validate() to build the local _xformComponents.localParentAxis, _xformComponents.localAxis and final local transform matrices for the current (Axis)Op's store state.

Default implementation builds _xformComponents.localParentAxis from the local parent TRS knobs. _xformComponents.localAxis has already been built during Knob store by the 'transform' Axis_Knob but a subclass could override that result via _getSceneOpLocalAxisTransform().

The local transform matrices are build by calling _buildLocalTransforms() with the updated individual transform components, then those are used to build the final concatentated output transforms in outputXformParams.

Note that the concatenated world matrices (l2w, w2l) in outputXformParams should not be calculated in this method and should be handled by the caller.

References _buildLocalTransforms(), _localParentRotate, _localParentScale, _localParentTranslate, _sceneOpNode, _xformComponents, DD::Image::AxisOp::constrainInputOp(), getAxisOp(), DD::Image::Op::nodeName(), DD::Image::Op::outputContext(), DD::Image::AxisOp::parentInputOp(), and DD::Image::AxisOp::worldTransform().

◆ _buildLocalTransforms()

void SceneOpI::_buildLocalTransforms ( const ndk::XformComponents &  xformComponents,
fdk::Mat4d &  preConstraintXform,
const ndk::ConstraintMatrixParams &  constraintParams,
ndk::XformParameters &  finalLocalXforms 
) const
protectedvirtual

Build the final local transforms from the individual transform components, applying any additional constraints.

By default this is called by _validateTransforms() and _getSceneOpWorldTransformAt() so the same transform calculations are done for both evaluation paths.

Note that the concatenated world matrices (l2w, w2l) in finalLocalXforms should not be calculated in this method and should be handled by the caller.

References _applyConstraintToParent, and DD::Image::ConstrainOpI::getConstraintType().

Referenced by _getSceneOpTransformComponentsAt(), and _validateTransforms().

◆ _getLocalParentTransformAnimation()

bool SceneOpI::_getLocalParentTransformAnimation ( fdk::TimeValueSet *  keyTimes = nullptr,
int32_t *  nAnimatedExpressions = nullptr,
int32_t  view = -1 
) const
protectedvirtual

Does the local parent transform animate? This is only an indicator that the transform -MAY- vary in time, not that its value actually does. Default implementation returns true if the local parent knobs have animation enabled or if the constraint input Op varies and it is applied to the local parent TRS. If the knob(s) are animated and keyTimes provided then the knob animation keys times are appended to it. If view is > -1 then the times are retrieved from just that view. If any knobs have expressions but no keyframes then this will also return true, and nAnimatedExpressions will be set > 0, if provided.

References _applyConstraintToParent, DD::Image::Knob::animationTimes(), DD::Image::AxisOp::constrainInputOp(), getAxisOp(), DD::Image::Knob::hasExpression(), DD::Image::Knob::isAnimated(), DD::Image::Op::knob(), and DD::Image::Op::varyingOutputHash().

Referenced by _writeTransformOps().

◆ _getLocalTransformAnimation()

bool SceneOpI::_getLocalTransformAnimation ( fdk::TimeValueSet *  keyTimes = nullptr,
int32_t *  nAnimatedExpressions = nullptr,
int32_t  view = -1 
) const
protectedvirtual

Does the local parent animate? This is only an indicator that the transform -MAY- vary in time, not that its value actually does. Default implementation returns true if the local parent knobs have animation enabled or animated expressions, or if the constraint input Op varies and it is applied to the local parent TRS. If the knob(s) are animated and keyTimes provided then the knob animation keys times are appended to it. If view is > -1 then the times are retrieved from just that view. If any knobs have expressions but no keyframes then this will also return true, and nAnimatedExpressions will be set > 0, if provided.

References _applyConstraintToParent, DD::Image::Knob::animationTimes(), DD::Image::AxisOp::constrainInputOp(), getAxisOp(), DD::Image::Knob::hasExpression(), DD::Image::Knob::isAnimated(), DD::Image::Op::knob(), and DD::Image::Op::varyingOutputHash().

Referenced by _writeTransformOps().

◆ _getSceneOpWorldTransformAt()

Mat4d SceneOpI::_getSceneOpWorldTransformAt ( const OutputContext context) const
protectedvirtual

Calculate the final world transform at a specific OutputContext.

Note that this does the same transform calculation as _validateTransforms() but samples all knobs and inputs at a different context than the one the AxisOp is at by calling the individual transform component 'At(context)' methods.

References _getSceneOpTransformComponentsAt(), getAxisOp(), and DD::Image::Op::nodeName().

Referenced by DD::Image::AxisSceneOp::_getWorldTransformAt(), DD::Image::CameraSceneOp::_getWorldTransformAt(), and DD::Image::LightSceneOp::_getWorldTransformAt().

◆ _sceneOpResetTargetState()

void DD::Image::SceneOpI::_sceneOpResetTargetState ( )
inlineprotected

Call this from the owner Op's implementation of Op::_knobStorePrep(), otherwise the scene op will not update properly. This resets the local GeomStateTargets which are built from knobs during the knobs() store pass.

Referenced by DD::Image::AxisSceneOp::_knobStorePrep(), DD::Image::CameraSceneOp::_knobStorePrep(), and DD::Image::LightSceneOp::_knobStorePrep().

◆ _sceneOpUpdateScenePrimState()

void SceneOpI::_sceneOpUpdateScenePrimState ( const DD::Image::Hash newOpEditVersionHash)
protected

Call this from the owner Op's implementation of Op::_knobStorePost(), otherwise the scene op will not update properly.

References _sceneOpNode.

Referenced by DD::Image::AxisSceneOp::_knobStorePost(), DD::Image::CameraSceneOp::_knobStorePost(), and DD::Image::LightSceneOp::_knobStorePost().

◆ _sceneOpKnobChanged()

int SceneOpI::_sceneOpKnobChanged ( Knob k,
int32_t  callAgain 
)
protectedvirtual

Call this from owner Op::knob_changed(). Enables/disables the local parent controls, and calls the SceneOpI interface to let it handle any changes.

References _snapKnobs, and getAxisOp().

◆ buildGeometryLayer()

usg::LayerRef SceneOpI::buildGeometryLayer ( bool  appendTo,
const fdk::TimeValueSet &  sampleTimes 
)
overrideprotectedvirtual

◆ _createParentPrims()

void SceneOpI::_createParentPrims ( usg::LayerRef &  layer,
const usg::Path &  basePrimPath 
)
protectedvirtual

Create (define) any parent prims in basePrimPath. These are prims in the path -before- the base prim which is always the last prim in the path. Base class implementation uses parentPrimCreateType() as the prim type to create.

References getAxisOp(), DD::Image::Op::nodeName(), and parentPrimCreateType().

Referenced by DD::Image::AxisSceneOp::_writeScenePrims(), DD::Image::CameraSceneOp::_writeScenePrims(), and DD::Image::LightSceneOp::_writeScenePrims().

◆ _writeScenePrims()

virtual void DD::Image::SceneOpI::_writeScenePrims ( usg::LayerRef &  layer,
bool  appendTo,
const fdk::TimeValueSet &  times = fdk::TimeValueSet() 
)
protectedpure virtual

Write prims into the layer. If appendTo is true then only additional time samples should be added to the prim (no define.) layer is assumed to be managed externally. Must implement.

Implemented in DD::Image::AxisSceneOp, DD::Image::CameraSceneOp, and DD::Image::LightSceneOp.

Referenced by writeScenePrimsToLayer().

◆ _writeTransformOps()

void SceneOpI::_writeTransformOps ( usg::LayerRef &  layer,
usg::XformablePrim &  xformable,
bool  appendTo,
const fdk::FrameValueSet &  times = fdk::FrameValueSet() 
)
protectedvirtual

Write the transform data to an Xformable prim. If appendTo is true then only additional time samples should be added to the prim (no define.) A subclass can override this to do additional specialization.

Base class implementation writes separate 'local_parent' and 'local_axis' matrix XformOps.

References _applyConstraintToParent, _getLocalParentTransformAnimation(), _getLocalTransformAnimation(), _sceneOpNode, DD::Image::AxisOp::constrainInputOp(), getAxisOp(), DD::Image::AxisOp::GetTransformComponentsAt(), localAxisXformOpName(), localParentXformOpName(), DD::Image::Op::nodeName(), DD::Image::Op::outputContext(), DD::Image::OutputContext::setView(), and DD::Image::Op::varyingOutputHash().

Referenced by DD::Image::AxisSceneOp::_writeScenePrims(), DD::Image::CameraSceneOp::_writeScenePrims(), and DD::Image::LightSceneOp::_writeScenePrims().

◆ writeKnob() [1/3]

bool SceneOpI::writeKnob ( const char *  knobName,
const fdk::FrameValueSet &  times,
usg::Prim &  outputPrim,
const usg::Token &  targetPropertyName,
usg::Value::Type  targetPropertyTypeHint 
) const
protected

Returns true if value was written or false if not due to error or knob value is at the default.

References writeKnob().

Referenced by DD::Image::CameraSceneOp::_writeScenePrims(), DD::Image::LightSceneOp::_writeScenePrims(), and writeKnob().

◆ writeKnob() [2/3]

bool SceneOpI::writeKnob ( const char *  knobName,
bool  ignoreDefaultTest,
const fdk::FrameValueSet &  times,
usg::Prim &  outputPrim,
const usg::Token &  targetPropertyName,
usg::Value::Type  targetPropertyTypeHint 
) const
protected

Same but controls the default value testing via the ignoreDefaultTest arg.

If ignoreDefaultTest is false we test if the knob is at its default value and only write the knob if it is off default. USD, like Nuke, will use the default value of the knob as fallback if an explicit value is not authored.

However, often the Nuke knob's default will not be the same as the USD property default, and in those cases we always want to author the USD property so that we don't allow USD to use the default fallback. Examples of this are the various CameraOp lens values like focal length, hAperture, vAperture, etc which historically have a default difference to the UsdGeomCamera schema. We don't want to suddenly change Nuke's (arbitrarily chosen) historic camera defaults to conform to USD's (arbitrarily chosen) defaults.

References getAxisOp(), DD::Image::Op::knob(), DD::Image::Op::nodeName(), and writeKnob().

◆ writeKnob() [3/3]

bool SceneOpI::writeKnob ( const ArrayKnobRefList &  knobRefs,
bool  ignoreDefaultTest,
const fdk::FrameValueSet &  times,
usg::Prim &  outputPrim,
const usg::Token &  targetPropertyName,
usg::Value::Type  targetPropertyType 
) const
protected

Same but the attribute Value can be filled in from multiple source ArrayKnobs. This is need when multiple source Knobs contribute to one attribute Value. If any of the source knobs are animated then the output attribute will have time samples.

Note - targetPropertyType is required since a specfic type cannot be divined from multiple source knobs.

References DD::Image::Authoring::DefaultValue, getAxisOp(), DD::Image::Authoring::NoChange, DD::Image::Op::nodeName(), DD::Image::Authoring::SetValue, and DD::Image::OutputContext::setView().



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