Aligned structure to how Armory does things.

This commit is contained in:
Maxim Stewart 2018-10-06 00:14:16 -05:00
parent e7574b343d
commit a695f10759
4 changed files with 32 additions and 20 deletions

View File

@ -1,24 +1,10 @@
from bpy.types import Node import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import * from arm.logicnode.arm_nodes import *
import arm.nodes_logic import arm.nodes_logic
from logicnode_definitions import *
class EnhancedTransformNode(Node, ArmLogicTreeNode):
'''EnhancedTransformNode'''
bl_idname = 'LNEnhancedTransformNode'
bl_label = 'Enhanced Transform'
bl_icon = 'GAME'
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('NodeSocketVector', 'Location')
self.inputs.new('NodeSocketVector', 'Rotation')
self.inputs.new('NodeSocketVector', 'Scale')
self.outputs.new('ArmNodeSocketAction', 'Out')
def register(): def register():
# Add custom nodes
add_node(EnhancedTransformNode, category='Action')
# Register newly added nodes # Register newly added nodes
arm.nodes_logic.register_nodes() arm.nodes_logic.register_nodes()

View File

@ -0,0 +1,5 @@
# Import all nodes
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [basename(f)[:-3] for f in modules if isfile(f)]

View File

@ -0,0 +1,21 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class EnhancedTransformNode(Node, ArmLogicTreeNode):
'''EnhancedTransformNode'''
bl_idname = 'LNEnhancedTransformNode'
bl_label = 'Enhanced Transform'
bl_icon = 'GAME'
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('NodeSocketVector', 'Location')
self.inputs.new('NodeSocketVector', 'Rotation')
self.inputs.new('NodeSocketVector', 'Scale')
self.outputs.new('ArmNodeSocketAction', 'Out')
add_node(EnhancedTransformNode, category='Action')