HDK
|
#include <HUSD_CreateMaterial.h>
Public Member Functions | |
HUSD_CreateMaterial (HUSD_AutoWriteLock &lock, const HUSD_OverridesPtr &overrides=HUSD_OverridesPtr()) | |
Standard c-tor. More... | |
bool | createMaterial (VOP_Node &material_vop, const UT_StringRef &usd_mat_path, bool auto_create_preview_shader) const |
bool | updateShaderParameters (VOP_Node &shader_vop, const UT_StringArray ¶meter_names, const UT_StringRef &usd_shader_path) const |
Re-translates the shader parameters given the shader VOP node. More... | |
bool | createDerivedMaterial (const UT_StringRef &base_material_path, const UT_Options &material_parameters, const UT_StringRef &usd_mat_path) const |
bool | createLightFilter (VOP_Node &light_filter_vop, const UT_StringRef &usd_light_filter_path) const |
bool | createPreviewShader (const UT_StringRef &main_shader_path) const |
bool | deletePreviewShader (const UT_StringRef &main_shader_path) const |
bool | hasPreviewShader (const UT_StringRef &main_shader_path) |
bool | clearAutoCreateFlag (const UT_StringRef &preview_shader_path) |
Clears the auto-created metadata flag on the preview shader primitive. More... | |
void | setTimeCode (const HUSD_TimeCode &time_code) |
Sets the time code at which shader parameters are evaluated. More... | |
void | setParentPrimType (const UT_StringHolder &type) |
void | addDependent (OP_Node *node) |
void | setShouldReferenceRenderVars (bool flag) |
Definition at line 32 of file HUSD_CreateMaterial.h.
HUSD_CreateMaterial::HUSD_CreateMaterial | ( | HUSD_AutoWriteLock & | lock, |
const HUSD_OverridesPtr & | overrides = HUSD_OverridesPtr() |
||
) |
Standard c-tor.
Adds the given node as a potential dependent on the shader nodes being translated.
bool HUSD_CreateMaterial::clearAutoCreateFlag | ( | const UT_StringRef & | preview_shader_path | ) |
Clears the auto-created metadata flag on the preview shader primitive.
bool HUSD_CreateMaterial::createDerivedMaterial | ( | const UT_StringRef & | base_material_path, |
const UT_Options & | material_parameters, | ||
const UT_StringRef & | usd_mat_path | ||
) | const |
Creates a new USD material primitive at usd_mat_path
, which inherits from the material given by base_material_path
, and sets the parameter override values on the created material. The keys are used for Material input attribute name (eg, "diffuseColor"), but they can also have a shader primitive path prefix (eg, "preview_surface/diffuseColor"), in which case the override value for "diffuseColor" will be authored on the "preview_surface" Shader primitive inside the usd_mat_path
Material.
bool HUSD_CreateMaterial::createLightFilter | ( | VOP_Node & | light_filter_vop, |
const UT_StringRef & | usd_light_filter_path | ||
) | const |
Creates a new USD light filter primitive at usd_light_filter_path
, from the filter node given by .
bool HUSD_CreateMaterial::createMaterial | ( | VOP_Node & | material_vop, |
const UT_StringRef & | usd_mat_path, | ||
bool | auto_create_preview_shader | ||
) | const |
Defines a USD material primitive at a given usd_mat_path
based on given material_vop
material node.
auto_create_preview_shader | If true, an attempt is made to ensure the created material has a preview shader (for the universal render context). Ie, if the material node does not contain any explicit preview shader node to translate, then an ad-hoc preview shader USD primitive will be generated. |
bool HUSD_CreateMaterial::createPreviewShader | ( | const UT_StringRef & | main_shader_path | ) | const |
Creates a new standard USD preview shader primitive based on the given render-specific shader USD primitive.
bool HUSD_CreateMaterial::deletePreviewShader | ( | const UT_StringRef & | main_shader_path | ) | const |
Destroys auto-created preview shader, that was created based on the given render-specific shader.
bool HUSD_CreateMaterial::hasPreviewShader | ( | const UT_StringRef & | main_shader_path | ) |
Returns ture if the given shader has a corresponding preview shader, auto-created based on its input attributes.
|
inline |
Sets the primitive type that should be used when creating parents that don't exist yet in the USD hierarchy.
Definition at line 97 of file HUSD_CreateMaterial.h.
|
inline |
Configures the material creator to reference any Render Vars scope created by shader translator into the global /Render/Products. This will allow Karma to readily render these AOVs/RenderVars.
Definition at line 107 of file HUSD_CreateMaterial.h.
|
inline |
Sets the time code at which shader parameters are evaluated.
Definition at line 92 of file HUSD_CreateMaterial.h.
bool HUSD_CreateMaterial::updateShaderParameters | ( | VOP_Node & | shader_vop, |
const UT_StringArray & | parameter_names, | ||
const UT_StringRef & | usd_shader_path | ||
) | const |
Re-translates the shader parameters given the shader VOP node.