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
This commit is contained in:
Hans Goudey
2023-11-08 10:46:59 +01:00
committed by Hans Goudey
parent 8178b12af4
commit 871c717c6e

View File

@@ -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");
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);
BLI_SCOPED_DEFER([&]() { IDP_FreeProperty_ex(properties, false); });