|
Blender
V2.93
|
#include <ctype.h>#include <float.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_defaults.h"#include "DNA_material_types.h"#include "DNA_meta_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_string_utils.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_main.h"#include "BKE_anim_data.h"#include "BKE_curve.h"#include "BKE_displist.h"#include "BKE_idtype.h"#include "BKE_lib_id.h"#include "BKE_lib_query.h"#include "BKE_material.h"#include "BKE_mball.h"#include "BKE_object.h"#include "BKE_scene.h"#include "DEG_depsgraph.h"#include "BLO_read_write.h"Go to the source code of this file.
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
Variables | |
| IDTypeInfo | IDType_ID_MB |
| void(* | BKE_mball_batch_cache_dirty_tag_cb )(MetaBall *mb, int mode) = NULL |
| void(* | BKE_mball_batch_cache_free_cb )(MetaBall *mb) = NULL |
Definition at line 214 of file mball.c.
References BKE_id_new(), and ID_MB.
Referenced by BKE_object_obdata_add_from_type().
This function finds the basis MetaBall.
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 511 of file mball.c.
References BASE_FROM_DUPLI, BLI_split_name_num(), Object::id, LISTBASE_FOREACH, MAX_ID_NAME, ID::name, OB_MBALL, scene, STREQ, Object::type, and Scene::view_layers.
Referenced by BKE_displist_make_mball(), blender::deg::DepsgraphRelationBuilder::build_object_data_geometry(), and object_convert_exec().
| void BKE_mball_batch_cache_dirty_tag | ( | MetaBall * | mb, |
| int | mode | ||
| ) |
Definition at line 748 of file mball.c.
References MetaBall::batch_cache, and BKE_mball_batch_cache_dirty_tag_cb.
Referenced by BKE_object_batch_cache_dirty_tag().
| void BKE_mball_batch_cache_free | ( | MetaBall * | mb | ) |
Definition at line 754 of file mball.c.
References MetaBall::batch_cache, and BKE_mball_batch_cache_free_cb.
Referenced by metaball_free_data().
Return or compute bbox for given metaball object.
Definition at line 322 of file mball.c.
References Object_Runtime::bb, BKE_mball_texspace_calc(), BLI_assert, BOUNDBOX_DIRTY, Object_Runtime::curve_cache, BoundBox::flag, NULL, OB_MBALL, Object::runtime, and Object::type.
Referenced by BKE_object_boundbox_get().
Definition at line 605 of file mball.c.
References BKE_mball_minmax(), max, mid_v3_v3v3(), and min.
Definition at line 587 of file mball.c.
References add_v3_v3(), MetaBall::elems, LISTBASE_FOREACH, mul_v3_fl(), and zero_v3().
| bool BKE_mball_deselect_all | ( | MetaBall * | mb | ) |
Definition at line 696 of file mball.c.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_deselect_all_multi_ex(), do_lasso_select_meta(), do_meta_box_select(), ED_mball_select_pick(), and mball_circle_select().
| bool BKE_mball_deselect_all_multi_ex | ( | Base ** | bases, |
| int | bases_len | ||
| ) |
Definition at line 708 of file mball.c.
References BKE_mball_deselect_all(), Object::data, DEG_id_tag_update(), MetaBall::id, ID_RECALC_SELECT, and Base::object.
Referenced by ED_mball_deselect_all_multi(), and mball_select_all_exec().
Definition at line 225 of file mball.c.
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, type, MetaElem::type, and unit_qt().
Referenced by ED_mball_add_primitive().
| bool BKE_mball_is_any_selected | ( | const MetaBall * | mb | ) |
Definition at line 426 of file mball.c.
References MetaBall::editelems, ListBase::first, NULL, and SELECT.
Referenced by BKE_mball_is_any_selected_multi().
| bool BKE_mball_is_any_selected_multi | ( | Base ** | bases, |
| int | bases_len | ||
| ) |
Definition at line 436 of file mball.c.
References BKE_mball_is_any_selected(), Object::data, if(), and Base::object.
Referenced by mball_select_all_exec().
| bool BKE_mball_is_any_unselected | ( | const MetaBall * | mb | ) |
Definition at line 448 of file mball.c.
References MetaBall::editelems, ListBase::first, NULL, and SELECT.
| bool BKE_mball_is_basis | ( | 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.
This is a can of worms.
This really needs a rewrite/refactor its totally broken in anything other than basic cases Multiple Scenes + Set Scenes & mixing meta-ball basis should work but fails to update the depsgraph on rename and linking into scenes or removal of basis meta-ball. So take care when changing this code.
Main idiot thing here is that the system returns BKE_mball_basis_find() objects which fail a BKE_mball_is_basis() test.
Not only that but the depsgraph and their areas depend on this behavior, so making small fixes here isn't worth it.
Definition at line 398 of file mball.c.
References Object::id, len, and ID::name.
Referenced by BKE_mball_is_basis_for(), DRW_mball_batch_cache_pos_vertbuf_get(), DRW_metaball_batch_cache_get_edge_detection(), DRW_metaball_batch_cache_get_surface_shaded(), DRW_metaball_batch_cache_get_triangles_with_normals(), DRW_metaball_batch_cache_get_wireframes_face(), libblock_remap_data_postprocess_object_update(), object_convert_exec(), and OVERLAY_bounds().
Definition at line 406 of file mball.c.
References BKE_mball_is_basis(), BLI_split_name_num(), Object::id, MAX_ID_NAME, ID::name, and STREQ.
Referenced by libblock_remap_data_postprocess_object_update().
Definition at line 339 of file mball.c.
References Freestyle::a, Object_Runtime::bb, data, ListBase::first, MEM_mallocN, DispList::nr, Object::runtime, size(), BoundBox::vec, and DispList::verts.
Definition at line 576 of file mball.c.
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], | ||
| const short | flag | ||
| ) |
Definition at line 542 of file mball.c.
References add_v3_fl(), copy_v3_v3(), MetaBall::elems, INIT_MINMAX, LISTBASE_FOREACH, mat4_to_scale(), max, min, minmax_v3v3_v3(), and mul_v3_m4v3().
copy some properties from object to other meta-ball object with same base name
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 influence polygonization of meta-balls.
Definition at line 465 of file mball.c.
References BKE_scene_base_iter_next(), BLI_split_name_num(), Object::data, DEG_id_tag_update(), MetaBall::flag, MetaBall::id, Object::id, MAX_ID_NAME, ID::name, NULL, OB_MBALL, MetaBall::rendersize, scene, STREQ, MetaBall::thresh, Object::type, and MetaBall::wiresize.
| bool BKE_mball_select_all | ( | MetaBall * | mb | ) |
Definition at line 673 of file mball.c.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_select_all_multi_ex().
| bool BKE_mball_select_all_multi_ex | ( | Base ** | bases, |
| int | bases_len | ||
| ) |
Definition at line 685 of file mball.c.
References BKE_mball_select_all(), Object::data, and Base::object.
Referenced by mball_select_all_exec().
| int BKE_mball_select_count | ( | const MetaBall * | mb | ) |
Definition at line 651 of file mball.c.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_select_count_multi().
| int BKE_mball_select_count_multi | ( | Base ** | bases, |
| int | bases_len | ||
| ) |
Definition at line 662 of file mball.c.
References BKE_mball_select_count(), Object::data, and Base::object.
Referenced by mball_select_similar_exec().
| bool BKE_mball_select_swap | ( | MetaBall * | mb | ) |
Definition at line 720 of file mball.c.
References MetaBall::editelems, LISTBASE_FOREACH, and SELECT.
Referenced by BKE_mball_select_swap_multi_ex().
| bool BKE_mball_select_swap_multi_ex | ( | Base ** | bases, |
| int | bases_len | ||
| ) |
Definition at line 730 of file mball.c.
References BKE_mball_select_swap(), Object::data, and Base::object.
Referenced by mball_select_all_exec().
| void BKE_mball_texspace_calc | ( | Object * | ob | ) |
Compute bounding box of all MetaElem / MetaBall
Bounding box is computed from polygonized surface. ob is basic meta-balls (with name Meta for example). All other meta-ball objects (with names Meta.001, Meta.002, etc) are included in this bounding-box.
Definition at line 278 of file mball.c.
References Object_Runtime::bb, BKE_boundbox_init_from_minmax(), BOUNDBOX_DIRTY, Object_Runtime::curve_cache, data, CurveCache::disp, ListBase::first, BoundBox::flag, max, MEM_callocN, min, minmax_v3v3_v3(), DispList::next, DispList::nr, NULL, Object::runtime, and DispList::verts.
Referenced by BKE_displist_make_mball(), BKE_displist_make_mball_forRender(), and BKE_mball_boundbox_get().
Definition at line 617 of file mball.c.
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 apply_objects_internal(), and metaball_coords_and_quats_apply_with_mat4().
Definition at line 643 of file mball.c.
References add_v3_v3(), MetaBall::elems, and LISTBASE_FOREACH.
Referenced by object_origin_set_exec().
|
static |
Definition at line 147 of file mball.c.
References MetaBall::adt, MetaBall::batch_cache, BKE_animdata_blend_read_data(), BLI_listbase_clear(), BLO_read_data_address, BLO_read_list(), BLO_read_pointer_array(), MetaBall::disp, MetaBall::editelems, MetaBall::elems, MetaBall::lastelem, MetaBall::mat, MetaBall::needs_flush_to_id, and NULL.
|
static |
Definition at line 176 of file mball.c.
References Freestyle::a, BLO_expand, MetaBall::mat, and MetaBall::totcol.
|
static |
Definition at line 166 of file mball.c.
References Freestyle::a, BLO_read_id_address, MetaBall::id, ID::lib, MetaBall::mat, and MetaBall::totcol.
|
static |
Definition at line 119 of file mball.c.
References MetaBall::adt, MetaBall::batch_cache, BKE_animdata_blend_write(), BKE_id_blend_write(), BLI_listbase_clear(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_pointer_array(), BLO_write_struct, MetaBall::disp, MetaBall::editelems, MetaBall::elems, MetaBall::id, MetaBall::lastelem, LISTBASE_FOREACH, MetaBall::mat, MetaBall::needs_flush_to_id, NULL, MetaBall::totcol, and ID::us.
|
static |
Definition at line 80 of file mball.c.
References MetaBall::batch_cache, BLI_duplicatelist(), MetaBall::editelems, MetaBall::elems, MetaBall::lastelem, MetaBall::mat, MEM_dupallocN, and NULL.
|
static |
Definition at line 111 of file mball.c.
References BKE_LIB_FOREACHID_PROCESS, data, IDWALK_CB_USER, and metaball().
|
static |
Definition at line 97 of file mball.c.
References BKE_displist_free(), BKE_mball_batch_cache_free(), BLI_freelistN(), MEM_SAFE_FREE, and metaball().
|
static |
Definition at line 71 of file mball.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, and metaball().
| void(* BKE_mball_batch_cache_dirty_tag_cb) (MetaBall *mb, int mode) | ( | MetaBall * | mb, |
| int | mode | ||
| ) | = NULL |
Definition at line 745 of file mball.c.
Referenced by BKE_mball_batch_cache_dirty_tag(), and DRW_engines_register().
Definition at line 746 of file mball.c.
Referenced by BKE_mball_batch_cache_free(), and DRW_engines_register().
| IDTypeInfo IDType_ID_MB |