Simulation nodes: UI for simulation state items in sidebar #106919

Merged
2 changed files with 0 additions and 14 deletions
Showing only changes of commit 877986ccda - Show all commits

View File

@ -43,9 +43,6 @@ bool NOD_geometry_simulation_output_item_set_unique_name(struct NodeGeometrySimu
const char *name,
const char *defname);
/** Find the node owning this simulation output data. */
bNode *NOD_geometry_simulation_output_find_node_by_data(
struct bNodeTree *ntree, const struct NodeGeometrySimulationOutput *sim);
/** Find the node owning this simulation state item. */
bNode *NOD_geometry_simulation_output_find_node_by_item(struct bNodeTree *ntree,
const struct NodeSimulationItem *item);

View File

@ -323,17 +323,6 @@ bool NOD_geometry_simulation_output_item_socket_type_supported(const eNodeSocket
return ELEM(socket_type, SOCK_GEOMETRY);
}

NOD_geometry_simulation_output_find_node_by_data is unused, and it doesn't seem like we should need this. If we do, I'd keep it local to RNA.

`NOD_geometry_simulation_output_find_node_by_data` is unused, and it doesn't seem like we should need this. If we do, I'd keep it local to RNA.

Downside of putting this in RNA is that we don't have access to the C++ functions like ntree->nodes_by_type there.

Downside of putting this in RNA is that we don't have access to the C++ functions like `ntree->nodes_by_type` there.

Removed the unused function though.

Removed the unused function though.
bNode *NOD_geometry_simulation_output_find_node_by_data(bNodeTree *ntree,
const NodeGeometrySimulationOutput *sim)
{
for (bNode *node : ntree->nodes_by_type("GeometryNodeSimulationOutput")) {
if (node->storage == sim) {
return node;
}
}
return nullptr;
}
bNode *NOD_geometry_simulation_output_find_node_by_item(bNodeTree *ntree,
const NodeSimulationItem *item)

I guess this is slightly different, but usually a method like this is called items_for_write(). Either way is fine with me.

I guess this is slightly different, but usually a method like this is called `items_for_write()`. Either way is fine with me.

We already have NodeSimulationItem *items for the array, so Span<NodeSimulationItem> items() is a conflict, otherwise items + items_for_write would work.

We already have `NodeSimulationItem *items` for the array, so `Span<NodeSimulationItem> items()` is a conflict, otherwise `items` + `items_for_write` would work.

I opted for items_span_for_write now, if that's ok for you.

I opted for `items_span_for_write` now, if that's ok for you.
{