91 float r_transform_mats[8][4][4])
94 float final_pivot_pos[3], d_t[3], d_r[4], d_s[3];
95 float t_mat[4][4], r_mat[4][4], s_mat[4][4], pivot_mat[4][4], pivot_imat[4][4],
98 float start_pivot_pos[3], start_pivot_rot[4], start_pivot_scale[3];
141 translate_m4(pivot_mat, final_pivot_pos[0], final_pivot_pos[1], final_pivot_pos[2]);
147 mul_m4_m4m4(r_transform_mats[i], transform_mat, pivot_imat);
148 mul_m4_m4m4(r_transform_mats[i], pivot_mat, r_transform_mats[i]);
169 float transformed_co[3], orig_co[3], disp[3];
185 mul_m4_v3(
data->transform_mats[(
int)symm_area], transformed_co);
252 const bool use_nested_undo =
true;
270 "Sets the pivot to the origin of the sculpt"},
275 "Sets the pivot position to the average position of the unmasked vertices"},
280 "Sets the pivot position to the center of the border of the mask"},
285 "Sets the pivot position to the active vertex position"},
290 "Sets the pivot position to the surface under the cursor"},
316 float stroke_location[3];
335 for (
int n = 0; n < totnode; n++) {
351 const float threshold = 0.2f;
353 for (
int n = 0; n < totnode; n++) {
357 if (
mask < (0.5f + threshold) &&
mask > (0.5f - threshold)) {
398 ot->
name =
"Set Pivot Position";
399 ot->
idname =
"SCULPT_OT_set_pivot_position";
400 ot->
description =
"Sets the sculpt transform pivot position";
421 "Position of the mouse used for \"Surface\" mode",
430 "Position of the mouse used for \"Surface\" mode",
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
General operations, lookup, etc. for blender objects.
void BKE_sculpt_update_object_for_edit(struct Depsgraph *depsgraph, struct Object *ob_orig, bool need_pmap, bool need_mask, bool need_colors)
A BVH for high poly meshes.
void BKE_pbvh_node_mark_update(PBVHNode *node)
#define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode)
#define BKE_pbvh_vertex_iter_end
void BKE_pbvh_parallel_range_settings(struct TaskParallelSettings *settings, bool use_threading, int totnode)
void BKE_pbvh_search_gather(PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***array, int *tot)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m4(float m[4][4])
void translate_m4(float mat[4][4], float tx, float ty, float tz)
bool invert_m4_m4(float R[4][4], const float A[4][4])
void size_to_mat4(float R[4][4], const float size[3])
void mul_m4_v3(const float M[4][4], float r[3])
void sub_qt_qtqt(float q[4], const float a[4], const float b[4])
float normalize_qt(float q[4])
void quat_to_mat4(float mat[4][4], const float q[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_task_parallel_range(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
struct Depsgraph Depsgraph
void ED_region_tag_redraw(struct ARegion *region)
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void SCULPT_orig_vert_data_update(SculptOrigVertData *orig_data, PBVHVertexIter *iter)
bool SCULPT_stroke_get_location(bContext *C, float out[3], const float mouse[2])
const float * SCULPT_active_vertex_co_get(SculptSession *ss)
void SCULPT_vertex_random_access_ensure(SculptSession *ss)
void SCULPT_flush_update_done(const bContext *C, Object *ob, SculptUpdateType update_flags)
void SCULPT_flush_update_step(bContext *C, SculptUpdateType update_flags)
void SCULPT_flip_v3_by_symm_area(float v[3], const ePaintSymmetryFlags symm, const ePaintSymmetryAreas symmarea, const float pivot[3])
bool SCULPT_mode_poll(bContext *C)
void SCULPT_flip_quat_by_symm_area(float quat[3], const ePaintSymmetryFlags symm, const ePaintSymmetryAreas symmarea, const float pivot[3])
char SCULPT_mesh_symmetry_xyz_get(Object *object)
bool SCULPT_check_vertex_pivot_symmetry(const float vco[3], const float pco[3], const char symm)
void SCULPT_flush_stroke_deform(Sculpt *sd, Object *ob, bool is_proxy_used)
ePaintSymmetryAreas SCULPT_get_vertex_symm_area(const float co[3])
void SCULPT_orig_vert_data_init(SculptOrigVertData *data, Object *ob, PBVHNode *node)
void SCULPT_filter_cache_init(bContext *C, Object *ob, Sculpt *sd, const int undo_type)
void SCULPT_filter_cache_free(SculptSession *ss)
void SCULPT_undo_push_begin(struct Object *ob, const char *name)
SculptTransformDisplacementMode
@ SCULPT_TRANSFORM_DISPLACEMENT_ORIGINAL
@ SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL
void SCULPT_undo_push_end_ex(const bool use_nested_undo)
SculptUndoNode * SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type)
SculptTransformDisplacementMode transform_displacement_mode
struct SculptSession * sculpt
struct KeyBlock * shapekey_active
float init_pivot_scale[3]
float prev_pivot_scale[3]
struct FilterCache * filter_cache
bool deform_modifiers_active
float average_stroke_accum[3]
int average_stroke_counter
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
CCL_NAMESPACE_BEGIN ccl_device float fade(float t)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)