Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_edit.c
| Show First 20 Lines • Show All 1,993 Lines • ▼ Show 20 Lines | static int select_random_exec(bContext *C, wmOperator *op) | ||||
| /* used by LOOP_VISIBLE_POINTS, LOOP_VISIBLE_KEYS and LOOP_KEYS */ | /* used by LOOP_VISIBLE_POINTS, LOOP_VISIBLE_KEYS and LOOP_KEYS */ | ||||
| PTCacheEdit *edit; | PTCacheEdit *edit; | ||||
| PTCacheEditPoint *point; | PTCacheEditPoint *point; | ||||
| PTCacheEditKey *key; | PTCacheEditKey *key; | ||||
| int p; | int p; | ||||
| int k; | int k; | ||||
| const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f; | const float randfac = RNA_float_get(op->ptr, "ratio"); | ||||
| const int seed = WM_operator_properties_select_random_seed_increment_get(op); | const int seed = WM_operator_properties_select_random_seed_increment_get(op); | ||||
| const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); | const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); | ||||
| RNG *rng; | RNG *rng; | ||||
| type = RNA_enum_get(op->ptr, "type"); | type = RNA_enum_get(op->ptr, "type"); | ||||
| PE_set_data(C, &data); | PE_set_data(C, &data); | ||||
| data.select_action = SEL_SELECT; | data.select_action = SEL_SELECT; | ||||
| ▲ Show 20 Lines • Show All 1,734 Lines • ▼ Show 20 Lines | if (k == 0) { | ||||
| fac = (float)pow((double)(1.0f - mouse_distance / data->rad), (double)data->pufffac); | fac = (float)pow((double)(1.0f - mouse_distance / data->rad), (double)data->pufffac); | ||||
| fac *= 0.025f; | fac *= 0.025f; | ||||
| if (data->invert) { | if (data->invert) { | ||||
| fac = -fac; | fac = -fac; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* compute position as if hair was standing up straight. | /* Compute position as if hair was standing up straight. */ | ||||
| * */ | |||||
| float length; | float length; | ||||
| copy_v3_v3(co_prev, co); | copy_v3_v3(co_prev, co); | ||||
| copy_v3_v3(co, key->co); | copy_v3_v3(co, key->co); | ||||
| mul_m4_v3(mat, co); | mul_m4_v3(mat, co); | ||||
| length = len_v3v3(co_prev, co); | length = len_v3v3(co_prev, co); | ||||
| length_accum += length; | length_accum += length; | ||||
| if ((data->select == 0 || (key->flag & PEK_SELECT)) && !(key->flag & PEK_HIDE)) { | if ((data->select == 0 || (key->flag & PEK_SELECT)) && !(key->flag & PEK_HIDE)) { | ||||
| ▲ Show 20 Lines • Show All 1,774 Lines • Show Last 20 Lines | |||||