Aligned structure to how Armory does things.
This commit is contained in:
parent
e7574b343d
commit
a695f10759
22
blender.py
22
blender.py
|
@ -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()
|
||||||
|
|
|
@ -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)]
|
|
@ -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')
|
Loading…
Reference in New Issue