How to find the node referenced by the update function of this BoolProperty property? I usually use self.id_data for other types of PointerProperty, but in this case I get the node_tree this node is contained in, I don't really understand how I can retrieve this node easily without having to create a super function.
Example:
def update_node_prop(self,context):
node = self.id_data #How to get the node? this id_data is the node_tree (unfortunately for me)
class MyNodeProp(bpy.types.PropertyGroup):
my_bool: bpy.props.BoolProperty(default = False, update = update_node_prop)
def register():
bpy.types.Node.node_prop = bpy.props.PointerProperty(type=MyNodeProp)
More Info:
To make it clearer: Let's say I want to count the socket outputs of the node in the callback function, this seems really complicated to do at the moment.
I also thought about assigning a Unique value in a property that can be recognized via self.univoque_id, but this also seems complex to deal with and assign to all nodes.
Thanks to the comments, I forgot to include an important piece of information:
The context from which this property is called is not necessarily the context.space_data.edit_tree
So I would like to get the node by simply using the self
parameter and not the context