### Purpose
Implement BSDF Transparent + include and shader's opacity to MatX nodetree.
### Technical steps
1. Added special type `NodeItem::Type::SurfaceOpacity` to retrieve opacity for \<surface> node.
2. Implemented export of BSDFTransparent node.
3. Implemented export of opacity component in BSDFPrincipled, Add/Mix shader nodes.
4. Removed redundant code.
### Notes
Storm and RPR hydra delegates aren't working good with opacity, this has to be fixed on delegate/hydra side, therefore those changes won't be visible. Opacity can be checked in MaterialXView or MaterialXGraphEditor of the exported mtlx.
Pull Request: DagerD/blender#36
### Purpose
* Code improvements.
* Implemente Tangent Node.
* Glass shader is over-reflected, make Glass shader node utilize only `dielectric_bsdf` with Reflection and Transmission components (scatter = RT).
`"""dielectric_bsdf: A reflection/transmission BSDF node based on a microfacet model and a Fresnel curve for dielectrics."""`
* Sheen node `Roughness` input affects the node's effect.
### Technical Steps
* Code Improvements.
* Comments fixes.
* Implemented Tangent Node, using default `tangent` node.
* Glass shader node: removed mixing with `conductor_bsdf` node as far as `dielectric_bsdf` node already has a reflection component so `conductor_bsdf` seems redundant.
* Sheen node: removed `weight` input for `sheen_bsdf`, as far as it affects the node's effect.
* Renamed Displacementshader -> DisplacementShader.
Pull Request: DagerD/blender#35
### Purpose
Errors in linux build https://builder.blender.org/admin/#/builders/132/builds/2398. Issues in group nodes.
### Technical steps
1. Fixed linux build: set math functions names to convenience.
2. Fixed some issues in group nodes. Made better naming of inputs and outputs in `nodegraph` for group node.
3. `make format`
Co-authored-by: Vasyl-Pidhirskyi <vpidhirskyi@gmail.com>
Pull Request: DagerD/blender#33
### Purpose
#111765 (comment)
* In the default startup .blend, putting the Principled BSDF node in a group doesn't seem to work here. The cube renders white instead of the specified base color.
* The shader/node_group_color.blend renders white when it should be green, ignoring the color set on the group.
### Technical steps
* Specified `to_type_` for `GroupOutputNodeParser`.
* Improved `GroupInputNodeParser::compute()`.
* Improved `GroupOutputNodeParser::compute()`.
Pull Request: DagerD/blender#32
### Purpose
Add support for Wave Texture node.
### Technical steps
Implemented Wave Texture node according to existing Blender's implementation.
Utilizing MaterialX "fractal3d" noise instead of Blender's "perlin_fractal" implementation. Adjusted parameter to get results close to Cycles/Eevee.
Pull Request: DagerD/blender#29
### Purpose
Add support for Gradient Texture node.
### Technical steps
Implemented Gradient Texture node according to existing Blender's implementation,
Fixed dotproduct, added `to_type` argument to be able to specify output type of node while using `arithmetic` method.
Pull Request: DagerD/blender#28
### Purpose
Add parameter `inputs` to `NodeItem::create_node()` and simplify node creation in export implementation.
### Technical steps
Added type `NodeItem::Inputs`
Added parameter `inputs` to `NodeItem::create_node()`.
Updated node export implementation with new functionality.
Pull Request: DagerD/blender#25
### Purpose
TexImage node creates 2 <image> nodes when Color and Output are connected.
### Technical steps
Added name to <image> node, same as node_name with Color output.
Added implementation of TexEnvironment node.
Fixed naming in group_nodes.cc
Pull Request: DagerD/blender#24
### Purpose
Group nodes should be supported.
### Technical steps
1. Created classes `GroupNodeParser`, `GroupOutputNodeParser`, `GroupInputNodeParser` in `materialx/group_nodes.cc/.h`.
2. Added support of `NodeItem::input`, `NodeItem::output`.
3. Added control to use `<nodegraph>` by `#define USE_MATERIALX_NODEGRAPH`. Disabled by default because `pxr::UsdMtlxRead()` doesn't perform nodegraphs.
4. Added logging of `stage->ExportToString()` after `pxr::UsdMtlxRead()`.
5. Improvement in `node_shader_tex_noise.cc`.
Pull Request: DagerD/blender#22
### Purpose
Add support for Input nodes.
### Technical steps
Implemented get_value_default, get_output_default.
Fixed type conversion issue. Now type is converted even if a node is already in the graph.
Added:
* RGB
* Value
Partially implemented:
* Geometry
* Object Info
* Texture Coordinate
* UVMap
* Color Attribute
* Wireframe
Not implemented:
* Ambient Occlusion
* Attribute
* Bevel
* Camera Data
* Fresnel
* Curves Info
* Layer Weight
* Particle Info
* Point Info
* Tangent
Pull Request: DagerD/blender#20
### Purpose
Due to review suggestions, MaterialX export code should be moved to existing node files.
### Technical steps
1. Added `bNodeType::materialx_fn` function pointer.
2. Created special macroses `NODE_SHADER_MATERIALX_BEGIN`, `NODE_SHADER_MATERIALX_END` for including MaterialX export code into `node_shader_<name>.cc` files.
3. Removed `ShaderNodeParser` as not needed, just `NodeParser` can be used. Adjusted `get_input_link()` to work with shader types. Made `get_input_link()` to call `materialx_fn`.
4. Moved `node_parser.cc/.h`, `node_item.cc/.h` to `materialx` folder.
5. Moved MaterialX node export implementation to corresponded `node_shader_<name>.cc` files. Removed `materialx/nodes/...` files.
6. Created `DefaultMaterialNodeParser` in `material.cc`.
Pull Request: DagerD/blender#18
### Purpose
Texture nodes has basic implementation without additional parameters and channels.
### Technical steps
1. Simplified and added `Fac` channel to TexChecker node
2. Fixed TexImage and TexEnvironment nodes: support alpha output, added params, image checking, TODOs.
3. Fix in Math node: moved to Float type.
4. Moved texture nodes to Color4.
Pull Request: DagerD/blender#16
### Purpose
Shader nodes has to be implemented. Adjust parsing system for export shaders.
### Technical steps
1. Added supported shader types to `NodeItem::Type`, added `Type::Any`, added comments.
2. Created `class ShaderNodeParser` special for parse shaders.
3. Added type conversion to `get_input_link()` and `get_input_default()`.
4. Added file templates for export new shaders. Implemented `AddShader`, `BSDFDiffuse`, `Emission`, `MixShader`.
5. Improved TexChecker using arithmetic functions.
### Notes
Other shaders aren't implemented, added TODOs. They'll be implemented in next PRs.
Pull Request: DagerD/blender#13
### Purpose
Move NodeItem::Type argument from setters to getters
### Technical steps
Moved NodeItem::Type argument from setters to getters
Pull Request:DagerD/blender#12
### Purpose
`NodeItem` requires `convert()` method for node type conversion. This will simplify arithmetic and other methods.
### Technical steps
1. Moved `NodeItem` type` and conditional type` in `if_else` from `string` to `enum` values.
2. Implemented `NodeItem::convert()` method.
3. Simplified `set_input` methods.
4. Refactor: rearranged functions in `NodeItem` to satisfy blender code style.
Pull Request: DagerD/blender#9
### Purpose
There is set of code improvements and bug fixes required in NodeParser system.
### Technical steps
1. Separated `OutputMaterialNodeParser` declaration to `output_material.h`. Added more functionality.
2. Added `NodeParser::compute_full()` with additional logging and naming of mx_node.
3. Fix: added check if node was already computed.
4. Fixed TexChecker.
5. Code improvements, renamings, code cleanup.
### Notes
There is no need additional scaling in TexChecker, it was removed. There is issue with UV map on default cube, which should be fixed another way.
Pull Request: DagerD/blender#8
### Purpose
Change debug printf to CLOG logger. Add other logging.
### Technical steps
1. Applied CLOG logger to `bf_nodes_shader` project.
2. Changed debug `printf` to logging. Added other logging.
3. Fixed "Use MaterialX" in `rna_render.cc`.
### Notes
Don't use `--log-show-basename` blender running flag in Windows, because of clog crash due to incorrect path separator for `bf_nodes_shader` project.
Pull Request: DagerD/blender#7
### Purpose
Continuing implementation of arithmetic functions for `NodeItem`. Implement Math node.
### Technical steps
1. Separated implementation of `NodeItem` and `NodeParser` to separate files.
2. Added more functions to `NodeItem`.
3. Implemented Blender Math node.
### Notes
Some operations from Math node aren't implemented. Probably will be done in separate task.
Pull Request: DagerD/blender#6