Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/ed_transverts.c
| Show All 20 Lines | |||||
| * \ingroup edutil | * \ingroup edutil | ||||
| */ | */ | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "DNA_lattice_types.h" | #include "DNA_lattice_types.h" | ||||
| #include "DNA_mesh_types.h" | |||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_DerivedMesh.h" | #include "BKE_DerivedMesh.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_mesh_iterators.h" | #include "BKE_mesh_iterators.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | |||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| #include "ED_transverts.h" /* own include */ | #include "ED_transverts.h" /* own include */ | ||||
| /* copied from editobject.c, now uses (almost) proper depgraph */ | /* copied from editobject.c, now uses (almost) proper depgraph */ | ||||
| void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit) | void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | if (tvs->transverts_tot) { | ||||
| BM_elem_index_set(eve, TM_INDEX_SKIP); /* set_dirty! */ | BM_elem_index_set(eve, TM_INDEX_SKIP); /* set_dirty! */ | ||||
| } | } | ||||
| } | } | ||||
| /* set dirty already, above */ | /* set dirty already, above */ | ||||
| userdata[1] = tvs->transverts; | userdata[1] = tvs->transverts; | ||||
| } | } | ||||
| if (tvs->transverts && em->mesh_eval_cage) { | if (tvs->transverts && !DEG_is_original_id(&obedit->id)) { | ||||
| Mesh *me_eval = obedit->data; | |||||
| EditMeshEval *em_eval = &me_eval->runtime.edit_eval; | |||||
| if (em_eval->mesh_cage) { | |||||
| BM_mesh_elem_table_ensure(bm, BM_VERT); | BM_mesh_elem_table_ensure(bm, BM_VERT); | ||||
| BKE_mesh_foreach_mapped_vert(em->mesh_eval_cage, set_mapped_co, userdata, MESH_FOREACH_NOP); | BKE_mesh_foreach_mapped_vert( | ||||
| em_eval->mesh_cage, set_mapped_co, userdata, MESH_FOREACH_NOP); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| else if (obedit->type == OB_ARMATURE) { | else if (obedit->type == OB_ARMATURE) { | ||||
| bArmature *arm = obedit->data; | bArmature *arm = obedit->data; | ||||
| int totmalloc = BLI_listbase_count(arm->edbo); | int totmalloc = BLI_listbase_count(arm->edbo); | ||||
| totmalloc *= 2; /* probably overkill but bones can have 2 trans verts each */ | totmalloc *= 2; /* probably overkill but bones can have 2 trans verts each */ | ||||
| ▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines | |||||