Skip to content
Snippets Groups Projects
Commit 871c717c authored by Hans Goudey's avatar Hans Goudey Committed by Hans Goudey
Browse files

Fix: Remove support for node tool data-block inputs for 4.0

There are two bugs with data-block inputs currently. One is #113383,
where clicking the "Clear" button on the data-block picker closes the
redo panel. The worse issue is that storing pointer properties in
operators isn't safe at all. Deleting the data-block doesn't clear
the pointer property in operator storage, for example.

The proper solution is to reuse some code from the existing data-block
picker but back it with a `session_uuid` integer property instead of an
actual pointer. This makes lookups safe without depending on the name.
However, doing that for 4.0 is too risky, so for now we will just not
support data-block inputs in the redo panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/114621
parent 8178b12a
No related branches found
No related tags found
No related merge requests found
...@@ -330,6 +330,19 @@ static int run_node_group_exec(bContext *C, wmOperator *op) ...@@ -330,6 +330,19 @@ static int run_node_group_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Node group must have a group output node"); BKE_report(op->reports, RPT_ERROR, "Node group must have a group output node");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
for (const bNodeTreeInterfaceSocket *input : node_tree->interface_inputs()) {
if (STR_ELEM(input->socket_type,
"NodeSocketObject",
"NodeSocketImage",
"NodeSocketGeometry",
"NodeSocketCollection",
"NodeSocketTexture",
"NodeSocketMaterial"))
{
BKE_report(op->reports, RPT_ERROR, "Data-block inputs are unsupported");
return OPERATOR_CANCELLED;
}
}
IDProperty *properties = replace_inputs_evaluated_data_blocks(*op->properties, *depsgraph); IDProperty *properties = replace_inputs_evaluated_data_blocks(*op->properties, *depsgraph);
BLI_SCOPED_DEFER([&]() { IDP_FreeProperty_ex(properties, false); }); BLI_SCOPED_DEFER([&]() { IDP_FreeProperty_ex(properties, false); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment