29 const int sample_count)
32 BLI_assert_msg(fcurve,
"The same F-Curve is being created twice, this is unexpected.");
40 BLI_assert(sample_index >= 0 && sample_index < fcu->totvert);
42 bez.
vec[1][0] = frame;
43 bez.
vec[1][1] = value;
52 if (!(bone && visitor)) {
78 if (md->type == type) {
109 const bool use_deform,
117 auto visitor = [&](
const Bone *bone) {
119 if (use_deform && !deform_map.
contains(bone_name)) {
123 r_names.
append(bone_name);
139 return pxr::TfToken(path);
149 pxr::VtTokenArray joints;
155 if (deform_map && !deform_map->
contains(pchan->bone->name)) {
165 skel_anim.GetJointsAttr().Set(joints);
171 return mod ?
mod->object :
nullptr;
202 auto deform_visitor = [&](
const Bone *bone) {
209 deform_map->
add(bone->
name, bone);
216 for (
const auto &item : deform_map->
items()) {
218 for (
const Bone *parent = item.value->
parent; parent; parent = parent->
parent) {
219 deform_map->
add(parent->name, parent);
Functions and classes to work with Actions.
Functions to modify FCurves.
Bone * BKE_armature_find_bone_name(bArmature *arm, const char *name)
void BKE_fcurve_bezt_resize(FCurve *fcu, int new_totvert)
bool BKE_modifier_is_enabled(const Scene *scene, ModifierData *md, int required_mode)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
Scene * DEG_get_input_scene(const Depsgraph *graph)
BPy_StructRNA * depsgraph
bool add(const Key &key, const Value &value)
bool contains(const Key &key) const
ItemIterator items() const &
void append(const T &value)
FCurve * fcurve_create_unique(Main *bmain, const FCurveDescriptor &fcurve_descriptor)
VecBase< float, D > constexpr mod(VecOp< float, D >, VecOp< float, D >) RET
void init_deform_bones_map(const Object *obj, Map< StringRef, const Bone * > *deform_map)
void set_fcurve_sample(FCurve *fcu, int64_t sample_index, const float frame, const float value)
void get_armature_bone_names(const Object *ob_arm, const bool use_deform, Vector< StringRef > &r_names)
FCurve * create_fcurve(blender::animrig::Channelbag &channelbag, const blender::animrig::FCurveDescriptor &fcurve_descriptor, const int sample_count)
static const ArmatureModifierData * get_armature_modifier(const Object &obj, const Depsgraph *depsgraph)
bool is_armature_modifier_bone_name(const Object &obj, const StringRefNull name, const Depsgraph *depsgraph)
void create_pose_joints(pxr::UsdSkelAnimation &skel_anim, const Object &obj, const Map< StringRef, const Bone * > *deform_map, bool allow_unicode)
std::string make_safe_name(const StringRef name, bool allow_unicode)
pxr::TfToken build_usd_joint_path(const Bone *bone, bool allow_unicode)
const ModifierData * get_enabled_modifier(const Object &obj, ModifierType type, const Depsgraph *depsgraph)
const Object * get_armature_modifier_obj(const Object &obj, const Depsgraph *depsgraph)
static void visit_bones(const Bone *bone, FunctionRef< void(const Bone *)> visitor)
bool can_export_skinned_mesh(const Object &obj, const Depsgraph *depsgraph)