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

#include <ModifyGeomOp.h>

Inheritance diagram for DD::Image::ModifyGeomOp::ModifyEngine:
DD::Image::GeomOpEngine DD::Image::FilterPrimsGeomEngineI

Public Member Functions

usg::PathArray filteredPrims ()
 
- Public Member Functions inherited from DD::Image::GeomOpEngine
std::string name () const override
 
OpfirstOp () const
 
KnobnodeKnob (const char *knobName) const
 Return the raw Knob* from the parent Node.
 
ndk::GraphScopeId graphScopeId () const
 
uint64_t version () const
 Version number of engine, incremented when state changes.
 
KnobBinding knob (const char *knobName) const
 Return a read handle to the named Knob from the engine.
 
template<typename T >
getValue (const KnobBinding &knob) const
 Convenience method to get a value from a KnobBinding, if it's valid.
 
template<typename T >
getValue (const char *knobName) const
 Convenience method to get a value from a named Knob, if it exists.
 
template<typename T >
getValue (const T &defaultValue, const char *knobName, double frame, int view=-1) const
 Convenience method to get a value from a named Knob, if it exists, otherwise return defaultValue.
 
template<typename T >
getValue (const T &defaultValue, const char *knobName) const
 getValue() variant for uniform (non-animating) Knobs, or if the default uiContext() is desired.
 
template<typename T >
void getValue (T &v, const char *knobName, double frame, int view=-1) const
 
template<typename T >
void getValue (T &v, const char *knobName) const
 getValue(&T) variant for uniform (non-animating) Knobs, or if the default uiContext() is desired.
 
template<typename T >
getValue (const T &defaultValue, const KnobBinding &knob, double frame, int view=-1) const
 Convenience method to get a value from a KnobBinding, if it's valid, otherwise return defaultValue.
 
template<typename T >
getValue (const T &defaultValue, const KnobBinding &knob) const
 getValue() variant for uniform (non-animating) Knobs, or if the default uiContext() is desired.
 
OpGraphLocation inputConnection (uint32_t nodeInput)
 
Op::Input inputConnectionAt (uint32_t nodeInput, double frame, const OutputContext &inputCtx, Execute *execute=nullptr)
 
Op::Input inputConnectionAt (uint32_t nodeInput, double frame, int32_t view=-1, Execute *execute=nullptr)
 
OpinputOpAt (uint32_t nodeInput, double frame, const OutputContext &inputCtx, Execute *execute=nullptr)
 
OpinputOpAt (uint32_t nodeInput, double frame, int32_t view=-1, Execute *execute=nullptr)
 
OpinputOp (uint32_t nodeInput) const
 
size_t nInputs () const override
 Return the number of Node input connections. Note that these are NOT Op inputs.
 
GeomEngine * inputEngine (uint32_t nodeInput) const override
 
GeomEngine * inputEngine0 () const override
 
GeomEngine * inputEngine1 () const override
 
void printInputs (std::ostream &, const char *prefix="") const
 Prints the contents of the current input.
 
bool validateState (bool forceUpdate=false)
 
void processScenegraph (usg::GeomSceneContext &context) override
 
void updateStateToContext (const OutputContext &context)
 
const fdk::Hash & lastRequestHash () const
 
virtual usg::Path importShaderOp (bool createMode, usg::GeomSceneContext &context, const Op::InputConnectionContextList &sourceOps, uint32_t materialGroupIndex, const usg::Path &materialLibraryPath)
 
virtual void assignMaterialBinding (usg::GeomSceneContext &context, bool createMode, const usg::Path &materialPath, const usg::PathArray &primPaths)
 
std::shared_ptr< usg::PathArray > getPathsToInjectDownstream (InjectionType type) const
 Returns the prim paths for a particular injection type that should be injected into the downstream engine.
 
void setPathsToInjectDownstream (InjectionType type, std::shared_ptr< usg::PathArray > paths)
 Sets the prim paths for a particular injection type that should be injected into the downstream engine.
 
virtual bool secondaryFilterPrimPaths (const usg::StageRef &srcStage, const usg::PathArray &inPrimPaths, usg::PathArray &outPrimPaths)=0
 

Protected Member Functions

 ModifyEngine (GeomOpNode *parent, FilterPrimsGeomEngineI *filter=nullptr)
 
bool updateFilteredPrimPaths (GeomEngine *inputEngine, const usg::StageRef &stage)
 
virtual void appendFilterHash (fdk::Hash &filterHash) const
 
void processScenegraph (usg::GeomSceneContext &context) override
 
virtual usg::PathArray filteredPrimPaths (const usg::StageRef &srcStage)
 
bool secondaryFilterPrimPaths (const usg::StageRef &srcStage, const usg::PathArray &inPrimPaths, usg::PathArray &outPrimPaths) override
 
virtual void processPrimSelection (usg::GeomSceneContext &context, const usg::StageRef &srcStage, const usg::PathArray &primPaths)
 
virtual void processPrim (usg::GeomSceneContext &context, const usg::StageRef &srcStage, const usg::Path &primPath)
 
