forked from blender/blender
Implement type conversion for NodeItem #9
No reviewers
Labels
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: DagerD/blender#9
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "BogdanNagirniak/blender:matx-nodeitem-type"
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
NodeItem
requiresconvert()
method for node type conversion. This will simplify arithmetic and other methods.Technical steps
NodeItem
typeand conditional type
inif_else
fromstring
toenum
values.NodeItem::convert()
method.set_input
methods.NodeItem
to satisfy blender code style.BSDFPrincipled
node.Comments in code. Also haven't found Working with
Type::integer
(inNodeItem::is_arithmetic
,NodeItem::convert
etc) . Shouldn't we add it?@ -425,2 +435,2 @@
return value ? value->getTypeString() : node->getType();
}
NodeItem res = empty();
if (type() != Type::Float || other.type() != Type::Float) {
Should
Integer
be here?Discussed: let it be here
@ -12,0 +22,4 @@
Color3,
Color4
};
enum class IfType { Less = 0, LessEq, Eq, GreaterEq, Greater, NotEq };
IfType -> ComparisonType
@ -378,2 +239,3 @@
NodeItem NodeItem::convert(Type to_type) const
{
std::string mx_type = type();
Type tp = type();
tp -> from_type
@ -587,3 +612,1 @@
else {
return false;
}
return tp >= Type::Float;
Type::Float -> Type::Integer
Integer isn't used in arithmetic operations
@ -12,0 +12,4 @@
public:
enum class Type {
Empty = 0,
Other,
Add comment what is
Other
@ -34,3 +38,1 @@
const std::string &output_name = "");
void add_output(const std::string &name, const std::string &mx_type);
/* Operators */
Suggest add
#pragma region
for such placesIt is not commonly used in Blender code
Works fine.