Blender
V3.3
|
#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 } |
Operators for dealing with armatures and GP data-blocks.
Definition in file gpencil_armature.c.
#define DEFAULT_DECAY 0.8f |
Definition at line 58 of file gpencil_armature.c.
#define DEFAULT_RATIO 0.10f |
Definition at line 57 of file gpencil_armature.c.
anonymous enum |
Enumerator | |
---|---|
GP_ARMATURE_NAME | |
GP_ARMATURE_AUTO |
Definition at line 52 of file gpencil_armature.c.
Definition at line 160 of file gpencil_armature.c.
References Freestyle::a, BKE_object_defgroup_add_name(), BKE_object_defgroup_find_name(), BKE_pose_channel_find_name(), BONE_HIDDEN_P, BONE_NO_DEFORM, data, DG_LOCK_WEIGHT, Bone::flag, bDeformGroup::flag, Bone::layer, bArmature::layer, Bone::name, NULL, and Bone::segments.
Referenced by gpencil_add_verts_to_dgroups().
bool ED_gpencil_add_armature | ( | const bContext * | C, |
ReportList * | reports, | ||
Object * | ob, | ||
Object * | ob_arm | ||
) |
Definition at line 465 of file gpencil_armature.c.
References BKE_gpencil_modifiers_findby_type(), BKE_report(), C, CTX_data_main(), CTX_data_scene(), DEG_id_tag_update(), ED_object_gpencil_modifier_add(), eGpencilModifierType_Armature, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, NULL, ArmatureGpencilModifierData::object, RPT_ERROR, and scene.
Referenced by ED_gpencil_add_armature_weights(), and ED_object_parent_set().
bool ED_gpencil_add_armature_weights | ( | const bContext * | C, |
ReportList * | reports, | ||
Object * | ob, | ||
Object * | ob_arm, | ||
int | mode | ||
) |
Definition at line 502 of file gpencil_armature.c.
References C, DEFAULT_DECAY, DEFAULT_RATIO, ED_gpencil_add_armature(), gpencil_object_vgroup_calc_from_armature(), and NULL.
Referenced by ED_object_parent_set().
Definition at line 229 of file gpencil_armature.c.
References interpf().
Referenced by gpencil_add_verts_to_dgroups().
|
static |
Definition at line 243 of file gpencil_armature.c.
References Bone::arm_head, Bone::arm_mat, Bone::arm_tail, BKE_defvert_ensure_index(), BKE_gpencil_dvert_ensure(), BKE_pchan_bbone_spline_setup(), BKE_pose_channel_find_name(), BLI_findindex(), bArmature::bonebase, C, copy_v3_v3(), Object::data, dgroup_skinnable_cb(), dist_squared_to_line_segment_v3(), ED_gpencil_stroke_can_use(), ListBase::first, float(), get_weight(), GP_FRAME_SELECT, gpencil_bone_looper(), gpencil_bone_skinnable_cb(), GPENCIL_MULTIEDIT_SESSIONS_ON, bGPdata::layers, len_squared_v3v3(), LISTBASE_FOREACH, Mat4::mat, MAX_BBONE_SUBDIV, MEM_callocN, MEM_SAFE_FREE, mul_m4_v3(), mul_v3_m4v3(), Bone::name, bGPDframe::next, NULL, Object::obmat, Object::pose, Bone::segments, bGPdata::vertex_group_names, verts, and MDeformWeight::weight.
Referenced by gpencil_object_vgroup_calc_from_armature().
|
static |
Definition at line 605 of file gpencil_armature.c.
References C, CTX_data_view_layer(), DummyRNA_DEFAULT_items, Object::id, EnumPropertyItem::identifier, LISTBASE_FOREACH, Node::name, ID::name, NULL, OB_ARMATURE, ViewLayer::object_bases, RNA_enum_item_add(), RNA_enum_item_end(), and Object::type.
Referenced by GPENCIL_OT_generate_weights().
|
static |
Definition at line 60 of file gpencil_armature.c.
References Bone::childbase, count, data, ListBase::first, and Bone::next.
Referenced by gpencil_add_verts_to_dgroups(), and gpencil_object_vgroup_calc_from_armature().
Definition at line 89 of file gpencil_armature.c.
References Freestyle::a, BKE_pose_channel_find_name(), BONE_HIDDEN_P, BONE_NO_DEFORM, data, Bone::flag, Bone::name, NULL, and Bone::segments.
Referenced by gpencil_add_verts_to_dgroups().
|
static |
Definition at line 548 of file gpencil_armature.c.
References BKE_gpencil_modifiers_findby_type(), BKE_report(), BLI_findlink(), C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_view_layer(), Object::data, DEG_get_evaluated_object(), DEG_id_tag_update(), depsgraph, eGpencilModifierType_Armature, ELEM, gpencil_object_vgroup_calc_from_armature(), bGPdata::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, NA_EDITED, NC_GPENCIL, ND_DATA, NULL, ArmatureGpencilModifierData::object, Base::object, ViewLayer::object_bases, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_float_get(), RPT_ERROR, and WM_event_add_notifier().
Referenced by GPENCIL_OT_generate_weights().
Definition at line 519 of file gpencil_armature.c.
References BLI_listbase_count(), C, CTX_data_active_object(), CTX_data_view_layer(), Object::data, if(), bGPdata::layers, LISTBASE_FOREACH, NULL, OB_ARMATURE, OB_GPENCIL, ViewLayer::object_bases, and Object::type.
Referenced by GPENCIL_OT_generate_weights().
|
static |
Definition at line 428 of file gpencil_armature.c.
References BKE_object_defgroup_count(), bArmature::bonebase, C, CTX_data_main(), Object::data, DEG_relations_tag_update(), ED_vgroup_data_clamp_range(), ListBase::first, GP_ARMATURE_AUTO, gpencil_add_verts_to_dgroups(), gpencil_bone_looper(), NULL, and vgroup_add_unique_bone_cb().
Referenced by ED_gpencil_add_armature_weights(), and gpencil_generate_weights_exec().
void GPENCIL_OT_generate_weights | ( | wmOperatorType * | ot | ) |
Definition at line 642 of file gpencil_armature.c.
References DEFAULT_DECAY, DEFAULT_RATIO, wmOperatorType::description, DummyRNA_DEFAULT_items, wmOperatorType::exec, wmOperatorType::flag, GP_ARMATURE_AUTO, GP_ARMATURE_NAME, gpencil_armatures_enum_itemf(), gpencil_generate_weights_exec(), gpencil_generate_weights_poll(), wmOperatorType::idname, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_float(), and wmOperatorType::srna.
Referenced by ED_operatortypes_gpencil().
Definition at line 145 of file gpencil_armature.c.
References BKE_object_defgroup_add_name(), BKE_object_defgroup_find_name(), BONE_NO_DEFORM, Bone::flag, and Bone::name.
Referenced by gpencil_object_vgroup_calc_from_armature().