Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some operations to the Math node. #111

Merged
merged 2 commits into from
Mar 7, 2020

Conversation

tomoaki-e33
Copy link

I suggest adding some missing operations to the Math node: "sqrt", "abs", "min", "max", "round", "floor", "ceil", "fraction".

These are found in the Math node of Blender Shader and Composite, but not in Sorcar. I think it would be better if Sorcar's Math node could be used as well as that of Shader. Beginners from Shader node will be able to use without hesitation.

I understand that these operations can be achieved by combining existing nodes. But they will make some node trees simpler and more straightforward.

What do you think?

スクリーンショット 2020-02-08 0 13 26 1

Copy link
Owner

@aachman98 aachman98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Sorry for the late reply. I had been busy for the last couple of months.
The code looks fine. Will be merging this by tomorrow (already approved), so if you want to make the change I've mentioned, feel free.
And thanks for contributing to Sorcar!

out["Value"] = x - math.floor(x)
elif (op == 'MOD'):
out["Value"] = int(x) % int(y)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to convert x & y to int

("SUB", "X - Y", "Subtraction"),
("MULT", "X * Y", "Multiplication"),
("DIV", "X / Y", "Division"),
None,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this..
I didn't know you could use "None" to create a separator in the menu xD

@aachman98 aachman98 added the scheduled Feature to be released soon label Mar 6, 2020
@tomoaki-e33
Copy link
Author

Thanks for your reply and review!
Sorcar is a great project!

@aachman98 aachman98 merged commit cda5c97 into aachman98:master Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scheduled Feature to be released soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants