Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mball.c
| Show First 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | void BKE_mball_translate(MetaBall *mb, const float offset[3]) | ||||
| MetaElem *ml; | MetaElem *ml; | ||||
| for (ml = mb->elems.first; ml; ml = ml->next) { | for (ml = mb->elems.first; ml; ml = ml->next) { | ||||
| add_v3_v3(&ml->x, offset); | add_v3_v3(&ml->x, offset); | ||||
| } | } | ||||
| } | } | ||||
| /* *** select funcs *** */ | /* *** select funcs *** */ | ||||
| int BKE_mball_select_count(struct MetaBall *mb) { | |||||
| int sel = 0; | |||||
| MetaElem *ml; | |||||
| for (ml = mb->editelems->first; ml; ml = ml->next) { | |||||
| if (ml->flag & SELECT) { | |||||
| sel++; | |||||
| } | |||||
| } | |||||
| return sel; | |||||
| } | |||||
| int BKE_mball_select_count_multi(Object **objects, int objects_len) { | |||||
| int sel = 0; | |||||
| for (uint ob_index = 0; ob_index < objects_len; ob_index++) { | |||||
| Object *obedit = objects[ob_index]; | |||||
| MetaBall *mb = (MetaBall *)obedit->data; | |||||
| sel += BKE_mball_select_count(mb); | |||||
| } | |||||
| return sel; | |||||
| } | |||||
| void BKE_mball_select_all(struct MetaBall *mb) | void BKE_mball_select_all(struct MetaBall *mb) | ||||
| { | { | ||||
| MetaElem *ml; | MetaElem *ml; | ||||
| for (ml = mb->editelems->first; ml; ml = ml->next) { | for (ml = mb->editelems->first; ml; ml = ml->next) { | ||||
| ml->flag |= SELECT; | ml->flag |= SELECT; | ||||
| } | } | ||||
| } | } | ||||
| Show All 38 Lines | |||||