Blender
V3.3
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_simd.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_editmesh.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_deform.h"
Go to the source code of this file.
Classes | |
struct | LatticeDeformData |
struct | LatticeDeformUserdata |
Lattice Deform API | |
typedef struct LatticeDeformData | LatticeDeformData |
LatticeDeformData * | BKE_lattice_deform_data_create (const Object *oblatt, const Object *ob) |
void | BKE_lattice_deform_data_eval_co (LatticeDeformData *lattice_deform_data, float co[3], float weight) |
void | BKE_lattice_deform_data_destroy (LatticeDeformData *lattice_deform_data) |
Lattice Deform #BKE_lattice_deform_coords API | |
BKE_lattice_deform_coords and related functions. | |
typedef struct LatticeDeformUserdata | LatticeDeformUserdata |
static void | lattice_deform_vert_with_dvert (const LatticeDeformUserdata *data, const int index, const MDeformVert *dvert) |
static void | lattice_deform_vert_task (void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | lattice_vert_task_editmesh (void *__restrict userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | lattice_vert_task_editmesh_no_dvert (void *__restrict userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | lattice_deform_coords_impl (const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const short flag, const char *defgrp_name, const float fac, const Mesh *me_target, BMEditMesh *em_target) |
void | BKE_lattice_deform_coords (const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const short flag, const char *defgrp_name, float fac) |
void | BKE_lattice_deform_coords_with_mesh (const Object *ob_lattice, const Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const short flag, const char *defgrp_name, const float fac, const Mesh *me_target) |
void | BKE_lattice_deform_coords_with_editmesh (const struct Object *ob_lattice, const struct Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const short flag, const char *defgrp_name, const float fac, struct BMEditMesh *em_target) |
Deform coordinates by a lattice object (used by modifier).
Definition in file lattice_deform.c.
typedef struct LatticeDeformData LatticeDeformData |
typedef struct LatticeDeformUserdata LatticeDeformUserdata |
void BKE_lattice_deform_coords | ( | const Object * | ob_lattice, |
const Object * | ob_target, | ||
float(*) | vert_coords[3], | ||
const int | vert_coords_len, | ||
const short | flag, | ||
const char * | defgrp_name, | ||
float | fac | ||
) |
Definition at line 411 of file lattice_deform.c.
References lattice_deform_coords_impl(), and NULL.
void BKE_lattice_deform_coords_with_editmesh | ( | const struct Object * | ob_lattice, |
const struct Object * | ob_target, | ||
float(*) | vert_coords[3], | ||
const int | vert_coords_len, | ||
const short | flag, | ||
const char * | defgrp_name, | ||
const float | fac, | ||
struct BMEditMesh * | em_target | ||
) |
Definition at line 443 of file lattice_deform.c.
References lattice_deform_coords_impl(), and NULL.
Referenced by deformVertsEM().
void BKE_lattice_deform_coords_with_mesh | ( | const Object * | ob_lattice, |
const Object * | ob_target, | ||
float(*) | vert_coords[3], | ||
const int | vert_coords_len, | ||
const short | flag, | ||
const char * | defgrp_name, | ||
const float | fac, | ||
const Mesh * | me_target | ||
) |
Definition at line 423 of file lattice_deform.c.
References lattice_deform_coords_impl(), and NULL.
LatticeDeformData* BKE_lattice_deform_data_create | ( | const Object * | oblatt, |
const Object * | ob | ||
) |
Definition at line 54 of file lattice_deform.c.
References BKE_defvert_find_weight(), BKE_displist_find(), BKE_id_defgroup_name_index(), BKE_lattice_deform_verts_get(), BKE_object_get_lattice(), copy_m4_m4(), Object_Runtime::curve_cache, Lattice::def, CurveCache::disp, DL_VERTS, Lattice::du, Lattice::dv, Lattice::dw, Lattice::fu, Lattice::fv, Lattice::fw, Lattice::id, invert_m4_m4(), LatticeDeformData::latmat, LatticeDeformData::lattice_weights, LatticeDeformData::latticedata, LatticeDeformData::lt, MEM_malloc_arrayN, MEM_mallocN, mul_m4_m4m4(), mul_mat3_m4_v3(), NULL, Object::obmat, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Object::runtime, v, BPoint::vec, DispList::verts, Lattice::vgroup, and w().
Referenced by lattice_deform_coords_impl().
void BKE_lattice_deform_data_destroy | ( | LatticeDeformData * | lattice_deform_data | ) |
Definition at line 249 of file lattice_deform.c.
References LatticeDeformData::latticedata, and MEM_freeN.
Referenced by bakeModifier(), BKE_gpencil_cache_data_clear(), BKE_gpencil_cache_data_init(), freeData(), lattice_deform_coords_impl(), psys_sim_data_free(), and blender::bke::tests::test_lattice_deform_free().
void BKE_lattice_deform_data_eval_co | ( | LatticeDeformData * | lattice_deform_data, |
float | co[3], | ||
float | weight | ||
) |
Definition at line 137 of file lattice_deform.c.
References BLI_assert, CLAMPIS, copy_v3_v3(), Lattice::du, Lattice::dv, Lattice::dw, blender::math::floor(), Lattice::fu, Lattice::fv, Lattice::fw, interp_v3_v3v3(), key_curve_position_weights(), LatticeDeformData::latmat, LatticeDeformData::lattice_weights, LatticeDeformData::latticedata, LatticeDeformData::lt, madd_v3_v3fl(), mul_v3_m4v3(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Lattice::typeu, Lattice::typev, Lattice::typew, v, and w().
Referenced by deformStroke(), lattice_deform_vert_with_dvert(), psys_apply_hair_lattice(), psys_get_particle_on_path(), psys_get_particle_state(), and blender::bke::tests::test_lattice_deform().
|
static |
Definition at line 326 of file lattice_deform.c.
References BKE_id_defgroup_name_index(), BKE_lattice_deform_data_create(), BKE_lattice_deform_data_destroy(), BLI_parallel_mempool_settings_defaults(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_mempool(), BLI_task_parallel_range(), BMEditMesh::bm, BM_mesh_elem_index_ensure(), BM_VERT, CD_MDEFORMVERT, CustomData_get_layer(), CustomData_get_offset(), data, Object::data, ELEM, Mesh::id, lattice_deform_vert_task(), lattice_vert_task_editmesh(), lattice_vert_task_editmesh_no_dvert(), TaskParallelSettings::min_iter_per_thread, MOD_LATTICE_INVERT_VGROUP, NULL, OB_LATTICE, OB_MESH, Object::type, BMesh::vdata, Mesh::vdata, and BMesh::vpool.
Referenced by BKE_lattice_deform_coords(), BKE_lattice_deform_coords_with_editmesh(), and BKE_lattice_deform_coords_with_mesh().
|
static |
Definition at line 299 of file lattice_deform.c.
References data, lattice_deform_vert_with_dvert(), and NULL.
Referenced by lattice_deform_coords_impl().
|
static |
Definition at line 280 of file lattice_deform.c.
References BKE_defvert_find_weight(), BKE_lattice_deform_data_eval_co(), data, and NULL.
Referenced by lattice_deform_vert_task(), lattice_vert_task_editmesh(), and lattice_vert_task_editmesh_no_dvert().
|
static |
Definition at line 307 of file lattice_deform.c.
References BM_ELEM_CD_GET_VOID_P, BM_elem_index_get, data, lattice_deform_vert_with_dvert(), and v.
Referenced by lattice_deform_coords_impl().
|
static |
Definition at line 317 of file lattice_deform.c.
References BM_elem_index_get, data, lattice_deform_vert_with_dvert(), NULL, and v.
Referenced by lattice_deform_coords_impl().