Blender  V2.59
Defines | Functions | Variables
object_vgroup.c File Reference
#include <string.h>
#include <stddef.h>
#include <math.h>
#include <assert.h>
#include "MEM_guardedalloc.h"
#include "DNA_cloth_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_scene_types.h"
#include "DNA_particle_types.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_report.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_mesh.h"
#include "UI_resources.h"
#include "object_intern.h"

Go to the source code of this file.

Defines

#define VGROUP_MIRR_OP   dvert_mirror_op(dvert, dvert_mirr, sel, sel_mirr, flip_map, mirror_weights, flip_vgroups)

Functions

static void vgroup_remap_update_users (Object *ob, int *map)
static void vgroup_delete_edit_mode (Object *ob, bDeformGroup *defgroup)
static void vgroup_delete_object_mode (Object *ob, bDeformGroup *dg)
static void vgroup_delete_all (Object *ob)
static Latticevgroup_edit_lattice (Object *ob)
int ED_vgroup_object_is_edit_mode (Object *ob)
bDeformGroupED_vgroup_add_name (Object *ob, const char *name)
bDeformGroupED_vgroup_add (Object *ob)
void ED_vgroup_delete (Object *ob, bDeformGroup *defgroup)
int ED_vgroup_data_create (ID *id)
static int ED_vgroup_give_parray (ID *id, MDeformVert ***dvert_arr, int *dvert_tot)
int ED_vgroup_give_array (ID *id, MDeformVert **dvert_arr, int *dvert_tot)
int ED_vgroup_copy_array (Object *ob, Object *ob_from)
static void ED_vgroup_nr_vert_remove (Object *ob, int def_nr, int vertnum)
static void ED_vgroup_nr_vert_add (Object *ob, int def_nr, int vertnum, float weight, int assignmode)
void ED_vgroup_vert_add (Object *ob, bDeformGroup *dg, int vertnum, float weight, int assignmode)
void ED_vgroup_vert_remove (Object *ob, bDeformGroup *dg, int vertnum)
static float get_vert_def_nr (Object *ob, int def_nr, int vertnum)
float ED_vgroup_vert_weight (Object *ob, bDeformGroup *dg, int vertnum)
void ED_vgroup_select_by_name (Object *ob, const char *name)
static void vgroup_select_verts (Object *ob, int select)
static void vgroup_duplicate (Object *ob)
static void vgroup_normalize (Object *ob)
static void vgroup_levels (Object *ob, float offset, float gain)
static void vgroup_normalize_all (Object *ob, int lock_active)
static void vgroup_invert (Object *ob, int auto_assign, int auto_remove)
static void vgroup_blend (Object *ob)
static void vgroup_clean (Object *ob, float eul, int keep_single)
static void vgroup_clean_all (Object *ob, float eul, int keep_single)
static void dvert_mirror_op (MDeformVert *dvert, MDeformVert *dvert_mirr, const char sel, const char sel_mirr, const int *flip_map, const short mirror_weights, const short flip_vgroups)
void ED_vgroup_mirror (Object *ob, const short mirror_weights, const short flip_vgroups)
static void vgroup_delete_update_users (Object *ob, int id)
static void vgroup_active_remove_verts (Object *ob, const int allverts, bDeformGroup *dg)
static int vgroup_object_in_edit_mode (Object *ob)
static void vgroup_delete (Object *ob)
static void vgroup_assign_verts (Object *ob, float weight)
static void vgroup_remove_verts (Object *ob, int allverts)
static int vertex_group_poll (bContext *C)
static int vertex_group_poll_edit (bContext *C)
static int vertex_group_add_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_add (wmOperatorType *ot)
static int vertex_group_remove_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_remove (wmOperatorType *ot)
static int vertex_group_assign_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_assign (wmOperatorType *ot)
static int vertex_group_remove_from_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_remove_from (wmOperatorType *ot)
static int vertex_group_select_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_select (wmOperatorType *ot)
static int vertex_group_deselect_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_deselect (wmOperatorType *ot)
static int vertex_group_copy_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_copy (wmOperatorType *ot)
static int vertex_group_levels_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_levels (wmOperatorType *ot)
static int vertex_group_normalize_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_normalize (wmOperatorType *ot)
static int vertex_group_normalize_all_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_normalize_all (wmOperatorType *ot)
static int vertex_group_invert_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_invert (wmOperatorType *ot)
static int vertex_group_blend_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_blend (wmOperatorType *ot)
static int vertex_group_clean_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_clean (wmOperatorType *ot)
static int vertex_group_mirror_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_mirror (wmOperatorType *ot)
static int vertex_group_copy_to_linked_exec (bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_copy_to_linked (wmOperatorType *ot)
static int vertex_group_copy_to_selected_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_copy_to_selected (wmOperatorType *ot)
static int set_active_group_exec (bContext *C, wmOperator *op)
static EnumPropertyItemvgroup_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
void OBJECT_OT_vertex_group_set_active (wmOperatorType *ot)
static char * vgroup_init_remap (Object *ob)
static int vgroup_do_remap (Object *ob, char *name_array, wmOperator *op)
static int vgroup_sort (void *def_a_ptr, void *def_b_ptr)
static int vertex_group_sort_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_sort (wmOperatorType *ot)
static int vgroup_move_exec (bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_move (wmOperatorType *ot)

Variables

static EnumPropertyItem vgroup_items []

Detailed Description

Definition in file object_vgroup.c.


Define Documentation

#define VGROUP_MIRR_OP   dvert_mirror_op(dvert, dvert_mirr, sel, sel_mirr, flip_map, mirror_weights, flip_vgroups)

Referenced by ED_vgroup_mirror().


Function Documentation

static void dvert_mirror_op ( MDeformVert dvert,
MDeformVert dvert_mirr,
const char  sel,
const char  sel_mirr,
const int *  flip_map,
const short  mirror_weights,
const short  flip_vgroups 
) [static]

Definition at line 1036 of file object_vgroup.c.

References BLI_assert, defvert_copy(), defvert_flip(), and SWAP.

bDeformGroup* ED_vgroup_add ( Object ob) [read]
bDeformGroup* ED_vgroup_add_name ( Object ob,
const char *  name 
) [read]
int ED_vgroup_copy_array ( Object ob,
Object ob_from 
)
int ED_vgroup_data_create ( ID id)
void ED_vgroup_delete ( Object ob,
bDeformGroup defgroup 
)
int ED_vgroup_give_array ( ID id,
MDeformVert **  dvert_arr,
int *  dvert_tot 
)
static int ED_vgroup_give_parray ( ID id,
MDeformVert ***  dvert_arr,
int *  dvert_tot 
) [static]
void ED_vgroup_mirror ( Object ob,
const short  mirror_weights,
const short  flip_vgroups 
)
static void ED_vgroup_nr_vert_add ( Object ob,
int  def_nr,
int  vertnum,
float  weight,
int  assignmode 
) [static]
static void ED_vgroup_nr_vert_remove ( Object ob,
int  def_nr,
int  vertnum 
) [static]
int ED_vgroup_object_is_edit_mode ( Object ob)

Definition at line 89 of file object_vgroup.c.

References Object::data, NULL, OB_LATTICE, OB_MESH, and Object::type.

Referenced by ED_vgroup_delete().

void ED_vgroup_select_by_name ( Object ob,
const char *  name 
)
void ED_vgroup_vert_add ( Object ob,
bDeformGroup dg,
int  vertnum,
float  weight,
int  assignmode 
)
void ED_vgroup_vert_remove ( Object ob,
bDeformGroup dg,
int  vertnum 
)
float ED_vgroup_vert_weight ( Object ob,
bDeformGroup dg,
int  vertnum 
)

Definition at line 575 of file object_vgroup.c.

References defgroup_find_index(), and get_vert_def_nr().

Referenced by heat_bone_weighting().

static float get_vert_def_nr ( Object ob,
int  def_nr,
int  vertnum 
) [static]
void OBJECT_OT_vertex_group_add ( wmOperatorType ot)
void OBJECT_OT_vertex_group_assign ( wmOperatorType ot)
void OBJECT_OT_vertex_group_blend ( wmOperatorType ot)
void OBJECT_OT_vertex_group_clean ( wmOperatorType ot)
void OBJECT_OT_vertex_group_copy ( wmOperatorType ot)
void OBJECT_OT_vertex_group_copy_to_linked ( wmOperatorType ot)
void OBJECT_OT_vertex_group_copy_to_selected ( wmOperatorType ot)
void OBJECT_OT_vertex_group_deselect ( wmOperatorType ot)
void OBJECT_OT_vertex_group_invert ( wmOperatorType ot)
void OBJECT_OT_vertex_group_levels ( wmOperatorType ot)
void OBJECT_OT_vertex_group_mirror ( wmOperatorType ot)
void OBJECT_OT_vertex_group_move ( wmOperatorType ot)
void OBJECT_OT_vertex_group_normalize ( wmOperatorType ot)
void OBJECT_OT_vertex_group_normalize_all ( wmOperatorType ot)
void OBJECT_OT_vertex_group_remove ( wmOperatorType ot)
void OBJECT_OT_vertex_group_remove_from ( wmOperatorType ot)
void OBJECT_OT_vertex_group_select ( wmOperatorType ot)
void OBJECT_OT_vertex_group_set_active ( wmOperatorType ot)
void OBJECT_OT_vertex_group_sort ( wmOperatorType ot)
static int set_active_group_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_add_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_assign_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_blend_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_clean_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_copy_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_copy_to_linked_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_copy_to_selected_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_deselect_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_invert_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_levels_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_mirror_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_normalize_all_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_normalize_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_poll ( bContext C) [static]
static int vertex_group_poll_edit ( bContext C) [static]
static int vertex_group_remove_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_remove_from_exec ( bContext C,
wmOperator op 
) [static]
static int vertex_group_select_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int vertex_group_sort_exec ( bContext C,
wmOperator op 
) [static]
static void vgroup_active_remove_verts ( Object ob,
const int  allverts,
bDeformGroup dg 
) [static]
static void vgroup_assign_verts ( Object ob,
float  weight 
) [static]
static void vgroup_blend ( Object ob) [static]
static void vgroup_clean ( Object ob,
float  eul,
int  keep_single 
) [static]
static void vgroup_clean_all ( Object ob,
float  eul,
int  keep_single 
) [static]
static void vgroup_delete ( Object ob) [static]
static void vgroup_delete_all ( Object ob) [static]
static void vgroup_delete_edit_mode ( Object ob,
bDeformGroup defgroup 
) [static]
static void vgroup_delete_object_mode ( Object ob,
bDeformGroup dg 
) [static]
static void vgroup_delete_update_users ( Object ob,
int  id 
) [static]
static int vgroup_do_remap ( Object ob,
char *  name_array,
wmOperator op 
) [static]
static void vgroup_duplicate ( Object ob) [static]
static Lattice* vgroup_edit_lattice ( Object ob) [static]
static char* vgroup_init_remap ( Object ob) [static]
static void vgroup_invert ( Object ob,
int  auto_assign,
int  auto_remove 
) [static]
static EnumPropertyItem* vgroup_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
int *  free 
) [static]
static void vgroup_levels ( Object ob,
float  offset,
float  gain 
) [static]
static int vgroup_move_exec ( bContext C,
wmOperator op 
) [static]
static void vgroup_normalize ( Object ob) [static]
static void vgroup_normalize_all ( Object ob,
int  lock_active 
) [static]
static int vgroup_object_in_edit_mode ( Object ob) [static]

Definition at line 1387 of file object_vgroup.c.

References Object::data, NULL, OB_LATTICE, OB_MESH, and Object::type.

Referenced by vertex_group_poll_edit(), and vgroup_delete().

static void vgroup_remap_update_users ( Object ob,
int *  map 
) [static]
static void vgroup_remove_verts ( Object ob,
int  allverts 
) [static]
static void vgroup_select_verts ( Object ob,
int  select 
) [static]
static int vgroup_sort ( void *  def_a_ptr,
void *  def_b_ptr 
) [static]

Definition at line 2189 of file object_vgroup.c.

References BLI_natstrcmp(), and bDeformGroup::name.

Referenced by vertex_group_sort_exec().


Variable Documentation

Initial value:
 {
        {0, NULL, 0, NULL, NULL}}

Definition at line 2046 of file object_vgroup.c.

Referenced by vgroup_itemf().