Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/meshtools.c
| Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | int join_mesh_exec(bContext *C, wmOperator *op) | ||||
| } | } | ||||
| /* ob is the object we are adding geometry to */ | /* ob is the object we are adding geometry to */ | ||||
| if (!ob || ob->type != OB_MESH) { | if (!ob || ob->type != OB_MESH) { | ||||
| BKE_report(op->reports, RPT_WARNING, "Active object is not a mesh"); | BKE_report(op->reports, RPT_WARNING, "Active object is not a mesh"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| /* count & check */ | /* count & check */ | ||||
| CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { | CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { | ||||
| if (ob_iter->type == OB_MESH) { | if (ob_iter->type == OB_MESH) { | ||||
| me = ob_iter->data; | me = ob_iter->data; | ||||
| totvert += me->totvert; | totvert += me->totvert; | ||||
| totedge += me->totedge; | totedge += me->totedge; | ||||
| ▲ Show 20 Lines • Show All 346 Lines • ▼ Show 20 Lines | |||||
| /* Append selected meshes vertex locations as shapes of the active mesh, | /* Append selected meshes vertex locations as shapes of the active mesh, | ||||
| * return 0 if no join is made (error) and 1 of the join is done */ | * return 0 if no join is made (error) and 1 of the join is done */ | ||||
| int join_mesh_shapes_exec(bContext *C, wmOperator *op) | int join_mesh_shapes_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *ob_active = CTX_data_active_object(C); | Object *ob_active = CTX_data_active_object(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Mesh *me = (Mesh *)ob_active->data; | Mesh *me = (Mesh *)ob_active->data; | ||||
| Mesh *selme = NULL; | Mesh *selme = NULL; | ||||
| Mesh *me_deformed = NULL; | Mesh *me_deformed = NULL; | ||||
| Key *key = me->key; | Key *key = me->key; | ||||
| KeyBlock *kb; | KeyBlock *kb; | ||||
| bool ok = false, nonequal_verts = false; | bool ok = false, nonequal_verts = false; | ||||
| CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { | CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) { | ||||
| ▲ Show 20 Lines • Show All 474 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** | /** | ||||
| * Use when the back buffer stores face index values. but we want a vert. | * Use when the back buffer stores face index values. but we want a vert. | ||||
| * This gets the face then finds the closest vertex to mval. | * This gets the face then finds the closest vertex to mval. | ||||
| */ | */ | ||||
| bool ED_mesh_pick_face_vert( | bool ED_mesh_pick_face_vert( | ||||
| bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index) | bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| unsigned int poly_index; | unsigned int poly_index; | ||||
| Mesh *me = ob->data; | Mesh *me = ob->data; | ||||
| BLI_assert(me && GS(me->id.name) == ID_ME); | BLI_assert(me && GS(me->id.name) == ID_ME); | ||||
| if (ED_mesh_pick_face(C, ob, mval, dist_px, &poly_index)) { | if (ED_mesh_pick_face(C, ob, mval, dist_px, &poly_index)) { | ||||
| Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); | Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); | ||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | ||||
| ▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines | |||||