Blender  V3.3
Classes | Public Member Functions | List of all members
SkinInfo Class Reference

#include <SkinInfo.h>

Public Member Functions

 SkinInfo ()
 
 SkinInfo (const SkinInfo &skin)
 
 SkinInfo (UnitConverter *conv)
 
template<typename T >
void transfer_array_data (T &src, T &dest)
 
void transfer_int_array_data_const (const COLLADAFW::IntValuesArray &src, COLLADAFW::IntValuesArray &dest)
 
void transfer_uint_array_data_const (const COLLADAFW::UIntValuesArray &src, COLLADAFW::UIntValuesArray &dest)
 
void borrow_skin_controller_data (const COLLADAFW::SkinControllerData *skin)
 
void free ()
 
void add_joint (const COLLADABU::Math::Matrix4 &matrix)
 
void set_controller (const COLLADAFW::SkinController *co)
 
Objectcreate_armature (Main *bmain, Scene *scene, ViewLayer *view_layer)
 
Objectset_armature (Object *ob_arm)
 
bool get_joint_inv_bind_matrix (float inv_bind_mat[4][4], COLLADAFW::Node *node)
 
ObjectBKE_armature_from_object ()
 
const COLLADAFW::UniqueId & get_controller_uid ()
 
bool uses_joint_or_descendant (COLLADAFW::Node *node)
 
void link_armature (bContext *C, Object *ob, std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > &joint_by_uid, TransformReader *tm)
 
bPoseChannelget_pose_channel_from_node (COLLADAFW::Node *node)
 
void set_parent (Object *_parent)
 
Objectget_parent ()
 
void find_root_joints (const std::vector< COLLADAFW::Node * > &root_joints, std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > &joint_by_uid, std::vector< COLLADAFW::Node * > &result)
 
bool find_node_in_tree (COLLADAFW::Node *node, COLLADAFW::Node *tree_root)
 

Detailed Description

This is used to store data passed in write_controller_data. Arrays from #COLLADAFW::SkinControllerData lose ownership, so do this class members so that arrays don't get freed until we free them explicitly.

Definition at line 29 of file SkinInfo.h.

Constructor & Destructor Documentation

◆ SkinInfo() [1/3]

SkinInfo::SkinInfo ( )
default

◆ SkinInfo() [2/3]

SkinInfo::SkinInfo ( const SkinInfo skin)

◆ SkinInfo() [3/3]

SkinInfo::SkinInfo ( UnitConverter conv)

Definition at line 59 of file SkinInfo.cpp.

Member Function Documentation

◆ add_joint()

void SkinInfo::add_joint ( const COLLADABU::Math::Matrix4 &  matrix)

Using inverse bind matrices to construct armature it is safe to invert them to get the original matrices because if they are inverse matrices, they can be inverted.

Definition at line 108 of file SkinInfo.cpp.

References UnitConverter::dae_matrix_to_mat4_().

Referenced by ArmatureImporter::write_skin_controller_data().

◆ BKE_armature_from_object()

Object * SkinInfo::BKE_armature_from_object ( )

◆ borrow_skin_controller_data()

void SkinInfo::borrow_skin_controller_data ( const COLLADAFW::SkinControllerData *  skin)

◆ create_armature()

Object * SkinInfo::create_armature ( Main bmain,
Scene scene,
ViewLayer view_layer 
)

Called from write_controller.

Definition at line 133 of file SkinInfo.cpp.

References bc_add_object(), OB_ARMATURE, and scene.

◆ find_node_in_tree()

bool SkinInfo::find_node_in_tree ( COLLADAFW::Node *  node,
COLLADAFW::Node *  tree_root 
)

Definition at line 315 of file SkinInfo.cpp.

References node.

Referenced by find_root_joints().

◆ find_root_joints()

void SkinInfo::find_root_joints ( const std::vector< COLLADAFW::Node * > &  root_joints,
std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > &  joint_by_uid,
std::vector< COLLADAFW::Node * > &  result 
)

Definition at line 289 of file SkinInfo.cpp.

References find_node_in_tree(), and result.

◆ free()

void SkinInfo::free ( )

Definition at line 100 of file SkinInfo.cpp.

Referenced by ArmatureImporter::make_armatures().

◆ get_controller_uid()

const COLLADAFW::UniqueId & SkinInfo::get_controller_uid ( )

Definition at line 168 of file SkinInfo.cpp.

Referenced by ArmatureImporter::make_armatures().

◆ get_joint_inv_bind_matrix()

bool SkinInfo::get_joint_inv_bind_matrix ( float  inv_bind_mat[4][4],
COLLADAFW::Node *  node 
)

Definition at line 149 of file SkinInfo.cpp.

References copy_m4_m4(), and node.

Referenced by ArmatureImporter::get_joint_bind_mat().

◆ get_parent()

Object * SkinInfo::get_parent ( )

Definition at line 284 of file SkinInfo.cpp.

Referenced by ArmatureImporter::make_armatures().

◆ get_pose_channel_from_node()

bPoseChannel * SkinInfo::get_pose_channel_from_node ( COLLADAFW::Node *  node)

Definition at line 274 of file SkinInfo.cpp.

References bc_get_joint_name(), BKE_pose_channel_find_name(), node, and Object::pose.

◆ link_armature()

void SkinInfo::link_armature ( bContext C,
Object ob,
std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > &  joint_by_uid,
TransformReader tm 
)

◆ set_armature()

Object * SkinInfo::set_armature ( Object ob_arm)

Definition at line 139 of file SkinInfo.cpp.

◆ set_controller()

void SkinInfo::set_controller ( const COLLADAFW::SkinController *  co)

Definition at line 115 of file SkinInfo.cpp.

◆ set_parent()

void SkinInfo::set_parent ( Object _parent)

Definition at line 279 of file SkinInfo.cpp.

◆ transfer_array_data()

template<class T >
void SkinInfo::transfer_array_data ( T src,
T dest 
)

Nobody owns the data after this, so it should be freed manually with releaseMemory.

Definition at line 63 of file SkinInfo.cpp.

References dest, and src.

Referenced by borrow_skin_controller_data().

◆ transfer_int_array_data_const()

void SkinInfo::transfer_int_array_data_const ( const COLLADAFW::IntValuesArray &  src,
COLLADAFW::IntValuesArray &  dest 
)

When src is const we cannot src.yieldOwnerShip, this is used by copy constructor.

Definition at line 70 of file SkinInfo.cpp.

References dest, and src.

Referenced by SkinInfo().

◆ transfer_uint_array_data_const()

void SkinInfo::transfer_uint_array_data_const ( const COLLADAFW::UIntValuesArray &  src,
COLLADAFW::UIntValuesArray &  dest 
)

Definition at line 77 of file SkinInfo.cpp.

References dest, and src.

Referenced by SkinInfo().

◆ uses_joint_or_descendant()

bool SkinInfo::uses_joint_or_descendant ( COLLADAFW::Node *  node)

Check if this skin controller references a joint or any descendant of it

some nodes may not be referenced by SkinController, in this case to determine if the node belongs to this armature, we need to search down the tree.

Definition at line 173 of file SkinInfo.cpp.

References node.

Referenced by ArmatureImporter::get_armature_for_joint().


The documentation for this class was generated from the following files: