Geometry Nodes: propagate string property subtype to modifier

The only exposed subtype for strings is `file path` currently. Inputs of this
type will show a button to select a path with the file browser.
This commit is contained in:
Jacques Lucke
2024-09-23 01:16:17 +02:00
parent 9239c00eda
commit b7bfdfa983
2 changed files with 6 additions and 1 deletions

View File

@@ -1500,10 +1500,14 @@ static void std_node_socket_interface_draw(ID *id,
uiItemR(sub, &ptr, "max_value", DEFAULT_FLAGS, IFACE_("Max"), ICON_NONE);
break;
}
case SOCK_STRING: {
uiItemR(col, &ptr, "subtype", DEFAULT_FLAGS, IFACE_("Subtype"), ICON_NONE);
uiItemR(col, &ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), ICON_NONE);
break;
}
case SOCK_BOOLEAN:
case SOCK_ROTATION:
case SOCK_RGBA:
case SOCK_STRING:
case SOCK_OBJECT:
case SOCK_COLLECTION:
case SOCK_IMAGE:

View File

@@ -326,6 +326,7 @@ std::unique_ptr<IDProperty, bke::idprop::IDPropertyDeleter> id_property_create_f
IDPropertyUIDataString *ui_data = (IDPropertyUIDataString *)IDP_ui_data_ensure(
property.get());
ui_data->default_value = BLI_strdup(value->value);
ui_data->base.rna_subtype = value->subtype;
return property;
}
case SOCK_MENU: {