forked from blender/blender
Code improvements + Mix node #30
No reviewers
Labels
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: DagerD/blender#30
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "BogdanNagirniak/blender:matx-code-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose
After last merged PRs some code has to be improved. Implement Mix node.
Technical steps
blend()
->mix()
+ shaders + mix node usageextract()
->operator[]
length()
,to_vector()
,normalize()
,rotate()
, fixeddotproduct()
matx-code-improvementsto Code improvements + Mix node@ -231,0 +219,4 @@
bool invert = node_->custom2;
NodeItem vector = get_input_value("Vector", NodeItem::Type::Vector3);
NodeItem center = get_input_value("Center", NodeItem::Type::Vector3);
To perform the same result as Blender it requires invert Z.
NodeItem center = get_input_value("Center", NodeItem::Type::Vector3) * val(MaterialX::Vector3(1.0f, 1.0f, -1.0f))
@ -242,2 +289,2 @@
other, "dotproduct", [](float a, float b) { return a * b; }, Type::Float);
if (d.value) {
if (value && other.value) {
NodeItem d = *this * other;
Please take a look at code below
To fix
dotproduct
for values used.value->asA<MaterialX::...
insteadvalue->asA<MaterialX::...
.Works fine.
Works as expected.