Nuke binary plugins  14.0.8
DD::Image::LightMaterialOpI Class Reference
Inheritance diagram for DD::Image::LightMaterialOpI:
DD::Image::MaterialOpI DD::Image::LightOp DD::Image::ComplexLightOp

Public Member Functions

void defineLightPrim (const usg::LayerRef &define_layer, const usg::Path &light_prim_path, const MaterialContext &rtx, usg::ShaderDescGroup &shaderdesc_group)
 
- Public Member Functions inherited from DD::Image::MaterialOpI
virtual OpgetOp ()
 Return the Op this interface is attached to. Should return 'this'.
 
virtual usg::TokenArray getAppliedApiSchemas () const
 Returns a list of API's this output shader must implement.
 
virtual const char * getOutputSchema () const
 
virtual int32_t getOutputType () const
 
bool isCoShader () const
 Convenience to check output type.
 
bool isSurfaceShader () const
 
bool isLightShader () const
 
bool isVolumeShader () const
 
virtual std::string getShaderNodeName (const usg::Token &target_renderer=usg::Token())
 
virtual int32_t connectionTypeForNodeInput (int32_t node_input) const
 
virtual usg::ShaderDesc * createShaderGraph (int32_t output_type, const MaterialContext &rtx, usg::ShaderDescGroup &shader_group)
 
virtual usg::ShaderDesc * createShaderGraphFromOp (Op *input_op, const MaterialContext &rtx, usg::ShaderDescGroup &shader_group)
 
virtual void updateShaderGraphOverrides (int32_t output_type, const MaterialContext &rtx, usg::ShaderDescGroup &shader_group)
 
virtual void updateShaderGraphFromOp (Op *input_op, const MaterialContext &rtx, usg::ShaderDescGroup &shader_group)
 

Protected Member Functions

bool overrideShaderDescInput (const char *knob_name, const MaterialContext &rtx, usg::ShaderDesc &shader_desc, const char *target_property_name, usg::Value::Type target_property_type_hint=usg::Value::Type::InvalidType) override
 
bool overrideShaderDescInput (const Channel &chan, const MaterialContext &rtx, usg::ShaderDesc &shader_desc, const char *target_property_name) override
 
bool overrideShaderDescInput (const Channel *chan_array, uint32_t num_channels, const MaterialContext &rtx, usg::ShaderDesc &shader_desc, const char *target_property_name) override
 
bool overrideShaderDescInput (const ChannelSet &channels, const MaterialContext &rtx, usg::ShaderDesc &shader_desc, const char *target_property_name) override
 

Additional Inherited Members

- Public Types inherited from DD::Image::MaterialOpI
enum  {
  INPUT_TYPE_NONE, INPUT_TYPE_OP, INPUT_TYPE_MATERIALOP, INPUT_TYPE_IOP,
  INPUT_TYPE_AXISOP, INPUT_TYPE_CAMERAOP, INPUT_TYPE_LIGHTOP
}
 
enum  {
  OUTPUT_TYPE_NONE, OUTPUT_TYPE_COSHADER, OUTPUT_TYPE_SURFACESHADER, OUTPUT_TYPE_LIGHTSHADER,
  OUTPUT_TYPE_VOLUMESHADER
}
 
- Static Public Member Functions inherited from DD::Image::MaterialOpI
static std::string buildName (const std::string &node_name, const char *schema_name)
 Convenience function builds a standard shader name with '<node_name>_<schema_name>'.
 
static std::string buildName (const usg::Token &target_renderer, const std::string &node_name, const char *schema_name)
 Convenience function builds a standard shader name with '<target_renderer>_<node_name>_<schema_name>'.
 
static int32_t getShaderTypeFromOp (Op *op)
 
static std::string getShaderNodeNameFromOp (const usg::Token &target_renderer, Op *op)
 
static const char * inputShaderTypeName (int32_t op_type)
 
static usg::ShaderDesc * createOpInterfaceShaderDesc (int32_t op_type, Op *op)
 
static usg::ShaderDesc * createOpInterfaceShaderDesc (Op *op)
 
