Matrix operations and sockets for geometry nodes #105408

Closed
Lukas Tönne wants to merge 37 commits from LukasTonne/blender:nodes-matrix-types into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 18 additions and 3 deletions
Showing only changes of commit b5f6919a80 - Show all commits

View File

@ -148,6 +148,7 @@ class NODE_MT_geometry_node_GEO_INPUT(Menu):
node_add_menu.add_node_type(layout, "FunctionNodeInputString")
node_add_menu.add_node_type(layout, "ShaderNodeValue")
node_add_menu.add_node_type(layout, "FunctionNodeInputVector")
node_add_menu.add_node_type(layout, "FunctionNodeInputMatrix4x4")
layout.separator()
node_add_menu.add_node_type(layout, "GeometryNodeInputID")
node_add_menu.add_node_type(layout, "GeometryNodeInputIndex")
@ -193,6 +194,18 @@ class NODE_MT_geometry_node_GEO_MATERIAL(Menu):
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
class NODE_MT_category_GEO_MATRIX(Menu):
bl_idname = "NODE_MT_category_GEO_MATRIX"
bl_label = "Matrix"
def draw(self, _context):
layout = self.layout
node_add_menu.add_node_type(layout, "FunctionNodeCombineMatrix4x4")
node_add_menu.add_node_type(layout, "FunctionNodeSeparateMatrix4x4")
node_add_menu.add_node_type(layout, "FunctionNodeMatrix4x4Math")
node_add_menu.draw_assets_for_catalog(layout, self.bl_label)
class NODE_MT_geometry_node_GEO_MESH(Menu):
bl_idname = "NODE_MT_geometry_node_GEO_MESH"
bl_label = "Mesh"
@ -423,6 +436,7 @@ class NODE_MT_geometry_node_add_all(Menu):
layout.menu("NODE_MT_geometry_node_GEO_INPUT")
layout.menu("NODE_MT_geometry_node_GEO_INSTANCE")
layout.menu("NODE_MT_geometry_node_GEO_MATERIAL")
layout.menu("NODE_MT_category_GEO_MATRIX")
layout.menu("NODE_MT_geometry_node_GEO_MESH")
layout.menu("NODE_MT_category_PRIMITIVES_MESH")
layout.menu("NODE_MT_geometry_node_mesh_topology")
@ -450,6 +464,7 @@ classes = (
NODE_MT_geometry_node_GEO_INPUT,
NODE_MT_geometry_node_GEO_INSTANCE,
NODE_MT_geometry_node_GEO_MATERIAL,
NODE_MT_category_GEO_MATRIX,
NODE_MT_geometry_node_GEO_MESH,
NODE_MT_category_PRIMITIVES_MESH,
NODE_MT_geometry_node_mesh_topology,

View File

@ -279,9 +279,9 @@ DefNode(FunctionNode, FN_NODE_SEPARATE_COLOR, def_fn_combsep_color, "SEPARATE_CO
DefNode(FunctionNode, FN_NODE_SLICE_STRING, 0, "SLICE_STRING", SliceString, "Slice String", "")
DefNode(FunctionNode, FN_NODE_STRING_LENGTH, 0, "STRING_LENGTH", StringLength, "String Length", "")
DefNode(FunctionNode, FN_NODE_VALUE_TO_STRING, 0, "VALUE_TO_STRING", ValueToString, "Value to String", "")
DefNode(FunctionNode, FN_NODE_INPUT_MATRIX_4X4, def_fn_input_matrix_4x4, "INPUT_MATRIX_4X4", InputMatrix, "4x4 Matrix", "")
DefNode(FunctionNode, FN_NODE_SEPARATE_MATRIX_4X4, def_fn_combsep_matrix, "SEPARATE_MATRIX_4X4", SeparateMatrix, "Separate 4x4 Matrix", "")
DefNode(FunctionNode, FN_NODE_COMBINE_MATRIX_4X4, def_fn_combsep_matrix, "COMBINE_MATRIX_4X4", CombineMatrix, "Combine 4x4 Matrix", "")
DefNode(FunctionNode, FN_NODE_INPUT_MATRIX_4X4, def_fn_input_matrix_4x4, "INPUT_MATRIX_4X4", InputMatrix4x4, "4x4 Matrix", "")
DefNode(FunctionNode, FN_NODE_SEPARATE_MATRIX_4X4, def_fn_combsep_matrix, "SEPARATE_MATRIX_4X4", SeparateMatrix4x4, "Separate 4x4 Matrix", "")
DefNode(FunctionNode, FN_NODE_COMBINE_MATRIX_4X4, def_fn_combsep_matrix, "COMBINE_MATRIX_4X4", CombineMatrix4x4, "Combine 4x4 Matrix", "")
DefNode(FunctionNode, FN_NODE_MATRIX_4X4_MATH, def_fn_matrix_4x4_math, "MATRIX_4X4_MATH", Matrix4x4Math, "4x4 Matrix Math", "")
DefNode(GeometryNode, GEO_NODE_ACCUMULATE_FIELD, def_geo_accumulate_field, "ACCUMULATE_FIELD", AccumulateField, "Accumulate Field", "Add the values of an evaluated field together and output the running total for each element")