2020-02-09 15:45:04 +01:00
|
|
|
import bpy
|
|
|
|
from bpy.props import *
|
|
|
|
from bpy.types import Node, NodeSocket
|
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class GetWorldNode(ArmLogicTreeNode):
|
2020-02-09 15:45:04 +01:00
|
|
|
'''Get world node'''
|
|
|
|
bl_idname = 'LNGetWorldNode'
|
|
|
|
bl_label = 'Get World'
|
2020-08-07 19:05:48 +02:00
|
|
|
bl_icon = 'NONE'
|
2020-02-09 15:45:04 +01:00
|
|
|
|
|
|
|
property0: EnumProperty(
|
|
|
|
items = [('right', 'right', 'right'),
|
|
|
|
('look', 'look', 'look'),
|
|
|
|
('up', 'up', 'up')],
|
|
|
|
name='', default='right')
|
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_input('ArmNodeSocketObject', 'Object')
|
|
|
|
self.add_output('NodeSocketVector', 'Vector')
|
2020-02-09 15:45:04 +01:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
|
2020-09-08 17:03:24 +02:00
|
|
|
add_node(GetWorldNode, category=MODULE_AS_CATEGORY, section='rotation')
|