[Bf-blender-cvs] [269dc0bbc62] ui-asset-view-template: Geometry Nodes: Move cone primtive to rest on its base by default

Hans Goudey noreply at git.blender.org
Sun Mar 21 16:12:01 CET 2021


Commit: 269dc0bbc6239dbe7da7fbbe78cc471d62b52295
Author: Hans Goudey
Date:   Fri Mar 19 11:21:24 2021 -0400
Branches: ui-asset-view-template
https://developer.blender.org/rB269dc0bbc6239dbe7da7fbbe78cc471d62b52295

Geometry Nodes: Move cone primtive to rest on its base by default

This is generally what people expect when generating a cone. Note that
this translation currently happens after the rotation, but since the rotation
will likely be removed in the future, that won't be a problem for long.

===================================================================

M	source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc

===================================================================

diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc
index 5e5dbd91d31..49c77602246 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc
@@ -258,6 +258,8 @@ static void geo_node_mesh_primitive_cone_exec(GeoNodeExecParams params)
   Mesh *mesh = create_cylinder_or_cone_mesh(
       location, rotation, radius_top, radius_bottom, depth, verts_num, fill_type);
 
+  BKE_mesh_translate(mesh, float3(0.0f, 0.0f, depth * 0.5f), false);
+
   params.set_output("Geometry", GeometrySet::create_with_mesh(mesh));
 }



More information about the Bf-blender-cvs mailing list