Standard attribute names can be used for printing
when debugging or testing. Before the advent of
dynamic sockets, this could be used as a unification
of the identifier_suffix. It also partially affects the
standardization of naming sockets of different types
of the same attribute.
Details
Diff Detail
Event Timeline
Added a switch node.
Also, since it is now planned to add versioning to change the names of the sockets, I can also standardize the name, no matter what
socket_identifier = "Attribute/Value/..._"+default_name(); ... params.set_output(socket_identifier ,Field<T>())
, and immediately use the result of default_name:
params.set_output(default_name<T>(),Field<T>())
Most often only one group of sockets is dynamic, nodes such as accumulation can still use suffixes
Switch Node: Type Bool: Now input values are not hidden
- Also now i need to add a random attribute
- Added version change. This does not work for the switch node
(tomorrow I will finish it, now 4 am)
- I think to abandon Vectors in favor of
value = value ->next;
The random value node does not rely on names in
operation, so it is not modified.
A ray cast node has also been added.
Versioning completed. Due to the fact that changing the
order of sockets was not included in the plans, all nodes
have their own recording order.
So far, there are no prefixes for those socket names that
do not intersect with others. If needed, this can be changed.
Named Attribute Save Node Support.
Returning socket prefixes.
Adding a warning that the Byte Color type name does
not match an existing socket. I'm also not sure if it's necessary
to mention somewhere that convert_to_static_type also requires
an exception to get a Color socket, although Byte Color is used.
maybe, for Byte Color
node_geometry_util.cc
template<typename Function>
void protect_static_type(const eCustomDataType data_type, Function &func){
attribute_math::convert_to_static_type(data_type, [&](auto dummy) {
if constexpr (std::is_same_v<decltype(dummy), ColorGeometry4b>) {
func(dummy, ColorGeometry4f());
}else{
func(dummy, dummy);
}
});
}node_geo_store_named_attribute.cc
protect_static_type(data_type, [&](auto dummy, auto socket_dummy){
using socket_T = decltype(socket_dummy);
field = params.extract_input<Field<socket_T >>("Value_" + attribute_math::default_name<socket_T >());
if constexpr (!std::is_same_v<decltype(dummy), decltype(socket_dummy)>) {
field = bke::get_implicit_type_conversions().try_convert(field, CPPType::get<decltype(dummy)>());
}
});Although, for one node it looks redundant
Thanks for working on this.
As long as the change is properly tested, I think this is a very nice improvement. And it would probably help for making changes to declarations in the future.
| source/blender/blenkernel/BKE_attribute_math.hh | ||
|---|---|---|
| 411–419 ↗ | (On Diff #53802) | These template specializations might make more sense in BKE_attribute.hh, they're not really math |
| 416 ↗ | (On Diff #53802) | How about using StringRef instead of StringRefNull? Also, maybe type_name_identifier would be a clearer name? "Default" is a bit vague. |
| source/blender/blenloader/intern/versioning_common.cc | ||
| 256 | I think this is a prefix rather than a suffix | |
| source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc | ||
| 126 | postfix -> suffix | |