Blender V2.61 - r43446
|
#include <string.h>
#include <math.h>
#include "ctype.h"
#include "MEM_guardedalloc.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BKE_deform.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
Go to the source code of this file.
Defines | |
#define | IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_') |
Functions | |
void | defgroup_copy_list (ListBase *outbase, ListBase *inbase) |
bDeformGroup * | defgroup_duplicate (bDeformGroup *ingroup) |
void | defvert_copy (MDeformVert *dvert_dst, const MDeformVert *dvert_src) |
void | defvert_copy_index (MDeformVert *dvert_dst, const MDeformVert *dvert_src, const int defgroup) |
void | defvert_sync (MDeformVert *dvert_dst, const MDeformVert *dvert_src, int use_verify) |
void | defvert_sync_mapped (MDeformVert *dvert_dst, const MDeformVert *dvert_src, const int *flip_map, const int flip_map_len, const int use_verify) |
void | defvert_remap (MDeformVert *dvert, int *map, const int map_len) |
void | defvert_normalize (MDeformVert *dvert) |
void | defvert_normalize_lock (MDeformVert *dvert, const int def_nr_lock) |
void | defvert_flip (MDeformVert *dvert, const int *flip_map, const int flip_map_len) |
bDeformGroup * | defgroup_find_name (Object *ob, const char *name) |
int | defgroup_name_index (Object *ob, const char *name) |
int * | defgroup_flip_map (Object *ob, int *flip_map_len, int use_default) |
int * | defgroup_flip_map_single (Object *ob, int *flip_map_len, int use_default, int defgroup) |
int | defgroup_flip_index (Object *ob, int index, int use_default) |
static int | defgroup_find_name_dupe (const char *name, bDeformGroup *dg, Object *ob) |
static int | defgroup_unique_check (void *arg, const char *name) |
void | defgroup_unique_name (bDeformGroup *dg, Object *ob) |
void | flip_side_name (char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_NAME], int strip_number) |
float | defvert_find_weight (const struct MDeformVert *dvert, const int defgroup) |
float | defvert_array_find_weight_safe (const struct MDeformVert *dvert, const int index, const int defgroup) |
MDeformWeight * | defvert_find_index (const MDeformVert *dvert, const int defgroup) |
MDeformWeight * | defvert_verify_index (MDeformVert *dvert, const int defgroup) |
void | defvert_add_index_notest (MDeformVert *dvert, int defgroup, const float weight) |
void | defvert_remove_group (MDeformVert *dvert, MDeformWeight *dw) |
Definition in file deform.c.
#define IS_SEPARATOR | ( | a | ) | ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_') |
Referenced by flip_side_name().
Definition at line 48 of file deform.c.
References BLI_addtail(), defgroup_duplicate(), ListBase::first, ListBase::last, bDeformGroup::next, and NULL.
Referenced by copy_object().
bDeformGroup* defgroup_duplicate | ( | bDeformGroup * | ingroup | ) | [read] |
Definition at line 60 of file deform.c.
References MEM_callocN(), bDeformGroup::next, NULL, and bDeformGroup::prev.
Referenced by defgroup_copy_list(), and vgroup_duplicate().
bDeformGroup* defgroup_find_name | ( | Object * | ob, |
const char * | name | ||
) | [read] |
Definition at line 264 of file deform.c.
References Object::defbase, ListBase::first, bDeformGroup::name, bDeformGroup::next, and NULL.
Referenced by add_verts_to_dgroups(), dgroup_skinnable_cb(), do_versions(), ED_armature_bone_rename(), join_mesh_exec(), output_toggle_exec(), vgroup_add_unique_bone_cb(), and wpaint_stroke_test_start().
static int defgroup_find_name_dupe | ( | const char * | name, |
bDeformGroup * | dg, | ||
Object * | ob | ||
) | [static] |
Definition at line 387 of file deform.c.
References Object::defbase, ListBase::first, bDeformGroup::name, and bDeformGroup::next.
Referenced by defgroup_unique_check().
int defgroup_flip_index | ( | Object * | ob, |
int | index, | ||
int | use_default | ||
) |
Definition at line 371 of file deform.c.
References BLI_findlink(), Object::defbase, defgroup_name_index(), flip_side_name(), and bDeformGroup::name.
Referenced by editvert_mirror_update().
int* defgroup_flip_map | ( | Object * | ob, |
int * | flip_map_len, | ||
int | use_default | ||
) |
Definition at line 300 of file deform.c.
References BLI_countlist(), Object::defbase, defgroup_name_index(), FALSE, ListBase::first, flip_side_name(), i, MEM_mallocN(), bDeformGroup::name, bDeformGroup::next, and NULL.
Referenced by doMirrorOnAxis(), ED_vgroup_mirror(), and editvert_mirror_update().
int* defgroup_flip_map_single | ( | Object * | ob, |
int * | flip_map_len, | ||
int | use_default, | ||
int | defgroup | ||
) |
Definition at line 338 of file deform.c.
References BLI_countlist(), BLI_findlink(), Object::defbase, defgroup_name_index(), FALSE, flip_side_name(), i, MEM_mallocN(), bDeformGroup::name, and NULL.
Referenced by ED_vgroup_mirror().
int defgroup_name_index | ( | Object * | ob, |
const char * | name | ||
) |
Definition at line 279 of file deform.c.
References Object::defbase, ListBase::first, bDeformGroup::name, and bDeformGroup::next.
Referenced by applyModifier(), armature_deform_verts(), calc_latt_deform(), contarget_get_lattice_mat(), contarget_get_mesh_mat(), curve_deform_verts(), defgroup_flip_index(), defgroup_flip_map(), defgroup_flip_map_single(), dynamicPaint_Modifier_apply(), dynamicPaint_outputLayerExists(), ED_vgroup_select_by_name(), get_weights_array(), lattice_deform_verts(), mesh_to_softbody(), modifier_get_vgroup(), shrinkwrapModifier_deform(), and weightvg_do_mask().
static int defgroup_unique_check | ( | void * | arg, |
const char * | name | ||
) | [static] |
Definition at line 402 of file deform.c.
References data, and defgroup_find_name_dupe().
Referenced by defgroup_unique_name().
void defgroup_unique_name | ( | bDeformGroup * | dg, |
Object * | ob | ||
) |
Definition at line 408 of file deform.c.
References BLI_uniquename_cb(), data, defgroup_unique_check(), and bDeformGroup::name.
Referenced by do_versions(), ED_vgroup_add_name(), namebutton_cb(), and vgroup_duplicate().
void defvert_add_index_notest | ( | MDeformVert * | dvert, |
int | defgroup, | ||
const float | weight | ||
) |
Definition at line 607 of file deform.c.
References MDeformWeight::def_nr, MDeformVert::dw, MEM_callocN(), MEM_freeN(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by ED_vgroup_nr_vert_add(), and weightvg_update_vg().
float defvert_array_find_weight_safe | ( | const struct MDeformVert * | dvert, |
const int | index, | ||
const int | defgroup | ||
) |
Definition at line 548 of file deform.c.
References defvert_find_weight(), and NULL.
Referenced by shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), and SimpleDeformModifier_do().
void defvert_copy | ( | MDeformVert * | dvert_dst, |
const MDeformVert * | dvert_src | ||
) |
Definition at line 78 of file deform.c.
References MDeformVert::dw, MEM_dupallocN(), MEM_freeN(), NULL, and MDeformVert::totweight.
void defvert_copy_index | ( | MDeformVert * | dvert_dst, |
const MDeformVert * | dvert_src, | ||
const int | defgroup | ||
) |
Definition at line 101 of file deform.c.
References defvert_find_index(), defvert_verify_index(), and MDeformWeight::weight.
MDeformWeight* defvert_find_index | ( | const MDeformVert * | dvert, |
const int | defgroup | ||
) |
Definition at line 557 of file deform.c.
References MDeformWeight::def_nr, MDeformVert::dw, i, NULL, and MDeformVert::totweight.
float defvert_find_weight | ( | const struct MDeformVert * | dvert, |
const int | defgroup | ||
) |
Definition at line 536 of file deform.c.
References defvert_find_index(), and MDeformWeight::weight.
Referenced by applyModifier(), armature_deform_verts(), calc_latt_deform(), calc_weightpaint_vert_color(), RAS_MeshObject::CheckWeightCache(), createFacepa(), curve_deform_verts(), deformVerts_do(), defvert_array_find_weight_safe(), displaceModifier_do(), editvert_mirror_update(), get_weights_array(), lattice_deform_verts(), meshdeformModifier_do(), psys_cache_vgroup(), return_editmesh_vgroup(), smoothModifier_do(), sphere_do(), warpModifier_do(), waveModifier_do(), weight_sample_invoke(), and weightvg_do_mask().
void defvert_flip | ( | MDeformVert * | dvert, |
const int * | flip_map, | ||
const int | flip_map_len | ||
) |
Definition at line 249 of file deform.c.
References MDeformWeight::def_nr, MDeformVert::dw, and i.
Referenced by doMirrorOnAxis(), and dvert_mirror_op().
void defvert_normalize | ( | MDeformVert * | dvert | ) |
Definition at line 178 of file deform.c.
References CLAMP(), MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by vgroup_normalize_active(), and vgroup_normalize_all().
void defvert_normalize_lock | ( | MDeformVert * | dvert, |
const int | def_nr_lock | ||
) |
Definition at line 207 of file deform.c.
References CLAMP(), MDeformWeight::def_nr, MDeformVert::dw, i, NULL, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by vgroup_normalize_all().
void defvert_remap | ( | MDeformVert * | dvert, |
int * | map, | ||
const int | map_len | ||
) |
Definition at line 164 of file deform.c.
References BLI_assert, MDeformWeight::def_nr, MDeformVert::dw, i, and MDeformVert::totweight.
Referenced by vgroup_do_remap().
void defvert_remove_group | ( | MDeformVert * | dvert, |
MDeformWeight * | dw | ||
) |
Definition at line 630 of file deform.c.
References MDeformVert::dw, i, MEM_freeN(), MEM_mallocN(), NULL, and MDeformVert::totweight.
Referenced by BKE_mesh_validate_arrays(), ED_vgroup_nr_vert_add(), ED_vgroup_vert_remove(), vgroup_active_remove_verts(), vgroup_clean(), vgroup_clean_all(), vgroup_delete_object_mode(), vgroup_invert(), and weightvg_update_vg().
void defvert_sync | ( | MDeformVert * | dvert_dst, |
const MDeformVert * | dvert_src, | ||
int | use_verify | ||
) |
Definition at line 125 of file deform.c.
References MDeformWeight::def_nr, defvert_find_index(), defvert_verify_index(), MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
void defvert_sync_mapped | ( | MDeformVert * | dvert_dst, |
const MDeformVert * | dvert_src, | ||
const int * | flip_map, | ||
const int | flip_map_len, | ||
const int | use_verify | ||
) |
Definition at line 143 of file deform.c.
References MDeformWeight::def_nr, defvert_find_index(), defvert_verify_index(), MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
MDeformWeight* defvert_verify_index | ( | MDeformVert * | dvert, |
const int | defgroup | ||
) | [read] |
Definition at line 575 of file deform.c.
References MDeformWeight::def_nr, defvert_find_index(), MDeformVert::dw, MEM_callocN(), MEM_freeN(), NULL, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by defvert_copy_index(), defvert_sync(), defvert_sync_mapped(), do_weight_paint_vertex(), dvert_mirror_op(), dynamicPaint_Modifier_apply(), editvert_mirror_update(), enforce_locks(), vgroup_assign_verts(), vgroup_blend(), vgroup_duplicate(), vgroup_invert(), wpaint_fill(), and wpaint_stroke_update_step().
void flip_side_name | ( | char | name[MAX_VGROUP_NAME], |
const char | from_name[MAX_VGROUP_NAME], | ||
int | strip_number | ||
) |
Definition at line 420 of file deform.c.
References BLI_snprintf(), BLI_strcasestr(), BLI_strncpy(), BLI_strnlen(), IS_SEPARATOR, len(), MAX_VGROUP_NAME, and NULL.