I am having an issue while working on a custom node tree. When I create a variable in self on a custom node it is not available in other functions of that class, for example:
from .base_node import Base_Node from bpy.types import Node class Test_Node(Node, Base_Node): bl_label = "Test Node" def init(self, context): self.outputs.new("tree_mesh_socket_type", "Tree") self.inputs.new("tree_socket_type", "Tree In") self.Test_Bool = False def On_Execute(self): print(self.Test_Bool)
I get the error:
line 14, in On_Execute print(self.Test_Bool) AttributeError: 'Test_Node' object has no attribute 'Test_Bool'
This happens where ever I define the variable, it is only accessible from the function it is created in.
Am I just misunderstanding how the node classes work or is this a bug? Should I be using a different method to store the data?
Thanks for any help.