armory/blender/arm/logicnode/physics_apply_force_at_location.py

22 lines
808 B
Python

import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class ApplyForceAtLocationNode(Node, ArmLogicTreeNode):
'''Apply force at location node'''
bl_idname = 'LNApplyForceAtLocationNode'
bl_label = 'Apply Force At Location'
bl_icon = 'NONE'
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('NodeSocketVector', 'Force')
self.inputs.new('NodeSocketBool', 'Force On Local Axis')
self.inputs.new('NodeSocketVector', 'Location')
self.inputs.new('NodeSocketBool', 'Location On Local Axis')
self.outputs.new('ArmNodeSocketAction', 'Out')
add_node(ApplyForceAtLocationNode, category='Physics')