Blender V2.61 - r43446
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_lattice_types.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
#include "BKE_animsys.h"
#include "BKE_anim.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_deform.h"
Go to the source code of this file.
Classes | |
struct | CurveDeform |
Functions | |
void | calc_lat_fudu (int flag, int res, float *fu, float *du) |
void | resizelattice (Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb) |
Lattice * | add_lattice (const char *name) |
Lattice * | copy_lattice (Lattice *lt) |
void | free_lattice (Lattice *lt) |
void | make_local_lattice (Lattice *lt) |
void | init_latt_deform (Object *oblatt, Object *ob) |
void | calc_latt_deform (Object *ob, float *co, float weight) |
void | end_latt_deform (Object *ob) |
static void | init_curve_deform (Object *par, Object *ob, CurveDeform *cd, int dloc) |
static int | where_on_path_deform (Object *ob, float ctime, float *vec, float *dir, float *quat, float *radius) |
static int | calc_curve_deform (Scene *scene, Object *par, float *co, short axis, CurveDeform *cd, float *quatp) |
void | curve_deform_verts (Scene *scene, Object *cuOb, Object *target, DerivedMesh *dm, float(*vertexCos)[3], int numVerts, const char *vgroup, short defaxis) |
void | curve_deform_vector (Scene *scene, Object *cuOb, Object *target, float *orco, float *vec, float mat[][3], int no_rot_axis) |
void | lattice_deform_verts (Object *laOb, Object *target, DerivedMesh *dm, float(*vertexCos)[3], int numVerts, const char *vgroup) |
int | object_deform_mball (Object *ob, ListBase *dispbase) |
static BPoint * | latt_bp (Lattice *lt, int u, int v, int w) |
void | outside_lattice (Lattice *lt) |
float(* | lattice_getVertexCos (struct Object *ob, int *numVerts_r))[3] |
void | lattice_applyVertexCos (struct Object *ob, float(*vertexCos)[3]) |
void | lattice_calc_modifiers (Scene *scene, Object *ob) |
struct MDeformVert * | lattice_get_deform_verts (struct Object *oblatt) |
Definition in file lattice.c.
Lattice* add_lattice | ( | const char * | name | ) | [read] |
Definition at line 187 of file lattice.c.
References alloc_libblock(), Lattice::def, Lattice::flag, G, ID_LT, KEY_BSPLINE, LT_GRID, MEM_callocN(), NULL, resizelattice(), Lattice::typeu, Lattice::typev, and Lattice::typew.
Referenced by add_obdata_from_type().
static int calc_curve_deform | ( | Scene * | scene, |
Object * | par, | ||
float * | co, | ||
short | axis, | ||
CurveDeform * | cd, | ||
float * | quatp | ||
) | [static] |
Definition at line 540 of file lattice.c.
References add_v3_v3v3(), copy_qt_qt(), copy_v3_v3(), cos(), CU_PATH_RADIUS, CU_SPEED, CU_STRETCH, Object::data, CurveDeform::dloc, CurveDeform::dmax, CurveDeform::dmin, ELEM3, Curve::flag, makeDispListCurveTypes(), mul_qt_qtqt(), mul_qt_v3(), mul_v3_fl(), CurveDeform::no_rot_axis, normalize_qt(), normalize_v3(), NULL, OB_NEGX, OB_NEGY, OB_NEGZ, Curve::path, quat_apply_track(), rotation_between_vecs_to_quat(), sin(), Path::totdist, vec_apply_track(), vec_to_quat(), and where_on_path_deform().
Referenced by curve_deform_vector(), and curve_deform_verts().
void calc_lat_fudu | ( | int | flag, |
int | res, | ||
float * | fu, | ||
float * | du | ||
) |
Definition at line 70 of file lattice.c.
References LT_GRID.
Referenced by do_versions(), and resizelattice().
void calc_latt_deform | ( | Object * | ob, |
float * | co, | ||
float | weight | ||
) |
Definition at line 344 of file lattice.c.
References copy_v3_v3(), Object::data, defgroup_name_index(), defvert_find_weight(), Lattice::du, Lattice::dv, Lattice::dw, Lattice::editlatt, Lattice::fu, Lattice::fv, Lattice::fw, interp_v3_v3v3(), key_curve_position_weights(), Lattice::latmat, EditLatt::latt, lattice_get_deform_verts(), Lattice::latticedata, madd_v3_v3fl(), mul_v3_m4v3(), NULL, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Lattice::typeu, Lattice::typev, Lattice::typew, Lattice::vgroup, and simple_enum_gen::w.
Referenced by lattice_deform_verts(), psys_apply_hair_lattice(), psys_get_particle_on_path(), and psys_get_particle_state().
Definition at line 203 of file lattice.c.
References copy_dverts(), copy_key(), copy_libblock(), Lattice::def, Lattice::dvert, Lattice::editlatt, Key::from, Lattice::id, Lattice::key, MEM_dupallocN(), MEM_mallocN(), NULL, Lattice::pntsu, Lattice::pntsv, and Lattice::pntsw.
Referenced by id_copy(), make_local_lattice(), object_add_duplicate_internal(), and single_obdata_users().
void curve_deform_vector | ( | Scene * | scene, |
Object * | cuOb, | ||
Object * | target, | ||
float * | orco, | ||
float * | vec, | ||
float | mat[][3], | ||
int | no_rot_axis | ||
) |
Definition at line 790 of file lattice.c.
References calc_curve_deform(), copy_v3_v3(), CurveDeform::curvespace, CurveDeform::dmax, CurveDeform::dmin, init_curve_deform(), mul_m3_m3m3(), mul_m4_v3(), CurveDeform::no_rot_axis, OB_CURVE, CurveDeform::objectspace, CurveDeform::objectspace3, quat_to_mat3(), Object::trackflag, Object::type, and unit_m3().
void curve_deform_verts | ( | Scene * | scene, |
Object * | cuOb, | ||
Object * | target, | ||
DerivedMesh * | dm, | ||
float(*) | vertexCos[3], | ||
int | numVerts, | ||
const char * | vgroup, | ||
short | defaxis | ||
) |
Definition at line 661 of file lattice.c.
References calc_curve_deform(), CD_MDEFORMVERT, copy_v3_v3(), CU_DEFORM_BOUNDS_OFF, CU_FOLLOW, CU_PATH, CU_STRETCH, CurveDeform::curvespace, Object::data, defgroup_name_index(), defvert_find_weight(), CurveDeform::dmax, CurveDeform::dmin, DO_MINMAX, Mesh::dvert, Curve::flag, DerivedMesh::getVertData, init_curve_deform(), INIT_MINMAX, interp_v3_v3v3(), mul_m4_v3(), NULL, OB_CURVE, OB_MESH, CurveDeform::objectspace, and Object::type.
Referenced by deformVerts().
void end_latt_deform | ( | Object * | ob | ) |
Definition at line 450 of file lattice.c.
References Object::data, Lattice::editlatt, EditLatt::latt, Lattice::latticedata, MEM_freeN(), and NULL.
Referenced by applyModifier(), cached_step(), draw_new_particle_system(), explodeMesh(), lattice_deform_verts(), new_particle_duplilist(), pointdensity_cache_psys(), psys_apply_hair_lattice(), psys_threads_free(), render_new_particle_system(), and system_step().
void free_lattice | ( | Lattice * | lt | ) |
Definition at line 224 of file lattice.c.
References Lattice::adt, BKE_free_animdata(), Lattice::def, Lattice::dvert, Lattice::editlatt, free_dverts(), Lattice::id, EditLatt::latt, MEM_freeN(), NULL, Lattice::pntsu, Lattice::pntsv, and Lattice::pntsw.
Referenced by free_libblock().
static void init_curve_deform | ( | Object * | par, |
Object * | ob, | ||
CurveDeform * | cd, | ||
int | dloc | ||
) | [static] |
Definition at line 470 of file lattice.c.
References copy_m3_m4(), CurveDeform::curvespace, CurveDeform::dloc, Object::imat, invert_m4_m4(), mul_v3_m4v3(), mult_m4_m4m4(), CurveDeform::no_rot_axis, CurveDeform::objectspace, CurveDeform::objectspace3, and Object::obmat.
Referenced by curve_deform_vector(), and curve_deform_verts().
Definition at line 292 of file lattice.c.
References co, Object::data, Lattice::def, Object::disp, DL_VERTS, Lattice::du, Lattice::dv, Lattice::dw, Lattice::editlatt, find_displist(), Lattice::fu, Lattice::fv, Lattice::fw, invert_m4_m4(), Lattice::latmat, EditLatt::latt, Lattice::latticedata, MEM_mallocN(), mul_mat3_m4_v3(), mult_m4_m4m4(), NULL, Object::obmat, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, BPoint::vec, DispList::verts, and simple_enum_gen::w.
Referenced by lattice_deform_verts(), and psys_get_lattice().
Definition at line 886 of file lattice.c.
References Lattice::def, Lattice::pntsu, and Lattice::pntsv.
Referenced by outside_lattice().
void lattice_applyVertexCos | ( | struct Object * | ob, |
float(*) | vertexCos[3] | ||
) |
Definition at line 979 of file lattice.c.
References copy_v3_v3(), Object::data, Lattice::def, i, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and BPoint::vec.
Definition at line 989 of file lattice.c.
References BLI_addtail(), Object::data, ModifierTypeInfo::deformVerts, Object::disp, DL_VERTS, Lattice::editlatt, eModifierMode_Editmode, eModifierMode_Realtime, eModifierTypeType_OnlyDeform, freedisplist(), ModifierTypeInfo::isDisabled, lattice_getVertexCos(), MEM_callocN(), ModifierData::mode, modifiers_getVirtualModifierList(), modifierType_getInfo(), mti, ModifierData::next, DispList::nr, NULL, DispList::parts, ModifierData::scene, DispList::type, ModifierTypeInfo::type, ModifierData::type, and DispList::verts.
Referenced by drawlattice(), meshdeform_bind_exec(), and object_handle_update().
void lattice_deform_verts | ( | Object * | laOb, |
Object * | target, | ||
DerivedMesh * | dm, | ||
float(*) | vertexCos[3], | ||
int | numVerts, | ||
const char * | vgroup | ||
) |
Definition at line 821 of file lattice.c.
References calc_latt_deform(), CD_MDEFORMVERT, Object::data, defgroup_name_index(), defvert_find_weight(), Mesh::dvert, end_latt_deform(), DerivedMesh::getVertData, init_latt_deform(), OB_LATTICE, OB_MESH, and Object::type.
Referenced by deformVerts(), object_deform_mball(), and resizelattice().
struct MDeformVert* lattice_get_deform_verts | ( | struct Object * | oblatt | ) | [read] |
Definition at line 1026 of file lattice.c.
References BLI_assert, Object::data, Lattice::dvert, Lattice::editlatt, EditLatt::latt, OB_LATTICE, and Object::type.
Referenced by calc_latt_deform(), modifier_get_vgroup(), and shrinkwrapModifier_deform().
float(* lattice_getVertexCos | ( | struct Object * | ob, |
int * | numVerts_r | ||
) | )[3] |
Definition at line 961 of file lattice.c.
References copy_v3_v3(), Lattice::def, Lattice::editlatt, i, EditLatt::latt, MEM_mallocN(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, and BPoint::vec.
Referenced by lattice_calc_modifiers().
void make_local_lattice | ( | Lattice * | lt | ) |
Definition at line 246 of file lattice.c.
References BKE_id_lib_local_paths(), copy_lattice(), Object::data, ELEM, FALSE, ListBase::first, G, Object::id, Lattice::id, id_clear_lib_data(), ID::lib, ID::next, NULL, Main::object, TRUE, and ID::us.
Referenced by id_make_local().
Definition at line 870 of file lattice.c.
References ListBase::first, lattice_deform_verts(), DispList::next, DispList::nr, NULL, OB_LATTICE, Object::parent, PARSKEL, Object::partype, Object::type, and DispList::verts.
Referenced by makeDispListMBall(), and makeDispListMBall_forRender().
void outside_lattice | ( | Lattice * | lt | ) |
Definition at line 891 of file lattice.c.
References Lattice::def, BPoint::f1, Lattice::flag, BPoint::hide, latt_bp(), LT_OUTSIDE, mul_v3_fl(), Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, SELECT, BPoint::vec, and simple_enum_gen::w.
Referenced by do_latt_key(), recalcData_view3d(), and special_transvert_update().
Definition at line 86 of file lattice.c.
References calc_lat_fudu(), co, copy_m4_m4(), copy_v3_v3(), Lattice::def, Object::disp, Lattice::du, Lattice::dv, Lattice::dvert, Lattice::dw, Lattice::flag, free_dverts(), freedisplist(), Lattice::fu, Lattice::fv, Lattice::fw, i, KEY_LINEAR, lattice_deform_verts(), MEM_callocN(), MEM_freeN(), MEM_mallocN(), NULL, Object::obmat, Lattice::pntsu, Lattice::pntsv, Lattice::pntsw, Lattice::typeu, Lattice::typev, Lattice::typew, unit_m4(), BPoint::vec, and simple_enum_gen::w.
Referenced by add_lattice(), and make_regular_exec().
static int where_on_path_deform | ( | Object * | ob, |
float | ctime, | ||
float * | vec, | ||
float * | dir, | ||
float * | quat, | ||
float * | radius | ||
) | [static] |
Definition at line 490 of file lattice.c.
References add_v3_v3(), Curve::bev, CLAMPIS, copy_qt_qt(), Object::data, Path::data, ListBase::first, Path::len, mul_v3_fl(), BevList::nr, NULL, Curve::path, BevList::poly, PathPoint::quat, PathPoint::radius, sub_v3_v3v3(), PathPoint::vec, and where_on_path().
Referenced by calc_curve_deform().