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

26 lines
917 B
Python

from lnx.logicnode.lnx_nodes import *
class SetActionSpeedNode(LnxLogicTreeNode):
"""Sets the current action playback speed of the given object."""
bl_idname = 'LNSetActionSpeedNode'
bl_label = 'Set Action Speed'
bl_width_default = 200
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxStringSocket', 'Action ID')
self.add_input('LnxFloatSocket', 'Speed', default_value=1.0)
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(
'LNSetActionSpeedNode', self.lnx_version, 'LNSetActionSpeedNode', 2,
in_socket_mapping={}, out_socket_mapping={}
)