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

Merged
3 changed files with 7 additions and 6 deletions
Showing only changes of commit 687db84aed - Show all commits

View File

@ -4104,7 +4104,8 @@ static void rna_SimulationStateItem_name_set(PointerRNA *ptr, const char *value)
bNode *node = node_geo_simulation_output_find_node_by_item(ntree, item);
NodeGeometrySimulationOutput *sim = (NodeGeometrySimulationOutput *)node->storage;
node_geo_simulation_output_item_set_unique_name(sim, item, value);
const char *defname = nodeStaticSocketLabel(item->socket_type, 0);
node_geo_simulation_output_item_set_unique_name(sim, item, value, defname);
}
static PointerRNA rna_NodeGeometrySimulationInput_paired_output_get(PointerRNA *ptr)

View File

@ -38,7 +38,7 @@ bool node_geo_simulation_input_pair_with_output(const struct bNodeTree *node_tre
*/
bool node_geo_simulation_output_item_set_unique_name(struct NodeGeometrySimulationOutput *sim,

Blender uses syntax like \return rather than @return. Also for multi-line function docstring comments, the /** should be on its own line at the start.

Blender uses syntax like `\return` rather than `@return`. Also for multi-line function docstring comments, the `/**` should be on its own line at the start.
struct NodeSimulationItem *item,
const char *name);
const char *name, const char *defname);
/** Find the node owning this simulation output data. */
bNode *node_geo_simulation_output_find_node_by_data(

View File

@ -337,10 +337,9 @@ bNode *node_geo_simulation_output_find_node_by_item(bNodeTree *ntree,
bool node_geo_simulation_output_item_set_unique_name(NodeGeometrySimulationOutput *sim,
NodeSimulationItem *item,

These functions should call ensure_topology_cache() before they use it.

These functions should call `ensure_topology_cache()` before they use it.
const char *name)
const char *name,
const char *defname)
{
const char *defname = nodeStaticSocketLabel(item->socket_type, 0);
char unique_name[MAX_NAME + 4];
BLI_strncpy(unique_name, name, sizeof(unique_name));
@ -413,8 +412,9 @@ NodeSimulationItem *node_geo_simulation_output_insert_item(NodeGeometrySimulatio
sim->items[i + 1].socket_type = old_items[i].socket_type;
}
const char *defname = nodeStaticSocketLabel(socket_type, 0);
NodeSimulationItem &added_item = sim->items[index];
node_geo_simulation_output_item_set_unique_name(sim, &added_item, name);
node_geo_simulation_output_item_set_unique_name(sim, &added_item, name, defname);

IndexRange(0, index) -> IndexRange(index)

`IndexRange(0, index)` -> `IndexRange(index)`
added_item.socket_type = socket_type;
sim->items_num++;