Compositor: Remove storage of Alpha Over node

This patch removes the storage of the Alpha Over node, since it is no
longer used. This is a continuation of b62ef2cdd6.

Pull Request: https://projects.blender.org/blender/blender/pulls/140359
This commit is contained in:
Omar Emara
2025-06-16 08:07:21 +02:00
committed by Omar Emara
parent 0937051d52
commit 976efdcac9
3 changed files with 9 additions and 12 deletions

View File

@@ -3391,6 +3391,14 @@ static void do_version_alpha_over_remove_premultiply(bNodeTree *node_tree)
blender::bke::node_remove_link(node_tree, *link);
}
LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) {
if (node->type_legacy == CMP_NODE_ALPHAOVER) {
NodeTwoFloats *storage = static_cast<NodeTwoFloats *>(node->storage);
MEM_freeN(storage);
node->storage = nullptr;
}
}
}
/* The options were converted into inputs. */

View File

@@ -7417,10 +7417,8 @@ static void def_cmp_alpha_over(BlenderRNA * /*brna*/, StructRNA *srna)
prop, "Convert Premultiplied", "(Deprecated: Use Straight Alpha input instead.)");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
RNA_def_struct_sdna_from(srna, "NodeTwoFloats", "storage");
prop = RNA_def_property(srna, "premul", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, nullptr, "x");
RNA_def_property_float_sdna(prop, nullptr, "custom3");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Premultiplied", "Mix Factor. (Deprecated: Unused.)");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");

View File

@@ -48,12 +48,6 @@ static void cmp_node_alphaover_declare(NodeDeclarationBuilder &b)
b.add_output<decl::Color>("Image");
}
static void node_alphaover_init(bNodeTree * /*ntree*/, bNode *node)
{
/* Not used, but the data is still allocated for forward compatibility. */
node->storage = MEM_callocN<NodeTwoFloats>(__func__);
}
using namespace blender::compositor;
static int node_gpu_material(GPUMaterial *material,
@@ -109,9 +103,6 @@ static void register_node_type_cmp_alphaover()
ntype.enum_name_legacy = "ALPHAOVER";
ntype.nclass = NODE_CLASS_OP_COLOR;
ntype.declare = file_ns::cmp_node_alphaover_declare;
ntype.initfunc = file_ns::node_alphaover_init;
blender::bke::node_type_storage(
ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage);
ntype.gpu_fn = file_ns::node_gpu_material;
ntype.build_multi_function = file_ns::node_build_multi_function;