Merge branch 'master' into new-nodes

# Conflicts:
#	blender/arm/logicnode/object/LN_get_visible.py
#	blender/arm/logicnode/object/LN_set_visible.py
This commit is contained in:
Moritz Brückner 2020-09-14 01:08:59 +02:00
commit 533c81e2cf
292 changed files with 1144 additions and 176 deletions

View file

@ -4,8 +4,10 @@ class AnimActionNode(ArmLogicTreeNode):
"""Anim action node"""
bl_idname = 'LNAnimActionNode'
bl_label = 'Action'
arm_version = 1
def init(self, context):
super(AnimActionNode, self).init(context)
self.add_input('ArmNodeSocketAnimAction', 'Action')
self.add_output('ArmNodeSocketAnimAction', 'Action', is_var=True)

View file

@ -4,8 +4,10 @@ class AnimationStateNode(ArmLogicTreeNode):
"""Animation state node"""
bl_idname = 'LNAnimationStateNode'
bl_label = 'Animation State'
arm_version = 1
def init(self, context):
super(AnimationStateNode, self).init(context)
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('NodeSocketBool', 'Is Playing')
self.add_output('NodeSocketString', 'Action')

View file

@ -4,8 +4,10 @@ class BlendActionNode(ArmLogicTreeNode):
"""Blend action node"""
bl_idname = 'LNBlendActionNode'
bl_label = 'Blend Action'
arm_version = 1
def init(self, context):
super(BlendActionNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('ArmNodeSocketAnimAction', 'Action 1')

View file

@ -4,8 +4,10 @@ class BoneFKNode(ArmLogicTreeNode):
"""Bone Forward Kinematics node"""
bl_idname = 'LNBoneFKNode'
bl_label = 'Bone FK'
arm_version = 1
def init(self, context):
super(BoneFKNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketString', 'Bone')

View file

@ -4,8 +4,10 @@ class BoneIKNode(ArmLogicTreeNode):
"""Bone Inverse Kinematics node"""
bl_idname = 'LNBoneIKNode'
bl_label = 'Bone IK'
arm_version = 1
def init(self, context):
super(BoneIKNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketString', 'Bone')

View file

@ -4,8 +4,10 @@ class OnActionMarkerNode(ArmLogicTreeNode):
"""On action marker node"""
bl_idname = 'LNOnActionMarkerNode'
bl_label = 'On Action Marker'
arm_version = 1
def init(self, context):
super(OnActionMarkerNode, self).init(context)
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketString', 'Marker')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class PauseActionNode(ArmLogicTreeNode):
"""Pause action node"""
bl_idname = 'LNPauseActionNode'
bl_label = 'Pause Action'
arm_version = 1
def init(self, context):
super(PauseActionNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class PauseTilesheetNode(ArmLogicTreeNode):
"""Pause tilesheet node"""
bl_idname = 'LNPauseTilesheetNode'
bl_label = 'Pause Tilesheet'
arm_version = 1
def init(self, context):
super(PauseTilesheetNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class PlayActionNode(ArmLogicTreeNode):
"""Play action node"""
bl_idname = 'LNPlayActionNode'
bl_label = 'Play Action'
arm_version = 1
def init(self, context):
super(PlayActionNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('ArmNodeSocketAnimAction', 'Action')

View file

@ -4,8 +4,10 @@ class PlayActionFromNode(ArmLogicTreeNode):
"""Play action from node"""
bl_idname = 'LNPlayActionFromNode'
bl_label = 'Play Action From'
arm_version = 1
def init(self, context):
super(PlayActionFromNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('ArmNodeSocketAnimAction', 'Action')

View file

@ -4,8 +4,10 @@ class PlayTilesheetNode(ArmLogicTreeNode):
"""Play tilesheet node"""
bl_idname = 'LNPlayTilesheetNode'
bl_label = 'Play Tilesheet'
arm_version = 1
def init(self, context):
super(PlayTilesheetNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketString', 'Action')

View file

@ -4,8 +4,10 @@ class ResumeActionNode(ArmLogicTreeNode):
"""Resume action node"""
bl_idname = 'LNResumeActionNode'
bl_label = 'Resume Action'
arm_version = 1
def init(self, context):
super(ResumeActionNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class ResumeTilesheetNode(ArmLogicTreeNode):
"""Resume tilesheet node"""
bl_idname = 'LNResumeTilesheetNode'
bl_label = 'Resume Tilesheet'
arm_version = 1
def init(self, context):
super(ResumeTilesheetNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class SetActionSpeedNode(ArmLogicTreeNode):
"""Set action speed node"""
bl_idname = 'LNSetActionSpeedNode'
bl_label = 'Set Action Speed'
arm_version = 1
def init(self, context):
super(SetActionSpeedNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketFloat', 'Speed', default_value=1.0)

View file

@ -4,8 +4,10 @@ class SetParentBoneNode(ArmLogicTreeNode):
"""Set parent bone node"""
bl_idname = 'LNSetParentBoneNode'
bl_label = 'Set Parent Bone'
arm_version = 1
def init(self, context):
super(SetParentBoneNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('ArmNodeSocketObject', 'Parent', default_value='Parent')

View file

@ -4,8 +4,10 @@ class SetParticleSpeedNode(ArmLogicTreeNode):
"""Set particle speed node"""
bl_idname = 'LNSetParticleSpeedNode'
bl_label = 'Set Particle Speed'
arm_version = 1
def init(self, context):
super(SetParticleSpeedNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketFloat', 'Speed', default_value=1.0)

View file

@ -1,6 +1,6 @@
import itertools
from collections import OrderedDict
from typing import Any, Generator, List, Optional, Type
from typing import Any, Generator, List, Optional, Type, Dict
from typing import OrderedDict as ODict # Prevent naming conflicts
import bpy.types
@ -19,10 +19,41 @@ array_nodes = dict()
class ArmLogicTreeNode(bpy.types.Node):
def init(self, context):
# make sure a given node knows the version of the NodeClass from when it was created
if isinstance(type(self).arm_version, int):
self.arm_version = type(self).arm_version
else:
self.arm_version = 1
@classmethod
def poll(cls, ntree):
return ntree.bl_idname == 'ArmLogicTreeType'
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
# needs to be overridden by individual node classes with arm_version>1
"""(only called if the node's version is inferior to the node class's version)
Help with the node replacement process, by explaining how a node (`self`) should be replaced.
This method can either return a NodeReplacement object (see `nodes_logic.py`), or a brand new node.
If a new node is returned, then the following needs to be already set:
- the node's links to the other nodes
- the node's properties
- the node inputs's default values
If more than one node need to be created (for example, if an input needs a type conversion after update),
please return all the nodes in a list.
please raise a LookupError specifically when the node's version isn't handled by the function.
note that the lowest 'defined' version should be 1. if the node's version is 0, it means that it has been saved before versioning was a thing.
NODES OF VERSION 1 AND VERSION 0 SHOULD HAVE THE SAME CONTENTS
"""
if self.arm_version==0 and type(self).arm_version == 1:
return NodeReplacement.Identity(self) # in case someone doesn't implement this function, but the node has version 0.
else:
raise LookupError(f"the current node class, {repr(type(self)):s}, does not implement the getReplacementNode method, even though it has updated")
def add_input(self, socket_type: str, socket_name: str, default_value: Any = None, is_var: bool = False) -> bpy.types.NodeSocket:
"""Adds a new input socket to the node.
@ -58,6 +89,82 @@ class ArmLogicTreeNode(bpy.types.Node):
return socket
class NodeReplacement:
"""
Represents a simple replacement rule, this can replace nodes of one type to nodes of a second type.
However, it is fairly limited. For instance, it assumes there are no changes in the type of the inputs or outputs
Second, it also assumes that node properties (especially EnumProperties) keep the same possible values.
- from_node, from_node_version: the type of node to be removed, and its version number
- to_node, to_node_version: the type of node which takes from_node's place, and its version number
- *_socket_mapping: a map which defines how the sockets of the old node shall be connected to the new node
{1: 2} means that anything connected to the socket with index 1 on the original node will be connected to the socket with index 2 on the new node
- property_mapping: the mapping used to transfer the values of the old node's properties to the new node's properties.
{"property0": "property1"} mean that the value of the new node's property1 should be the old node's property0's value.
- input_defaults: a mapping used to give default values to the inputs which aren't overridden otherwise.
- property_defaults: a mapping used to define the value of the new node's properties, when they aren't overridden otherwise.
"""
def __init__(self, from_node: str, from_node_version: int, to_node: str, to_node_version: int,
in_socket_mapping: Dict[int, int], out_socket_mapping: Dict[int, int], property_mapping: Optional[Dict[str, str]] = None,
input_defaults: Optional[Dict[int, any]] = None, property_defaults: Optional[Dict[str, any]] = None):
self.from_node = from_node
self.to_node = to_node
self.from_node_version = from_node_version
self.to_node_version = to_node_version
self.in_socket_mapping = in_socket_mapping
self.out_socket_mapping = out_socket_mapping
self.property_mapping = {} if property_mapping is None else property_mapping
self.input_defaults = {} if input_defaults is None else input_defaults
self.property_defaults = {} if property_defaults is None else property_defaults
@classmethod
def Identity(cls, node: ArmLogicTreeNode):
"""returns a NodeReplacement that does nothing, while operating on a given node.
WARNING: it assumes that all node properties are called "property0", "property1", etc...
"""
in_socks = {i:i for i in range(len(node.inputs))}
out_socks = {i:i for i in range(len(node.outputs))}
props = {}
i=0
while hasattr(node, f'property{i:d}'):
props[f'property{i:d}'] = f'property{i:d}'
i +=1
return NodeReplacement(
node.bl_idname, node.arm_version, node.bl_idname, type(node).arm_version,
in_socket_mapping=in_socks, out_socket_mapping=out_socks,
property_mapping=props
)
def chain_with(self, other):
"""modify the current NodeReplacement by "adding" a second replacement after it"""
if self.to_node != other.from_node or self.to_node_version != other.from_node_version:
raise TypeError('the given NodeReplacement-s could not be chained')
self.to_node = other.to_node
self.to_node_version = other.to_node_version
for i1, i2 in self.in_socket_mapping.items():
i3 = other.in_socket_mapping[i2]
self.in_socket_mapping[i1] = i3
for i1, i2 in self.out_socket_mapping.items():
i3 = other.out_socket_mapping[i2]
self.out_socket_mapping[i1] = i3
for p1, p2 in self.property_mapping.items():
p3 = other.property_mapping[p2]
self.property_mapping[p1] = p3
old_input_defaults = self.input_defaults
self.input_defaults = other.input_defaults.copy()
for i, x in old_input_defaults.items():
self.input_defaults[ other.in_socket_mapping[i] ] = x
old_property_defaults = self.property_defaults
self.property_defaults = other.property_defaults.copy()
for p, x in old_property_defaults.items():
self.property_defaults[ other.property_mapping[p] ] = x
class ArmNodeAddInputButton(bpy.types.Operator):
"""Add new input"""
bl_idname = 'arm.node_add_input'
@ -317,7 +424,7 @@ def add_category(category: str, section: str = 'default', icon: str = 'BLANK1',
return None
def add_node(node_type: Type[bpy.types.Node], category: str, section: str = 'default') -> None:
def add_node(node_type: Type[bpy.types.Node], category: str, section: str = 'default', is_obselete: bool = False) -> None:
"""
Registers a node to the given category. If no section is given, the
node is put into the default section that does always exist.
@ -330,6 +437,11 @@ def add_node(node_type: Type[bpy.types.Node], category: str, section: str = 'def
nodes.append(node_type)
node_category = get_category(category)
if is_obselete:
# We need the obselete nodes to be registered in order to have them replaced,
# but do not add them to the menu.
return
if node_category is None:
node_category = add_category(category)

View file

@ -5,78 +5,102 @@ from bpy.types import NodeSocket
import arm.utils
class ArmActionSocket(NodeSocket):
bl_idname = 'ArmNodeSocketAction'
bl_label = 'Action Socket'
def draw(self, context, layout, node, text):
layout.label(text=self.name)
def draw_color(self, context, node):
return 0.8, 0.3, 0.3, 1
class ArmAnimActionSocket(NodeSocket):
bl_idname = 'ArmNodeSocketAnimAction'
bl_label = 'Action Socket'
default_value_get: PointerProperty(name='Action', type=bpy.types.Action)
def get_default_value(self):
if self.default_value_get is None:
return ''
if self.default_value_get.name not in bpy.data.actions:
return self.default_value_get.name
name = arm.utils.asset_name(bpy.data.actions[self.default_value_get.name])
return arm.utils.safestr(name)
def draw(self, context, layout, node, text):
if self.is_output:
layout.label(text=self.name)
elif self.is_linked:
layout.label(text=self.name)
else:
layout.prop_search(self, 'default_value_get', bpy.data, 'actions', icon='NONE', text='')
def draw_color(self, context, node):
return 0.8, 0.8, 0.8, 1
class ArmArraySocket(NodeSocket):
bl_idname = 'ArmNodeSocketArray'
bl_label = 'Array Socket'
def draw(self, context, layout, node, text):
layout.label(text=self.name)
def draw_color(self, context, node):
return 0.8, 0.4, 0.0, 1
class ArmCustomSocket(NodeSocket):
"""
A custom socket that can be used to define more socket types for
logic node packs. Do not use this type directly (it is not
registered)!
"""
bl_idname = 'ArmCustomSocket'
bl_label = 'Custom Socket'
# note: trying to use the `type` property will fail. All custom nodes will have "VALUE" as a type, because it is the default.
arm_socket_type = 'NONE'
# please also declare a property named "default_value_raw" of arm_socket_type isn't "NONE"
def get_default_value(self):
"""Override this for values of unconnected input sockets."""
return None
class ArmObjectSocket(NodeSocket):
bl_idname = 'ArmNodeSocketObject'
bl_label = 'Object Socket'
default_value_get: PointerProperty(name='Object', type=bpy.types.Object)
class ArmActionSocket(ArmCustomSocket):
bl_idname = 'ArmNodeSocketAction'
bl_label = 'Action Socket'
arm_socket_type = 'NONE'
def draw(self, context, layout, node, text):
layout.label(text=self.name)
def draw_color(self, context, node):
return 0.8, 0.3, 0.3, 1
class ArmAnimActionSocket(ArmCustomSocket):
bl_idname = 'ArmNodeSocketAnimAction'
bl_label = 'Action Socket'
arm_socket_type = 'STRING'
default_value_get: PointerProperty(name='Action', type=bpy.types.Action) # legacy version of the line after this one
default_value_raw: PointerProperty(name='Action', type=bpy.types.Action)
def __init__(self):
super().__init__()
if self.default_value_get is not None:
self.default_value_raw = self.default_value_get
self.default_value_get = None
def get_default_value(self):
if self.default_value_get is None:
if self.default_value_raw is None:
return ''
if self.default_value_get.name not in bpy.data.objects:
return self.default_value_get.name
return arm.utils.asset_name(bpy.data.objects[self.default_value_get.name])
if self.default_value_raw.name not in bpy.data.actions:
return self.default_value_raw.name
name = arm.utils.asset_name(bpy.data.actions[self.default_value_raw.name])
return arm.utils.safestr(name)
def draw(self, context, layout, node, text):
if self.is_output:
layout.label(text=self.name)
elif self.is_linked:
layout.label(text=self.name)
else:
layout.prop_search(self, 'default_value_raw', bpy.data, 'actions', icon='NONE', text='')
def draw_color(self, context, node):
return 0.8, 0.8, 0.8, 1
class ArmArraySocket(ArmCustomSocket):
bl_idname = 'ArmNodeSocketArray'
bl_label = 'Array Socket'
arm_socket_type = 'NONE'
def draw(self, context, layout, node, text):
layout.label(text=self.name)
def draw_color(self, context, node):
return 0.8, 0.4, 0.0, 1
class ArmObjectSocket(ArmCustomSocket):
bl_idname = 'ArmNodeSocketObject'
bl_label = 'Object Socket'
arm_socket_type = 'OBJECT'
default_value_get: PointerProperty(name='Object', type=bpy.types.Object) # legacy version of the line after this one
default_value_raw: PointerProperty(name='Object', type=bpy.types.Object)
def __init__(self):
super().__init__()
if self.default_value_get is not None:
self.default_value_raw = self.default_value_get
self.default_value_get = None
def get_default_value(self):
if self.default_value_raw is None:
return ''
if self.default_value_raw.name not in bpy.data.objects:
return self.default_value_raw.name
return arm.utils.asset_name(bpy.data.objects[self.default_value_raw.name])
def draw(self, context, layout, node, text):
if self.is_output:
@ -85,7 +109,7 @@ class ArmObjectSocket(NodeSocket):
layout.label(text=self.name)
else:
row = layout.row(align=True)
row.prop_search(self, 'default_value_get', context.scene, 'objects', icon='NONE', text=self.name)
row.prop_search(self, 'default_value_raw', context.scene, 'objects', icon='NONE', text=self.name)
def draw_color(self, context, node):
return 0.15, 0.55, 0.75, 1

View file

@ -4,11 +4,13 @@ class ArrayNode(ArmLogicTreeNode):
"""Array node"""
bl_idname = 'LNArrayNode'
bl_label = 'Array Dynamic'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(ArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,11 +4,13 @@ class ArrayAddNode(ArmLogicTreeNode):
"""Array add node"""
bl_idname = 'LNArrayAddNode'
bl_label = 'Array Add'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(ArrayAddNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketBool', 'Unique Values')

View file

@ -4,11 +4,13 @@ class BooleanArrayNode(ArmLogicTreeNode):
"""Boolean array node"""
bl_idname = 'LNArrayBooleanNode'
bl_label = 'Array Boolean'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(BooleanArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,11 +4,13 @@ class ColorArrayNode(ArmLogicTreeNode):
"""Color array node"""
bl_idname = 'LNArrayColorNode'
bl_label = 'Array Color'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(ColorArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,8 +4,10 @@ class ArrayContainsNode(ArmLogicTreeNode):
"""Array contains node"""
bl_idname = 'LNArrayInArrayNode'
bl_label = 'Array Contains'
arm_version = 1
def init(self, context):
super(ArrayContainsNode, self).init(context)
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketShader', 'Value')
self.add_output('NodeSocketBool', 'Bool')

View file

@ -4,11 +4,13 @@ class FloatArrayNode(ArmLogicTreeNode):
"""Float array node"""
bl_idname = 'LNArrayFloatNode'
bl_label = 'Array Float'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(FloatArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,8 +4,10 @@ class ArrayGetNode(ArmLogicTreeNode):
"""Array get node"""
bl_idname = 'LNArrayGetNode'
bl_label = 'Array Get'
arm_version = 1
def init(self, context):
super(ArrayGetNode, self).init(context)
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketInt', 'Index')
self.add_output('NodeSocketShader', 'Value')

View file

@ -4,11 +4,13 @@ class IntegerArrayNode(ArmLogicTreeNode):
"""Integer array node"""
bl_idname = 'LNArrayIntegerNode'
bl_label = 'Array Integer'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(IntegerArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array')
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,8 +4,10 @@ class ArrayLengthNode(ArmLogicTreeNode):
"""Array length node"""
bl_idname = 'LNArrayLengthNode'
bl_label = 'Array Length'
arm_version = 1
def init(self, context):
super(ArrayLengthNode, self).init(context)
self.add_input('ArmNodeSocketArray', 'Array')
self.add_output('NodeSocketInt', 'Length')

View file

@ -5,8 +5,10 @@ class ArrayLoopNode(ArmLogicTreeNode):
"""ArrayLoop node"""
bl_idname = 'LNArrayLoopNode'
bl_label = 'Array Loop'
arm_version = 1
def init(self, context):
super(ArrayLoopNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketArray', 'Array')
self.add_output('ArmNodeSocketAction', 'Loop')

View file

@ -4,11 +4,13 @@ class ObjectArrayNode(ArmLogicTreeNode):
"""Object array node"""
bl_idname = 'LNArrayObjectNode'
bl_label = 'Array Object'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(ObjectArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,8 +4,10 @@ class ArrayPopNode(ArmLogicTreeNode):
"""Array pop node"""
bl_idname = 'LNArrayPopNode'
bl_label = 'Array Pop'
arm_version = 1
def init(self, context):
super(ArrayPopNode, self).init(context)
self.add_input('ArmNodeSocketArray', 'Array')
self.add_output('NodeSocketShader', 'Value')

View file

@ -4,8 +4,10 @@ class ArrayRemoveIndexNode(ArmLogicTreeNode):
"""Removes an element from an array given by its index."""
bl_idname = 'LNArrayRemoveNode'
bl_label = 'Array Remove By Index'
arm_version = 1
def init(self, context):
super(ArrayRemoveIndexNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketInt', 'Index')

View file

@ -4,11 +4,13 @@ class ArrayRemoveValueNode(ArmLogicTreeNode):
"""Removes an element from an array given by its value."""
bl_idname = 'LNArrayRemoveValueNode'
bl_label = 'Array Remove By Value'
arm_version = 1
# def __init__(self):
# array_nodes[str(id(self))] = self
def init(self, context):
super(ArrayRemoveValueNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketShader', 'Value')

View file

@ -4,8 +4,10 @@ class ArraySetNode(ArmLogicTreeNode):
"""Array set node"""
bl_idname = 'LNArraySetNode'
bl_label = 'Array Set'
arm_version = 1
def init(self, context):
super(ArraySetNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketInt', 'Index')

View file

@ -4,8 +4,10 @@ class ArrayShiftNode(ArmLogicTreeNode):
"""Array shift node"""
bl_idname = 'LNArrayShiftNode'
bl_label = 'Array Shift'
arm_version = 1
def init(self, context):
super(ArrayShiftNode, self).init(context)
self.add_input('ArmNodeSocketArray', 'Array')
self.add_output('NodeSocketShader', 'Value')

View file

@ -4,8 +4,10 @@ class ArraySliceNode(ArmLogicTreeNode):
"""Array slice node"""
bl_idname = 'LNArraySliceNode'
bl_label = 'Array Slice'
arm_version = 1
def init(self, context):
super(ArraySliceNode, self).init(context)
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketInt', 'Index')
self.add_input('NodeSocketInt', 'End')

View file

@ -4,8 +4,10 @@ class ArraySpliceNode(ArmLogicTreeNode):
"""Array splice node"""
bl_idname = 'LNArraySpliceNode'
bl_label = 'Array Splice'
arm_version = 1
def init(self, context):
super(ArraySpliceNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketArray', 'Array')
self.add_input('NodeSocketInt', 'Index')

View file

@ -4,11 +4,13 @@ class StringArrayNode(ArmLogicTreeNode):
"""String array node"""
bl_idname = 'LNArrayStringNode'
bl_label = 'Array String'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(StringArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,11 +4,13 @@ class VectorArrayNode(ArmLogicTreeNode):
"""Vector array node"""
bl_idname = 'LNArrayVectorNode'
bl_label = 'Array Vector'
arm_version = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(VectorArrayNode, self).init(context)
self.add_output('ArmNodeSocketArray', 'Array', is_var=True)
self.add_output('NodeSocketInt', 'Length')

View file

@ -4,8 +4,10 @@ class ActiveCameraNode(ArmLogicTreeNode):
"""Get the active camera of the active scene."""
bl_idname = 'LNActiveCameraNode'
bl_label = 'Get Active Camera'
arm_version = 1
def init(self, context):
super(ActiveCameraNode, self).init(context)
self.add_output('ArmNodeSocketObject', 'Object')
add_node(ActiveCameraNode, category=PKG_AS_CATEGORY)

View file

@ -4,8 +4,10 @@ class GetCameraFovNode(ArmLogicTreeNode):
"""Get camera FOV node"""
bl_idname = 'LNGetCameraFovNode'
bl_label = 'Get Camera FOV'
arm_version = 1
def init(self, context):
super(GetCameraFovNode, self).init(context)
self.add_input('ArmNodeSocketObject', 'Object')
self.add_output('NodeSocketFloat', 'FOV')

View file

@ -4,8 +4,10 @@ class SetCameraNode(ArmLogicTreeNode):
"""Set the active camera of the active scene."""
bl_idname = 'LNSetCameraNode'
bl_label = 'Set Active Camera'
arm_version = 1
def init(self, context):
super(SetCameraNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')

View file

@ -5,8 +5,10 @@ class SetCameraFovNode(ArmLogicTreeNode):
bl_idname = 'LNSetCameraFovNode'
bl_label = 'Set Camera FOV'
bl_description = 'Set the camera\'s field of view'
arm_version = 1
def init(self, context):
super(SetCameraFovNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketFloat', 'FOV', default_value=0.85)

View file

@ -4,8 +4,10 @@ class CanvasGetCheckboxNode(ArmLogicTreeNode):
"""Get canvas checkbox value"""
bl_idname = 'LNCanvasGetCheckboxNode'
bl_label = 'Canvas Get Checkbox'
arm_version = 1
def init(self, context):
super(CanvasGetCheckboxNode, self).init(context)
self.add_input('NodeSocketString', 'Element')
self.add_output('NodeSocketBool', 'Value')

View file

@ -4,8 +4,10 @@ class CanvasGetInputTextNode(ArmLogicTreeNode):
"""Get canvas input text"""
bl_idname = 'LNCanvasGetInputTextNode'
bl_label = 'Canvas Get Input Text'
arm_version = 1
def init(self, context):
super(CanvasGetInputTextNode, self).init(context)
self.add_input('NodeSocketString', 'Element')
self.add_output('NodeSocketString', 'Value')

View file

@ -4,8 +4,10 @@ class CanvasGetLocationNode(ArmLogicTreeNode):
"""Get canvas element location"""
bl_idname = 'LNCanvasGetLocationNode'
bl_label = 'Canvas Get Location'
arm_version = 1
def init(self, context):
super(CanvasGetLocationNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class CanvasGetPBNode(ArmLogicTreeNode):
"""Get canvas progress bar"""
bl_idname = 'LNCanvasGetPBNode'
bl_label = 'Canvas Get Progress Bar'
arm_version = 1
def init(self, context):
super(CanvasGetPBNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class CanvasGetPositionNode(ArmLogicTreeNode):
"""Get canvas radio and combo value"""
bl_idname = 'LNCanvasGetPositionNode'
bl_label = 'Canvas Get Position'
arm_version = 1
def init(self, context):
super(CanvasGetPositionNode, self).init(context)
self.add_input('NodeSocketString', 'Element')
self.add_output('NodeSocketInt', 'Value')

View file

@ -4,8 +4,10 @@ class CanvasGetRotationNode(ArmLogicTreeNode):
"""Get canvas element rotation"""
bl_idname = 'LNCanvasGetRotationNode'
bl_label = 'Canvas Get Rotation'
arm_version = 1
def init(self, context):
super(CanvasGetRotationNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class CanvasGetScaleNode(ArmLogicTreeNode):
"""Get canvas element scale"""
bl_idname = 'LNCanvasGetScaleNode'
bl_label = 'Canvas Get Scale'
arm_version = 1
def init(self, context):
super(CanvasGetScaleNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class CanvasGetSliderNode(ArmLogicTreeNode):
"""Set canvas text"""
bl_idname = 'LNCanvasGetSliderNode'
bl_label = 'Canvas Get Slider'
arm_version = 1
def init(self, context):
super(CanvasGetSliderNode, self).init(context)
self.add_input('NodeSocketString', 'Element')
self.add_output('NodeSocketFloat', 'Value')

View file

@ -7,8 +7,10 @@ class CanvasGetVisibleNode(ArmLogicTreeNode):
"""Canvas Get Visible node"""
bl_idname = 'LNCanvasGetVisibleNode'
bl_label = 'Canvas Get Visible'
arm_version = 1
def init(self, context):
super(CanvasGetVisibleNode, self).init(context)
self.inputs.new('NodeSocketString', 'Element')
self.outputs.new('NodeSocketBool', 'Visible')

View file

@ -4,8 +4,10 @@ class CanvasSetAssetNode(ArmLogicTreeNode):
"""Set canvas asset"""
bl_idname = 'LNCanvasSetAssetNode'
bl_label = 'Canvas Set Asset'
arm_version = 1
def init(self, context):
super(CanvasSetAssetNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketString', 'Asset')

View file

@ -4,8 +4,10 @@ class CanvasSetCheckBoxNode(ArmLogicTreeNode):
"""Set canvas check box"""
bl_idname = 'LNCanvasSetCheckBoxNode'
bl_label = 'Canvas Set Checkbox'
arm_version = 1
def init(self, context):
super(CanvasSetCheckBoxNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketBool', 'Value')

View file

@ -4,8 +4,10 @@ class CanvasSetLocationNode(ArmLogicTreeNode):
"""Set canvas element location"""
bl_idname = 'LNCanvasSetLocationNode'
bl_label = 'Canvas Set Location'
arm_version = 1
def init(self, context):
super(CanvasSetLocationNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketFloat', 'X')

View file

@ -4,8 +4,10 @@ class CanvasSetPBNode(ArmLogicTreeNode):
"""Set canvas progress bar"""
bl_idname = 'LNCanvasSetPBNode'
bl_label = 'Canvas Set Progress Bar'
arm_version = 1
def init(self, context):
super(CanvasSetPBNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketInt', 'At')

View file

@ -4,8 +4,10 @@ class CanvasSetRotationNode(ArmLogicTreeNode):
"""Set canvas element rotation"""
bl_idname = 'LNCanvasSetRotationNode'
bl_label = 'Canvas Set Rotation'
arm_version = 1
def init(self, context):
super(CanvasSetRotationNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketFloat', 'Rad')

View file

@ -4,8 +4,10 @@ class CanvasSetScaleNode(ArmLogicTreeNode):
"""Set canvas element scale"""
bl_idname = 'LNCanvasSetScaleNode'
bl_label = 'Canvas Set Scale'
arm_version = 1
def init(self, context):
super(CanvasSetScaleNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketInt', 'Height')

View file

@ -4,8 +4,10 @@ class CanvasSetSliderNode(ArmLogicTreeNode):
"""Set canvas text"""
bl_idname = 'LNCanvasSetSliderNode'
bl_label = 'Canvas Set Slider'
arm_version = 1
def init(self, context):
super(CanvasSetSliderNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketFloat', 'Value')

View file

@ -4,8 +4,10 @@ class CanvasSetTextNode(ArmLogicTreeNode):
"""Set canvas text"""
bl_idname = 'LNCanvasSetTextNode'
bl_label = 'Canvas Set Text'
arm_version = 1
def init(self, context):
super(CanvasSetTextNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketString', 'Text')

View file

@ -4,8 +4,10 @@ class CanvasSetTextColorNode(ArmLogicTreeNode):
"""Set canvas text color"""
bl_idname = 'LNCanvasSetTextColorNode'
bl_label = 'Canvas Set Text Color'
arm_version = 1
def init(self, context):
super(CanvasSetTextColorNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketFloat', 'R')

View file

@ -4,8 +4,10 @@ class CanvasSetVisibleNode(ArmLogicTreeNode):
"""Canvas Set Visible node"""
bl_idname = 'LNCanvasSetVisibleNode'
bl_label = 'Canvas Set Visible'
arm_version = 1
def init(self, context):
super(CanvasSetVisibleNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Element')
self.add_input('NodeSocketBool', 'Visible')

View file

@ -4,6 +4,7 @@ class OnCanvasElementNode(ArmLogicTreeNode):
"""On canvas element node"""
bl_idname = 'LNOnCanvasElementNode'
bl_label = 'On Canvas Element'
arm_version = 1
property0: EnumProperty(
items=[('click', 'Click', 'Listen to mouse clicks'),
@ -21,6 +22,7 @@ class OnCanvasElementNode(ArmLogicTreeNode):
name='Mouse Button', default='left')
def init(self, context):
super(OnCanvasElementNode, self).init(context)
self.add_input('NodeSocketString', 'Element')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,9 +4,11 @@ class OnEventNode(ArmLogicTreeNode):
"""On event node"""
bl_idname = 'LNOnEventNode'
bl_label = 'On Event'
arm_version = 1
property0: StringProperty(name='', default='')
def init(self, context):
super(OnEventNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):

View file

@ -4,8 +4,10 @@ class OnInitNode(ArmLogicTreeNode):
"""On init node"""
bl_idname = 'LNOnInitNode'
bl_label = 'On Init'
arm_version = 1
def init(self, context):
super(OnInitNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
add_node(OnInitNode, category=PKG_AS_CATEGORY)

View file

@ -4,8 +4,10 @@ class OnTimerNode(ArmLogicTreeNode):
"""On timer node"""
bl_idname = 'LNOnTimerNode'
bl_label = 'On Timer'
arm_version = 1
def init(self, context):
super(OnTimerNode, self).init(context)
self.add_input('NodeSocketFloat', 'Duration')
self.add_input('NodeSocketBool', 'Repeat')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,6 +4,7 @@ class OnUpdateNode(ArmLogicTreeNode):
"""On update node"""
bl_idname = 'LNOnUpdateNode'
bl_label = 'On Update'
arm_version = 1
property0: EnumProperty(
items = [('Update', 'Update', 'Update'),
('Late Update', 'Late Update', 'Late Update'),
@ -11,6 +12,7 @@ class OnUpdateNode(ArmLogicTreeNode):
name='On', default='Update')
def init(self, context):
super(OnUpdateNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):

View file

@ -4,6 +4,7 @@ class OnVolumeTriggerNode(ArmLogicTreeNode):
"""On volume trigger node"""
bl_idname = 'LNOnVolumeTriggerNode'
bl_label = 'On Volume Trigger'
arm_version = 1
property0: EnumProperty(
items = [('Enter', 'Enter', 'Enter'),
('Leave', 'Leave', 'Leave'),
@ -11,6 +12,7 @@ class OnVolumeTriggerNode(ArmLogicTreeNode):
name='', default='Enter')
def init(self, context):
super(OnVolumeTriggerNode, self).init(context)
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('ArmNodeSocketObject', 'Volume', default_value='Volume')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class SendEventNode(ArmLogicTreeNode):
"""Send event node"""
bl_idname = 'LNSendEventNode'
bl_label = 'Send Event'
arm_version = 1
def init(self, context):
super(SendEventNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Event')
self.add_input('ArmNodeSocketObject', 'Object')

View file

@ -4,8 +4,10 @@ class SendGlobalEventNode(ArmLogicTreeNode):
"""Send global event node"""
bl_idname = 'LNSendGlobalEventNode'
bl_label = 'Send Global Event'
arm_version = 1
def init(self, context):
super(SendGlobalEventNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketString', 'Event')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,6 +4,7 @@ class GamepadNode(ArmLogicTreeNode):
"""Gamepad node"""
bl_idname = 'LNMergedGamepadNode'
bl_label = 'Gamepad'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
@ -35,6 +36,7 @@ class GamepadNode(ArmLogicTreeNode):
name='', default='cross')
def init(self, context):
super(GamepadNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('NodeSocketBool', 'State')
self.add_input('NodeSocketInt', 'Gamepad')

View file

@ -4,8 +4,10 @@ class GamepadCoordsNode(ArmLogicTreeNode):
"""Gamepad coords node"""
bl_idname = 'LNGamepadCoordsNode'
bl_label = 'Gamepad Coords'
arm_version = 1
def init(self, context):
super(GamepadCoordsNode, self).init(context)
self.add_output('NodeSocketVector', 'Left Stick')
self.add_output('NodeSocketVector', 'Right Stick')
self.add_output('NodeSocketVector', 'Left Movement')

View file

@ -7,8 +7,10 @@ class GetMouseLockNode(ArmLogicTreeNode):
"""Get Mouse Lock node"""
bl_idname = 'LNGetMouseLockNode'
bl_label = 'Get Mouse Lock'
arm_version = 1
def init(self, context):
super(GetMouseLockNode, self).init(context)
self.outputs.new('NodeSocketBool', 'Lock')
add_node(GetMouseLockNode, category=PKG_AS_CATEGORY, section='mouse')

View file

@ -7,8 +7,10 @@ class GetMouseVisibleNode(ArmLogicTreeNode):
"""Get Mouse Visible node"""
bl_idname = 'LNGetMouseVisibleNode'
bl_label = 'Get Mouse Visible'
arm_version = 1
def init(self, context):
super(GetMouseVisibleNode, self).init(context)
self.outputs.new('NodeSocketBool', 'Visible')
add_node(GetMouseVisibleNode, category=PKG_AS_CATEGORY, section='mouse')

View file

@ -4,6 +4,7 @@ class KeyboardNode(ArmLogicTreeNode):
"""Keyboard node"""
bl_idname = 'LNMergedKeyboardNode'
bl_label = 'Keyboard'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
@ -67,6 +68,7 @@ class KeyboardNode(ArmLogicTreeNode):
name='', default='space')
def init(self, context):
super(KeyboardNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('NodeSocketBool', 'State')

View file

@ -4,6 +4,7 @@ class MouseNode(ArmLogicTreeNode):
"""Mouse node"""
bl_idname = 'LNMergedMouseNode'
bl_label = 'Mouse'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
@ -17,6 +18,7 @@ class MouseNode(ArmLogicTreeNode):
name='', default='left')
def init(self, context):
super(MouseNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('NodeSocketBool', 'State')

View file

@ -4,8 +4,10 @@ class MouseCoordsNode(ArmLogicTreeNode):
"""Mouse coords node"""
bl_idname = 'LNMouseCoordsNode'
bl_label = 'Mouse Coords'
arm_version = 1
def init(self, context):
super(MouseCoordsNode, self).init(context)
self.add_output('NodeSocketVector', 'Coords')
self.add_output('NodeSocketVector', 'Movement')
self.add_output('NodeSocketInt', 'Wheel')

View file

@ -4,6 +4,7 @@ class OnGamepadNode(ArmLogicTreeNode):
"""On gamepad node"""
bl_idname = 'LNOnGamepadNode'
bl_label = 'On Gamepad'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
@ -35,6 +36,7 @@ class OnGamepadNode(ArmLogicTreeNode):
name='', default='cross')
def init(self, context):
super(OnGamepadNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
self.add_input('NodeSocketInt', 'Gamepad')

View file

@ -4,6 +4,7 @@ class OnKeyboardNode(ArmLogicTreeNode):
"""On keyboard node"""
bl_idname = 'LNOnKeyboardNode'
bl_label = 'On Keyboard'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
@ -67,6 +68,7 @@ class OnKeyboardNode(ArmLogicTreeNode):
name='', default='space')
def init(self, context):
super(OnKeyboardNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):

View file

@ -4,6 +4,7 @@ class OnMouseNode(ArmLogicTreeNode):
"""On mouse node"""
bl_idname = 'LNOnMouseNode'
bl_label = 'On Mouse'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
@ -17,6 +18,7 @@ class OnMouseNode(ArmLogicTreeNode):
name='', default='left')
def init(self, context):
super(OnMouseNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):

View file

@ -4,6 +4,7 @@ class OnSurfaceNode(ArmLogicTreeNode):
"""On surface node"""
bl_idname = 'LNOnSurfaceNode'
bl_label = 'On Surface'
arm_version = 1
property0: EnumProperty(
items = [('Touched', 'Touched', 'Touched'),
('Started', 'Started', 'Started'),
@ -12,6 +13,7 @@ class OnSurfaceNode(ArmLogicTreeNode):
name='', default='Touched')
def init(self, context):
super(OnSurfaceNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):

View file

@ -4,6 +4,7 @@ class OnVirtualButtonNode(ArmLogicTreeNode):
"""On virtual button node"""
bl_idname = 'LNOnVirtualButtonNode'
bl_label = 'On Virtual Button'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
@ -12,6 +13,7 @@ class OnVirtualButtonNode(ArmLogicTreeNode):
property1: StringProperty(name='', default='button')
def init(self, context):
super(OnVirtualButtonNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):

View file

@ -4,8 +4,10 @@ class SensorCoordsNode(ArmLogicTreeNode):
"""Sensor coords node"""
bl_idname = 'LNSensorCoordsNode'
bl_label = 'Sensor Coords'
arm_version = 1
def init(self, context):
super(SensorCoordsNode, self).init(context)
self.add_output('NodeSocketVector', 'Coords')
add_node(SensorCoordsNode, category=PKG_AS_CATEGORY, section='sensor')

View file

@ -4,8 +4,10 @@ class SetMouseLockNode(ArmLogicTreeNode):
"""Set Mouse Lock node"""
bl_idname = 'LNSetMouseLockNode'
bl_label = 'Set Mouse Lock'
arm_version = 1
def init(self, context):
super(SetMouseLockNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketBool', 'Lock')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class ShowMouseNode(ArmLogicTreeNode):
"""Show Mouse node"""
bl_idname = 'LNShowMouseNode'
bl_label = 'Show Mouse'
arm_version = 1
def init(self, context):
super(ShowMouseNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketBool', 'Show')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,6 +4,7 @@ class SurfaceNode(ArmLogicTreeNode):
"""Surface node"""
bl_idname = 'LNMergedSurfaceNode'
bl_label = 'Surface'
arm_version = 1
property0: EnumProperty(
items = [('Touched', 'Touched', 'Touched'),
('Started', 'Started', 'Started'),
@ -12,6 +13,7 @@ class SurfaceNode(ArmLogicTreeNode):
name='', default='Touched')
def init(self, context):
super(SurfaceNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('NodeSocketBool', 'State')

View file

@ -4,8 +4,10 @@ class SurfaceCoordsNode(ArmLogicTreeNode):
"""Surface coords node"""
bl_idname = 'LNSurfaceCoordsNode'
bl_label = 'Surface Coords'
arm_version = 1
def init(self, context):
super(SurfaceCoordsNode, self).init(context)
self.add_output('NodeSocketVector', 'Coords')
self.add_output('NodeSocketVector', 'Movement')

View file

@ -4,6 +4,7 @@ class VirtualButtonNode(ArmLogicTreeNode):
"""Virtual button node"""
bl_idname = 'LNMergedVirtualButtonNode'
bl_label = 'Virtual Button'
arm_version = 1
property0: EnumProperty(
items = [('Down', 'Down', 'Down'),
('Started', 'Started', 'Started'),
@ -12,6 +13,7 @@ class VirtualButtonNode(ArmLogicTreeNode):
property1: StringProperty(name='', default='button')
def init(self, context):
super(VirtualButtonNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
self.add_output('NodeSocketBool', 'State')

View file

@ -4,8 +4,10 @@ class SetLightColorNode(ArmLogicTreeNode):
"""Set light color node"""
bl_idname = 'LNSetLightColorNode'
bl_label = 'Set Light Color'
arm_version = 1
def init(self, context):
super(SetLightColorNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketColor', 'Color', default_value=[1.0, 1.0, 1.0, 1.0])

View file

@ -4,8 +4,10 @@ class SetLightStrengthNode(ArmLogicTreeNode):
"""Set light strength node"""
bl_idname = 'LNSetLightStrengthNode'
bl_label = 'Set Light Strength'
arm_version = 1
def init(self, context):
super(SetLightStrengthNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('ArmNodeSocketObject', 'Object')
self.add_input('NodeSocketFloat', 'Strength', default_value=100)

View file

@ -5,8 +5,10 @@ class AlternateNode(ArmLogicTreeNode):
"""Alternate node"""
bl_idname = 'LNAlternateNode'
bl_label = 'Alternate'
arm_version = 1
def init(self, context):
super(AlternateNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_output('ArmNodeSocketAction', '0')
self.add_output('ArmNodeSocketAction', '1')

View file

@ -5,8 +5,10 @@ class BranchNode(ArmLogicTreeNode):
"""Branch node"""
bl_idname = 'LNBranchNode'
bl_label = 'Branch'
arm_version = 1
def init(self, context):
super(BranchNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketBool', 'Bool')
self.add_output('ArmNodeSocketAction', 'True')

View file

@ -4,12 +4,14 @@ class CallFunctionNode(ArmLogicTreeNode):
"""Call Haxe function node"""
bl_idname = 'LNCallFunctionNode'
bl_label = 'Call Function'
arm_version = 1
min_inputs = 3
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(CallFunctionNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketShader', 'Trait/Any')
self.add_input('NodeSocketString', 'Function')

View file

@ -5,12 +5,14 @@ class FunctionNode(ArmLogicTreeNode):
"""Function node"""
bl_idname = 'LNFunctionNode'
bl_label = 'Function'
arm_version = 1
min_outputs = 1
def __init__(self):
array_nodes[str(id(self))] = self
def init(self, context):
super(FunctionNode, self).init(context)
self.add_output('ArmNodeSocketAction', 'Out')
function_name: StringProperty(name="Name")

View file

@ -5,8 +5,10 @@ class FunctionOutputNode(ArmLogicTreeNode):
"""Function output node"""
bl_idname = 'LNFunctionOutputNode'
bl_label = 'Function Output'
arm_version = 1
def init(self, context):
super(FunctionOutputNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketShader', 'Value')

View file

@ -11,6 +11,7 @@ class GateNode(ArmLogicTreeNode):
"""Gate node"""
bl_idname = 'LNGateNode'
bl_label = 'Gate'
arm_version = 1
min_inputs = 3
property0: EnumProperty(
@ -30,6 +31,7 @@ class GateNode(ArmLogicTreeNode):
array_nodes[str(id(self))] = self
def init(self, context):
super(GateNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketShader', 'Value')
self.add_input('NodeSocketShader', 'Value')

View file

@ -5,8 +5,10 @@ class InverseNode(ArmLogicTreeNode):
"""Inverse node"""
bl_idname = 'LNInverseNode'
bl_label = 'Inverse'
arm_version = 1
def init(self, context):
super(InverseNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -5,8 +5,10 @@ class IsFalseNode(ArmLogicTreeNode):
"""Is False node"""
bl_idname = 'LNIsFalseNode'
bl_label = 'Is False'
arm_version = 1
def init(self, context):
super(IsFalseNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketBool', 'Value')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -5,8 +5,10 @@ class IsNoneNode(ArmLogicTreeNode):
"""Is none node"""
bl_idname = 'LNIsNoneNode'
bl_label = 'Is None'
arm_version = 1
def init(self, context):
super(IsNoneNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketShader', 'Value')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class IsNotNoneNode(ArmLogicTreeNode):
"""Is not none node"""
bl_idname = 'LNIsNotNoneNode'
bl_label = 'Is Not None'
arm_version = 1
def init(self, context):
super(IsNotNoneNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketShader', 'Value')
self.add_output('ArmNodeSocketAction', 'Out')

View file

@ -4,8 +4,10 @@ class IsTrueNode(ArmLogicTreeNode):
"""Is true node"""
bl_idname = 'LNIsTrueNode'
bl_label = 'Is True'
arm_version = 1
def init(self, context):
super(IsTrueNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
self.add_input('NodeSocketBool', 'Value')
self.add_output('ArmNodeSocketAction', 'Out')

Some files were not shown because too many files have changed in this diff Show more