forked from LeenkxTeam/LNXSDK
Merge pull request 'Animation fixes' (#5) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#5
This commit is contained in:
@ -1,25 +1,25 @@
|
|||||||
from lnx.logicnode.lnx_nodes import *
|
from lnx.logicnode.lnx_nodes import *
|
||||||
|
|
||||||
class BlendActionNode(LnxLogicTreeNode):
|
class BlendActionNode(LnxLogicTreeNode):
|
||||||
"""Interpolates between the two given actions."""
|
"""Interpolates between the two given actions."""
|
||||||
bl_idname = 'LNBlendActionNode'
|
bl_idname = 'LNBlendActionNode'
|
||||||
bl_label = 'Blend Action'
|
bl_label = 'Blend Action'
|
||||||
lnx_version = 2
|
lnx_version = 2
|
||||||
|
|
||||||
def lnx_init(self, context):
|
def lnx_init(self, context):
|
||||||
self.add_input('LnxNodeSocketObject', 'Object')
|
self.add_input('LnxNodeSocketObject', 'Object')
|
||||||
self.add_input('LnxNodeSocketAnimTree', 'Action 1')
|
self.add_input('LnxNodeSocketAnimTree', 'Action 1')
|
||||||
self.add_input('LnxNodeSocketAnimTree', 'Action 2')
|
self.add_input('LnxNodeSocketAnimTree', 'Action 2')
|
||||||
self.add_input('ArmFactorSocket', 'Factor', default_value = 0.5)
|
self.add_input('LnxFactorSocket', 'Factor', default_value = 0.5)
|
||||||
self.add_input('LnxIntSocket', 'Bone Group', default_value = -1)
|
self.add_input('LnxIntSocket', 'Bone Group', default_value = -1)
|
||||||
|
|
||||||
self.add_output('LnxNodeSocketAnimTree', 'Result')
|
self.add_output('LnxNodeSocketAnimTree', 'Result')
|
||||||
|
|
||||||
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
||||||
if self.lnx_version not in (0, 1):
|
if self.lnx_version not in (0, 1):
|
||||||
raise LookupError()
|
raise LookupError()
|
||||||
|
|
||||||
return NodeReplacement(
|
return NodeReplacement(
|
||||||
'LNBlendActionNode', self.lnx_version, 'LNBlendActionNode', 2,
|
'LNBlendActionNode', self.lnx_version, 'LNBlendActionNode', 2,
|
||||||
in_socket_mapping={}, out_socket_mapping={}
|
in_socket_mapping={}, out_socket_mapping={}
|
||||||
)
|
)
|
||||||
|
@ -112,8 +112,8 @@ class BlendSpaceNode(LnxLogicTreeNode):
|
|||||||
def lnx_init(self, context):
|
def lnx_init(self, context):
|
||||||
self.add_input('LnxNodeSocketObject', 'Object')
|
self.add_input('LnxNodeSocketObject', 'Object')
|
||||||
self.add_input('LnxNodeSocketArray', 'Actions')
|
self.add_input('LnxNodeSocketArray', 'Actions')
|
||||||
self.add_input('ArmBlendSpaceSocket', 'Cursor X')
|
self.add_input('LnxBlendSpaceSocket', 'Cursor X')
|
||||||
self.add_input('ArmBlendSpaceSocket', 'Cursor Y')
|
self.add_input('LnxBlendSpaceSocket', 'Cursor Y')
|
||||||
self.add_output('LnxNodeSocketAnimTree', 'Out')
|
self.add_output('LnxNodeSocketAnimTree', 'Out')
|
||||||
|
|
||||||
def add_advanced_draw(self):
|
def add_advanced_draw(self):
|
||||||
|
@ -45,7 +45,7 @@ class BoneIKNode(LnxLogicTreeNode):
|
|||||||
self.add_input('LnxBoolSocket', 'Enable Pole')
|
self.add_input('LnxBoolSocket', 'Enable Pole')
|
||||||
self.add_input('LnxVectorSocket', 'Pole Position')
|
self.add_input('LnxVectorSocket', 'Pole Position')
|
||||||
self.add_input('LnxFloatSocket', 'Roll Angle')
|
self.add_input('LnxFloatSocket', 'Roll Angle')
|
||||||
self.add_input('ArmFactorSocket', 'Influence', default_value = 1.0)
|
self.add_input('LnxFactorSocket', 'Influence', default_value = 1.0)
|
||||||
self.add_input('LnxIntSocket', 'Bone Group', default_value = 0)
|
self.add_input('LnxIntSocket', 'Bone Group', default_value = 0)
|
||||||
|
|
||||||
self.add_output('LnxNodeSocketAnimTree', 'Result')
|
self.add_output('LnxNodeSocketAnimTree', 'Result')
|
||||||
|
@ -32,8 +32,8 @@ socket_colors = {
|
|||||||
'LnxVectorSocket': (0.39, 0.39, 0.78, 1.0),
|
'LnxVectorSocket': (0.39, 0.39, 0.78, 1.0),
|
||||||
'LnxAnySocket': (0.9, 0.9, 0.9, 1),
|
'LnxAnySocket': (0.9, 0.9, 0.9, 1),
|
||||||
'LnxNodeSocketAnimTree': (0.3, 0.1, 0.0, 1.0),
|
'LnxNodeSocketAnimTree': (0.3, 0.1, 0.0, 1.0),
|
||||||
'ArmFactorSocket': (0.631, 0.631, 0.631, 1.0),
|
'LnxFactorSocket': (0.631, 0.631, 0.631, 1.0),
|
||||||
'ArmBlendSpaceSocket': (0.631, 0.631, 0.631, 1.0)
|
'LnxBlendSpaceSocket': (0.631, 0.631, 0.631, 1.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -591,8 +591,8 @@ class LnxAnimTreeSocket(LnxCustomSocket):
|
|||||||
def draw_color(self, context, node):
|
def draw_color(self, context, node):
|
||||||
return socket_colors[self.bl_idname]
|
return socket_colors[self.bl_idname]
|
||||||
|
|
||||||
class ArmFactorSocket(LnxCustomSocket):
|
class LnxFactorSocket(LnxCustomSocket):
|
||||||
bl_idname = 'ArmFactorSocket'
|
bl_idname = 'LnxFactorSocket'
|
||||||
bl_label = 'Factor Socket'
|
bl_label = 'Factor Socket'
|
||||||
lnx_socket_type = 'FACTOR'
|
lnx_socket_type = 'FACTOR'
|
||||||
|
|
||||||
@ -614,8 +614,8 @@ class ArmFactorSocket(LnxCustomSocket):
|
|||||||
def get_default_value(self):
|
def get_default_value(self):
|
||||||
return self.default_value_raw
|
return self.default_value_raw
|
||||||
|
|
||||||
class ArmBlendSpaceSocket(LnxCustomSocket):
|
class LnxBlendSpaceSocket(LnxCustomSocket):
|
||||||
bl_idname = 'ArmBlendSpaceSocket'
|
bl_idname = 'LnxBlendSpaceSocket'
|
||||||
bl_label = 'Blend Space Socket'
|
bl_label = 'Blend Space Socket'
|
||||||
lnx_socket_type = 'FACTOR'
|
lnx_socket_type = 'FACTOR'
|
||||||
|
|
||||||
@ -718,8 +718,8 @@ LnxStringSocketInterface = _make_socket_interface('LnxStringSocketInterface', 'L
|
|||||||
LnxVectorSocketInterface = _make_socket_interface('LnxVectorSocketInterface', 'LnxVectorSocket')
|
LnxVectorSocketInterface = _make_socket_interface('LnxVectorSocketInterface', 'LnxVectorSocket')
|
||||||
LnxAnySocketInterface = _make_socket_interface('LnxAnySocketInterface', 'LnxAnySocket')
|
LnxAnySocketInterface = _make_socket_interface('LnxAnySocketInterface', 'LnxAnySocket')
|
||||||
LnxAnimTreeSocketInterface = _make_socket_interface('LnxAnimTreeSocketInterface', 'LnxNodeSocketAnimTree')
|
LnxAnimTreeSocketInterface = _make_socket_interface('LnxAnimTreeSocketInterface', 'LnxNodeSocketAnimTree')
|
||||||
ArmFactorSocketInterface = _make_socket_interface('ArmFactorSocketInterface', 'ArmFactorSocket')
|
LnxFactorSocketInterface = _make_socket_interface('LnxFactorSocketInterface', 'LnxFactorSocket')
|
||||||
ArmBlendSpaceSocketInterface = _make_socket_interface('ArmBlendSpaceSocketInterface', 'ArmBlendSpaceSocket')
|
LnxBlendSpaceSocketInterface = _make_socket_interface('LnxBlendSpaceSocketInterface', 'LnxBlendSpaceSocket')
|
||||||
|
|
||||||
__REG_CLASSES = (
|
__REG_CLASSES = (
|
||||||
LnxActionSocketInterface,
|
LnxActionSocketInterface,
|
||||||
@ -736,8 +736,8 @@ __REG_CLASSES = (
|
|||||||
LnxVectorSocketInterface,
|
LnxVectorSocketInterface,
|
||||||
LnxAnySocketInterface,
|
LnxAnySocketInterface,
|
||||||
LnxAnimTreeSocketInterface,
|
LnxAnimTreeSocketInterface,
|
||||||
ArmFactorSocketInterface,
|
LnxFactorSocketInterface,
|
||||||
ArmBlendSpaceSocketInterface,
|
LnxBlendSpaceSocketInterface,
|
||||||
|
|
||||||
LnxActionSocket,
|
LnxActionSocket,
|
||||||
LnxAnimActionSocket,
|
LnxAnimActionSocket,
|
||||||
@ -753,7 +753,7 @@ __REG_CLASSES = (
|
|||||||
LnxVectorSocket,
|
LnxVectorSocket,
|
||||||
LnxAnySocket,
|
LnxAnySocket,
|
||||||
LnxAnimTreeSocket,
|
LnxAnimTreeSocket,
|
||||||
ArmFactorSocket,
|
LnxFactorSocket,
|
||||||
ArmBlendSpaceSocket,
|
LnxBlendSpaceSocket,
|
||||||
)
|
)
|
||||||
register, unregister = bpy.utils.register_classes_factory(__REG_CLASSES)
|
register, unregister = bpy.utils.register_classes_factory(__REG_CLASSES)
|
||||||
|
Reference in New Issue
Block a user