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
Using new mix node in Blender 3.4 #357
Using new mix node in Blender 3.4 #357
Conversation
…dAnimations-patch-1
For the new Mix Node use A ,B ,Result
@zNightlord can this be merged into the dev branch? Master is what we use for releases
Edit 2: all new features go to dev regardless |
I'll do further review later this week, but through my quick skim of the code here's what I did notice the use of |
Just requesting a review from @.TheDuckCow for this pull request, though I'll also be reviewing the code and noting where changes have to be made to account for #348 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking to request changes, but I recognize I'm not being very explicit yet as I need to take a look myself. The main comment is below, about having consistent return times. I don't love the idea of having to have every single node return both its reference and a sockets function just due to this one change, but the higher-level point for me is that functions have a consistent return structure regardless of what happens inside (ie number of return vars)
Regardless, thanks for jumping so quick on this!
MCprep_addon/materials/generate.py
Outdated
sockets= { | ||
"inputs": inputs, | ||
"outputs": outputs | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to live test a little, but this feels a bit funny to me. I think it's important that a function generally has the same return structure regardless of how it runs (here, sometimes it returns one value, sometimes two, which makes it unclear what you get back down the line).
I'll probably propose an edit later today unless you beat me to it.
Did the socket names change, or just the order? If the names we need to use are the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be the C++/Rust part of my brain acting up, but couldn't we just either:
A. Always return a tuple regardless of the amount of objects, where the first item is the node and the second object depending on the version can be the sockets
B. Use a small wrapper class to handle this situation
Knowing how CPython works though, the C++/Rust part of my brain is screaming "unnecessary copy!" as I write this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could split the sockets part out to a different function like get_node_socket("ShaderMixNode", "outputs",1)
It will do versioning for the socket of that node type seperate.
…into mixrgb-legacy
Oops. |
Alright I'll start my review (sorry for the delay, I was installing Arch on my system) |
Note that anything I mark as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, some good things. There are a couple of sections that may need to be changed for internal refactoring, depending on what we decide for 3.4 version detection
cleanup, commenting
replace `location` `name` `label` any default attribute add `hide_sockets` optional hide the node sockets
Sorry for the long delay getting back to you - I'll try to finish my review towards the end of this weekend, and then hopefully we can just merge it and address any follow ups ad hoc so we don't lose track. Thanks again for going through the iterations here! |
create_node add functionality for nodegroup name string
No problem. |
FYI I'm almost but not quite done with some local updates I'm going to push onto the branch before approving/merging, so please avoid making any changes until I get that in (just didn't quite get it done tonight). |
Hey @zNightlord can you add me as an editor to your fork here? (settings deeplink: https://github.com/zNightlord/MCprep/settings/access). Then I can push the commit I've got locally. On that, I'll approve and we can merge it in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
I was quite hesitant about having the *attrs argument for the node function. But in the end, it does provide upside, and from a code completion standpoint, we don't have static typing really with the node objects being passed around anyways.
All in, thanks for making this change, glad to have it merged in 👍 (oh and local testing went well enough, I'll do some more testing in older blender versions too; but all automated tests through 2.80+ work fine).
Alright I don't have write access. So you can merge it now |
This adds
create_node()
to helps with node generation between version with different socket index