static std::string buildAssetPath (Op *input_op)
 
static bool parseAssetPath (const usg::AssetPath &assetPath, std::string &nodeName, OutputContext &context, Hash &hash)
 
static OpretrieveOpFromAssetPath (const usg::AssetPath &assetPath)
 

Detailed Description

Interface for abstracting Light usg::Prims and their possible materials, usually built from LightOps.

LightMaterialOpI converts a graph network of Nuke LightOp, AxisOp, and Iop Nodes into usg::Prims with the matching Xform parenting structure. At the moment (Nuke14-2022) the material and shader graph part is ignored in favor of using the direct texture assignment attributes on the Light Prims. When light shader graphs are formally supported they will likely be handled similar to surface materials and stored under a shared 'light library' locale in the scenegraph. This is the reason why this class is a subclass of MaterialOpI.

The biggest topological difference between this and MaterialOpI is that a Light usg::Prim is created with possibly a parenting rig added above it rather than a single usg::MaterialPrim and multiple usg::ShaderPrims underneath.

Member Function Documentation

void DD::Image::LightMaterialOpI::defineLightPrim ( const usg::LayerRef &  define_layer,
const usg::Path &  light_prim_path,
const MaterialContext rtx,
usg::ShaderDescGroup &  shaderdesc_group 
)

Define a Light Prim from the wrapped LightOp in the provided GeomLayer, setting any attribute overrides.

'light_path' is the absolute path to the new Light Prim with the new prim name at the end.

Optionally initialize a ShaderDescGroup with all the ShaderDesc comprising this light's shader tree and its input connections, and assign the 'output' shader entry point for the group.

References DD::Image::MaterialOpI::getOp(), DD::Image::MaterialOpI::getOutputSchema(), DD::Image::MaterialOpI::getShaderNodeName(), DD::Image::Op::nodeName(), DD::Image::MaterialOpI::OUTPUT_TYPE_LIGHTSHADER, and DD::Image::MaterialOpI::updateShaderGraphOverrides().

bool DD::Image::LightMaterialOpI::overrideShaderDescInput ( const char *  knob_name,
const MaterialContext rtx,
usg::ShaderDesc &  shader_desc,
const char *  target_property_name,
usg::Value::Type  target_property_type_hint = usg::Value::Type::InvalidType 
)
overrideprotectedvirtual

Copy the value from a local Op Knob to the ShaderDesc. Translates light Prim property names and trim any leading 'inputs:' or 'outputs:'.

Reimplemented from DD::Image::MaterialOpI.

References DD::Image::MaterialOpI::overrideShaderDescInput().

bool DD::Image::LightMaterialOpI::overrideShaderDescInput ( const Channel chan,
const MaterialContext rtx,
usg::ShaderDesc &  shader_desc,
const char *  target_property_name 
)
overrideprotectedvirtual

Specialization for Channel-source override. Translates light Prim property names and trim any leading 'inputs:' or 'outputs:'.

Reimplemented from DD::Image::MaterialOpI.

References DD::Image::MaterialOpI::overrideShaderDescInput().

bool DD::Image::LightMaterialOpI::overrideShaderDescInput ( const Channel chan_array,
uint32_t  num_channels,
const MaterialContext rtx,
usg::ShaderDesc &  shader_desc,
const char *  target_property_name 
)
overrideprotectedvirtual

Specialization for ChannelArray-source override. Translates light Prim property names and trim any leading 'inputs:' or 'outputs:'.

Reimplemented from DD::Image::MaterialOpI.

References DD::Image::MaterialOpI::overrideShaderDescInput().

bool DD::Image::LightMaterialOpI::overrideShaderDescInput ( const ChannelSet channels,
const MaterialContext rtx,
usg::ShaderDesc &  shader_desc,
const char *  target_property_name 
)
overrideprotectedvirtual

Specialization for ChannelSet-source override. Translates light Prim property names and trim any leading 'inputs:' or 'outputs:'.

Reimplemented from DD::Image::MaterialOpI.

References DD::Image::MaterialOpI::overrideShaderDescInput().



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