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. */
|
||||
if (socket_index < ntree.interface_inputs().size()) {
|
||||
io_socket = ntree.interface_inputs()[socket_index];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue