[Bf-blender-cvs] [fc0a7648b54] functions: fix finding execute sockets
Jacques Lucke
noreply at git.blender.org
Tue Sep 3 16:23:19 CEST 2019
Commit: fc0a7648b54521c184bfee27a36459e37ece1bf7
Author: Jacques Lucke
Date: Tue Sep 3 16:07:03 2019 +0200
Branches: functions
https://developer.blender.org/rBfc0a7648b54521c184bfee27a36459e37ece1bf7
fix finding execute sockets
===================================================================
M release/scripts/startup/nodes/declaration/bparticles.py
M source/blender/simulations/bparticles/node_frontend.cpp
===================================================================
diff --git a/release/scripts/startup/nodes/declaration/bparticles.py b/release/scripts/startup/nodes/declaration/bparticles.py
index 43c5c460bd5..38b24ba8481 100644
--- a/release/scripts/startup/nodes/declaration/bparticles.py
+++ b/release/scripts/startup/nodes/declaration/bparticles.py
@@ -74,7 +74,10 @@ class ExecuteInputListDecl(SocketDeclBase):
identifier=self.identifier_prefix + str(i))
socket.display_shape = 'SQUARE'
yield socket
- socket = node_sockets.new("fn_OperatorSocket", "Operator")
+ socket = node_sockets.new(
+ "fn_OperatorSocket",
+ self.display_name,
+ identifier=self.identifier_prefix + "(Operator)")
socket.display_shape = 'SQUARE'
yield socket
@@ -97,6 +100,10 @@ class ExecuteInputListDecl(SocketDeclBase):
if not isinstance(sockets[-1], OperatorSocket):
return False
+ if not sockets[-1].name == self.display_name:
+ return False
+ if not sockets[-1].identifier == self.identifier_prefix + "(Operator)":
+ return False
return True
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp b/source/blender/simulations/bparticles/node_frontend.cpp
index b719819d42f..4c12cf695ba 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -65,10 +65,12 @@ static Vector<std::string> find_connected_particle_type_names(VirtualSocket *out
static Vector<VirtualSocket *> find_execute_sockets(VirtualNode *vnode, StringRef name_prefix)
{
+ bool found_name = false;
Vector<VirtualSocket *> execute_sockets;
for (VirtualSocket *vsocket : vnode->inputs()) {
if (StringRef(vsocket->name()).startswith(name_prefix)) {
if (STREQ(vsocket->idname(), "fn_OperatorSocket")) {
+ found_name = true;
break;
}
else {
@@ -76,6 +78,7 @@ static Vector<VirtualSocket *> find_execute_sockets(VirtualNode *vnode, StringRe
}
}
}
+ BLI_assert(found_name);
return execute_sockets;
}
@@ -125,7 +128,7 @@ static std::unique_ptr<Action> ACTION_explode(VTreeDataGraph &vtree_data_graph,
std::unique_ptr<ParticleFunction> compute_inputs_fn = fn_or_error.extract_value();
std::unique_ptr<Action> on_birth_action = build_action_list(
- vtree_data_graph, vnode, "Execute on Event");
+ vtree_data_graph, vnode, "Execute on Birth");
Vector<std::string> type_names = find_connected_particle_type_names(vnode->output(1, "Type"));
Action *action = new ExplodeAction(
More information about the Bf-blender-cvs
mailing list