Page MenuHome

Nodes: Remove `bNodeTree->interface_type`.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Nov 11 2021, 3:49 PM.

Details

Summary

This does not seem to be used anywhere. It's not clear if any addon depends on this or what functionality this provided to addons.

This was introduced in rB4638e5f99a9b: Merge of the PyNodes branch (aka "custom nodes") into trunk..

Diff Detail

Repository
rB Blender
Branch
remove-ntree-interface (branched from master)
Build Status
Buildable 18595
Build 18595: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Nov 11 2021, 3:49 PM
Jacques Lucke (JacquesLucke) created this revision.
Jacques Lucke (JacquesLucke) retitled this revision from Cleanup: Remove `bNodeTree->interface_type` (WIP). to Cleanup: Remove `bNodeTree->interface_type`..Nov 23 2022, 11:04 AM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)
Jacques Lucke (JacquesLucke) retitled this revision from Cleanup: Remove `bNodeTree->interface_type`. to Nodes: Remove `bNodeTree->interface_type`..
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)

It's code archaeology, but if i remember correctly the purpose of this was to generate RNA properties that have a distinct subtype, limits, etc to match the socket declaration of the node group.

We're not actually using that. Instead we generate all the different type/subtype variants in advance (e.g. NodeSocketFloatDistance, NodeSocketFloatPercentage) and use a matching one for group sockets, with limits being stored in the default_value structs (e.g. bNodeSocketValueFloat) rather than an RNA property.

I probably forgot to remove it after initially adding it and then switching to predefined RNA types. No objection from my side to clean this up. The interface_register_properties callback is only used for this RNA declaration should also be removed, although it is technically registerable and some addon could theoretically break (i.e. get an error when trying to register the callback, even though it serves no purpose).

source/blender/blenkernel/BKE_node.h
166

This callback is only used for generating properties in the "Interface" RNA structs and can be removed as well.

source/blender/makesrna/intern/rna_nodetree.c
11350–11355

If removing a registerable method seems too risky, we could keep this as a dummy function and just remove the C callback. Maybe issue a warning when this gets registered that the method will be deprecated in a future version.

Lukas Tönne (lukastoenne) requested changes to this revision.Nov 23 2022, 12:12 PM
This revision now requires changes to proceed.Nov 23 2022, 12:12 PM
This revision is now accepted and ready to land.Nov 23 2022, 1:04 PM