2019-07-16 15:36:22 +02:00
|
|
|
import bpy
|
|
|
|
from bpy.props import *
|
|
|
|
from .. base import FunctionNode
|
2019-12-03 11:51:47 +01:00
|
|
|
from .. node_builder import NodeBuilder
|
2019-07-16 15:36:22 +02:00
|
|
|
|
|
|
|
class ObjectMeshNode(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_ObjectMeshNode"
|
|
|
|
bl_label = "Object Mesh"
|
|
|
|
|
|
|
|
def declaration(self, builder):
|
|
|
|
builder.fixed_input("object", "Object", "Object")
|
|
|
|
builder.fixed_output("vertex_locations", "Vertex Locations", "Vector List")
|
2019-11-03 14:12:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
class VertexInfo(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_VertexInfoNode"
|
|
|
|
bl_label = "Vertex Info"
|
|
|
|
|
|
|
|
def declaration(self, builder):
|
|
|
|
builder.fixed_output("position", "Position", "Vector")
|
2019-11-13 13:48:03 +01:00
|
|
|
|
|
|
|
|
2019-11-27 18:15:48 +01:00
|
|
|
class ClosestLocationOnObjectNode(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_ClosestLocationOnObjectNode"
|
|
|
|
bl_label = "Closest Location on Object"
|
2019-11-13 13:48:03 +01:00
|
|
|
|
2019-12-11 12:18:56 +01:00
|
|
|
use_list__object: NodeBuilder.VectorizedProperty()
|
|
|
|
use_list__position: NodeBuilder.VectorizedProperty()
|
|
|
|
|
|
|
|
def declaration(self, builder: NodeBuilder):
|
|
|
|
builder.vectorized_input("object", "use_list__object", "Object", "Objects", "Object")
|
|
|
|
builder.vectorized_input("position", "use_list__position", "Position", "Positions", "Vector")
|
2019-12-11 15:50:06 +01:00
|
|
|
|
|
|
|
vectorize_props = ["use_list__object", "use_list__position"]
|
|
|
|
builder.vectorized_output("closest_hook", vectorize_props, "Closest Hook", "Closest Hooks", "Surface Hook")
|
|
|
|
builder.vectorized_output("closest_position", vectorize_props, "Closest Position", "Closest Positions", "Vector")
|
|
|
|
builder.vectorized_output("closest_normal", vectorize_props, "Closest Normal", "Closest Normals", "Vector")
|
2019-11-30 13:30:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
class GetPositionOnSurfaceNode(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_GetPositionOnSurfaceNode"
|
|
|
|
bl_label = "Get Position on Surface"
|
|
|
|
|
2019-12-11 12:18:56 +01:00
|
|
|
use_list__surface_hook: NodeBuilder.VectorizedProperty()
|
|
|
|
|
|
|
|
def declaration(self, builder: NodeBuilder):
|
|
|
|
builder.vectorized_input("surface_hook", "use_list__surface_hook", "Surface Hook", "Surface Hooks", "Surface Hook")
|
|
|
|
builder.vectorized_output("position", ["use_list__surface_hook"], "Position", "Positions", "Vector")
|
2019-12-03 16:00:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
class GetNormalOnSurfaceNode(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_GetNormalOnSurfaceNode"
|
|
|
|
bl_label = "Get Normal on Surface"
|
|
|
|
|
2019-12-11 12:18:56 +01:00
|
|
|
use_list__surface_hook: NodeBuilder.VectorizedProperty()
|
|
|
|
|
2019-12-03 16:00:02 +01:00
|
|
|
def declaration(self, builder):
|
2019-12-11 12:18:56 +01:00
|
|
|
builder.vectorized_input("surface_hook", "use_list__surface_hook", "Surface Hook", "Surface Hooks", "Surface Hook")
|
|
|
|
builder.vectorized_output("normal", ["use_list__surface_hook"], "Normal", "Normals", "Vector")
|
2019-11-30 14:36:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
class GetWeightOnSurfaceNode(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_GetWeightOnSurfaceNode"
|
|
|
|
bl_label = "Get Weight on Surface"
|
|
|
|
|
2019-12-11 12:18:56 +01:00
|
|
|
use_list__surface_hook: NodeBuilder.VectorizedProperty()
|
2019-12-11 16:05:47 +01:00
|
|
|
use_list__vertex_group_name: NodeBuilder.VectorizedProperty()
|
2019-12-11 12:18:56 +01:00
|
|
|
|
2019-12-11 16:05:47 +01:00
|
|
|
def declaration(self, builder: NodeBuilder):
|
2019-12-11 12:18:56 +01:00
|
|
|
builder.vectorized_input("surface_hook", "use_list__surface_hook", "Surface Hook", "Surface Hooks", "Surface Hook")
|
2019-12-11 16:05:47 +01:00
|
|
|
builder.vectorized_input("vertex_group_name", "use_list__vertex_group_name", "Name", "Names", "Text", default="Group")
|
|
|
|
builder.vectorized_output("weight", ["use_list__surface_hook", "use_list__vertex_group_name"], "Weight", "Weights", "Float")
|
2019-12-03 11:51:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
class GetImageColorOnSurfaceNode(bpy.types.Node, FunctionNode):
|
|
|
|
bl_idname = "fn_GetImageColorOnSurfaceNode"
|
|
|
|
bl_label = "Get Image Color on Surface"
|
|
|
|
|
2019-12-11 12:18:56 +01:00
|
|
|
use_list__surface_hook: NodeBuilder.VectorizedProperty()
|
2019-12-11 13:01:55 +01:00
|
|
|
use_list__image: NodeBuilder.VectorizedProperty()
|
2019-12-11 12:18:56 +01:00
|
|
|
|
2019-12-03 11:51:47 +01:00
|
|
|
def declaration(self, builder: NodeBuilder):
|
2019-12-11 12:18:56 +01:00
|
|
|
builder.vectorized_input("surface_hook", "use_list__surface_hook", "Surface Hook", "Surface Hooks", "Surface Hook")
|
2019-12-11 13:01:55 +01:00
|
|
|
builder.vectorized_input("image", "use_list__image", "Image", "Images", "Image")
|
|
|
|
builder.vectorized_output("color", ["use_list__surface_hook", "use_list__image"], "Color", "Colors", "Color")
|