Fix #106208: data-block socket defaults not used for node group #107179
|
@ -158,7 +158,11 @@ class StringBuilder : public SocketDeclarationBuilder<String> {
|
|||
class IDSocketDeclaration : public SocketDeclaration {
|
||||
public:
|
||||
const char *idname;
|
||||
/** Get the default ID pointer for this socket. This is a function to avoid dangling pointers. */
|
||||
/**
|
||||
|
||||
* Get the default ID pointer for this socket. This is a function to avoid dangling pointers,
|
||||
* since bNode::id pointers are remapped as ID pointers change, but pointers in socket
|
||||
* declarations are not managed the same way.
|
||||
*/
|
||||
std::function<ID *(const bNode &node)> default_value_fn;
|
||||
|
||||
public:
|
||||
|
|
|
@ -140,6 +140,7 @@ static std::function<ID *(const bNode &node)> get_default_id_getter(const bNodeT
|
|||
const bNodeTree &ntree = *reinterpret_cast<const bNodeTree *>(node.id);
|
||||
const bNodeSocket *io_socket;
|
||||
if (in_out == SOCK_IN) {
|
||||
/* Better be save than sorry when the underlying node group changed. */
|
||||
Hans Goudey
commented
Hmm, why would the socket index be out of bounds here? Does this function object live past some changes to the group interface? If so, maybe worth noting that in a comment. Hmm, why would the socket index be out of bounds here? Does this function object live past some changes to the group interface? If so, maybe worth noting that in a comment.
Jacques Lucke
commented
The problem is, I don't think we know for sure how long this will live currently. At least I don't know. The problem is, I don't think we know for sure how long this will live currently. At least I don't know.
Hans Goudey
commented
`save` -> `safe`
|
||||
if (socket_index < ntree.interface_inputs().size()) {
|
||||
io_socket = ntree.interface_inputs()[socket_index];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Maybe add
, since
bNode::idpointers are remapped as
IDpointers change, but pointers in socket declarations are not managed the same way.