- Protected Member Functions inherited from DD::Image::GeomOpEngine
 GeomOpEngine (GeomOpNode *parent)
 
void _printInput (std::ostream &o, const GeomOpEngine::Input &b) const
 
void setOwnerNode ()
 Sets the owner node data in the edit layer to point to the owning node.
 
void _updateState (ndk::GraphScopeId nodeGraphScopeId, fdk::TimeValueSet &sampleTimes, std::set< int32_t > &sampleViews)
 
virtual void _updatePathsToInjectFromInput ()
 

Protected Attributes

ModifyPathsGeomOpI::SubEngine _modifySubEngine
 
- Protected Attributes inherited from DD::Image::GeomOpEngine
GeomOpNode * _geomNode
 Owner node.
 
ndk::GraphScopeId _graphScopeId
 Node graph context hash identifier, unique to the GraphScope.
 
usg::ShaderDescGroupPtrMap _shaderDescGroups
 Groups of locally-created ShaderDescs.
 
InjectedPaths _pathsToInjectDownstreamByType
 Array of prim path arrays to be injected downstream where the array is indexed by the injection type.
 

Additional Inherited Members

- Public Types inherited from DD::Image::GeomOpEngine
enum class  InjectionType : int32_t { DownstreamEngineDefault , NextEngineOverride , NumElements }
 
using InjectedPaths = std::array< std::shared_ptr< usg::PathArray >, static_cast< int32_t >(InjectionType::NumElements)>
 
- Protected Types inherited from DD::Image::GeomOpEngine
using InputList = std::vector< Input >
 

Detailed Description

The plugin author should at least implement the processPrim() method.

Constructor & Destructor Documentation

◆ ModifyEngine()

DD::Image::ModifyGeomOp::ModifyEngine::ModifyEngine ( GeomOpNode *  parent,
FilterPrimsGeomEngineI filter = nullptr 
)
inlineprotected

Prim filtering will be done in subclass's secondaryFilterPrimPaths() unless filter argument is a non-null pointer.

Member Function Documentation

◆ updateFilteredPrimPaths()

bool ModifyGeomOp::ModifyEngine::updateFilteredPrimPaths ( GeomEngine *  inputEngine,
const usg::StageRef &  stage 
)
protected

Call this to re-evaluate the filtered paths defined by the mask expression and any additional filter logic a subclass may want to apply in filteredPrimPaths() and secondaryFilterPrimPaths(). Returns true if the path set changed.

◆ appendFilterHash()

virtual void DD::Image::ModifyGeomOp::ModifyEngine::appendFilterHash ( fdk::Hash &  filterHash) const
inlineprotectedvirtual

Change the hash of the current filter. Subclasses can implement this to force the prim filter methods to be re-run, usually because the subclass has knobs that can affect the result of the filtering. Default implementation does nothing.

◆ processScenegraph()

void ModifyGeomOp::ModifyEngine::processScenegraph ( usg::GeomSceneContext &  context)
overrideprotected

Calls buildScenegraph() on input 0 then the subclass processPrimSelection() method.

References DD::Image::GeomOpEngine::processScenegraph().

◆ filteredPrimPaths()

usg::PathArray ModifyGeomOp::ModifyEngine::filteredPrimPaths ( const usg::StageRef &  srcStage)
protectedvirtual

Get the list of filtered prim paths from the provided stage using the current scenegraph filter. ModifyEngine calls this in updateFilteredPrimPaths() when the mesh expression or input stage compose state changes, and saves the resulting path list to _filtered_prims.

Subclasses can override this method to extend/replace the filtering logic of the builtin PathExpression knob, or implement secondaryFilterPrimPaths() to do Prim type testing, etc.

◆ secondaryFilterPrimPaths()

bool DD::Image::ModifyGeomOp::ModifyEngine::secondaryFilterPrimPaths ( const usg::StageRef &  srcStage,
const usg::PathArray &  inPrimPaths,
usg::PathArray &  outPrimPaths 
)
inlineoverrideprotectedvirtual

◆ processPrimSelection()

void ModifyGeomOp::ModifyEngine::processPrimSelection ( usg::GeomSceneContext &  context,
const usg::StageRef &  srcStage,
const usg::PathArray &  primPaths 
)
protectedvirtual

Loops through the selected prim paths calling processPrim().

This method is called from processScenegraph() only if the input or local state is dirty.

This is virtual to allow a subclass that needs the entire prim selection a chance to do something before the per-prim loop is run. For example finding the total bbox of the selected prims.

So a subclass would implement this method, do something with the prim paths first, then call ModifyGeomOp::processPrimSelection() to have the prim loop run. Or it can just do all the work in here and not bother calling the base class implementation.

References DD::Image::Op::error().

◆ processPrim()

virtual void DD::Image::ModifyGeomOp::ModifyEngine::processPrim ( usg::GeomSceneContext &  context,
const usg::StageRef &  srcStage,
const usg::Path &  primPath 
)
inlineprotectedvirtual

Per-prim processing method.

This method is called from a prim path loop in processPrimSelection() only if the input or local state is dirty.

If your subclass needs to work with the entire selection set then just implement processPrimSelection().



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