# Node initialization with default value for drag and drop from socket ## Goals: Initialization of nodes can be with any data. This ties in well with the drag and drop feature. Some layer of abstraction will unify the creation of a node with known data in advance. ## Plan: ```Cpp static void node_init(bNodeTree * /*tree*/, bNode *node) { NodeFunctionFloatValue *data = MEM_cnew<NodeFunctionFloatValue>(__func__); data.value = 0.0f; node->storage = data; } ``` can be changed on: ```Cpp static void node_init(bNodeTree * /*tree*/, bNode *node, NodeValueProvider &provider) { NodeFunctionFloatValue &data = *MEM_cnew<NodeFunctionFloatValue>(__func__); data.value = provider.value<float>(); // provider.subtype(); // provider.type(); // provider.min(); // provider.max(); // ... // StringRef socket_name = provider.for_socket(); // if (socket(name) == input, index == 0, type == ...) node->storage = &data; } ```