Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editface.c
| Show All 29 Lines | |||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_customdata.h" | #include "BKE_customdata.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_object.h" | |||||
| #include "ED_mesh.h" | #include "ED_mesh.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_select_utils.h" | #include "ED_select_utils.h" | ||||
| #include "ED_view3d.h" | #include "ED_view3d.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| Show All 29 Lines | void paintface_flush_flags(struct bContext *C, Object *ob, short flag) | ||||
| Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | ||||
| if (ob_eval == NULL) { | if (ob_eval == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| Mesh *me_orig = ob_eval->runtime.mesh_orig; | Mesh *me_orig = (Mesh *)ob_eval->runtime.data_orig; | ||||
| Mesh *me_eval = ob_eval->runtime.mesh_eval; | Mesh *me_eval = (Mesh *)ob_eval->runtime.data_eval; | ||||
| bool updated = false; | bool updated = false; | ||||
| if (me_orig != NULL && me_eval != NULL && me_orig->totpoly == me->totpoly) { | if (me_orig != NULL && me_eval != NULL && me_orig->totpoly == me->totpoly) { | ||||
| /* Update the COW copy of the mesh. */ | /* Update the COW copy of the mesh. */ | ||||
| for (i = 0; i < me->totpoly; i++) { | for (i = 0; i < me->totpoly; i++) { | ||||
| me_orig->mpoly[i].flag = me->mpoly[i].flag; | me_orig->mpoly[i].flag = me->mpoly[i].flag; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* (similar to void paintface_flush_flags(Object *ob)) | /* (similar to void paintface_flush_flags(Object *ob)) | ||||
| * copy the vertex flags, most importantly selection from the mesh to the final derived mesh, | * copy the vertex flags, most importantly selection from the mesh to the final derived mesh, | ||||
| * use in object mode when selecting vertices (while painting) */ | * use in object mode when selecting vertices (while painting) */ | ||||
| void paintvert_flush_flags(Object *ob) | void paintvert_flush_flags(Object *ob) | ||||
| { | { | ||||
| Mesh *me = BKE_mesh_from_object(ob); | Mesh *me = BKE_mesh_from_object(ob); | ||||
| Mesh *me_eval = ob->runtime.mesh_eval; | Mesh *me_eval = BKE_object_get_evaluated_mesh(ob); | ||||
| MVert *mvert_eval, *mv; | MVert *mvert_eval, *mv; | ||||
| const int *index_array = NULL; | const int *index_array = NULL; | ||||
| int totvert; | int totvert; | ||||
| int i; | int i; | ||||
| if (me == NULL) { | if (me == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines | |||||