22#include <fmt/format.h>
28 b.use_custom_socket_order();
29 b.allow_any_socket_order();
32 .description(
"Evaluated final transform of the bone in armature space");
34 .description(
"Difference between the pose and rest pose relative to the parent bone");
36 .description(
"Matrix representing the bone's location, rotation, and scale properties");
38 .description(
"Original transform of the bone in armature space, defined in edit mode");
39 b.add_output<
decl::Float>(
"Rest Length"_ustr).description(
"Original length of the bone");
40 b.add_output<
decl::Bool>(
"Exists"_ustr).description(
"Whether the bone exists in the armature");
43 auto &p =
b.add_panel(
"Envelope"_ustr).default_closed(
true);
45 .description(
"Original envelope distance to the bone");
47 .description(
"Original radius of the head of the bone");
49 .description(
"Original radius of the tail of the bone");
54 .
description(
"Armature object to retrieve the bone information from");
148 const Bone *bone = pchan.bone_get(
object);
186 const std::string bone_name = params.
extract_input<std::string>(
"Bone Name"_ustr);
187 if (bone_name.empty()) {
197 const bool transform_space_relative = (params.
node().custom1 ==
200 if (transform_space_relative) {
204 if (!self_transform_evaluated || !object_transform_evaluated) {
207 TIP_(
"Cannot access object's transforms because it's not evaluated yet. "
208 "This can happen when there is a dependency cycle"));
212 geometry_transform = self_object->world_to_object() *
object->object_to_world();
221 fmt::format(fmt::runtime(
TIP_(
"Bone \"{}\" not found")), bone_name));
257 if (bone_name.empty()) {
271 if (!this->
get_result(
"Exists").should_compute()) {
273 fmt::format(fmt::runtime(
TIP_(
"Bone \"{}\" not found")), bone_name));
344 static const EnumPropertyItem rna_node_geometry_object_info_transform_space_items[] = {
349 "Output the bone pose relative to the armature object transform"},
354 "Bring the bone pose into the modified object"},
355 {0,
nullptr, 0,
nullptr,
nullptr},
361 "The transformation of the vector and geometry outputs",
362 rna_node_geometry_object_info_transform_space_items,
Blender kernel action and pose functionality.
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
NodeOperation(Context &context, const bNode &node)
void add_warning(nodes::NodeWarningType type, std::string message)
Result & get_result(StringRef identifier)
void allocate_default_remaining_outputs()
Result & get_input(StringRef identifier) const
bool should_compute() const
void set_single_value(const T &value)
void allocate_single_value()
const T & get_single_value() const
void add_item(std::string socket_name, SocketLinkOperation::LinkSocketFn fn, int weight=0)
const bNodeTree & node_tree() const
const bNodeSocket & other_socket() const
eNodeSocketInOut in_out() const
void error_message_add(const NodeWarningType type, StringRef message) const
T extract_input(const UString identifier)
bool output_is_required(const UString identifier) const
const bNode & node() const
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
const Object * self_object() const
void update_and_connect_available_socket(bNode &new_node, UString socket_name)
bNode & add_node(UString idname)
void node_register_type(bNodeType &ntype)
CartesianBasis invert(const CartesianBasis &basis)
static void node_geo_exec(GeoNodeExecParams params)
static void node_rna(StructRNA *srna)
static BoneInfo compute_bone_info(const Object &object, const bPoseChannel &pchan, const float4x4 &space_transformation=float4x4::identity())
static void node_layout(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_gather_link_search_ops(GatherLinkSearchOpParams ¶ms)
static void node_register()
static void node_node_init(bNodeTree *, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static compositor::NodeOperation * get_compositor_operation(compositor::Context &context, const bNode &node)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
void BKE_pchan_to_mat4(bke::PChanBoneConst pchanbone, float r_chanmat[4][4])
MatBase< float, 4, 4 > float4x4
bool DEG_object_transform_is_evaluated(const Object &object)
void rna_Node_update_relations(Main *bmain, Scene *scne, PointerRNA *ptr)
@ GEO_NODE_TRANSFORM_SPACE_ORIGINAL
@ GEO_NODE_TRANSFORM_SPACE_RELATIVE
void RNA_def_property_update_runtime(PropertyRNA *prop, RNAPropertyUpdateFunc func)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
void geo_cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
const c_style_mat & ptr() const
static MatBase identity()
bke::bNodeTreeType * typeinfo
struct bPoseChannel * parent
bool(*) validate_link(eNodeSocketDatatype from, eNodeSocketDatatype to)
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)