Blender V2.61 - r43446
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_meta_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_animsys.h"
#include "BKE_scene.h"
#include "BKE_library.h"
#include "BKE_displist.h"
#include "BKE_mball.h"
#include "BKE_object.h"
#include "BKE_material.h"
Go to the source code of this file.
Defines | |
#define | RES 12 |
#define | L 0 |
#define | R 1 |
#define | B 2 |
#define | T 3 |
#define | N 4 |
#define | F 5 |
#define | LBN 0 |
#define | LBF 1 |
#define | LTN 2 |
#define | LTF 3 |
#define | RBN 4 |
#define | RBF 5 |
#define | RTN 6 |
#define | RTF 7 |
#define | HASHBIT (5) |
#define | HASHSIZE (size_t)(1<<(3*HASHBIT)) |
#define | HASH(i, j, k) ((((( (i) & 31)<<5) | ( (j) & 31))<<5 ) | ( (k) & 31) ) |
#define | MB_BIT(i, bit) (((i)>>(bit))&1) |
#define | FLIP(i, bit) ((i)^1<<(bit)) |
#define | LB 0 |
#define | LT 1 |
#define | LN 2 |
#define | LF 3 |
#define | RB 4 |
#define | RT 5 |
#define | RN 6 |
#define | RF 7 |
#define | BN 8 |
#define | BF 9 |
#define | TN 10 |
#define | TF 11 |
Functions | |
void | unlink_mball (MetaBall *mb) |
void | free_mball (MetaBall *mb) |
MetaBall * | add_mball (const char *name) |
MetaBall * | copy_mball (MetaBall *mb) |
static void | extern_local_mball (MetaBall *mb) |
void | make_local_mball (MetaBall *mb) |
MetaElem * | add_metaball_element (MetaBall *mb, const int type) |
void | tex_space_mball (Object *ob) |
float * | make_orco_mball (Object *ob, ListBase *dispbase) |
int | is_basis_mball (Object *ob) |
Test, if Object *ob is basic MetaBall. | |
int | is_mball_basis_for (Object *ob1, Object *ob2) |
void | copy_mball_properties (Scene *scene, Object *active_object) |
Object * | find_basis_mball (Scene *scene, Object *basis) |
This function finds basic MetaBall. | |
void | calc_mballco (MetaElem *ml, float *vec) |
float | densfunc (MetaElem *ball, float x, float y, float z) |
octal_node * | find_metaball_octal_node (octal_node *node, float x, float y, float z, short depth) |
float | metaball (float x, float y, float z) |
void | accum_mballfaces (int i1, int i2, int i3, int i4) |
void * | new_pgn_element (int size) |
void | freepolygonize (PROCESS *p) |
void | docube (CUBE *cube, PROCESS *p, MetaBall *mb) |
void | testface (int i, int j, int k, CUBE *old, int bit, int c1, int c2, int c3, int c4, PROCESS *p) |
CORNER * | setcorner (PROCESS *p, int i, int j, int k) |
int | nextcwedge (int edge, int face) |
int | otherface (int edge, int face) |
void | makecubetable (void) |
void | BKE_freecubetable (void) |
int | setcenter (CENTERLIST *table[], int i, int j, int k) |
void | setedge (EDGELIST *table[], int i1, int j1, int k1, int i2, int j2, int k2, int vid) |
int | getedge (EDGELIST *table[], int i1, int j1, int k1, int i2, int j2, int k2) |
void | addtovertices (VERTICES *vertices, VERTEX v) |
void | vnormal (MB_POINT *point, PROCESS *p, MB_POINT *v) |
int | vertid (CORNER *c1, CORNER *c2, PROCESS *p, MetaBall *mb) |
void | converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, float(*function)(float, float, float), MB_POINT *p, MetaBall *mb, int f) |
void | add_cube (PROCESS *mbproc, int i, int j, int k, int count) |
void | find_first_points (PROCESS *mbproc, MetaBall *mb, int a) |
void | polygonize (PROCESS *mbproc, MetaBall *mb) |
float | init_meta (Scene *scene, Object *ob) |
void | fill_metaball_octal_node (octal_node *node, MetaElem *ml, short i) |
void | subdivide_metaball_octal_node (octal_node *node, float size_x, float size_y, float size_z, short depth) |
void | free_metaball_octal_node (octal_node *node) |
void | init_metaball_octal_tree (int depth) |
void | metaball_polygonize (Scene *scene, Object *ob, ListBase *dispbase) |
Variables | |
static float | thresh = 0.6f |
static int | totelem = 0 |
static MetaElem ** | mainb |
static octal_tree * | metaball_tree = NULL |
static int * | indices = NULL |
static int | totindex |
static int | curindex |
static INTLISTS * | cubetable [256] |
static int | corner1 [12] |
static int | corner2 [12] |
static int | leftface [12] |
static int | rightface [12] |
Definition in file mball.c.
#define B 2 |
Definition at line 498 of file mball.c.
Referenced by __nlInvert_SUPERLU(), BLI_ghashutil_paircmp(), bsdf_westin_backscatter_sample(), TNT::Fortran_Array3D< T >::copy(), TNT::Fortran_Array2D< T >::copy(), dBoxBox2(), do_material_tex(), ewa_eval(), FHT2D(), fresnel_dielectric(), fresnel_dielectric_cos(), imagewraposa_aniso(), InputAngle(), lerp(), TNT::matmult(), md5_process_block(), TNT::mult_element(), newPerlin(), nextcwedge(), operator!=(), TNT::operator*(), TNT::operator*=(), TNT::operator+(), TNT::operator+=(), TNT::operator-(), TNT::operator-=(), TNT::operator/(), TNT::operator/=(), TNT::operator>>(), OrenNayar_Diff(), qd_getPixelLerp(), qd_getPixelLerpChan(), GenericEmissiveClosure::sample(), WestinBackscatterClosure::sample(), sample_cos_hemisphere(), sample_uniform_hemisphere(), Color32::setBGRA(), and Color32::setRGBA().
#define BF 9 |
Definition at line 814 of file mball.c.
Referenced by nextcwedge().
#define BN 8 |
Definition at line 813 of file mball.c.
Referenced by nextcwedge().
#define F 5 |
Definition at line 501 of file mball.c.
Referenced by distfactor_to_bone(), ewa_eval(), KX_Camera::ExtractFrustumSphere(), ff_normalize(), fresnel(), imagewraposa_aniso(), and normalizef().
Definition at line 520 of file mball.c.
Referenced by testface().
Definition at line 517 of file mball.c.
Referenced by BOP_Mesh::getEdge(), getedge(), BOP_Mesh::getIndexEdge(), setcenter(), setcorner(), and setedge().
#define HASHSIZE (size_t)(1<<(3*HASHBIT)) |
Definition at line 515 of file mball.c.
Referenced by polygonize().
#define L 0 |
Definition at line 496 of file mball.c.
Referenced by add_text(), avgLogLum(), AVI_close_compress(), AVI_is_avi(), AVI_open_compress(), AVI_open_movie(), AVI_write_frame(), BL_ConvertMesh(), btSequentialImpulseConstraintSolver::btRand2(), TNT::Cholesky_upper_factorization(), cloth_calc_spring_force(), fb(), fbderiv(), fbstar(), fbstar_jacobi(), fht_convolve(), GetRGB(), indirect_emission(), kernel_path_integrate(), kernel_path_trace(), nextcwedge(), p_chart_convex_hull(), paste_file(), read_file_data(), reopen_text(), replace_if_different(), GHOST_WindowX11::setWindowCustomCursorShape(), sobol_generate_direction_vectors(), startavi(), sweepCircleSegment(), DiagSplit::T(), and tonemap().
#define LB 0 |
Definition at line 805 of file mball.c.
Referenced by nextcwedge().
#define LBF 1 |
Definition at line 503 of file mball.c.
Referenced by polygonize().
#define LBN 0 |
Definition at line 502 of file mball.c.
Referenced by polygonize().
#define LF 3 |
Definition at line 808 of file mball.c.
Referenced by nextcwedge().
#define LN 2 |
Definition at line 807 of file mball.c.
Referenced by nextcwedge().
#define LT 1 |
Definition at line 806 of file mball.c.
Referenced by nextcwedge().
#define LTF 3 |
Definition at line 505 of file mball.c.
Referenced by polygonize().
#define LTN 2 |
Definition at line 504 of file mball.c.
Referenced by polygonize().
Definition at line 519 of file mball.c.
Referenced by add_cube(), and makecubetable().
#define N 4 |
Definition at line 500 of file mball.c.
Referenced by EdgeDice::add_vert(), FLUID_3D::addVorticity(), bt_segment_collision(), TNT::Cholesky_upper_factorization(), TNT::Vector< Subscript >::copy(), TNT::Fortran_Matrix< T >::copy(), TNT::Matrix< MT_Scalar >::copy(), create_mesh(), TNT::dot_prod(), eigenvalue_solve(), KX_Camera::ExtractFrustumSphere(), fht_convolve(), fresnel_dielectric(), MemoryAllocator< N >::getBytes(), InitAtmosphere(), TNT::Vector< Subscript >::initialize(), TNT::Fortran_Matrix< T >::initialize(), TNT::Matrix< MT_Scalar >::initialize(), Lapack_LLS_QR_linear_solve(), Lapack_LU_linear_solve(), lattice_foreachScreenVert(), TNT::Lower_triangular_solve(), TNT::LU_factor(), TNT::matmult(), TNT::Matrix< MT_Scalar >::Matrix(), MemoryAllocator< N >::MemoryAllocator(), TNT::mult_element(), TNT::Vector_Adaptor< BBVec >::newsize(), TNT::Fortran_Sparse_Vector< T >::newsize(), TNT::operator*(), TNT::operator+(), TNT::operator-(), TNT::operator<<(), TNT::Vector_Adaptor< BBVec >::operator=(), TNT::Region2D< Array2D >::operator=(), TNT::Region1D< Array1D >::operator=(), TNT::operator>>(), TNT::QR_factor(), TNT::QR_solve(), TNT::R_solve(), reflect(), btUnionFind::reset(), sample_cos_hemisphere(), sample_uniform_hemisphere(), QuadDice::scale_factor(), sCopy_Dense_Matrix(), TNT::Vector< Subscript >::set(), TNT::Fortran_Matrix< T >::set(), TNT::Matrix< MT_Scalar >::set(), iTaSC::WSDLSSolver::solve(), subsurf_calculate_limit_positions(), TNT::transpose(), TNT::Unit_lower_triangular_solve(), TNT::Unit_upper_triangular_solve(), AUD_SoftwareDevice::AUD_SoftwareHandle::update(), Upper_symmetric_eigenvalue_solve(), TNT::Upper_triangular_solve(), TNT::Vector< Subscript >::Vector(), TNT::Vector_Adaptor< BBVec >::Vector_Adaptor(), TNT::vectoradd(), TNT::vectorscale(), and TNT::vectorsub().
#define R 1 |
Definition at line 497 of file mball.c.
Referenced by add_filt_fmask(), add_filt_fmask_pixsize(), add_filt_passes(), add_halo_flare(), addtosamp_shr(), ambient_occlusion(), ambient_occlusion_apply(), atm_tile(), bake_displacement(), bake_intersect_tree(), bake_set_shade_input(), bake_shade(), bsdf_microfacet_beckmann_sample(), bsdf_microfacet_ggx_sample(), bsdf_refraction_sample(), calc_renderco_ortho(), calc_renderco_zbuf(), calc_view_vector(), compatible_bump_compute(), ComputeTwist(), btCollisionWorld::convexSweepTest(), copyto_abufz(), count_mask(), cubemap_glob(), do_2d_mapping(), do_bake_shade(), do_bake_thread(), do_halo_tex(), do_lamp_tex(), do_sky_tex(), edge_enhance_add(), edge_enhance_tile(), environment_lighting_apply(), envmaptex(), EulerAngleFromMatrix(), eulO_to_gimbal_axis(), eulO_to_mat3(), eulO_to_quat(), KDL::Frame::Frame(), KDL::Frame2::Frame2(), fresnel(), get_lights(), get_next_bake_face(), get_sample_layers(), halo_pixelstruct(), halo_tile(), haloZtoDist(), image_sample(), imagewrap(), imagewraposa(), imagewraposa_aniso(), indirect_lighting_apply(), isb_add_samples(), isb_add_samples_transp(), isb_add_shadfac(), isb_bsp_test_face(), isb_bsp_test_strand(), ISB_create(), ISB_free(), ISB_getshadow(), isb_make_buffer(), isb_make_buffer_transp(), lamp_get_shadow(), lamphalo_tile(), make_pixelstructs(), mask_array(), mat3_to_eulo2(), mat4_to_dquat(), merge_transp_passes(), mistfactor(), multitex(), multitex_mtex(), multitex_nodes(), nextcwedge(), ntap_bump_compute(), ocean_texture(), TNT::Region2D< Array2D >::operator=(), TNT::Region1D< Array1D >::operator=(), pointdensitytex(), ray_ao(), ray_ao_qmc(), ray_ao_spheresamp(), ray_shadow(), ray_shadow_jitter(), ray_shadow_jittered_coords(), ray_shadow_qmc(), ray_trace_shadow_rad(), ray_trace_shadow_tra(), RE_bake_shade_all_selected(), RE_bake_shade_get_image(), render_lighting_halo(), render_realtime_texture(), renderflare(), renderhalo_post(), RefractionClosure::sample(), MicrofacetBeckmannClosure< Refractive >::sample(), MicrofacetGGXClosure< Refractive >::sample(), Color32::setBGRA(), Color32::setRGBA(), shade_color(), shade_input_calc_viewco(), shade_input_do_shade(), shade_input_initialize(), shade_input_set_shade_texco(), shade_input_set_strand(), shade_input_set_strand_texco(), shade_input_set_triangle(), shade_input_set_triangle_i(), shade_input_set_viewco(), shade_lamp_loop(), shade_lamp_loop_only_shadow(), shade_material_loop(), shade_one_light(), shade_sample_initialize(), shade_sample_sss(), shade_samples_do_AO(), shade_samples_fill_with_ps(), shade_strand_samples(), shade_tface(), shade_tra_samples(), shade_tra_samples_fill(), shade_volume_inside(), shadeDA_tile(), shadeHaloFloat(), shadeSkyPixel(), shadeSkyView(), shadeSunView(), sky_tile(), sphere_sampler(), spothalo(), threadsafe_table_sphere(), trace_reflect(), trace_refract(), traceray(), transform_inverse(), unref_strand_samples(), viewpixel_to_lampbuf(), vol_get_bounds(), vol_get_density(), vol_get_emission(), vol_get_reflection_color(), vol_get_shadow(), vol_get_sigma_t(), vol_precache_objectinstance_threads(), vol_trace_behind(), volume_trace(), volumeintegrate(), wrld_exposure_correct(), zbuffer_abuf_render(), zbuffer_solid(), zbuffer_sss(), zbuffer_transp_shade(), zbufshade_sss_tile(), zbufshade_tile(), and zbufshadeDA_tile().
#define RB 4 |
Definition at line 809 of file mball.c.
Referenced by nextcwedge().
#define RBF 5 |
Definition at line 507 of file mball.c.
Referenced by polygonize().
#define RBN 4 |
Definition at line 506 of file mball.c.
Referenced by polygonize().
#define RES 12 |
Definition at line 494 of file mball.c.
Referenced by converge(), KX_FontObject::DrawText(), and metaball_polygonize().
#define RF 7 |
Definition at line 812 of file mball.c.
Referenced by nextcwedge().
#define RN 6 |
Definition at line 811 of file mball.c.
Referenced by nextcwedge().
#define RT 5 |
Definition at line 810 of file mball.c.
Referenced by nextcwedge().
#define RTF 7 |
Definition at line 509 of file mball.c.
Referenced by polygonize().
#define RTN 6 |
Definition at line 508 of file mball.c.
Referenced by polygonize().
#define T 3 |
Definition at line 499 of file mball.c.
Referenced by KDL::abs(), KDL::acos(), CacheData::add(), array< uint4 >::array(), TNT::Array2D< T >::Array2D(), TNT::Array3D< T >::Array3D(), KDL::asin(), KDL::atan(), KDL::atan2(), AUD_convert_copy(), AUD_Reference< AUD_PitchReader >::AUD_Reference(), SG_QList::iterator< T >::back(), SG_DList::const_iterator< T >::back(), SG_DList::iterator< T >::back(), SG_QList::iterator< T >::begin(), SG_DList::const_iterator< T >::begin(), SG_DList::iterator< T >::begin(), bsdf_microfacet_beckmann_sample(), bsdf_microfacet_ggx_sample(), bsdf_refraction_sample(), bsdf_westin_backscatter_sample(), btSwap(), clear(), device_vector< uint4 >::copy(), btAlignedObjectArray< Material * >::copy(), TNT::i_refvec< T >::copy_(), KDL::cos(), KDL::cosh(), defocus_blur(), TNT::dot_prod(), btAlignedObjectArray< Material * >::downHeap(), SG_QList::iterator< T >::end(), SG_DList::const_iterator< T >::end(), SG_DList::iterator< T >::end(), gim_array< GIM_CONTACT >::erase_sorted_mem(), KDL::exp(), btAlignedObjectArray< Material * >::expand(), Filter_init(), id_map< void *, Shader >::find(), TNT::Fortran_Array3D< T >::Fortran_Array3D(), fresnel(), gim_down_heap(), gim_radix_sort(), gim_swap_elements(), gim_swap_elements_memcpy(), KDL::hypot(), TNT::i_refvec< T >::i_refvec(), Image_init(), InitAtmosphere(), TNT::Vector< Subscript >::initialize(), TNT::Fortran_Matrix< T >::initialize(), TNT::Matrix< MT_Scalar >::initialize(), btAlignedObjectArray< Material * >::initializeFromBuffer(), InitSunSky(), TNT::Fortran_Array3D< T >::inject(), gim_array< GIM_CONTACT >::insert_mem(), SG_QList::iterator< T >::iterator(), KDL::log(), TNT::matmult(), TNT::matmultdiag(), MAX3(), maxdirsterid(), nearest_point_in_tri_surface(), nextcwedge(), memcopy_elements_func::operator()(), TNT::operator*(), SG_QList::iterator< T >::operator++(), SG_DList::const_iterator< T >::operator++(), SG_DList::iterator< T >::operator++(), SG_QList::iterator< T >::operator--(), SG_DList::const_iterator< T >::operator--(), SG_DList::iterator< T >::operator--(), array< uint4 >::operator=(), TNT::Fortran_Array3D< T >::operator=(), GIM_AABB::overlapping_trans_cache(), p_face_stretch(), id_map< void *, Shader >::post_sync(), KDL::pow(), BSSRDFCubicClosure::pow5(), btAlignedObjectArray< Material * >::push_back(), gim_array< GIM_CONTACT >::push_back_memcpy(), btAlignedObjectArray< Material * >::quickSortInternal(), KDL::Rall1d< T, V, S >::Rall1d(), CacheData::read(), MEM_SmartPtr< GlutMouseManager >::Release(), SG_DListHead< BL_ArmatureConstraint >::Remove(), RemoveEulerAngleFromMatrix(), RemoveTwist(), btAlignedObjectArray< Material * >::reserve(), array< uint4 >::resize(), gim_array< GIM_CONTACT >::resize(), btAlignedObjectArray< Material * >::resize(), gim_array< GIM_CONTACT >::resizeData(), GenericEmissiveClosure::sample(), WestinBackscatterClosure::sample(), RefractionClosure::sample(), MicrofacetBeckmannClosure< Refractive >::sample(), MicrofacetGGXClosure< Refractive >::sample(), sample_cos_hemisphere(), sample_uniform_hemisphere(), SG_DListHead< BL_ArmatureConstraint >::SG_DListHead(), Sign(), KDL::sin(), KDL::sinh(), sky_texture_precompute(), KDL::sqr(), KDL::sqrt(), TNT::Array3D< T >::subarray(), TNT::Array2D< T >::subarray(), sum(), swap(), Swap(), btAlignedObjectArray< Material * >::swap(), SWAP_POINTERS(), id_map< void *, Shader >::sync(), KDL::tan(), KDL::tanh(), transform_inverse(), IK_QElbowSegment::UpdateAngleApply(), Video_init(), and ZeroInitialize().
#define TF 11 |
Definition at line 816 of file mball.c.
Referenced by nextcwedge().
#define TN 10 |
Definition at line 815 of file mball.c.
Referenced by nextcwedge().
void accum_mballfaces | ( | int | i1, |
int | i2, | ||
int | i3, | ||
int | i4 | ||
) |
Definition at line 716 of file mball.c.
References curindex, indices, MEM_freeN(), MEM_mallocN(), and totindex.
Referenced by docube().
void add_cube | ( | PROCESS * | mbproc, |
int | i, | ||
int | j, | ||
int | k, | ||
int | count | ||
) |
Definition at line 1399 of file mball.c.
References process::centers, cube::corners, cubes::cube, process::cubes, cube::i, cube::j, cube::k, MB_BIT, new_pgn_element(), cubes::next, setcenter(), and setcorner().
Referenced by find_first_points().
MetaBall* add_mball | ( | const char * | name | ) | [read] |
Definition at line 102 of file mball.c.
References alloc_libblock(), G, ID_MB, MB_AUTOSPACE, MetaBall::rendersize, MetaBall::size, MetaBall::texflag, MetaBall::thresh, and MetaBall::wiresize.
Referenced by add_obdata_from_type().
Definition at line 197 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, MetaElem::type, and unit_qt().
Referenced by add_metaball_primitive().
Definition at line 1202 of file mball.c.
References vertices::count, i, if(), vertices::max, MEM_callocN(), MEM_freeN(), NULL, and vertices::ptr.
Referenced by vertid().
void BKE_freecubetable | ( | void | ) |
Definition at line 1073 of file mball.c.
References i, intlists::list, MEM_freeN(), intlist::next, intlists::next, and NULL.
Referenced by WM_exit_ext().
void calc_mballco | ( | MetaElem * | ml, |
float * | vec | ||
) |
Definition at line 525 of file mball.c.
References MetaElem::mat, and mul_m4_v3().
Referenced by find_first_points(), and init_meta().
Definition at line 118 of file mball.c.
References MetaBall::bb, BLI_duplicatelist(), copy_libblock(), MetaBall::editelems, MetaBall::elems, MetaBall::id, id_us_plus(), MetaBall::lastelem, MetaBall::mat, MEM_dupallocN(), NULL, and MetaBall::totcol.
Referenced by id_copy(), make_local_mball(), object_add_duplicate_internal(), and single_obdata_users().
Definition at line 374 of file mball.c.
References BLI_split_name_num(), Object::data, F_ERROR, MetaBall::flag, Object::id, MAX_ID_NAME, ID::name, next_object(), NULL, OB_MBALL, MetaBall::rendersize, MetaBall::thresh, Object::type, and MetaBall::wiresize.
float densfunc | ( | MetaElem * | ball, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Definition at line 532 of file mball.c.
References MetaElem::expx, MetaElem::expy, MetaElem::expz, MetaElem::flag, MetaElem::imat, MetaElem::len, len(), MB_BALL, MB_CUBE, MB_ELIPSOID, MB_NEGATIVE, MB_PLANE, MB_TUBE, MB_TUBEX, MB_TUBEY, MB_TUBEZ, mul_m4_v3(), MetaElem::rad2, MetaElem::s, and MetaElem::type.
Referenced by init_meta(), and metaball().
Definition at line 835 of file mball.c.
References accum_mballfaces(), corner1, corner2, cube::corners, intlist::i, i, intlists::list, intlists::next, intlist::next, corner::value, and vertid().
Referenced by polygonize().
static void extern_local_mball | ( | MetaBall * | mb | ) | [static] |
Definition at line 139 of file mball.c.
References extern_local_matarar(), MetaBall::mat, and MetaBall::totcol.
Referenced by make_local_mball().
void fill_metaball_octal_node | ( | octal_node * | node, |
MetaElem * | ml, | ||
short | i | ||
) |
Definition at line 1815 of file mball.c.
References BLI_addtail(), octal_node::count, octal_node::elems, MetaElem::flag, i, MB_NEGATIVE, MEM_mallocN(), ml_pointer::ml, octal_node::neg, octal_node::nodes, and octal_node::pos.
Referenced by subdivide_metaball_octal_node().
This function finds basic MetaBall.
Basic MetaBall doesn't include any number at the end of its name. All MetaBalls with same base of name can be blended. MetaBalls with different basic name can't be blended.
warning!, is_basis_mball() can fail on returned object, see long note above.
Definition at line 419 of file mball.c.
References BLI_split_name_num(), Object::data, MetaBall::editelems, MetaBall::elems, F_ERROR, ListBase::first, MetaElem::flag, Object::flag, Object::id, MAX_ID_NAME, MB_HIDE, ID::name, MetaElem::next, next_object(), NULL, OB_FROMDUPLI, OB_MBALL, totelem, and Object::type.
Referenced by allow_render_object(), build_dag_object(), convert_exec(), init_render_mball(), and makeDispListMBall().
Definition at line 1429 of file mball.c.
References abs(), add_cube(), calc_mballco(), MetaElem::expx, MetaElem::expy, MetaElem::expz, MetaElem::flag, process::function, i, IN, len(), MAX3(), MB_BALL, MB_CUBE, MB_ELIPSOID, MB_NEGATIVE, MB_PLANE, MB_TUBE, OUT, MetaElem::rad, MetaElem::s, process::size, sqrtf, MetaBall::thresh, MetaElem::type, point::x, point::y, and point::z.
Referenced by polygonize().
octal_node* find_metaball_octal_node | ( | octal_node * | node, |
float | x, | ||
float | y, | ||
float | z, | ||
short | depth | ||
) |
Definition at line 608 of file mball.c.
References find_metaball_octal_node(), and octal_node::nodes.
Referenced by find_metaball_octal_node(), and metaball().
void free_mball | ( | MetaBall * | mb | ) |
Definition at line 88 of file mball.c.
References MetaBall::adt, MetaBall::bb, BKE_free_animdata(), BLI_freelistN(), MetaBall::disp, MetaBall::elems, ListBase::first, freedisplist(), MetaBall::mat, MEM_freeN(), NULL, and unlink_mball().
Referenced by free_libblock().
void free_metaball_octal_node | ( | octal_node * | node | ) |
Definition at line 2104 of file mball.c.
References BLI_freelistN(), octal_node::elems, free_metaball_octal_node(), MEM_freeN(), octal_node::nodes, and NULL.
Referenced by free_metaball_octal_node(), and metaball_polygonize().
void freepolygonize | ( | PROCESS * | p | ) |
Definition at line 792 of file mball.c.
References process::centers, process::corners, process::edges, MEM_freeN(), new_pgn_element(), vertices::ptr, and process::vertices.
Referenced by metaball_polygonize().
int getedge | ( | EDGELIST * | table[], |
int | i1, | ||
int | j1, | ||
int | k1, | ||
int | i2, | ||
int | j2, | ||
int | k2 | ||
) |
Definition at line 1164 of file mball.c.
References HASH, edgelist::i1, edgelist::i2, edgelist::j1, edgelist::j2, edgelist::k1, edgelist::k2, edgelist::next, NULL, and edgelist::vid.
Referenced by vertid().
Definition at line 1589 of file mball.c.
References Object::bb, MetaElem::bb, BLI_split_name_num(), calc_mballco(), copy_m4_m4(), Object::data, densfunc(), MetaBall::editelems, MetaBall::elems, MetaElem::expx, MetaElem::expy, MetaElem::expz, fabsf, ListBase::first, Base::flag, MetaElem::flag, i, Object::id, MetaElem::imat, invert_m4_m4(), Object::mat, MetaElem::mat, MAX_ID_NAME, MB_HIDE, mul_m4_v3(), mult_m4_m4m4(), ID::name, new_pgn_element(), MetaElem::next, next_object(), NULL, OB_FROMDUPLI, OB_MBALL, Object::obmat, Object::parent, MetaElem::quat, quat_to_mat4(), MetaElem::rad, MetaElem::rad2, MetaElem::s, Object::size, size(), thresh, totelem, Object::type, unit_m4(), BoundBox::vec, MetaElem::x, MetaElem::y, and MetaElem::z.
Referenced by metaball_polygonize().
void init_metaball_octal_tree | ( | int | depth | ) |
Definition at line 2115 of file mball.c.
References MetaElem::bb, BLI_addtail(), octal_node::count, octal_tree::depth, octal_node::elems, ListBase::first, octal_tree::first, FLT_MAX, ListBase::last, MB_NEGATIVE, MEM_mallocN(), ml_pointer::ml, octal_tree::neg, octal_node::neg, octal_node::nodes, NULL, octal_node::pos, octal_tree::pos, size(), subdivide_metaball_octal_node(), totelem, BoundBox::vec, octal_node::x_max, octal_node::x_min, octal_node::y_max, octal_node::y_min, octal_node::z_max, and octal_node::z_min.
Referenced by metaball_polygonize().
int is_basis_mball | ( | Object * | ob | ) |
Test, if Object *ob is basic MetaBall.
It test last character of Object ID name. If last character is digit it return 0, else it return 1.
Definition at line 345 of file mball.c.
References Object::id, len(), ID::name, and strlen().
Referenced by draw_bounding_volume(), drawDispList(), drawObjectSelect(), drawWireExtra(), and is_mball_basis_for().
Definition at line 356 of file mball.c.
References BLI_split_name_num(), Object::id, is_basis_mball(), MAX_ID_NAME, and ID::name.
Referenced by unlink_object().
void make_local_mball | ( | MetaBall * | mb | ) |
Definition at line 146 of file mball.c.
References BKE_id_lib_local_paths(), copy_mball(), Object::data, ELEM, extern_local_mball(), FALSE, G, MetaBall::id, Object::id, id_clear_lib_data(), ID::lib, ID::next, NULL, TRUE, and ID::us.
Referenced by id_make_local().
Definition at line 293 of file mball.c.
References Object::bb, data, ListBase::first, MEM_mallocN(), DispList::nr, size(), BoundBox::vec, and DispList::verts.
Referenced by init_render_mball().
void makecubetable | ( | void | ) |
Definition at line 1032 of file mball.c.
References corner1, corner2, credits_svn_gen::e, intlist::i, i, leftface, intlists::list, MB_BIT, MEM_callocN(), intlists::next, intlist::next, nextcwedge(), NULL, otherface(), and rightface.
Referenced by polygonize().
float metaball | ( | float | x, |
float | y, | ||
float | z | ||
) |
Definition at line 676 of file mball.c.
References densfunc(), octal_tree::depth, octal_node::elems, find_metaball_octal_node(), ListBase::first, octal_tree::first, ml_pointer::ml, octal_tree::neg, octal_node::neg, ml_pointer::next, octal_node::pos, octal_tree::pos, thresh, and totelem.
Referenced by metaball_polygonize().
Definition at line 2173 of file mball.c.
References BLI_addtail(), process::bounds, vertices::count, process::cubes, curindex, Object::data, process::delta, DL_INDEX4, octal_tree::first, MetaBall::flag, free_metaball_octal_node(), freepolygonize(), process::function, G, DispList::index, indices, init_meta(), init_metaball_octal_tree(), MB_UPDATE_FAST, MB_UPDATE_HALFRES, MB_UPDATE_NEVER, MEM_callocN(), MEM_freeN(), MEM_mallocN(), metaball(), new_pgn_element(), vertex::normal, DispList::nors, DispList::nr, NULL, DispList::parts, polygonize(), vertex::position, vertices::ptr, MetaBall::rendersize, RES, Object::size, process::size, thresh, MetaBall::thresh, totelem, totindex, DispList::type, process::vertices, DispList::verts, MetaBall::wiresize, point::x, octal_node::x_max, octal_node::x_min, point::y, octal_node::y_max, octal_node::y_min, point::z, octal_node::z_max, and octal_node::z_min.
Referenced by makeDispListMBall(), and makeDispListMBall_forRender().
void* new_pgn_element | ( | int | size | ) |
Definition at line 749 of file mball.c.
References BLI_addtail(), BLI_freelistN(), pgn_elements::data, ListBase::first, MEM_callocN(), MEM_freeN(), pgn_elements::next, NULL, offs, and size().
Referenced by add_cube(), freepolygonize(), init_meta(), metaball_polygonize(), setcenter(), setcorner(), setedge(), and testface().
int nextcwedge | ( | int | edge, |
int | face | ||
) |
int otherface | ( | int | edge, |
int | face | ||
) |
Definition at line 1023 of file mball.c.
References leftface, and rightface.
Referenced by makecubetable().
Definition at line 1549 of file mball.c.
References process::centers, process::corners, vertices::count, cubes::cube, process::cubes, docube(), process::edges, find_first_points(), HASHSIZE, cube::i, cube::j, cube::k, LBF, LBN, LTF, LTN, makecubetable(), vertices::max, MEM_callocN(), cubes::next, NULL, vertices::ptr, RBF, RBN, RTF, RTN, testface(), totelem, and process::vertices.
Referenced by metaball_polygonize().
int setcenter | ( | CENTERLIST * | table[], |
int | i, | ||
int | j, | ||
int | k | ||
) |
Definition at line 1103 of file mball.c.
References HASH, centerlist::i, i, centerlist::j, centerlist::k, new_pgn_element(), centerlist::next, and NULL.
Referenced by add_cube(), and testface().
Definition at line 954 of file mball.c.
References process::corners, process::function, HASH, corner::i, i, corner::j, corner::k, new_pgn_element(), corner::next, NULL, process::size, corner::value, corner::x, corner::y, and corner::z.
Referenced by add_cube(), and testface().
void setedge | ( | EDGELIST * | table[], |
int | i1, | ||
int | j1, | ||
int | k1, | ||
int | i2, | ||
int | j2, | ||
int | k2, | ||
int | vid | ||
) |
Definition at line 1128 of file mball.c.
References HASH, edgelist::i1, edgelist::i2, edgelist::j1, edgelist::j2, edgelist::k1, edgelist::k2, new_pgn_element(), edgelist::next, and edgelist::vid.
Referenced by vertid().
void subdivide_metaball_octal_node | ( | octal_node * | node, |
float | size_x, | ||
float | size_y, | ||
float | size_z, | ||
short | depth | ||
) |
Definition at line 1847 of file mball.c.
References MetaElem::bb, BLI_freelistN(), octal_node::count, octal_node::elems, fill_metaball_octal_node(), ListBase::first, i, ListBase::last, MEM_mallocN(), ml_pointer::ml, octal_node::neg, ml_pointer::next, octal_node::nodes, NULL, octal_node::parent, octal_node::pos, subdivide_metaball_octal_node(), BoundBox::vec, octal_node::x, octal_node::x_min, octal_node::y, octal_node::y_min, octal_node::z, and octal_node::z_min.
Referenced by init_metaball_octal_tree(), and subdivide_metaball_octal_node().
void testface | ( | int | i, |
int | j, | ||
int | k, | ||
CUBE * | old, | ||
int | bit, | ||
int | c1, | ||
int | c2, | ||
int | c3, | ||
int | c4, | ||
PROCESS * | p | ||
) |
Definition at line 903 of file mball.c.
References process::centers, cube::corners, cubes::cube, process::cubes, FLIP, cube::i, i, cube::j, cube::k, new_pgn_element(), cubes::next, NULL, setcenter(), setcorner(), and corner::value.
Referenced by polygonize().
void tex_space_mball | ( | Object * | ob | ) |
Compute bounding box of all MetaElems/MetaBalls.
Bounding box is computed from polygonized surface. Object *ob is basic MetaBall (usually with name Meta). All other MetaBalls (with names Meta.001, Meta.002, etc) are included in this Bounding Box.
Definition at line 249 of file mball.c.
References Object::bb, boundbox_set_from_min_max(), data, Object::disp, DO_MINMAX, ListBase::first, max, MEM_callocN(), min, DispList::next, DispList::nr, NULL, and DispList::verts.
Referenced by copy_texture_space(), makeDispListMBall(), and makeDispListMBall_forRender().
void unlink_mball | ( | MetaBall * | mb | ) |
Definition at line 76 of file mball.c.
References Material::id, MetaBall::mat, NULL, MetaBall::totcol, and ID::us.
Referenced by free_mball(), and free_object().
Definition at line 1270 of file mball.c.
References addtovertices(), converge(), vertices::count, process::edges, process::function, getedge(), corner::i, corner::j, corner::k, vertex::normal, vertex::position, setedge(), corner::value, process::vertices, vnormal(), corner::x, point::x, corner::y, point::y, corner::z, and point::z.
Referenced by docube(), and SubdFaceRing::evaluate_stencils().
Definition at line 1220 of file mball.c.
References process::delta, FALSE, process::function, sqrtf, point::x, point::y, and point::z.
Referenced by MeshManager::device_update_mesh(), and vertid().
int corner1[12] [static] |
int corner2[12] [static] |
int curindex |
Definition at line 713 of file mball.c.
Referenced by accum_mballfaces(), curve_surf_to_softbody(), draw_track_path(), EM_fgon_flags(), and metaball_polygonize().
int* indices = NULL [static] |
Definition at line 712 of file mball.c.
Referenced by accum_mballfaces(), applyModifier(), MeanValueMeshCoords::computeWeights(), DM_calc_auto_bump_scale(), findFreeNavPolyIndex(), btGImpactMeshShapePart::TrimeshPrimitiveManager::get_bullet_triangle(), btGImpactMeshShapePart::TrimeshPrimitiveManager::get_primitive_triangle(), metaball_polygonize(), multiresbake_get_normal(), and OSLRenderServices::pointcloud().
int leftface[12] [static] |
octal_tree* metaball_tree = NULL [static] |
int rightface[12] [static] |
float thresh = 0.6f [static] |
Definition at line 70 of file mball.c.
Referenced by actkeys_clean_exec(), adaptive_sample_variance(), autosmooth(), btConeTwistConstraint::calcAngleInfo(), curvemapping_changed(), graphkeys_clean_exec(), init_meta(), metaball(), metaball_polygonize(), set_phong_threshold(), shade_one_light(), similar_vert_select_exec(), and spivotL().
int totelem = 0 [static] |
Definition at line 71 of file mball.c.
Referenced by customData_add_layer__internal(), distribute_threads_init_data(), do_key(), find_basis_mball(), gp_stroke_newfrombuffer(), init_meta(), init_metaball_octal_tree(), make_editMesh(), metaball(), metaball_polygonize(), my_tex_space_mesh(), outliner_sort(), polygonize(), and psys_calc_dmcache().
int totindex [static] |
Definition at line 713 of file mball.c.
Referenced by accum_mballfaces(), deformVerts_do(), metaball_polygonize(), select_editcurve_hook(), select_editlattice_hook(), select_editmesh_hook(), vpaint_stroke_update_step(), and wpaint_stroke_update_step().