|
Blender
V2.93
|
#include <ctype.h>#include <math.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_string.h"#include "BLI_string_utils.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_customdata.h"#include "BKE_data_transfer.h"#include "BKE_deform.h"#include "BKE_mesh.h"#include "BKE_mesh_mapping.h"#include "BKE_object.h"#include "BKE_object_deform.h"#include "BLO_read_write.h"#include "data_transfer_intern.h"Go to the source code of this file.
Functions | |
| bDeformGroup * | BKE_object_defgroup_new (Object *ob, const char *name) |
| void | BKE_defgroup_copy_list (ListBase *outbase, const ListBase *inbase) |
| bDeformGroup * | BKE_defgroup_duplicate (const bDeformGroup *ingroup) |
| void | BKE_defvert_copy_subset (MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bool *vgroup_subset, const int vgroup_tot) |
| void | BKE_defvert_mirror_subset (MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bool *vgroup_subset, const int vgroup_tot, const int *flip_map, const int flip_map_len) |
| void | BKE_defvert_copy (MDeformVert *dvert_dst, const MDeformVert *dvert_src) |
| void | BKE_defvert_copy_index (MDeformVert *dvert_dst, const int defgroup_dst, const MDeformVert *dvert_src, const int defgroup_src) |
| void | BKE_defvert_sync (MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bool use_ensure) |
| void | BKE_defvert_sync_mapped (MDeformVert *dvert_dst, const MDeformVert *dvert_src, const int *flip_map, const int flip_map_len, const bool use_ensure) |
| void | BKE_defvert_remap (MDeformVert *dvert, const int *map, const int map_len) |
| void | BKE_defvert_normalize_subset (MDeformVert *dvert, const bool *vgroup_subset, const int vgroup_tot) |
| void | BKE_defvert_normalize (MDeformVert *dvert) |
| void | BKE_defvert_normalize_lock_single (MDeformVert *dvert, const bool *vgroup_subset, const int vgroup_tot, const uint def_nr_lock) |
| void | BKE_defvert_normalize_lock_map (MDeformVert *dvert, const bool *vgroup_subset, const int vgroup_tot, const bool *lock_flags, const int defbase_tot) |
| void | BKE_defvert_flip (MDeformVert *dvert, const int *flip_map, const int flip_map_len) |
| void | BKE_defvert_flip_merged (MDeformVert *dvert, const int *flip_map, const int flip_map_len) |
| bDeformGroup * | BKE_object_defgroup_find_name (const Object *ob, const char *name) |
| int | BKE_object_defgroup_name_index (const Object *ob, const char *name) |
| int * | BKE_object_defgroup_flip_map (const Object *ob, int *flip_map_len, const bool use_default) |
| int * | BKE_object_defgroup_flip_map_single (const Object *ob, int *flip_map_len, const bool use_default, int defgroup) |
| int | BKE_object_defgroup_flip_index (const Object *ob, int index, const bool use_default) |
| static bool | defgroup_find_name_dupe (const char *name, bDeformGroup *dg, Object *ob) |
| static bool | defgroup_unique_check (void *arg, const char *name) |
| void | BKE_object_defgroup_unique_name (bDeformGroup *dg, Object *ob) |
| float | BKE_defvert_find_weight (const struct MDeformVert *dvert, const int defgroup) |
| float | BKE_defvert_array_find_weight_safe (const struct MDeformVert *dvert, const int index, const int defgroup) |
| MDeformWeight * | BKE_defvert_find_index (const MDeformVert *dvert, const int defgroup) |
| MDeformWeight * | BKE_defvert_ensure_index (MDeformVert *dvert, const int defgroup) |
| void | BKE_defvert_add_index_notest (MDeformVert *dvert, int defgroup, const float weight) |
| void | BKE_defvert_remove_group (MDeformVert *dvert, MDeformWeight *dw) |
| void | BKE_defvert_clear (MDeformVert *dvert) |
| int | BKE_defvert_find_shared (const MDeformVert *dvert_a, const MDeformVert *dvert_b) |
| bool | BKE_defvert_is_weight_zero (const struct MDeformVert *dvert, const int defgroup_tot) |
| float | BKE_defvert_total_selected_weight (const struct MDeformVert *dv, int defbase_tot, const bool *defbase_sel) |
| float | BKE_defvert_multipaint_collective_weight (const struct MDeformVert *dv, int defbase_tot, const bool *defbase_sel, int defbase_tot_sel, bool is_normalized) |
| float | BKE_defvert_calc_lock_relative_weight (float weight, float locked_weight, float unlocked_weight) |
| float | BKE_defvert_lock_relative_weight (float weight, const struct MDeformVert *dv, int defbase_tot, const bool *defbase_locked, const bool *defbase_unlocked) |
Defvert Array functions | |
| void | BKE_defvert_array_copy (MDeformVert *dst, const MDeformVert *src, int totvert) |
| void | BKE_defvert_array_free_elems (MDeformVert *dvert, int totvert) |
| void | BKE_defvert_array_free (MDeformVert *dvert, int totvert) |
| void | BKE_defvert_extract_vgroup_to_vertweights (MDeformVert *dvert, const int defgroup, const int num_verts, float *r_weights, const bool invert_vgroup) |
| void | BKE_defvert_extract_vgroup_to_edgeweights (MDeformVert *dvert, const int defgroup, const int num_verts, MEdge *edges, const int num_edges, float *r_weights, const bool invert_vgroup) |
| void | BKE_defvert_extract_vgroup_to_loopweights (MDeformVert *dvert, const int defgroup, const int num_verts, MLoop *loops, const int num_loops, float *r_weights, const bool invert_vgroup) |
| void | BKE_defvert_extract_vgroup_to_polyweights (MDeformVert *dvert, const int defgroup, const int num_verts, MLoop *loops, const int UNUSED(num_loops), MPoly *polys, const int num_polys, float *r_weights, const bool invert_vgroup) |
Data Transfer | |
| static void | vgroups_datatransfer_interp (const CustomDataTransferLayerMap *laymap, void *dest, const void **sources, const float *weights, const int count, const float mix_factor) |
| static bool | data_transfer_layersmapping_vgroups_multisrc_to_dst (ListBase *r_map, const int mix_mode, const float mix_factor, const float *mix_weights, const int num_elem_dst, const bool use_create, const bool use_delete, Object *ob_src, Object *ob_dst, MDeformVert *data_src, MDeformVert *data_dst, CustomData *UNUSED(cd_src), CustomData *cd_dst, const bool UNUSED(use_dupref_dst), const int tolayers, const bool *use_layers_src, const int num_layers_src) |
| bool | data_transfer_layersmapping_vgroups (ListBase *r_map, const int mix_mode, const float mix_factor, const float *mix_weights, const int num_elem_dst, const bool use_create, const bool use_delete, Object *ob_src, Object *ob_dst, CustomData *cd_src, CustomData *cd_dst, const bool use_dupref_dst, const int fromlayers, const int tolayers) |
Various utils & helpers. | |
| void | BKE_defvert_weight_to_rgb (float r_rgb[3], const float weight) |
.blend file I/O | |
| void | BKE_defvert_blend_write (BlendWriter *writer, int count, MDeformVert *dvlist) |
| void | BKE_defvert_blend_read (BlendDataReader *reader, int count, MDeformVert *mdverts) |
Definition at line 75 of file deform.c.
References BKE_defgroup_duplicate(), BLI_addtail(), BLI_listbase_clear(), ListBase::first, and bDeformGroup::next.
| bDeformGroup* BKE_defgroup_duplicate | ( | const bDeformGroup * | ingroup | ) |
Definition at line 87 of file deform.c.
References BLI_assert, MEM_callocN, bDeformGroup::next, NULL, and bDeformGroup::prev.
Referenced by BKE_defgroup_copy_list().
| void BKE_defvert_add_index_notest | ( | MDeformVert * | dvert, |
| int | defgroup, | ||
| const float | weight | ||
| ) |
Adds the given vertex to the specified vertex group, with given weight.
Definition at line 726 of file deform.c.
References BLI_assert, MDeformWeight::def_nr, MDeformVert::dw, MEM_callocN, MEM_freeN, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by ED_vgroup_nr_vert_add(), gpencil_vertex_group_invert_exec(), subdivide_base(), vgroups_datatransfer_interp(), and weightvg_update_vg().
| void BKE_defvert_array_copy | ( | MDeformVert * | dst, |
| const MDeformVert * | src, | ||
| int | totvert | ||
| ) |
Definition at line 941 of file deform.c.
References MDeformVert::dw, and MEM_mallocN.
| float BKE_defvert_array_find_weight_safe | ( | const struct MDeformVert * | dvert, |
| const int | index, | ||
| const int | defgroup | ||
| ) |
Take care with this the rationale is:
This is a bit confusing, just saves some checks from the caller.
Definition at line 645 of file deform.c.
References BKE_defvert_find_weight(), and NULL.
Referenced by modifyMesh(), shrinkwrap_calc_nearest_surface_point_cb_ex(), shrinkwrap_calc_nearest_vertex_cb_ex(), shrinkwrap_calc_normal_projection_cb_ex(), and SimpleDeformModifier_do().
| void BKE_defvert_array_free | ( | MDeformVert * | dvert, |
| int | totvert | ||
| ) |
Definition at line 977 of file deform.c.
References BKE_defvert_array_free_elems(), and MEM_freeN.
Referenced by BKE_editlattice_free(), BKE_editlattice_load(), BKE_lattice_resize(), lattice_free_data(), and wpaint_prev_destroy().
| void BKE_defvert_array_free_elems | ( | MDeformVert * | dvert, |
| int | totvert | ||
| ) |
Definition at line 959 of file deform.c.
References MEM_freeN.
Referenced by BKE_defvert_array_free(), BKE_sculptsession_free_vwpaint_data(), paint_weight_gradient_modal(), and vertex_paint_init_session_data().
| void BKE_defvert_blend_read | ( | BlendDataReader * | reader, |
| int | count, | ||
| MDeformVert * | mdverts | ||
| ) |
Definition at line 1542 of file deform.c.
References BLO_read_get_new_data_address(), count, MDeformVert::dw, MEM_freeN, MEM_mallocN, NULL, and MDeformVert::totweight.
Referenced by BKE_gpencil_blend_read_data(), lattice_blend_read_data(), and mesh_blend_read_data().
| void BKE_defvert_blend_write | ( | BlendWriter * | writer, |
| int | count, | ||
| MDeformVert * | dvlist | ||
| ) |
Definition at line 1525 of file deform.c.
References BLO_write_struct_array, count, and NULL.
Referenced by CustomData_blend_write(), greasepencil_blend_write(), and lattice_blend_write().
| float BKE_defvert_calc_lock_relative_weight | ( | float | weight, |
| float | locked_weight, | ||
| float | unlocked_weight | ||
| ) |
Computes the display weight for the lock relative weight paint mode.
Definition at line 887 of file deform.c.
References VERTEX_WEIGHT_LOCK_EPSILON.
Referenced by BKE_defvert_lock_relative_weight(), do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
| void BKE_defvert_clear | ( | MDeformVert * | dvert | ) |
Definition at line 785 of file deform.c.
References MDeformVert::dw, MEM_freeN, NULL, and MDeformVert::totweight.
Referenced by bpy_bmdeformvert_clear().
| void BKE_defvert_copy | ( | MDeformVert * | dvert_dst, |
| const MDeformVert * | dvert_src | ||
| ) |
Definition at line 144 of file deform.c.
References MDeformVert::dw, MEM_dupallocN, MEM_freeN, NULL, and MDeformVert::totweight.
| void BKE_defvert_copy_index | ( | MDeformVert * | dvert_dst, |
| const int | defgroup_dst, | ||
| const MDeformVert * | dvert_src, | ||
| const int | defgroup_src | ||
| ) |
Copy an index from one dvert to another.
Definition at line 172 of file deform.c.
References BKE_defvert_ensure_index(), BKE_defvert_find_index(), and MDeformWeight::weight.
Referenced by BKE_defvert_copy_subset(), and BKE_defvert_mirror_subset().
| void BKE_defvert_copy_subset | ( | MDeformVert * | dvert_dst, |
| const MDeformVert * | dvert_src, | ||
| const bool * | vgroup_subset, | ||
| const int | vgroup_tot | ||
| ) |
Overwrite weights filtered by vgroup_subset.
Definition at line 111 of file deform.c.
References BKE_defvert_copy_index().
| MDeformWeight* BKE_defvert_ensure_index | ( | MDeformVert * | dvert, |
| const int | defgroup | ||
| ) |
Ensures that mv has a deform weight entry for the specified defweight group.
Definition at line 688 of file deform.c.
References BKE_defvert_find_index(), BLI_assert, MDeformWeight::def_nr, MDeformVert::dw, MEM_freeN, MEM_mallocN, NULL, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by BKE_defvert_copy_index(), BKE_defvert_flip_merged(), BKE_defvert_sync(), BKE_defvert_sync_mapped(), BKE_gpencil_stroke_close(), bpy_bmdeformvert_ass_subscript(), brush_draw_apply(), do_weight_paint_vertex_single(), dvert_mirror_op(), dynamicPaint_Modifier_apply(), ED_gpencil_vgroup_assign(), ED_vgroup_parray_from_weight_array(), gpencil_add_verts_to_dgroups(), gpencil_primitive_interaction_end(), gpencil_stroke_from_buffer(), gpencil_stroke_newfrombuffer(), gpencil_vertex_group_smooth_exec(), gradientVert_update(), lineart_gpencil_generate(), mesh_defvert_mirror_update_internal(), MOD_solidify_extrude_modifyMesh(), blender::bke::VertexWeightWriteAttribute::set_internal(), vgroup_assign_verts(), vgroup_duplicate(), vgroup_invert_subset(), and weight_paint_set().
| void BKE_defvert_extract_vgroup_to_edgeweights | ( | MDeformVert * | dvert, |
| const int | defgroup, | ||
| const int | num_verts, | ||
| MEdge * | edges, | ||
| const int | num_edges, | ||
| float * | r_weights, | ||
| const bool | invert_vgroup | ||
| ) |
The following three make basic interpolation, using temp vert_weights array to avoid looking up same weight several times.
Definition at line 1015 of file deform.c.
References BKE_defvert_extract_vgroup_to_vertweights(), copy_vn_fl(), MEM_freeN, MEM_mallocN, MEdge::v1, and MEdge::v2.
Referenced by BKE_object_data_transfer_ex().
| void BKE_defvert_extract_vgroup_to_loopweights | ( | MDeformVert * | dvert, |
| const int | defgroup, | ||
| const int | num_verts, | ||
| MLoop * | loops, | ||
| const int | num_loops, | ||
| float * | r_weights, | ||
| const bool | invert_vgroup | ||
| ) |
Definition at line 1043 of file deform.c.
References BKE_defvert_extract_vgroup_to_vertweights(), copy_vn_fl(), MEM_freeN, MEM_mallocN, and MLoop::v.
Referenced by BKE_object_data_transfer_ex(), and mix_normals().
| void BKE_defvert_extract_vgroup_to_polyweights | ( | MDeformVert * | dvert, |
| const int | defgroup, | ||
| const int | num_verts, | ||
| MLoop * | loops, | ||
| const int | UNUSEDnum_loops, | ||
| MPoly * | polys, | ||
| const int | num_polys, | ||
| float * | r_weights, | ||
| const bool | invert_vgroup | ||
| ) |
Definition at line 1071 of file deform.c.
References BKE_defvert_extract_vgroup_to_vertweights(), copy_vn_fl(), float(), MPoly::loopstart, MEM_freeN, MEM_mallocN, MPoly::totloop, MLoop::v, and w().
| void BKE_defvert_extract_vgroup_to_vertweights | ( | MDeformVert * | dvert, |
| const int | defgroup, | ||
| const int | num_verts, | ||
| float * | r_weights, | ||
| const bool | invert_vgroup | ||
| ) |
Definition at line 992 of file deform.c.
References BKE_defvert_find_weight(), copy_vn_fl(), and w().
Referenced by BKE_defvert_extract_vgroup_to_edgeweights(), BKE_defvert_extract_vgroup_to_loopweights(), BKE_defvert_extract_vgroup_to_polyweights(), and BKE_object_data_transfer_ex().
| MDeformWeight* BKE_defvert_find_index | ( | const MDeformVert * | dvert, |
| const int | defgroup | ||
| ) |
Definition at line 664 of file deform.c.
References BLI_assert, MDeformWeight::def_nr, MDeformVert::dw, NULL, and MDeformVert::totweight.
Referenced by BKE_defvert_copy_index(), BKE_defvert_ensure_index(), BKE_defvert_find_weight(), BKE_defvert_sync(), BKE_defvert_sync_mapped(), and vgroups_datatransfer_interp().
| int BKE_defvert_find_shared | ( | const MDeformVert * | dvert_a, |
| const MDeformVert * | dvert_b | ||
| ) |
Definition at line 799 of file deform.c.
References BKE_defvert_find_weight(), MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
| float BKE_defvert_find_weight | ( | const struct MDeformVert * | dvert, |
| const int | defgroup | ||
| ) |
Definition at line 632 of file deform.c.
References BKE_defvert_find_index(), and MDeformWeight::weight.
Referenced by armature_vert_task_with_dvert(), bevel_vert_construct(), BKE_defvert_array_find_weight_safe(), BKE_defvert_extract_vgroup_to_vertweights(), BKE_defvert_find_shared(), BKE_lattice_deform_data_create(), BM_mesh_wireframe(), compute_vertex_mask__vertex_group_mode(), createFacepa(), cuboid_do(), deformVert(), displaceModifier_do_task(), do_weight_paint_vertex_single(), ED_vgroup_parray_to_weight_array(), edbm_decimate_exec(), evaluate_vertex_weight(), get_weights_array(), gpencil_point_edit_weight(), gpencil_vertex_group_smooth_exec(), hook_co_apply(), initSystem(), isSystemDifferent(), laplaciansmoothModifier_do(), lattice_batch_cache_get_pos(), lattice_deform_vert_with_dvert(), lattice_to_softbody(), mesh_defvert_mirror_update_internal(), mesh_get_weights(), mesh_to_softbody(), meshdeform_vert_task(), MOD_solidify_extrude_modifyMesh(), modifyMesh(), psys_cache_vgroup(), return_editmesh_vgroup(), smoothModifier_do(), sphere_do(), stroke_interpolate_deform_weights(), uv_warp_compute(), vertex_paint_from_weight(), vgroup_copy_active_to_sel_single(), warpModifier_do(), waveModifier_do(), weight_sample_invoke(), weightvg_do_mask(), weldModifier_doWeld(), and wpaint_get_active_weight().
| void BKE_defvert_flip | ( | MDeformVert * | dvert, |
| const int * | flip_map, | ||
| const int | flip_map_len | ||
| ) |
Definition at line 448 of file deform.c.
References MDeformWeight::def_nr, and MDeformVert::dw.
Referenced by BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), and dvert_mirror_op().
| void BKE_defvert_flip_merged | ( | MDeformVert * | dvert, |
| const int * | flip_map, | ||
| const int | flip_map_len | ||
| ) |
Definition at line 462 of file deform.c.
References BKE_defvert_ensure_index(), MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by BKE_mesh_mirror_apply_mirror_on_axis_for_modifier().
| bool BKE_defvert_is_weight_zero | ( | const struct MDeformVert * | dvert, |
| const int | defgroup_tot | ||
| ) |
return true if has no weights
Definition at line 818 of file deform.c.
References MDeformWeight::def_nr, MDeformVert::dw, LIKELY, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by evaluate_vertex_weight().
| float BKE_defvert_lock_relative_weight | ( | float | weight, |
| const struct MDeformVert * | dv, | ||
| int | defbase_tot, | ||
| const bool * | defbase_locked, | ||
| const bool * | defbase_unlocked | ||
| ) |
Computes the display weight for the lock relative weight paint mode, using weight data.
Definition at line 920 of file deform.c.
References BKE_defvert_calc_lock_relative_weight(), and BKE_defvert_total_selected_weight().
Referenced by do_weight_paint_vertex_multi(), do_weight_paint_vertex_single(), evaluate_vertex_weight(), weight_sample_invoke(), and wpaint_get_active_weight().
| void BKE_defvert_mirror_subset | ( | MDeformVert * | dvert_dst, |
| const MDeformVert * | dvert_src, | ||
| const bool * | vgroup_subset, | ||
| const int | vgroup_tot, | ||
| const int * | flip_map, | ||
| const int | flip_map_len | ||
| ) |
Overwrite weights filtered by vgroup_subset and with mirroring specified by the flip map
Definition at line 129 of file deform.c.
References BKE_defvert_copy_index().
| float BKE_defvert_multipaint_collective_weight | ( | const struct MDeformVert * | dv, |
| int | defbase_tot, | ||
| const bool * | defbase_sel, | ||
| int | defbase_tot_sel, | ||
| bool | is_normalized | ||
| ) |
Result equal to sum of weights with auto normalize, and average otherwise. Value is not clamped, since painting relies on multiplication being always commutative with the collective weight function.
Definition at line 865 of file deform.c.
References BKE_defvert_total_selected_weight().
Referenced by do_weight_paint_vertex_multi(), evaluate_vertex_weight(), weight_sample_invoke(), and wpaint_get_active_weight().
| void BKE_defvert_normalize | ( | MDeformVert * | dvert | ) |
Definition at line 304 of file deform.c.
References CLAMP, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
| void BKE_defvert_normalize_lock_map | ( | MDeformVert * | dvert, |
| const bool * | vgroup_subset, | ||
| const int | vgroup_tot, | ||
| const bool * | lock_flags, | ||
| const int | defbase_tot | ||
| ) |
Same as BKE_defvert_normalize() if no locked vgroup is a member of the subset
Definition at line 393 of file deform.c.
References CLAMP, MDeformWeight::def_nr, MDeformVert::dw, max_ff(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by vgroup_normalize_all().
| void BKE_defvert_normalize_lock_single | ( | MDeformVert * | dvert, |
| const bool * | vgroup_subset, | ||
| const int | vgroup_tot, | ||
| const uint | def_nr_lock | ||
| ) |
Same as BKE_defvert_normalize() if the locked vgroup is not a member of the subset
Definition at line 336 of file deform.c.
References CLAMP, MDeformWeight::def_nr, MDeformVert::dw, NULL, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by paint_weight_gradient_exec(), and vgroup_normalize_all().
| void BKE_defvert_normalize_subset | ( | MDeformVert * | dvert, |
| const bool * | vgroup_subset, | ||
| const int | vgroup_tot | ||
| ) |
Same as BKE_defvert_normalize but takes a bool array.
Definition at line 267 of file deform.c.
References CLAMP, MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by vgroup_normalize_active_vertex(), and vgroup_normalize_all().
| void BKE_defvert_remap | ( | MDeformVert * | dvert, |
| const int * | map, | ||
| const int | map_len | ||
| ) |
be sure all flip_map values are valid
Definition at line 252 of file deform.c.
References BLI_assert, MDeformWeight::def_nr, MDeformVert::dw, and MDeformVert::totweight.
Referenced by vgroup_do_remap().
| void BKE_defvert_remove_group | ( | MDeformVert * | dvert, |
| MDeformWeight * | dw | ||
| ) |
Removes the given vertex from the vertex group.
Definition at line 754 of file deform.c.
References BLI_assert, MDeformVert::dw, MEM_freeN, MEM_reallocN, NULL, and MDeformVert::totweight.
Referenced by BKE_gpencil_vgroup_remove(), BKE_mesh_validate_arrays(), BKE_object_defgroup_clear(), bpy_bmdeformvert_ass_subscript(), dvert_mirror_op(), ED_gpencil_vgroup_remove(), ED_vgroup_data_clamp_range(), ED_vgroup_nr_vert_add(), ED_vgroup_parray_from_weight_array(), ED_vgroup_parray_remove_zero(), ED_vgroup_vert_remove(), gpencil_vertex_group_invert_exec(), gradientVert_update(), object_defgroup_remove_object_mode(), blender::bke::VertexGroupsAttributeProvider::try_delete(), vgroup_remove_weight(), and weightvg_update_vg().
| void BKE_defvert_sync | ( | MDeformVert * | dvert_dst, |
| const MDeformVert * | dvert_src, | ||
| const bool | use_ensure | ||
| ) |
Only sync over matching weights, don't add or remove groups warning, loop within loop.
Definition at line 200 of file deform.c.
References BKE_defvert_ensure_index(), BKE_defvert_find_index(), MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
| void BKE_defvert_sync_mapped | ( | MDeformVert * | dvert_dst, |
| const MDeformVert * | dvert_src, | ||
| const int * | flip_map, | ||
| const int | flip_map_len, | ||
| const bool | use_ensure | ||
| ) |
be sure all flip_map values are valid
Definition at line 223 of file deform.c.
References BKE_defvert_ensure_index(), BKE_defvert_find_index(), MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
| float BKE_defvert_total_selected_weight | ( | const struct MDeformVert * | dv, |
| int | defbase_tot, | ||
| const bool * | defbase_sel | ||
| ) |
Definition at line 835 of file deform.c.
References MDeformWeight::def_nr, MDeformVert::dw, NULL, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by BKE_defvert_lock_relative_weight(), BKE_defvert_multipaint_collective_weight(), do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
Definition at line 1486 of file deform.c.
References blend().
Referenced by psys_cache_edit_paths_iter().
| bDeformGroup* BKE_object_defgroup_find_name | ( | const Object * | ob, |
| const char * | name | ||
| ) |
Definition at line 487 of file deform.c.
References BLI_findstring(), Object::defbase, and NULL.
| int BKE_object_defgroup_flip_index | ( | const Object * | ob, |
| int | index, | ||
| const bool | use_default | ||
| ) |
Definition at line 579 of file deform.c.
References BKE_object_defgroup_name_index(), BLI_findlink(), BLI_string_flip_side_name(), Object::defbase, bDeformGroup::name, and STREQ.
| int* BKE_object_defgroup_flip_map | ( | const Object * | ob, |
| int * | flip_map_len, | ||
| const bool | use_default | ||
| ) |
Definition at line 504 of file deform.c.
References BKE_object_defgroup_name_index(), BLI_listbase_count(), BLI_string_flip_side_name(), Object::defbase, ListBase::first, MEM_mallocN, bDeformGroup::name, bDeformGroup::next, NULL, and STREQ.
| int* BKE_object_defgroup_flip_map_single | ( | const Object * | ob, |
| int * | flip_map_len, | ||
| const bool | use_default, | ||
| int | defgroup | ||
| ) |
Definition at line 545 of file deform.c.
References BKE_object_defgroup_name_index(), BLI_findlink(), BLI_listbase_count(), BLI_string_flip_side_name(), Object::defbase, MEM_mallocN, bDeformGroup::name, NULL, and STREQ.
| int BKE_object_defgroup_name_index | ( | const Object * | ob, |
| const char * | name | ||
| ) |
Definition at line 494 of file deform.c.
References BLI_findstringindex(), and Object::defbase.
Referenced by BKE_object_defgroup_flip_index(), BKE_object_defgroup_flip_map(), BKE_object_defgroup_flip_map_single(), data_transfer_layersmapping_vgroups(), and data_transfer_layersmapping_vgroups_multisrc_to_dst().
| bDeformGroup* BKE_object_defgroup_new | ( | Object * | ob, |
| const char * | name | ||
| ) |
Definition at line 57 of file deform.c.
References BKE_object_batch_cache_dirty_tag(), BKE_object_defgroup_unique_name(), BLI_addtail(), BLI_assert, BLI_strncpy(), Object::defbase, MEM_callocN, bDeformGroup::name, OB_TYPE_SUPPORT_VGROUP, and Object::type.
Referenced by BKE_object_defgroup_add_name(), and ED_wpaint_mirror_vgroup_ensure().
| void BKE_object_defgroup_unique_name | ( | bDeformGroup * | dg, |
| Object * | ob | ||
| ) |
Definition at line 620 of file deform.c.
References BLI_uniquename_cb(), data, DATA_, defgroup_unique_check(), and bDeformGroup::name.
Referenced by BKE_object_defgroup_new(), blo_do_versions_pre250(), ED_gpencil_join_objects_exec(), namebutton_fn(), and vgroup_duplicate().
| bool data_transfer_layersmapping_vgroups | ( | ListBase * | r_map, |
| const int | mix_mode, | ||
| const float | mix_factor, | ||
| const float * | mix_weights, | ||
| const int | num_elem_dst, | ||
| const bool | use_create, | ||
| const bool | use_delete, | ||
| Object * | ob_src, | ||
| Object * | ob_dst, | ||
| CustomData * | cd_src, | ||
| CustomData * | cd_dst, | ||
| const bool | use_dupref_dst, | ||
| const int | fromlayers, | ||
| const int | tolayers | ||
| ) |
Definition at line 1308 of file deform.c.
References Object::actdef, BKE_object_defgroup_add(), BKE_object_defgroup_add_name(), BKE_object_defgroup_name_index(), BKE_object_defgroup_remove_all(), BKE_object_defgroup_subset_from_select_type(), BLI_assert, BLI_findlink(), BLI_listbase_count(), BLI_listbase_is_empty(), CD_CALLOC, CD_FAKE_MDEFORMVERT, CD_MDEFORMVERT, CustomData_add_layer(), CustomData_duplicate_referenced_layer(), CustomData_get_layer(), data_transfer_layersmapping_add_item(), data_transfer_layersmapping_vgroups_multisrc_to_dst(), Object::defbase, DT_LAYERS_ACTIVE_DST, DT_LAYERS_ACTIVE_SRC, DT_LAYERS_ALL_SRC, DT_LAYERS_INDEX_DST, DT_LAYERS_NAME_DST, DT_LAYERS_VGROUP_SRC_BONE_DEFORM, DT_LAYERS_VGROUP_SRC_BONE_SELECT, MEM_SAFE_FREE, bDeformGroup::name, NULL, ret, vgroups_datatransfer_interp(), WT_VGROUP_ALL, WT_VGROUP_BONE_DEFORM, and WT_VGROUP_BONE_SELECT.
Referenced by data_transfer_layersmapping_generate().
|
static |
Definition at line 1163 of file deform.c.
References Object::actdef, BKE_object_defgroup_add(), BKE_object_defgroup_add_name(), BKE_object_defgroup_name_index(), BKE_object_defgroup_remove(), BLI_listbase_count(), CD_CALLOC, CD_FAKE_MDEFORMVERT, CD_MDEFORMVERT, CustomData_add_layer(), data_transfer_layersmapping_add_item(), Object::defbase, DT_LAYERS_INDEX_DST, DT_LAYERS_NAME_DST, ListBase::first, ListBase::last, bDeformGroup::name, bDeformGroup::next, NULL, and vgroups_datatransfer_interp().
Referenced by data_transfer_layersmapping_vgroups().
|
static |
Definition at line 596 of file deform.c.
References Object::defbase, ListBase::first, bDeformGroup::name, bDeformGroup::next, and STREQ.
Referenced by defgroup_unique_check().
|
static |
Definition at line 611 of file deform.c.
References data, and defgroup_find_name_dupe().
Referenced by BKE_object_defgroup_unique_name().
|
static |
Definition at line 1113 of file deform.c.
References BKE_defvert_add_index_notest(), BKE_defvert_find_index(), CDT_MIX_REPLACE_ABOVE_THRESHOLD, CLAMP, count, CustomDataTransferLayerMap::data_dst_n, CustomDataTransferLayerMap::data_src_n, data_transfer_interp_float_do(), CustomDataTransferLayerMap::mix_mode, and MDeformWeight::weight.
Referenced by data_transfer_layersmapping_vgroups(), and data_transfer_layersmapping_vgroups_multisrc_to_dst().