from lnx.logicnode.lnx_nodes import *


class TraitNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
    """Stores the given trait as a variable. If the trait was not found or
    was not exported, an error is thrown ([more information](https://github.com/leenkx3d/leenkx/wiki/troubleshooting#trait-not-exported)).
    """
    bl_idname = 'LNTraitNode'
    bl_label = 'Trait'
    lnx_version = 1

    property0: HaxeStringProperty('property0', name='', default='')

    def lnx_init(self, context):
        self.add_output('LnxDynamicSocket', 'Trait', is_var=True)

    def draw_content(self, context, layout):
        layout.prop(self, 'property0')

    def synchronize_from_master(self, master_node: LnxLogicVariableNodeMixin):
        self.property0 = master_node.property0