LNXSDK/leenkx/blender/lnx/logicnode/object/LN_remove_object.py

26 lines
1.1 KiB
Python
Raw Normal View History

2025-01-22 16:18:30 +01:00
from lnx.logicnode.lnx_nodes import *
class RemoveObjectNode(LnxLogicTreeNode):
"""This node will remove a scene object or a scene object and its children.
@input Object: Scene object to remove.
@input Remove Children: Remove scene object's children too.
@input Keep Children Transforms: Scene object's children will maintain current transforms when the scene object is removed, else children transforms revert to scene origin transforms.
"""
bl_idname = 'LNRemoveObjectNode'
bl_label = 'Remove Object'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxBoolSocket', 'Remove Children', default_value=True)
self.add_input('LnxBoolSocket', 'Keep Children Transforms', default_value=True)
self.add_output('LnxNodeSocketAction', 'Out')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement.Identity(self)