Blender V2.61 - r43446
|
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "PIL_time.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_graph.h"
#include "BLI_rand.h"
#include "BLI_threads.h"
#include "BKE_constraint.h"
#include "BKE_armature.h"
#include "BKE_context.h"
#include "ED_armature.h"
#include "ED_util.h"
#include "BIF_retarget.h"
#include "reeb.h"
#include "armature_intern.h"
Go to the source code of this file.
Classes | |
struct | MemoNode |
struct | RetargetParam |
Defines | |
#define | SHAPE_LEVELS (SHAPE_RADIX * SHAPE_RADIX) |
#define | MAX_COST FLT_MAX |
Typedefs | |
typedef struct MemoNode | MemoNode |
typedef struct RetargetParam | RetargetParam |
Enumerations | |
enum | RetargetMode { RETARGET_LENGTH, RETARGET_AGGRESSIVE } |
enum | RetargetMethod { METHOD_BRUTE_FORCE = 0, METHOD_MEMOIZE = 1 } |
enum | ArcUsageFlags { ARC_FREE = 0, ARC_TAKEN = 1, ARC_USED = 2 } |
Functions | |
void * | exec_retargetArctoArc (void *param) |
static void | RIG_calculateEdgeAngles (RigEdge *edge_first, RigEdge *edge_second) |
float | rollBoneByQuat (EditBone *bone, float old_up_axis[3], float qrot[4]) |
static int | countEditBoneChildren (ListBase *list, EditBone *parent) |
static EditBone * | nextEditBoneChild (ListBase *list, EditBone *parent, int n) |
static void | getEditBoneRollUpAxis (EditBone *bone, float roll, float up_axis[3]) |
static float | rollBoneByQuatAligned (EditBone *bone, float old_up_axis[3], float qrot[4], float qroll[4], float aligned_axis[3]) |
static float | rollBoneByQuatJoint (RigEdge *edge, RigEdge *previous, float qrot[4], float qroll[4], float up_axis[3]) |
static void | RIG_freeRigArc (BArc *arc) |
void | RIG_freeRigGraph (BGraph *rg) |
static RigGraph * | newRigGraph (void) |
static RigArc * | newRigArc (RigGraph *rg) |
static RigControl * | newRigControl (RigGraph *rg) |
static RigNode * | newRigNodeHead (RigGraph *rg, RigArc *arc, float p[3]) |
static void | addRigNodeHead (RigGraph *UNUSED(rg), RigArc *arc, RigNode *node) |
static RigNode * | newRigNode (RigGraph *rg, float p[3]) |
static RigNode * | newRigNodeTail (RigGraph *rg, RigArc *arc, float p[3]) |
static void | RIG_appendEdgeToArc (RigArc *arc, RigEdge *edge) |
static void | RIG_addEdgeToArc (RigArc *arc, float tail[3], EditBone *bone) |
static void | renameTemplateBone (char *name, char *template_name, ListBase *editbones, char *side_string, char *num_string) |
static RigControl * | cloneControl (RigGraph *rg, RigGraph *src_rg, RigControl *src_ctrl, GHash *ptr_hash, char *side_string, char *num_string) |
static RigArc * | cloneArc (RigGraph *rg, RigGraph *src_rg, RigArc *src_arc, GHash *ptr_hash, char *side_string, char *num_string) |
static RigGraph * | cloneRigGraph (RigGraph *src, ListBase *editbones, Object *ob, char *side_string, char *num_string) |
static void | RIG_addControlBone (RigGraph *rg, EditBone *bone) |
static int | RIG_parentControl (RigControl *ctrl, EditBone *link) |
static void | RIG_reconnectControlBones (RigGraph *rg) |
static void | RIG_joinArcs (RigGraph *rg, RigNode *node, RigArc *joined_arc1, RigArc *joined_arc2) |
static void | RIG_removeNormalNodes (RigGraph *rg) |
static void | RIG_removeUneededOffsets (RigGraph *rg) |
static void | RIG_arcFromBoneChain (RigGraph *rg, ListBase *list, EditBone *root_bone, RigNode *starting_node, int selected) |
static void | RIG_findHead (RigGraph *rg) |
static void | RIG_printNode (RigNode *node, const char name[]) |
void | RIG_printArcBones (RigArc *arc) |
static void | RIG_printCtrl (RigControl *ctrl, char *indent) |
static void | RIG_printLinkedCtrl (RigGraph *rg, EditBone *bone, int tabs) |
void | RIG_printArc (RigGraph *rg, RigArc *arc) |
void | RIG_printGraph (RigGraph *rg) |
RigGraph * | RIG_graphFromArmature (const bContext *C, Object *ob, bArmature *arm) |
static RigGraph * | armatureSelectedToGraph (bContext *C, Object *ob, bArmature *arm) |
static void | repositionControl (RigGraph *rigg, RigControl *ctrl, float head[3], float tail[3], float qrot[4], float resize) |
static void | repositionTailControl (RigGraph *rigg, RigControl *ctrl) |
static void | finalizeControl (RigGraph *rigg, RigControl *ctrl, float resize) |
static void | repositionControl (RigGraph *rigg, RigControl *ctrl, float head[3], float UNUSED(tail[3]), float qrot[4], float resize) |
static void | repositionBone (bContext *C, RigGraph *rigg, RigEdge *edge, float vec0[3], float vec1[3], float up_axis[3]) |
static RetargetMode | detectArcRetargetMode (RigArc *arc) |
static void | retargetArctoArcLength (bContext *C, RigGraph *rigg, RigArc *iarc, RigNode *inode_start) |
static float | costDistance (BArcIterator *iter, float *vec0, float *vec1, int i0, int i1, float distance_weight) |
static float | costAngle (float original_angle, float vec_first[3], float vec_second[3], float angle_weight) |
static float | costLength (float original_length, float current_length, float length_weight) |
static float | calcCostAngleLengthDistance (BArcIterator *iter, float **UNUSED(vec_cache), RigEdge *edge, float *vec0, float *vec1, float *vec2, int i1, int i2, float angle_weight, float length_weight, float distance_weight) |
static int | indexMemoNode (int nb_positions, int previous, int current, int joints_left) |
static void | copyMemoPositions (int *positions, MemoNode *table, int nb_positions, int joints_left) |
static MemoNode * | solveJoints (MemoNode *table, BArcIterator *iter, float **vec_cache, int nb_joints, int nb_positions, int previous, int current, RigEdge *edge, int joints_left, float angle_weight, float length_weight, float distance_weight) |
static int | testFlipArc (RigArc *iarc, RigNode *inode_start) |
static void | retargetArctoArcAggresive (bContext *C, RigGraph *rigg, RigArc *iarc, RigNode *inode_start) |
static void | retargetArctoArc (bContext *C, RigGraph *rigg, RigArc *iarc, RigNode *inode_start) |
static void | matchMultiResolutionNode (RigGraph *rigg, RigNode *inode, ReebNode *top_node) |
static void | markMultiResolutionChildArc (ReebNode *end_enode, ReebNode *enode) |
static void | markMultiResolutionArc (ReebArc *start_earc) |
static void | matchMultiResolutionArc (RigGraph *rigg, RigNode *start_node, RigArc *next_iarc, ReebArc *next_earc) |
static void | matchMultiResolutionStartingNode (RigGraph *rigg, ReebGraph *reebg, RigNode *inode) |
static void | findCorrespondingArc (RigGraph *rigg, RigArc *start_arc, RigNode *start_node, RigArc *next_iarc, int root) |
static void | retargetSubgraph (bContext *C, RigGraph *rigg, RigArc *start_arc, RigNode *start_node) |
static void | finishRetarget (RigGraph *rigg) |
static void | adjustGraphs (bContext *C, RigGraph *rigg) |
static void | retargetGraphs (bContext *C, RigGraph *rigg) |
const char * | RIG_nameBone (RigGraph *rg, int arc_index, int bone_index) |
int | RIG_nbJoints (RigGraph *rg) |
static void | BIF_freeRetarget (void) |
void | BIF_retargetArmature (bContext *C) |
void | BIF_retargetArc (bContext *C, ReebArc *earc, RigGraph *template_rigg) |
void | BIF_adjustRetarget (bContext *C) |
Variables | |
static RigGraph * | GLOBAL_RIGG = NULL |
Definition in file editarmature_retarget.c.
#define MAX_COST FLT_MAX |
Definition at line 1960 of file editarmature_retarget.c.
Referenced by costDistance(), costLength(), and solveJoints().
#define SHAPE_LEVELS (SHAPE_RADIX * SHAPE_RADIX) |
Definition at line 114 of file editarmature_retarget.c.
Referenced by matchMultiResolutionArc(), matchMultiResolutionNode(), and matchMultiResolutionStartingNode().
typedef struct RetargetParam RetargetParam |
enum ArcUsageFlags |
Definition at line 97 of file editarmature_retarget.c.
enum RetargetMethod |
Definition at line 91 of file editarmature_retarget.c.
enum RetargetMode |
Definition at line 85 of file editarmature_retarget.c.
Definition at line 379 of file editarmature_retarget.c.
References RigNode::degree, and RigArc::head.
Referenced by RIG_arcFromBoneChain().
Definition at line 2714 of file editarmature_retarget.c.
References RigGraph::arcs, Object::data, ED_armature_from_edit(), ED_undo_push(), bArmature::edbo, RigGraph::editbones, finishRetarget(), ListBase::first, RigArc::head, RigArc::link_mesh, RigArc::next, RigGraph::ob, and retargetArctoArc().
Referenced by BIF_adjustRetarget().
Definition at line 1583 of file editarmature_retarget.c.
References BLI_buildAdjacencyList(), BLI_isGraphCyclic(), BLI_markdownSymmetry(), BLI_removeDoubleNodes(), bArmature::bonebase, CTX_data_edit_object(), CTX_data_scene(), bArmature::edbo, RigGraph::editbones, ListBase::first, RigGraph::flag, make_boneList(), MEM_callocN(), newRigGraph(), EditBone::next, NULL, RigGraph::ob, EditBone::parent, RIG_arcFromBoneChain(), RIG_findHead(), RIG_FREE_BONELIST, RIG_reconnectControlBones(), RIG_removeNormalNodes(), RIG_removeUneededOffsets(), ToolSettings::skgen_symmetry_limit, and Scene::toolsettings.
Referenced by BIF_retargetArc().
void BIF_adjustRetarget | ( | bContext * | C | ) |
Definition at line 2948 of file editarmature_retarget.c.
References adjustGraphs().
static void BIF_freeRetarget | ( | void | ) | [static] |
Definition at line 2806 of file editarmature_retarget.c.
References NULL, and RIG_freeRigGraph().
Referenced by BIF_retargetArmature().
Definition at line 2893 of file editarmature_retarget.c.
References RigGraph::arcs, armatureSelectedToGraph(), cloneRigGraph(), CTX_data_edit_object(), CTX_data_scene(), Object::data, ED_armature_validate_active(), bArmature::edbo, finishRetarget(), ListBase::first, RigArc::head, ReebArc::head, RigArc::link_mesh, RigNode::link_mesh, NULL, RigGraph::ob, retargetArctoArc(), RIG_freeRigGraph(), ToolSettings::skgen_num_string, ToolSettings::skgen_side_string, RigArc::tail, ReebArc::tail, and Scene::toolsettings.
Referenced by sk_retargetStroke().
void BIF_retargetArmature | ( | bContext * | C | ) |
Definition at line 2815 of file editarmature_retarget.c.
References BIF_freeRetarget(), BIF_ReebGraphMultiFromEditMesh(), CTX_DATA_BEGIN, CTX_DATA_END, Object::data, ED_undo_push(), Object::id, RigGraph::link_mesh, ID::name, OB_ARMATURE, PIL_check_seconds_timer(), retargetGraphs(), RIG_graphFromArmature(), and Object::type.
static float calcCostAngleLengthDistance | ( | BArcIterator * | iter, |
float ** | UNUSEDvec_cache, | ||
RigEdge * | edge, | ||
float * | vec0, | ||
float * | vec1, | ||
float * | vec2, | ||
int | i1, | ||
int | i2, | ||
float | angle_weight, | ||
float | length_weight, | ||
float | distance_weight | ||
) | [static] |
Definition at line 2055 of file editarmature_retarget.c.
References RigEdge::angle, costAngle(), costDistance(), costLength(), RigEdge::length, normalize_v3(), RigEdge::prev, and sub_v3_v3v3().
Referenced by solveJoints().
static RigArc* cloneArc | ( | RigGraph * | rg, |
RigGraph * | src_rg, | ||
RigArc * | src_arc, | ||
GHash * | ptr_hash, | ||
char * | side_string, | ||
char * | num_string | ||
) | [static] |
Definition at line 511 of file editarmature_retarget.c.
References RigEdge::angle, BLI_addtail(), BLI_ghash_insert(), BLI_ghash_lookup(), RigEdge::bone, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, copy_v3_v3(), RigArc::count, RigNode::degree, duplicateEditBoneObjects(), RigArc::edges, RigGraph::editbones, ListBase::first, EditBone::flag, RigArc::head, RigEdge::head, RigArc::length, RigEdge::length, MAXBONENAME, MEM_callocN(), EditBone::name, newRigArc(), RigEdge::next, NULL, RigGraph::ob, renameTemplateBone(), RigArc::tail, RigEdge::tail, RigEdge::up_angle, and RigEdge::up_axis.
Referenced by cloneRigGraph().
static RigControl* cloneControl | ( | RigGraph * | rg, |
RigGraph * | src_rg, | ||
RigControl * | src_ctrl, | ||
GHash * | ptr_hash, | ||
char * | side_string, | ||
char * | num_string | ||
) | [static] |
Definition at line 485 of file editarmature_retarget.c.
References BLI_ghash_insert(), RigControl::bone, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, copy_v3_v3(), duplicateEditBoneObjects(), RigGraph::editbones, EditBone::flag, RigControl::flag, RigControl::head, RigControl::link, RigControl::link_tail, MAXBONENAME, EditBone::name, newRigControl(), RigGraph::ob, RigControl::offset, renameTemplateBone(), RigControl::tail, RigControl::tail_mode, and RigControl::up_axis.
Referenced by cloneRigGraph().
static RigGraph* cloneRigGraph | ( | RigGraph * | src, |
ListBase * | editbones, | ||
Object * | ob, | ||
char * | side_string, | ||
char * | num_string | ||
) | [static] |
Definition at line 557 of file editarmature_retarget.c.
References RigGraph::arcs, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), RigEdge::bone, RigControl::bone, BONE_CONNECTED, cloneArc(), cloneControl(), RigGraph::controls, RigArc::edges, RigGraph::editbones, ListBase::first, EditBone::flag, RigGraph::head, RigControl::link, RigControl::link_tail, newRigGraph(), newRigNode(), RigArc::next, RigEdge::next, RigControl::next, RigNode::next, RigGraph::nodes, NULL, RigGraph::ob, RigNode::p, EditBone::parent, preEditBoneDuplicate(), and updateDuplicateSubtargetObjects().
Referenced by BIF_retargetArc().
static void copyMemoPositions | ( | int * | positions, |
MemoNode * | table, | ||
int | nb_positions, | ||
int | joints_left | ||
) | [static] |
Definition at line 2088 of file editarmature_retarget.c.
References i, indexMemoNode(), and MemoNode::next.
Referenced by retargetArctoArcAggresive().
static float costAngle | ( | float | original_angle, |
float | vec_first[3], | ||
float | vec_second[3], | ||
float | angle_weight | ||
) | [static] |
Definition at line 2006 of file editarmature_retarget.c.
References dot_v3v3(), fabsf, is_zero_v3(), M_PI, and saacos().
Referenced by calcCostAngleLengthDistance().
static float costDistance | ( | BArcIterator * | iter, |
float * | vec0, | ||
float * | vec1, | ||
int | i0, | ||
int | i1, | ||
float | distance_weight | ||
) | [static] |
Definition at line 1962 of file editarmature_retarget.c.
References cross_v3_v3v3(), dot_v3v3(), IT_peek(), MAX_COST, NULL, EmbedBucket::p, and sub_v3_v3v3().
Referenced by calcCostAngleLengthDistance().
static float costLength | ( | float | original_length, |
float | current_length, | ||
float | length_weight | ||
) | [static] |
Definition at line 2029 of file editarmature_retarget.c.
References fabs(), and MAX_COST.
Referenced by calcCostAngleLengthDistance().
Definition at line 118 of file editarmature_retarget.c.
References ListBase::first, EditBone::next, and EditBone::parent.
Referenced by RIG_arcFromBoneChain().
static RetargetMode detectArcRetargetMode | ( | RigArc * | arc | ) | [static] |
Definition at line 1883 of file editarmature_retarget.c.
References RigEdge::angle, ReebArc::bcount, RigArc::count, RigArc::edges, fabs(), ListBase::first, RigArc::link_mesh, M_PI, RigEdge::next, RETARGET_AGGRESSIVE, and RETARGET_LENGTH.
Referenced by exec_retargetArctoArc().
void * exec_retargetArctoArc | ( | void * | param | ) |
Definition at line 2424 of file editarmature_retarget.c.
References BLI_countlist(), C, RetargetParam::context, detectArcRetargetMode(), RigArc::edges, ListBase::first, ReebArc::head, RetargetParam::iarc, RetargetParam::inode_start, RigArc::link_mesh, MEM_freeN(), ReebNode::no, NULL, p, ReebNode::p, repositionBone(), RETARGET_AGGRESSIVE, retargetArctoArcAggresive(), retargetArctoArcLength(), RetargetParam::rigg, ReebArc::tail, and testFlipArc().
Referenced by newRigGraph(), and retargetArctoArc().
static void finalizeControl | ( | RigGraph * | rigg, |
RigControl * | ctrl, | ||
float | resize | ||
) | [static] |
Definition at line 1723 of file editarmature_retarget.c.
References RigControl::bone, RigGraph::controls, copy_v3_v3(), ListBase::first, RigControl::flag, EditBone::head, RigControl::head, len_v3(), len_v3v3(), RigControl::link, RigControl::link_tail, mul_qt_qtqt(), EditBone::name, RigControl::next, NULL, RigControl::qrot, repositionControl(), repositionTailControl(), RIG_CTRL_DONE, EditBone::roll, rollBoneByQuat(), rotation_between_vecs_to_quat(), sub_v3_v3v3(), EditBone::tail, RigControl::tail, RigControl::tail_mode, TL_HEAD, TL_NONE, TL_TAIL, and RigControl::up_axis.
Referenced by repositionControl(), and repositionTailControl().
static void findCorrespondingArc | ( | RigGraph * | rigg, |
RigArc * | start_arc, | ||
RigNode * | start_node, | ||
RigArc * | next_iarc, | ||
int | root | ||
) | [static] |
Definition at line 2579 of file editarmature_retarget.c.
References ARC_FREE, ReebNode::arcs, ReebNode::degree, ReebArc::flag, i, if(), RigNode::link_mesh, RigArc::link_mesh, ReebNode::link_up, matchMultiResolutionArc(), NULL, ReebArc::symmetry_flag, RigArc::symmetry_flag, ReebArc::symmetry_group, RigArc::symmetry_group, ReebArc::symmetry_level, and RigArc::symmetry_level.
Referenced by retargetSubgraph().
static void finishRetarget | ( | RigGraph * | rigg | ) | [static] |
Definition at line 2707 of file editarmature_retarget.c.
References BLI_end_worker(), and RigGraph::worker.
Referenced by adjustGraphs(), BIF_retargetArc(), and retargetGraphs().
static void getEditBoneRollUpAxis | ( | EditBone * | bone, |
float | roll, | ||
float | up_axis[3] | ||
) | [static] |
Definition at line 153 of file editarmature_retarget.c.
References copy_v3_v3(), EditBone::head, sub_v3_v3v3(), EditBone::tail, and vec_roll_to_mat3().
Referenced by RIG_addControlBone(), and RIG_addEdgeToArc().
static int indexMemoNode | ( | int | nb_positions, |
int | previous, | ||
int | current, | ||
int | joints_left | ||
) | [static] |
Definition at line 2083 of file editarmature_retarget.c.
Referenced by copyMemoPositions(), and solveJoints().
static void markMultiResolutionArc | ( | ReebArc * | start_earc | ) | [static] |
Definition at line 2509 of file editarmature_retarget.c.
References ARC_TAKEN, ReebArc::flag, ReebNode::index, ReebArc::link_up, markMultiResolutionChildArc(), and ReebArc::tail.
Referenced by matchMultiResolutionArc().
Definition at line 2488 of file editarmature_retarget.c.
References ARC_FREE, ARC_TAKEN, ReebNode::arcs, ReebNode::degree, ReebArc::flag, i, if(), and ReebArc::tail.
Referenced by markMultiResolutionArc().
static void matchMultiResolutionArc | ( | RigGraph * | rigg, |
RigNode * | start_node, | ||
RigArc * | next_iarc, | ||
ReebArc * | next_earc | ||
) | [static] |
Definition at line 2526 of file editarmature_retarget.c.
References ARC_TAKEN, ARC_USED, BIF_graphForMultiNode(), BLI_subtreeShape(), BArc::flag, BArc::head, ReebArc::head, RigGraph::link_mesh, markMultiResolutionArc(), and SHAPE_LEVELS.
Referenced by findCorrespondingArc().
static void matchMultiResolutionNode | ( | RigGraph * | rigg, |
RigNode * | inode, | ||
ReebNode * | top_node | ||
) | [static] |
Definition at line 2467 of file editarmature_retarget.c.
References BIF_graphForMultiNode(), BLI_subtreeShape(), RigGraph::link_mesh, NULL, and SHAPE_LEVELS.
Referenced by retargetSubgraph().
static void matchMultiResolutionStartingNode | ( | RigGraph * | rigg, |
ReebGraph * | reebg, | ||
RigNode * | inode | ||
) | [static] |
Definition at line 2557 of file editarmature_retarget.c.
References BLI_subtreeShape(), ListBase::first, ReebGraph::link_up, ReebGraph::nodes, NULL, and SHAPE_LEVELS.
Referenced by retargetGraphs().
Definition at line 342 of file editarmature_retarget.c.
References RigGraph::arcs, BLI_addtail(), RigArc::count, and MEM_callocN().
Referenced by cloneArc(), and RIG_arcFromBoneChain().
static RigControl* newRigControl | ( | RigGraph * | rg | ) | [static] |
Definition at line 353 of file editarmature_retarget.c.
References BLI_addtail(), RigGraph::controls, and MEM_callocN().
Referenced by cloneControl(), and RIG_addControlBone().
static RigGraph* newRigGraph | ( | void | ) | [static] |
Definition at line 311 of file editarmature_retarget.c.
References BLI_create_worker(), BLI_ghash_new(), BLI_ghashutil_strcmp(), BLI_ghashutil_strhash(), BLI_system_thread_count(), RigGraph::bones_map, RigGraph::controls_map, exec_retargetArctoArc(), RigGraph::free_arc, RigGraph::free_node, RigGraph::head, MEM_callocN(), NULL, RIG_freeRigArc(), and RigGraph::worker.
Referenced by armatureSelectedToGraph(), cloneRigGraph(), and RIG_graphFromArmature().
Definition at line 386 of file editarmature_retarget.c.
References RigNode::arcs, BLI_addtail(), copy_v3_v3(), RigNode::degree, MEM_callocN(), RigGraph::nodes, NULL, and RigNode::p.
Referenced by cloneRigGraph(), newRigNodeTail(), and RIG_arcFromBoneChain().
Definition at line 364 of file editarmature_retarget.c.
References RigNode::arcs, BLI_addtail(), copy_v3_v3(), RigNode::degree, RigArc::head, MEM_callocN(), RigGraph::nodes, NULL, and RigNode::p.
Referenced by RIG_arcFromBoneChain().
Definition at line 399 of file editarmature_retarget.c.
References RigNode::degree, newRigNode(), and RigArc::tail.
Referenced by RIG_arcFromBoneChain().
Definition at line 134 of file editarmature_retarget.c.
References ListBase::first, EditBone::next, NULL, and EditBone::parent.
Referenced by RIG_arcFromBoneChain().
static void renameTemplateBone | ( | char * | name, |
char * | template_name, | ||
ListBase * | editbones, | ||
char * | side_string, | ||
char * | num_string | ||
) | [static] |
Definition at line 449 of file editarmature_retarget.c.
References i, MAXBONENAME, NULL, and unique_editbone_name().
Referenced by cloneArc(), and cloneControl().
static void repositionBone | ( | bContext * | C, |
RigGraph * | rigg, | ||
RigEdge * | edge, | ||
float | vec0[3], | ||
float | vec1[3], | ||
float | up_axis[3] | ||
) | [static] |
Definition at line 1818 of file editarmature_retarget.c.
References RigEdge::bone, RigGraph::controls, copy_v3_v3(), CTX_data_scene(), ListBase::first, EditBone::head, RigEdge::head, is_zero_v3(), RigControl::link, RigControl::link_tail, mul_qt_qtqt(), RigControl::next, normalize_v3(), RigEdge::prev, repositionControl(), repositionTailControl(), resize(), EditBone::roll, rollBoneByQuat(), rollBoneByQuatAligned(), rollBoneByQuatJoint(), rotation_between_vecs_to_quat(), SK_RETARGET_ROLL_JOINT, SK_RETARGET_ROLL_VIEW, ToolSettings::skgen_retarget_roll, sub_v3_v3v3(), EditBone::tail, RigEdge::tail, Scene::toolsettings, unit_qt(), and RigEdge::up_axis.
Referenced by exec_retargetArctoArc(), retargetArctoArcAggresive(), and retargetArctoArcLength().
static void repositionControl | ( | RigGraph * | rigg, |
RigControl * | ctrl, | ||
float | head[3], | ||
float | tail[3], | ||
float | qrot[4], | ||
float | resize | ||
) | [static] |
Referenced by finalizeControl(), and repositionBone().
static void repositionControl | ( | RigGraph * | rigg, |
RigControl * | ctrl, | ||
float | head[3], | ||
float | UNUSEDtail[3], | ||
float | qrot[4], | ||
float | resize | ||
) | [static] |
Definition at line 1790 of file editarmature_retarget.c.
References add_v3_v3v3(), RigControl::bone, copy_qt_qt(), copy_v3_v3(), finalizeControl(), RigControl::flag, EditBone::head, RigControl::head, mul_qt_v3(), mul_v3_fl(), RigControl::offset, RigControl::qrot, RIG_CTRL_HEAD_DONE, RIG_CTRL_TAIL_DONE, sub_v3_v3v3(), EditBone::tail, RigControl::tail, RigControl::tail_mode, and TL_NONE.
static void repositionTailControl | ( | RigGraph * | rigg, |
RigControl * | ctrl | ||
) | [static] |
Definition at line 1783 of file editarmature_retarget.c.
References finalizeControl(), RigControl::flag, and RIG_CTRL_TAIL_DONE.
Referenced by finalizeControl(), and repositionBone().
static void retargetArctoArc | ( | bContext * | C, |
RigGraph * | rigg, | ||
RigArc * | iarc, | ||
RigNode * | inode_start | ||
) | [static] |
Definition at line 2401 of file editarmature_retarget.c.
References BLI_insert_work(), C, RetargetParam::context, exec_retargetArctoArc(), RetargetParam::iarc, RetargetParam::inode_start, MEM_callocN(), p, RetargetParam::rigg, and RigGraph::worker.
Referenced by adjustGraphs(), BIF_retargetArc(), and retargetSubgraph().
static void retargetArctoArcAggresive | ( | bContext * | C, |
RigGraph * | rigg, | ||
RigArc * | iarc, | ||
RigNode * | inode_start | ||
) | [static] |
Definition at line 2192 of file editarmature_retarget.c.
References ReebArc::bcount, BLI_countlist(), RigEdge::bone, copyMemoPositions(), RigArc::edges, ListBase::first, FLT_MAX, ReebArc::head, i, initArcIterator(), IT_peek(), RigArc::link_mesh, MEM_callocN(), MEM_freeN(), METHOD_MEMOIZE, RigEdge::next, ReebNode::no, EmbedBucket::no, NULL, EmbedBucket::p, ReebNode::p, repositionBone(), solveJoints(), table, ReebArc::tail, and testFlipArc().
Referenced by exec_retargetArctoArc().
static void retargetArctoArcLength | ( | bContext * | C, |
RigGraph * | rigg, | ||
RigArc * | iarc, | ||
RigNode * | inode_start | ||
) | [static] |
Definition at line 2317 of file editarmature_retarget.c.
References RigEdge::bone, RigArc::edges, ListBase::first, ReebArc::head, initArcIterator(), IT_next(), len_v3v3(), RigArc::length, length(), RigEdge::length, RigArc::link_mesh, RigEdge::next, ReebNode::no, EmbedBucket::no, NULL, EmbedBucket::p, ReebNode::p, repositionBone(), ReebArc::tail, and testFlipArc().
Referenced by exec_retargetArctoArc().
Definition at line 2736 of file editarmature_retarget.c.
References ARC_FREE, BIF_flagMultiArcs(), Object::data, ED_armature_from_edit(), bArmature::edbo, RigGraph::editbones, finishRetarget(), RigGraph::head, RigGraph::link_mesh, matchMultiResolutionStartingNode(), NULL, RigGraph::ob, and retargetSubgraph().
Referenced by BIF_retargetArmature().
static void retargetSubgraph | ( | bContext * | C, |
RigGraph * | rigg, | ||
RigArc * | start_arc, | ||
RigNode * | start_node | ||
) | [static] |
Definition at line 2671 of file editarmature_retarget.c.
References RigNode::arcs, BIF_otherNodeFromIndex(), BLI_otherNode(), RigNode::degree, findCorrespondingArc(), i, if(), RigNode::link_mesh, RigArc::link_mesh, matchMultiResolutionNode(), and retargetArctoArc().
Referenced by retargetGraphs().
Definition at line 689 of file editarmature_retarget.c.
References BLI_ghash_insert(), RigControl::bone, RigGraph::controls_map, copy_v3_v3(), getEditBoneRollUpAxis(), RigControl::head, EditBone::head, EditBone::name, newRigControl(), EditBone::roll, EditBone::tail, RigControl::tail, RigControl::tail_mode, TL_NONE, and RigControl::up_axis.
Referenced by RIG_arcFromBoneChain().
Definition at line 431 of file editarmature_retarget.c.
References RigEdge::bone, copy_v3_v3(), getEditBoneRollUpAxis(), MEM_callocN(), RIG_appendEdgeToArc(), EditBone::roll, RigEdge::tail, and RigEdge::up_axis.
Referenced by RIG_arcFromBoneChain().
Definition at line 409 of file editarmature_retarget.c.
References BLI_addtail(), copy_v3_v3(), RigArc::count, RigArc::edges, RigArc::head, RigEdge::head, len_v3v3(), RigArc::length, RigEdge::length, NULL, RigNode::p, RigEdge::prev, RIG_calculateEdgeAngles(), and RigEdge::tail.
Referenced by RIG_addEdgeToArc(), and RIG_joinArcs().
static void RIG_arcFromBoneChain | ( | RigGraph * | rg, |
ListBase * | list, | ||
EditBone * | root_bone, | ||
RigNode * | starting_node, | ||
int | selected | ||
) | [static] |
Definition at line 1296 of file editarmature_retarget.c.
References addRigNodeHead(), BLI_ghash_insert(), BONE_CONNECTED, BONE_EDITMODE_LOCKED, BONE_NO_DEFORM, BONE_SELECTED, RigGraph::bones_map, countEditBoneChildren(), EditBone::flag, EditBone::head, RigGraph::head, i, EditBone::name, newRigArc(), newRigNode(), newRigNodeHead(), newRigNodeTail(), nextEditBoneChild(), NULL, EditBone::parent, RIG_addControlBone(), RIG_addEdgeToArc(), RigArc::tail, and EditBone::tail.
Referenced by armatureSelectedToGraph(), and RIG_graphFromArmature().
Definition at line 664 of file editarmature_retarget.c.
References RigEdge::angle, angle_normalized_v3v3(), RigEdge::bone, cross_v3_v3v3(), RigEdge::head, normalize_v3(), NULL, sub_v3_v3v3(), RigEdge::tail, RigEdge::up_angle, and RigEdge::up_axis.
Referenced by RIG_appendEdgeToArc().
static void RIG_findHead | ( | RigGraph * | rg | ) | [static] |
Definition at line 1385 of file editarmature_retarget.c.
References RigGraph::arcs, BLI_countlist(), RigEdge::bone, BONE_SELECTED, BONE_TIPSEL, RigArc::edges, ListBase::first, EditBone::flag, RigArc::head, RigGraph::head, ListBase::last, RigArc::next, RigGraph::nodes, NULL, and RigArc::tail.
Referenced by armatureSelectedToGraph(), and RIG_graphFromArmature().
static void RIG_freeRigArc | ( | BArc * | arc | ) | [static] |
Definition at line 263 of file editarmature_retarget.c.
References BLI_freelistN().
Referenced by newRigGraph(), and RIG_freeRigGraph().
void RIG_freeRigGraph | ( | BGraph * | rg | ) |
Definition at line 268 of file editarmature_retarget.c.
References BGraph::arcs, BLI_destroy_worker(), BLI_freelistN(), BLI_freeNode(), BLI_ghash_free(), RigGraph::bones_map, RigGraph::controls, RigGraph::controls_map, RigGraph::editbones, ListBase::first, RigGraph::flag, RigGraph::link_mesh, MEM_freeN(), BArc::next, BNode::next, BGraph::nodes, NULL, REEB_freeGraph(), RIG_FREE_BONELIST, RIG_freeRigArc(), and RigGraph::worker.
Referenced by BIF_freeRetarget(), BIF_freeTemplates(), BIF_retargetArc(), BIF_setTemplate(), and sk_makeTemplateGraph().
Definition at line 1531 of file editarmature_retarget.c.
References BLI_buildAdjacencyList(), BLI_isGraphCyclic(), BLI_markdownSymmetry(), BLI_removeDoubleNodes(), bArmature::bonebase, CTX_data_edit_object(), CTX_data_scene(), Object::data, RigGraph::editbones, ListBase::first, RigGraph::flag, make_boneList(), MEM_callocN(), newRigGraph(), EditBone::next, NULL, RigGraph::ob, EditBone::parent, RIG_arcFromBoneChain(), RIG_findHead(), RIG_FREE_BONELIST, RIG_reconnectControlBones(), RIG_removeNormalNodes(), RIG_removeUneededOffsets(), ToolSettings::skgen_symmetry_limit, and Scene::toolsettings.
static void RIG_joinArcs | ( | RigGraph * | rg, |
RigNode * | node, | ||
RigArc * | joined_arc1, | ||
RigArc * | joined_arc2 | ||
) | [static] |
Definition at line 1045 of file editarmature_retarget.c.
References BLI_removeArc(), BLI_removeNode(), RigArc::edges, ListBase::first, RigArc::head, ListBase::last, RigEdge::next, NULL, RIG_appendEdgeToArc(), and RigArc::tail.
Referenced by RIG_removeNormalNodes().
const char* RIG_nameBone | ( | RigGraph * | rg, |
int | arc_index, | ||
int | bone_index | ||
) |
Definition at line 2761 of file editarmature_retarget.c.
References RigGraph::arcs, BLI_countlist(), BLI_findlink(), RigEdge::bone, RigArc::edges, EditBone::name, and NULL.
Referenced by BIF_nameBoneTemplate().
int RIG_nbJoints | ( | RigGraph * | rg | ) |
Definition at line 2791 of file editarmature_retarget.c.
References RigGraph::arcs, BLI_countlist(), RigArc::edges, ListBase::first, RigArc::next, and RigGraph::nodes.
Referenced by BIF_nbJointsTemplate().
static int RIG_parentControl | ( | RigControl * | ctrl, |
EditBone * | link | ||
) | [static] |
Definition at line 701 of file editarmature_retarget.c.
References RigControl::bone, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), RigControl::flag, EditBone::head, len(), link(), RigControl::link, NULL, RigControl::offset, EditBone::parent, RIG_CTRL_FIT_BONE, RIG_CTRL_FIT_ROOT, sub_v3_v3v3(), and EditBone::tail.
Referenced by RIG_reconnectControlBones().
Definition at line 1486 of file editarmature_retarget.c.
References RigEdge::angle, RigEdge::bone, RigArc::edges, ListBase::first, RigArc::head, RigEdge::length, M_PI, EditBone::name, RigEdge::next, RIG_printLinkedCtrl(), RIG_printNode(), RigArc::symmetry_flag, RigArc::symmetry_group, RigArc::symmetry_level, RigArc::tail, and RigEdge::tail.
Referenced by RIG_printGraph().
void RIG_printArcBones | ( | RigArc * | arc | ) |
Definition at line 1435 of file editarmature_retarget.c.
References RigEdge::bone, RigArc::edges, ListBase::first, EditBone::name, and RigEdge::next.
static void RIG_printCtrl | ( | RigControl * | ctrl, |
char * | indent | ||
) | [static] |
Definition at line 1449 of file editarmature_retarget.c.
References BLI_snprintf(), RigControl::bone, RigControl::flag, RigControl::link, EditBone::name, RigControl::offset, and print_v3().
Referenced by RIG_printLinkedCtrl().
void RIG_printGraph | ( | RigGraph * | rg | ) |
Definition at line 1508 of file editarmature_retarget.c.
References RigGraph::arcs, ListBase::first, RigGraph::head, RigArc::next, RIG_printArc(), and RIG_printNode().
Definition at line 1462 of file editarmature_retarget.c.
References RigControl::bone, RigGraph::controls, ListBase::first, i, RigControl::link, RigControl::next, and RIG_printCtrl().
Referenced by RIG_printArc().
static void RIG_printNode | ( | RigNode * | node, |
const char | name[] | ||
) | [static] |
Definition at line 1420 of file editarmature_retarget.c.
References RigNode::degree, print_v3(), SYM_AXIAL, SYM_RADIAL, and SYM_TOPOLOGICAL.
Referenced by RIG_printArc(), and RIG_printGraph().
static void RIG_reconnectControlBones | ( | RigGraph * | rg | ) | [static] |
Definition at line 776 of file editarmature_retarget.c.
References RigGraph::arcs, BLI_ghash_haskey(), BLI_ghash_lookup(), BLI_ghashIterator_getValue(), BLI_ghashIterator_init(), BLI_ghashIterator_isDone(), BLI_ghashIterator_step(), RigEdge::bone, RigControl::bone, RigGraph::bones_map, bPose::chanbase, constraint_get_typeinfo(), CONSTRAINT_TYPE_KINEMATIC, bPoseChannel::constraints, RigGraph::controls, RigGraph::controls_map, RigArc::edges, ListBase::first, RigControl::flag, bConstraintTypeInfo::flush_constraint_targets, bConstraintTypeInfo::get_constraint_targets, EditBone::head, len_v3v3(), link(), RigControl::link, RigControl::link_tail, bPoseChannel::name, EditBone::name, bPoseChannel::next, RigArc::next, RigEdge::next, bConstraint::next, RigControl::next, bConstraintTarget::next, NULL, RigGraph::ob, EditBone::parent, Object::pose, RIG_CTRL_FIT_BONE, RIG_parentControl(), bConstraintTarget::subtarget, RigArc::symmetry_level, EditBone::tail, RigControl::tail_mode, bConstraintTarget::tar, TL_HEAD, TL_NONE, TL_TAIL, and bConstraint::type.
Referenced by armatureSelectedToGraph(), and RIG_graphFromArmature().
static void RIG_removeNormalNodes | ( | RigGraph * | rg | ) | [static] |
Definition at line 1079 of file editarmature_retarget.c.
References RigGraph::arcs, RigNode::degree, ListBase::first, RigArc::head, RigArc::next, RigNode::next, RigGraph::nodes, NULL, RIG_joinArcs(), and RigArc::tail.
Referenced by armatureSelectedToGraph(), and RIG_graphFromArmature().
static void RIG_removeUneededOffsets | ( | RigGraph * | rg | ) | [static] |
Definition at line 1112 of file editarmature_retarget.c.
References RigEdge::angle, RigGraph::arcs, BLI_FindNodeByPosition(), BLI_remlink(), BLI_replaceNodeInArc(), RigEdge::bone, copy_v3_v3(), RigNode::degree, RigArc::edges, ListBase::first, RigArc::head, BArc::head, RigEdge::head, ListBase::last, len_v3v3(), MEM_freeN(), RigArc::next, RigEdge::next, NULL, RigNode::p, RigEdge::prev, RigArc::tail, RigEdge::tail, and BArc::tail.
Referenced by armatureSelectedToGraph(), and RIG_graphFromArmature().
float rollBoneByQuat | ( | EditBone * | bone, |
float | old_up_axis[3], | ||
float | qrot[4] | ||
) |
Definition at line 251 of file editarmature_retarget.c.
References copy_v3_v3(), ED_rollBoneToVector(), FALSE, and mul_qt_v3().
Referenced by finalizeControl(), and repositionBone().
static float rollBoneByQuatAligned | ( | EditBone * | bone, |
float | old_up_axis[3], | ||
float | qrot[4], | ||
float | qroll[4], | ||
float | aligned_axis[3] | ||
) | [static] |
Definition at line 163 of file editarmature_retarget.c.
References angle_normalized_v3v3(), copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), ED_rollBoneToVector(), FALSE, EditBone::head, mul_qt_v3(), negate_v3(), normalize_v3(), rotation_between_vecs_to_quat(), sub_v3_v3v3(), and EditBone::tail.
Referenced by repositionBone(), and rollBoneByQuatJoint().
static float rollBoneByQuatJoint | ( | RigEdge * | edge, |
RigEdge * | previous, | ||
float | qrot[4], | ||
float | qroll[4], | ||
float | up_axis[3] | ||
) | [static] |
Definition at line 201 of file editarmature_retarget.c.
References axis_angle_to_quat(), RigEdge::bone, copy_v3_v3(), cross_v3_v3v3(), ED_rollBoneToVector(), FALSE, EditBone::head, mul_qt_v3(), normalize_v3(), NULL, RigEdge::prev, rollBoneByQuatAligned(), rotation_between_vecs_to_quat(), sub_v3_v3v3(), EditBone::tail, RigEdge::up_angle, and RigEdge::up_axis.
Referenced by repositionBone().
static MemoNode* solveJoints | ( | MemoNode * | table, |
BArcIterator * | iter, | ||
float ** | vec_cache, | ||
int | nb_joints, | ||
int | nb_positions, | ||
int | previous, | ||
int | current, | ||
RigEdge * | edge, | ||
int | joints_left, | ||
float | angle_weight, | ||
float | length_weight, | ||
float | distance_weight | ||
) | [static] |
Definition at line 2105 of file editarmature_retarget.c.
References calcCostAngleLengthDistance(), indexMemoNode(), BArcIterator::length, MAX_COST, RigEdge::next, MemoNode::next, next, and NULL.
Referenced by retargetArctoArcAggresive().
Definition at line 2176 of file editarmature_retarget.c.
References BIF_NodeFromIndex(), RigArc::head, ReebArc::head, RigArc::link_mesh, RigNode::link_mesh, ReebArc::tail, and RigArc::tail.
Referenced by exec_retargetArctoArc(), retargetArctoArcAggresive(), and retargetArctoArcLength().
RigGraph* GLOBAL_RIGG = NULL [static] |
Definition at line 104 of file editarmature_retarget.c.