Blender V4.3
usd_armature_utils.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "BLI_function_ref.hh"
6#include "BLI_map.hh"
7#include "BLI_string_ref.hh"
8#include "BLI_vector.hh"
9
10#include "DNA_modifier_types.h"
11
12#include <pxr/base/tf/token.h>
13#include <pxr/usd/usdSkel/animation.h>
14
15#include <string>
16
17struct Bone;
18struct Depsgraph;
19struct ModifierData;
20struct Object;
21
22namespace blender::io::usd {
23
24/* Custom Blender Primvar name used for storing armature bone lengths. */
25inline const pxr::TfToken BlenderBoneLengths("blender:bone_lengths", pxr::TfToken::Immortal);
26
34void visit_bones(const Object *ob_arm, FunctionRef<void(const Bone *)> visitor);
35
44void get_armature_bone_names(const Object *ob_arm, bool use_deform, Vector<std::string> &r_names);
45
55pxr::TfToken build_usd_joint_path(const Bone *bone, bool allow_unicode);
56
70void create_pose_joints(pxr::UsdSkelAnimation &skel_anim,
71 const Object &obj,
72 const Map<StringRef, const Bone *> *deform_map,
73 bool allow_unicode);
74
84 ModifierType type,
85 const Depsgraph *depsgraph);
86
95const Object *get_armature_modifier_obj(const Object &obj, const Depsgraph *depsgraph);
96
108 const StringRefNull name,
109 const Depsgraph *depsgraph);
110
120bool can_export_skinned_mesh(const Object &obj, const Depsgraph *depsgraph);
121
131void init_deform_bones_map(const Object *obj, Map<StringRef, const Bone *> *deform_map);
132
133} // namespace blender::io::usd
const Depsgraph * depsgraph
void init_deform_bones_map(const Object *obj, Map< StringRef, const Bone * > *deform_map)
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)
const pxr::TfToken BlenderBoneLengths("blender:bone_lengths", pxr::TfToken::Immortal)
pxr::TfToken build_usd_joint_path(const Bone *bone, bool allow_unicode)
void get_armature_bone_names(const Object *ob_arm, const bool use_deform, Vector< std::string > &r_names)
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)