|
Blender V5.0
|
Go to the source code of this file.
Definition at line 173 of file mball.cc.
References BKE_id_new(), and name.
Referenced by BKE_object_obdata_add_from_type().
This function finds the basis meta-ball.
Basis meta-ball doesn't include any number at the end of its name. All meta-balls with same base of name can be blended. meta-balls with different basic name can't be blended.
Definition at line 419 of file mball.cc.
References BASE_FROM_DUPLI, BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), BLI_string_split_name_number(), Object::id, LISTBASE_FOREACH, MAX_ID_NAME, ID::name, OB_MBALL, STREQ, Object::type, and Scene::view_layers.
Referenced by BKE_mball_data_update(), blender::deg::DepsgraphRelationBuilder::build_object_data_geometry(), blender::ed::object::convert_mball_to_mesh(), and blender::ed::object::object_convert_exec().
Definition at line 513 of file mball.cc.
References BKE_mball_minmax(), max, mid_v3_v3v3(), and min.
Referenced by blender::ed::object::object_origin_set_exec().
Definition at line 495 of file mball.cc.
References add_v3_v3(), MetaBall::elems, LISTBASE_FOREACH, mul_v3_fl(), and zero_v3().
Referenced by blender::ed::object::object_origin_set_exec().
Definition at line 650 of file mball.cc.
References BKE_lattice_deform_coords(), BKE_mball_basis_find(), BKE_mball_polygonize(), BKE_object_free_derived_caches(), BLI_assert, Object::data, depsgraph, GeometrySet::from_mesh(), MetaBall::mat, MEM_dupallocN(), OB_LATTICE, OB_MBALL, Object::parent, PARSKEL, Object::partype, Object::runtime, MetaBall::totcol, and Object::type.
Referenced by BKE_object_handle_data_update(), and blender::ed::object::object_force_modifier_update_for_bind().
| bool BKE_mball_deselect_all | ( | MetaBall * | mb | ) |
Definition at line 603 of file mball.cc.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_deselect_all_multi_ex(), do_lasso_select_meta(), do_meta_box_select(), and mball_circle_select().
| bool BKE_mball_deselect_all_multi_ex | ( | blender::Span< Base * > | bases | ) |
Referenced by ED_mball_deselect_all_multi(), and mball_select_all_exec().
Most simple meta-element adding function.
Definition at line 179 of file mball.cc.
References BLI_addtail(), MetaBall::elems, MetaElem::expx, MetaElem::expy, MetaElem::expz, MetaElem::flag, MB_BALL, MB_CUBE, MB_ELIPSOID, MB_PLANE, MB_SCALE_RAD, MB_TUBE, MEM_callocN(), MetaElem::quat, MetaElem::rad, MetaElem::s, MetaElem::type, and unit_qt().
Referenced by ED_mball_add_primitive().
Calculate & return the display radius.
Definition at line 245 of file mball.cc.
References MetaElem::expx, MetaElem::expy, MetaElem::expz, M_SQRT2, MB_CUBE, min_fff(), MetaElem::rad, and MetaElem::type.
Referenced by blender::draw::overlay::Metaballs::object_sync().
| blender::float2 BKE_mball_element_display_radius_calc_with_stiffness | ( | const MetaElem * | ml | ) |
Calculate & return the display radius & stiffness.
Definition at line 226 of file mball.cc.
References atanf, MetaElem::expx, MetaElem::expy, MetaElem::expz, float, M_SQRT2, MB_CUBE, min_fff(), blender::math::numbers::pi, MetaElem::rad, MetaElem::s, and MetaElem::type.
Referenced by blender::draw::overlay::Metaballs::edit_object_sync().
| bool BKE_mball_is_any_selected | ( | const MetaBall * | mb | ) |
Definition at line 299 of file mball.cc.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_is_any_selected_multi(), delete_metaelems_exec(), and duplicate_metaelems_exec().
| bool BKE_mball_is_any_selected_multi | ( | blender::Span< Base * > | bases | ) |
References flag, max, and min.
Referenced by mball_select_all_exec().
| bool BKE_mball_is_any_unselected | ( | const MetaBall * | mb | ) |
Definition at line 321 of file mball.cc.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by select_random_metaelems_exec().
| bool BKE_mball_is_basis | ( | const Object * | ob | ) |
Test, if ob is a basis meta-ball.
It test last character of Object ID name. If last character is digit it return 0, else it return 1.
Definition at line 255 of file mball.cc.
References Object::id, len, and ID::name.
Referenced by BKE_mball_is_basis_for(), libblock_remap_data_postprocess_object_update(), blender::ed::object::object_convert_exec(), and blender::draw::overlay::Bounds::object_sync().
Return true if ob1 and ob2 are part of the same metaBall group, and ob1 is its basis.
Definition at line 294 of file mball.cc.
References BKE_mball_is_basis(), and BKE_mball_is_same_group().
Referenced by libblock_remap_data_postprocess_object_update().
Return true if ob1 and ob2 are part of the same metaBall group.
Definition at line 278 of file mball.cc.
References BLI_string_split_name_number(), Object::id, MAX_ID_NAME, ID::name, and STREQ.
Referenced by BKE_mball_is_basis_for().
Definition at line 484 of file mball.cc.
References BLI_listbase_is_empty(), MetaBall::elems, INIT_MINMAX, LISTBASE_FOREACH, max, min, and minmax_v3v3_v3().
Referenced by BKE_mball_center_bounds().
| bool BKE_mball_minmax_ex | ( | const MetaBall * | mb, |
| float | min[3], | ||
| float | max[3], | ||
| const float | obmat[4][4], | ||
| short | flag ) |
Definition at line 451 of file mball.cc.
References add_v3_fl(), copy_v3_v3(), MetaBall::elems, flag, i, INIT_MINMAX, LISTBASE_FOREACH, mat4_to_scale(), max, min, minmax_v3v3_v3(), and mul_v3_m4v3().
Referenced by ED_view3d_minmax_verts().
Copy some properties from a meta-ball obdata to all other meta-ball obdata belonging to the same family (i.e. object sharing the same name basis).
When some properties (wire-size, threshold, update flags) of meta-ball are changed, then this properties are copied to all meta-balls in same "group" (meta-balls with same base name: MBall, MBall.001, MBall.002, etc). The most important is to copy properties to the base meta-ball, because this meta-ball influences polygonization of meta-balls.
WARNING: This code does not cover all potential corner-cases. E.g. if:
| Object | ObData | | ---------- | ---------- | | Meta_A | Meta_A | | Meta_A.001 | Meta_A.001 | | Meta_B | Meta_A | | Meta_B.001 | Meta_B.001 |
Calling this function with metaball_src being Meta_A.001 will update Meta_A, but NOT Meta_B.001. So in the 'Meta_B' family, the two metaballs will have unmatching settings now.
Solving this case would drastically increase the complexity of this code though, so don't think it would be worth it.
Definition at line 340 of file mball.cc.
References BLI_string_split_name_number(), Object::data, ListBase::first, Object::id, ID_IS_EDITABLE, MAX_ID_NAME, mball_data_properties_copy(), ID::name, ID::next, OB_MBALL, Main::objects, ID::prev, STREQ, and Object::type.
| bool BKE_mball_select_all | ( | MetaBall * | mb | ) |
Definition at line 580 of file mball.cc.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_select_all_multi_ex().
| bool BKE_mball_select_all_multi_ex | ( | blender::Span< Base * > | bases | ) |
Referenced by mball_select_all_exec().
| int BKE_mball_select_count | ( | const MetaBall * | mb | ) |
Definition at line 558 of file mball.cc.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_select_count_multi().
| int BKE_mball_select_count_multi | ( | blender::Span< Base * > | bases | ) |
Referenced by mball_select_similar_exec().
| bool BKE_mball_select_swap | ( | MetaBall * | mb | ) |
Definition at line 627 of file mball.cc.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_select_swap_multi_ex().
| bool BKE_mball_select_swap_multi_ex | ( | blender::Span< Base * > | bases | ) |
References depsgraph.
Referenced by mball_select_all_exec().
Definition at line 525 of file mball.cc.
References MetaBall::elems, LISTBASE_FOREACH, mat4_to_quat(), mat4_to_scale(), MB_TYPE_SIZE_SQUARED, mul_m4_v3(), mul_qt_qtqt(), mul_v3_fl(), and sqrtf.
Referenced by blender::ed::object::apply_objects_internal(), and blender::ed::object::metaball_coords_and_quats_apply_with_mat4().
Definition at line 551 of file mball.cc.
References add_v3_v3(), MetaBall::elems, and LISTBASE_FOREACH.
Referenced by blender::ed::object::object_origin_set_exec().