Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_transform.c
| Show All 40 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "bmesh.h" | #include "bmesh.h" | ||||
| #include <math.h> | #include <math.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| void ED_sculpt_init_transform(struct bContext *C, Object *ob, const char *undo_name) | void ED_sculpt_init_transform(struct bContext *C, | ||||
| Object *ob, | |||||
| const int mval[2], | |||||
| const char *undo_name) | |||||
| { | { | ||||
| Sculpt *sd = CTX_data_tool_settings(C)->sculpt; | Sculpt *sd = CTX_data_tool_settings(C)->sculpt; | ||||
| SculptSession *ss = ob->sculpt; | SculptSession *ss = ob->sculpt; | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | ||||
| copy_v3_v3(ss->init_pivot_pos, ss->pivot_pos); | copy_v3_v3(ss->init_pivot_pos, ss->pivot_pos); | ||||
| copy_v4_v4(ss->init_pivot_rot, ss->pivot_rot); | copy_v4_v4(ss->init_pivot_rot, ss->pivot_rot); | ||||
| copy_v3_v3(ss->init_pivot_scale, ss->pivot_scale); | copy_v3_v3(ss->init_pivot_scale, ss->pivot_scale); | ||||
| copy_v3_v3(ss->prev_pivot_pos, ss->pivot_pos); | copy_v3_v3(ss->prev_pivot_pos, ss->pivot_pos); | ||||
| copy_v4_v4(ss->prev_pivot_rot, ss->pivot_rot); | copy_v4_v4(ss->prev_pivot_rot, ss->pivot_rot); | ||||
| copy_v3_v3(ss->prev_pivot_scale, ss->pivot_scale); | copy_v3_v3(ss->prev_pivot_scale, ss->pivot_scale); | ||||
| SCULPT_undo_push_begin_ex(ob, undo_name); | SCULPT_undo_push_begin_ex(ob, undo_name); | ||||
| BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false); | BKE_sculpt_update_object_for_edit(depsgraph, ob, false, false, false); | ||||
| ss->pivot_rot[3] = 1.0f; | ss->pivot_rot[3] = 1.0f; | ||||
| SCULPT_vertex_random_access_ensure(ss); | SCULPT_vertex_random_access_ensure(ss); | ||||
| SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS); | |||||
| SCULPT_filter_cache_init(C, ob, sd, SCULPT_UNDO_COORDS, mval, 5.0); | |||||
| if (sd->transform_mode == SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC) { | if (sd->transform_mode == SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC) { | ||||
| ss->filter_cache->transform_displacement_mode = SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL; | ss->filter_cache->transform_displacement_mode = SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL; | ||||
| } | } | ||||
| else { | else { | ||||
| ss->filter_cache->transform_displacement_mode = SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL; | ss->filter_cache->transform_displacement_mode = SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 457 Lines • Show Last 20 Lines | |||||