GeometryNodes: Make properties exposed in modifier overridable.

This commit is contained in:
Bastien Montagne 2020-12-11 10:52:23 +01:00
parent b62a9ef66f
commit f7e5f96f56
2 changed files with 17 additions and 0 deletions

View File

@ -1243,5 +1243,20 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
/* Make all IDProperties used as interface of geometry node trees overridable. */
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
if (md->type == eModifierType_Nodes) {
NodesModifierData *nmd = (NodesModifierData *)md;
IDProperty *nmd_properties = nmd->settings.properties;
BLI_assert(nmd_properties->type == IDP_GROUP);
LISTBASE_FOREACH (IDProperty *, nmd_socket_idprop, &nmd_properties->data.group) {
nmd_socket_idprop->flag |= IDP_FLAG_OVERRIDABLE_LIBRARY;
}
}
}
}
}
}

View File

@ -439,6 +439,8 @@ static IDProperty *socket_add_property(IDProperty *settings_prop_group,
IDProperty *prop = property_type.create_prop(socket, new_prop_name);
IDP_AddToGroup(settings_prop_group, prop);
prop->flag |= IDP_FLAG_OVERRIDABLE_LIBRARY;
/* Make the group in the ui container group to hold the property's UI settings. */
IDProperty *prop_ui_group;
{