Mesh: Replace auto smooth with node group #108014
|
@ -608,11 +608,6 @@ struct Mesh *ED_mesh_context(struct bContext *C);
|
||||||
*/
|
*/
|
||||||
void ED_mesh_split_faces(struct Mesh *mesh);
|
void ED_mesh_split_faces(struct Mesh *mesh);
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset and fill the "sharp_edge" attribute based on the angle of manifold edges.
|
|
||||||
*/
|
|
||||||
void ED_mesh_sharp_from_angle_set(struct Mesh *mesh, float angle);
|
|
||||||
|
|
||||||
/* mesh backup */
|
/* mesh backup */
|
||||||
typedef struct BMBackup {
|
typedef struct BMBackup {
|
||||||
struct BMesh *bmcopy;
|
struct BMesh *bmcopy;
|
||||||
|
|
|
@ -1150,10 +1150,3 @@ void ED_mesh_split_faces(Mesh *mesh)
|
||||||
geometry::split_edges(*mesh, split_mask, {});
|
geometry::split_edges(*mesh, split_mask, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_mesh_sharp_from_angle_set(Mesh *mesh, const float angle)
|
|
||||||
{
|
|
||||||
mesh->attributes_for_write().remove("sharp_edge");
|
|
||||||
mesh->attributes_for_write().remove("sharp_face");
|
|
||||||
BKE_mesh_sharp_edges_set_from_angle(mesh, angle);
|
|
||||||
DEG_id_tag_update(&mesh->id, ID_RECALC_GEOMETRY);
|
|
||||||
}
|
|
||||||
|
|
|
@ -47,6 +47,14 @@ static const char *rna_Mesh_unit_test_compare(Mesh *mesh, Mesh *mesh2, float thr
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rna_Mesh_sharp_from_angle_set(Mesh *mesh, const float angle)
|
||||||
|
{
|
||||||
|
mesh->attributes_for_write().remove("sharp_edge");
|
||||||
|
mesh->attributes_for_write().remove("sharp_face");
|
||||||
|
BKE_mesh_sharp_edges_set_from_angle(mesh, angle);
|
||||||
|
DEG_id_tag_update(&mesh->id, ID_RECALC_GEOMETRY);
|
||||||
|
}
|
||||||
|
|
||||||
static void rna_Mesh_calc_tangents(Mesh *mesh, ReportList *reports, const char *uvmap)
|
static void rna_Mesh_calc_tangents(Mesh *mesh, ReportList *reports, const char *uvmap)
|
||||||
{
|
{
|
||||||
float(*r_looptangents)[4];
|
float(*r_looptangents)[4];
|
||||||
|
@ -219,10 +227,19 @@ void RNA_api_mesh(StructRNA *srna)
|
||||||
"Invert winding of all polygons "
|
"Invert winding of all polygons "
|
||||||
"(clears tessellation, does not handle custom normals)");
|
"(clears tessellation, does not handle custom normals)");
|
||||||
|
|
||||||
func = RNA_def_function(srna, "set_sharp_from_angle", "ED_mesh_sharp_from_angle_set");
|
func = RNA_def_function(srna, "set_sharp_from_angle", "rna_Mesh_sharp_from_angle_set");
|
||||||
RNA_def_function_ui_description(
|
RNA_def_function_ui_description(func,
|
||||||
func, "Set the sharp edge status for edges based on the angle of incident faces");
|
"Reset and fill the \"sharp_edge\" attribute based on the angle "
|
||||||
RNA_def_float(func, "angle", M_PI, 0.0f, M_PI, "Angle", "", 0.0f, M_PI);
|
"of faces neighboring manifold edges");
|
||||||
|
RNA_def_float(func,
|
||||||
|
"angle",
|
||||||
|
M_PI,
|
||||||
|
0.0f,
|
||||||
|
M_PI,
|
||||||
|
"Angle",
|
||||||
|
"Angle between faces beyond which edges are marked sharp",
|
||||||
|
0.0f,
|
||||||
|
M_PI);
|
||||||
|
|
||||||
func = RNA_def_function(srna, "split_faces", "ED_mesh_split_faces");
|
func = RNA_def_function(srna, "split_faces", "ED_mesh_split_faces");
|
||||||
RNA_def_function_ui_description(func, "Split faces based on the edge angle");
|
RNA_def_function_ui_description(func, "Split faces based on the edge angle");
|
||||||
|
|
Loading…
Reference in New Issue