Blender  V3.3
Macros | Enumerations | Functions
gpencil_armature.c File Reference
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_armature_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_main.h"
#include "BKE_object_deform.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_gpencil.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Macros

#define DEFAULT_RATIO   0.10f
 
#define DEFAULT_DECAY   0.8f
 

Enumerations

enum  { GP_ARMATURE_NAME = 0 , GP_ARMATURE_AUTO = 1 }
 

Functions

static int gpencil_bone_looper (Object *ob, Bone *bone, void *data, int(*bone_func)(Object *, Bone *, void *))
 
static int gpencil_bone_skinnable_cb (Object *UNUSED(ob), Bone *bone, void *datap)
 
static int vgroup_add_unique_bone_cb (Object *ob, Bone *bone, void *UNUSED(ptr))
 
static int dgroup_skinnable_cb (Object *ob, Bone *bone, void *datap)
 
static float get_weight (float dist, float decay_rad, float dif_rad)
 
static void gpencil_add_verts_to_dgroups (const bContext *C, Object *ob, Object *ob_arm, const float ratio, const float decay)
 
static void gpencil_object_vgroup_calc_from_armature (const bContext *C, Object *ob, Object *ob_arm, const int mode, const float ratio, const float decay)
 
bool ED_gpencil_add_armature (const bContext *C, ReportList *reports, Object *ob, Object *ob_arm)
 
bool ED_gpencil_add_armature_weights (const bContext *C, ReportList *reports, Object *ob, Object *ob_arm, int mode)
 
static bool gpencil_generate_weights_poll (bContext *C)
 
static int gpencil_generate_weights_exec (bContext *C, wmOperator *op)
 
static const EnumPropertyItemgpencil_armatures_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
void GPENCIL_OT_generate_weights (wmOperatorType *ot)
 

Detailed Description

Operators for dealing with armatures and GP data-blocks.

Definition in file gpencil_armature.c.

Macro Definition Documentation

◆ DEFAULT_DECAY

#define DEFAULT_DECAY   0.8f

Definition at line 58 of file gpencil_armature.c.

◆ DEFAULT_RATIO

#define DEFAULT_RATIO   0.10f

Definition at line 57 of file gpencil_armature.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GP_ARMATURE_NAME 
GP_ARMATURE_AUTO 

Definition at line 52 of file gpencil_armature.c.

Function Documentation

◆ dgroup_skinnable_cb()

static int dgroup_skinnable_cb ( Object ob,
Bone bone,
void datap 
)
static

◆ ED_gpencil_add_armature()

bool ED_gpencil_add_armature ( const bContext C,
ReportList reports,
Object ob,
Object ob_arm 
)

◆ ED_gpencil_add_armature_weights()

bool ED_gpencil_add_armature_weights ( const bContext C,
ReportList reports,
Object ob,
Object ob_arm,
int  mode 
)

◆ get_weight()

static float get_weight ( float  dist,
float  decay_rad,
float  dif_rad 
)
static

Definition at line 229 of file gpencil_armature.c.

References interpf().

Referenced by gpencil_add_verts_to_dgroups().

◆ gpencil_add_verts_to_dgroups()

static void gpencil_add_verts_to_dgroups ( const bContext C,
Object ob,
Object ob_arm,
const float  ratio,
const float  decay 
)
static

◆ gpencil_armatures_enum_itemf()

static const EnumPropertyItem* gpencil_armatures_enum_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
bool r_free 
)
static

◆ gpencil_bone_looper()

static int gpencil_bone_looper ( Object ob,
Bone bone,
void data,
int(*)(Object *, Bone *, void *)  bone_func 
)
static

◆ gpencil_bone_skinnable_cb()

static int gpencil_bone_skinnable_cb ( Object UNUSEDob,
Bone bone,
void datap 
)
static

◆ gpencil_generate_weights_exec()

static int gpencil_generate_weights_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_generate_weights_poll()

static bool gpencil_generate_weights_poll ( bContext C)
static

◆ gpencil_object_vgroup_calc_from_armature()

static void gpencil_object_vgroup_calc_from_armature ( const bContext C,
Object ob,
Object ob_arm,
const int  mode,
const float  ratio,
const float  decay 
)
static

◆ GPENCIL_OT_generate_weights()

void GPENCIL_OT_generate_weights ( wmOperatorType ot)

◆ vgroup_add_unique_bone_cb()

static int vgroup_add_unique_bone_cb ( Object ob,
Bone bone,
void UNUSEDptr 
)
static