LNXSDK/leenkx/blender/lnx/logicnode/object/LN_set_object_property.py
2025-01-22 16:18:30 +01:00

33 lines
1.3 KiB
Python

from lnx.logicnode.lnx_nodes import *
class SetPropertyNode(LnxLogicTreeNode):
"""Set the value of the given object property.
This node can be used to share variables between different traits.
If the trait(s) you want to access the variable with are on
different objects, use the *[`Global Object`](#global-object)*
node to store the data. Every trait can access this one.
@input Object: The object to which the property belongs. If the object is `null`, the node does not do anything.
@input Property: The name of the property from which to get the value.
@input Value: The value of the property.
@see `Object Properties Panel > Leenkx Props > Properties` (do not confuse Leenkx object properties with Blender custom properties!)
@see [`iron.object.Object.properties`](https://api.leenkx.com/iron/object/Object.html#properties)
@seeNode Get Object Property
"""
bl_idname = 'LNSetPropertyNode'
bl_label = 'Set Object Property'
lnx_section = 'props'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxStringSocket', 'Property')
self.add_input('LnxDynamicSocket', 'Value')
self.add_output('LnxNodeSocketAction', 'Out')