add mode for copying values only and not connections
Sometimes we'll be copying nodes without wanting to copy their connections, since we'll want to connect them to equivalent copies rather than connecting them to the same nodes the originals were connected to. We now have an extra parameter to distinguish such operations.
This commit is contained in:
+2
-2
@@ -280,7 +280,7 @@ void NodeInput::set_maximum(const QVariant &max)
|
||||
has_maximum_ = true;
|
||||
}
|
||||
|
||||
void NodeInput::CopyValues(NodeInput *source, NodeInput *dest)
|
||||
void NodeInput::CopyValues(NodeInput *source, NodeInput *dest, bool include_connections)
|
||||
{
|
||||
// Copy values
|
||||
dest->keyframes_ = source->keyframes_;
|
||||
@@ -289,7 +289,7 @@ void NodeInput::CopyValues(NodeInput *source, NodeInput *dest)
|
||||
dest->set_is_keyframing(source->is_keyframing());
|
||||
|
||||
// Copy connections
|
||||
if (source->get_connected_output() != nullptr) {
|
||||
if (include_connections && source->get_connected_output() != nullptr) {
|
||||
ConnectEdge(source->get_connected_output(), dest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user