Nuke binary plugins  14.0.8
DD::Image::ModifyGeomOp::ModifyEngine Class Reference

Inherits DD::Image::GeomOpEngine.

Public Member Functions

usg::PathArray filteredPrims ()
 

Protected Member Functions

 ModifyEngine (Op *parent)
 
bool updateFilteredPrimPaths (GeomEngine *inputEngine)
 
void processScenegraph (usg::GeomSceneContext &context) override
 
virtual usg::PathArray filteredPrimPaths (const usg::StageRef &srcStage)
 
virtual bool secondaryFilterPrimPaths (const usg::StageRef &srcStage, const usg::PathArray &inPrimPaths, usg::PathArray &outPrimPaths)
 
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 Attributes

std::string _filter_source
 Raw mask pattern string.
 
bool _filter_do_all
 Filter applies to all objects.
 
fdk::Hash _filter_hash
 Indicates when _filtered_prims need updating.
 
usg::PathArray _masked_prims
 Results of path masking.
 
usg::PathArray _filtered_prims
 Results of filtering the masked paths.
 

Detailed Description

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

Member Function Documentation

bool ModifyGeomOp::ModifyEngine::updateFilteredPrimPaths ( GeomEngine *  inputEngine)
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.

References _filter_do_all, _filter_hash, _filter_source, _filtered_prims, _masked_prims, and filteredPrimPaths().

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

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

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.

References DD::Image::Op::knob(), and DD::Image::PathExpression_KnobI::match().

Referenced by updateFilteredPrimPaths().

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.

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



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