Differential D10866 Diff 35799 source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc
| Show All 12 Lines | |||||
| * along with this program; if not, write to the Free Software Foundation, | * along with this program; if not, write to the Free Software Foundation, | ||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| */ | */ | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "bmesh.h" | |||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| static bNodeSocketTemplate geo_node_mesh_primitive_circle_in[] = { | static bNodeSocketTemplate geo_node_mesh_primitive_circle_in[] = { | ||||
| {SOCK_INT, N_("Vertices"), 32, 0.0f, 0.0f, 0.0f, 3, 4096}, | {SOCK_INT, N_("Vertices"), 32, 0.0f, 0.0f, 0.0f, 3, 4096}, | ||||
| ▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | for (const int i : IndexRange(verts_num)) { | ||||
| loop_b.e = verts_num + ((i + 1) % verts_num); | loop_b.e = verts_num + ((i + 1) % verts_num); | ||||
| loop_b.v = (i + 1) % verts_num; | loop_b.v = (i + 1) % verts_num; | ||||
| MLoop &loop_c = loops[3 * i + 2]; | MLoop &loop_c = loops[3 * i + 2]; | ||||
| loop_c.e = verts_num + i; | loop_c.e = verts_num + i; | ||||
| loop_c.v = verts_num; | loop_c.v = verts_num; | ||||
| } | } | ||||
| } | } | ||||
| return mesh; | /* Fix for T86874, converting to BMesh and then back. */ | ||||
| BMeshCreateParams bm_create_params = {0}; | |||||
| bm_create_params.use_toolflags = true; | |||||
| BMeshFromMeshParams bm_from_mesh_params = {0}; | |||||
| bm_from_mesh_params.calc_face_normal = true; | |||||
| BMesh *bm = BKE_mesh_to_bmesh_ex(mesh, &bm_create_params, &bm_from_mesh_params); | |||||
| Mesh *result = BKE_mesh_from_bmesh_for_eval_nomain(bm, nullptr, mesh); | |||||
| return result; | |||||
| } | } | ||||
| static void geo_node_mesh_primitive_circle_exec(GeoNodeExecParams params) | static void geo_node_mesh_primitive_circle_exec(GeoNodeExecParams params) | ||||
| { | { | ||||
| const bNode &node = params.node(); | const bNode &node = params.node(); | ||||
| const NodeGeometryMeshCircle &storage = *(const NodeGeometryMeshCircle *)node.storage; | const NodeGeometryMeshCircle &storage = *(const NodeGeometryMeshCircle *)node.storage; | ||||
| const GeometryNodeMeshCircleFillType fill_type = (const GeometryNodeMeshCircleFillType) | const GeometryNodeMeshCircleFillType fill_type = (const GeometryNodeMeshCircleFillType) | ||||
| Show All 32 Lines | |||||