2017-04-14 20:38:50 +02:00
|
|
|
import bpy
|
|
|
|
from bpy.props import *
|
|
|
|
from bpy.types import Node, NodeSocket
|
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
|
|
|
class SetRotationNode(Node, ArmLogicTreeNode):
|
|
|
|
'''Set rotation node'''
|
|
|
|
bl_idname = 'LNSetRotationNode'
|
|
|
|
bl_label = 'Set Rotation'
|
2018-12-18 23:48:38 +01:00
|
|
|
bl_icon = 'QUESTION'
|
2017-04-14 20:38:50 +02:00
|
|
|
|
2019-09-27 21:35:26 +02:00
|
|
|
property0: EnumProperty(
|
|
|
|
items = [('Euler Angles', 'Euler Angles', 'Euler Angles'),
|
|
|
|
('Angle Axies (Radians)', 'Angle Axies (Radians)', 'Angle Axies (Radians)'),
|
|
|
|
('Angle Axies (Degrees)', 'Angle Axies (Degrees)', 'Angle Axies (Degrees)'),
|
|
|
|
('Quaternion', 'Quaternion', 'Quaternion')],
|
|
|
|
name='', default='Euler Angles')
|
|
|
|
|
2017-04-14 20:38:50 +02:00
|
|
|
def init(self, context):
|
|
|
|
self.inputs.new('ArmNodeSocketAction', 'In')
|
|
|
|
self.inputs.new('ArmNodeSocketObject', 'Object')
|
2019-09-27 21:47:07 +02:00
|
|
|
self.inputs.new('NodeSocketVector', 'Euler Angles / Vector XYZ')
|
|
|
|
self.inputs.new('NodeSocketFloat', 'Angle / W')
|
2017-04-14 20:38:50 +02:00
|
|
|
self.outputs.new('ArmNodeSocketAction', 'Out')
|
|
|
|
|
2019-09-27 21:35:26 +02:00
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
|
2017-04-14 20:38:50 +02:00
|
|
|
add_node(SetRotationNode, category='Action')
|