rename pose_channels to bones

was: object.pose.pose_channels["Bone"]
now: object.pose.bones["Bone"]
This commit is contained in:
Campbell Barton 2009-11-18 11:40:55 +00:00
parent 95229aa6f5
commit 67c295da9c
22 changed files with 55 additions and 53 deletions

@ -868,7 +868,7 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
/* build PointerRNA from provided data to obtain the paths to use */
if (pchan)
RNA_pointer_create((ID *)ob, &RNA_PoseChannel, pchan, &ptr);
RNA_pointer_create((ID *)ob, &RNA_PoseBone, pchan, &ptr);
else if (ob)
RNA_id_pointer_create((ID *)ob, &ptr);
else

@ -353,7 +353,7 @@ static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName
/* Fix all RNA-Paths in the AnimData block used by the given ID block
* NOTE: it is assumed that the structure we're replacing is <prefix><["><name><"]>
* i.e. pose.pose_channels["Bone"]
* i.e. pose.bones["Bone"]
*/
void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, char *oldName, char *newName)
{
@ -388,7 +388,7 @@ void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, c
/* Fix all RNA-Paths throughout the database (directly access the Global.main version)
* NOTE: it is assumed that the structure we're replacing is <prefix><["><name><"]>
* i.e. pose.pose_channels["Bone"]
* i.e. pose.bones["Bone"]
*/
void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newName)
{

@ -327,7 +327,7 @@ static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node
node1 = dag_get_node(dag, dtar->id);
/* check if bone... */
if ((ob->type==OB_ARMATURE) && dtar->rna_path && strstr(dtar->rna_path, "pose.pose_channels["))
if ((ob->type==OB_ARMATURE) && dtar->rna_path && strstr(dtar->rna_path, "pose.bones["))
dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Driver");
/* check if ob data */
else if (dtar->rna_path && strstr(dtar->rna_path, "data."))

@ -881,7 +881,7 @@ static void driver_get_target_pchans2 (ChannelDriver *driver, bPoseChannel **pch
/* resolve path so that we have pointer to the right posechannel */
if (RNA_path_resolve(&id_ptr, dtar->rna_path, &ptr, &prop)) {
/* is pointer valid (i.e. pointing to an actual posechannel */
if ((ptr.type == &RNA_PoseChannel) && (ptr.data)) {
if ((ptr.type == &RNA_PoseBone) && (ptr.data)) {
/* first or second target? */
if (i)
*pchan1= ptr.data;

@ -919,11 +919,11 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
/* append preceeding bits to path */
if ((actname && actname[0]) && (constname && constname[0])) {
/* Constraint in Pose-Channel */
sprintf(buf, "pose.pose_channels[\"%s\"].constraints[\"%s\"]", actname, constname);
sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
}
else if (actname && actname[0]) {
/* Pose-Channel */
sprintf(buf, "pose.pose_channels[\"%s\"]", actname);
sprintf(buf, "pose.bones[\"%s\"]", actname);
}
else if (constname && constname[0]) {
/* Constraint in Object */

@ -989,7 +989,7 @@ public:
void get_rna_path_for_joint(COLLADAFW::Node *node, char *joint_path, size_t count)
{
BLI_snprintf(joint_path, count, "pose.pose_channels[\"%s\"]", get_joint_name(node));
BLI_snprintf(joint_path, count, "pose.bones[\"%s\"]", get_joint_name(node));
}
void fix_animation()
@ -1979,7 +1979,7 @@ public:
return true;
}
// for bones rna_path is like: pose.pose_channels["bone-name"].rotation
// for bones rna_path is like: pose.bones["bone-name"].rotation
// what does this AnimationList animate?
Animation& animated = uid_animated_map[anim_list_id];
@ -2165,7 +2165,7 @@ public:
char joint_path[100];
char rna_path[100];
BLI_snprintf(joint_path, sizeof(joint_path), "pose.pose_channels[\"%s\"]", grp->name);
BLI_snprintf(joint_path, sizeof(joint_path), "pose.bones[\"%s\"]", grp->name);
BLI_snprintf(rna_path, sizeof(rna_path), "%s.rotation_euler", joint_path);
FCurve *quatcu[4] = {

@ -779,13 +779,13 @@ static int animdata_filter_fcurves (ListBase *anim_data, bDopeSheet *ads, FCurve
{
Object *ob= (Object *)owner_id;
/* only consider if F-Curve involves pose_channels */
if ((fcu->rna_path) && strstr(fcu->rna_path, "pose_channels")) {
/* only consider if F-Curve involves pose.bones */
if ((fcu->rna_path) && strstr(fcu->rna_path, "bones")) {
bPoseChannel *pchan;
char *bone_name;
/* get bone-name, and check if this bone is selected */
bone_name= BLI_getQuotedStr(fcu->rna_path, "pose_channels[");
bone_name= BLI_getQuotedStr(fcu->rna_path, "bones[");
pchan= get_pose_channel(ob->pose, bone_name);
if (bone_name) MEM_freeN(bone_name);

@ -109,9 +109,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
* - however, if we're showing subdata of bones (probably there will be other exceptions later)
* need to include that info too since it gets confusing otherwise
*/
if (strstr(fcu->rna_path, "pose_channels") && strstr(fcu->rna_path, "constraints")) {
if (strstr(fcu->rna_path, "bones") && strstr(fcu->rna_path, "constraints")) {
/* perform string 'chopping' to get "Bone Name : Constraint Name" */
char *pchanName= BLI_getQuotedStr(fcu->rna_path, "pose_channels[");
char *pchanName= BLI_getQuotedStr(fcu->rna_path, "bones[");
char *constName= BLI_getQuotedStr(fcu->rna_path, "constraints[");
/* assemble the string to display in the UI... */

@ -511,7 +511,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
con= ob->constraints.first;
identifier= (char *)RNA_property_identifier(prop);
}
else if (ptr->type == &RNA_PoseChannel) {
else if (ptr->type == &RNA_PoseBone) {
/* Pose Channel */
bPoseChannel *pchan= (bPoseChannel *)ptr->data;
@ -622,7 +622,7 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_
}
}
}
else if (ptr->type == &RNA_PoseChannel) {
else if (ptr->type == &RNA_PoseBone) {
Object *ob= (Object *)ptr->id.data; /* we assume that this is always set, and is an object */
bPoseChannel *pchan= (bPoseChannel *)ptr->data;
float tmat[4][4];

@ -1395,7 +1395,7 @@ int modify_keyframes (Scene *scene, ListBase *dsources, bAction *act, KeyingSet
// FIXME: this currently only works with a few hardcoded cases
if ((ksp->templates & KSP_TEMPLATE_PCHAN) && (cks->pchan)) {
/* add basic pose-channel path access */
BLI_dynstr_append(pathds, "pose.pose_channels[\"");
BLI_dynstr_append(pathds, "pose.bones[\"");
BLI_dynstr_append(pathds, cks->pchan->name);
BLI_dynstr_append(pathds, "\"]");

@ -5411,7 +5411,7 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
// TODO: should we be using the database wide version instead (since drivers may break)
if (ob->adt) {
/* posechannels only... */
BKE_animdata_fix_paths_rename(&ob->id, ob->adt, "pose.pose_channels", oldname, newname);
BKE_animdata_fix_paths_rename(&ob->id, ob->adt, "pose.bones", oldname, newname);
}
}
}

@ -195,7 +195,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode)
pfl->pchan= pchan;
/* get the RNA path to this pchan - this needs to be freed! */
RNA_pointer_create((ID *)pso->ob, &RNA_PoseChannel, pchan, &ptr);
RNA_pointer_create((ID *)pso->ob, &RNA_PoseBone, pchan, &ptr);
pfl->pchan_path= RNA_path_from_ID_to_struct(&ptr);
/* add linkage data to operator data */

@ -200,7 +200,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
for (pchan= obact->pose->chanbase.first; pchan; pchan= pchan->next) {
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
CTX_data_list_add(result, &obact->id, &RNA_PoseChannel, pchan);
CTX_data_list_add(result, &obact->id, &RNA_PoseBone, pchan);
}
}
@ -216,7 +216,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
if (pchan->bone->flag & BONE_SELECTED || pchan->bone == arm->act_bone)
CTX_data_list_add(result, &obact->id, &RNA_PoseChannel, pchan);
CTX_data_list_add(result, &obact->id, &RNA_PoseBone, pchan);
}
}
@ -245,7 +245,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
pchan= get_active_posechannel(obact);
if (pchan) {
CTX_data_pointer_set(result, &obact->id, &RNA_PoseChannel, pchan);
CTX_data_pointer_set(result, &obact->id, &RNA_PoseBone, pchan);
return 1;
}
}

@ -72,7 +72,7 @@ void node_operatortypes(void)
void node_keymap(struct wmKeyConfig *keyconf)
{
wmKeyMap *keymap;
wmKeyMapItem *kmi;
// wmKeyMapItem *kmi;
/* Entire Editor only ----------------- */
keymap= WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);

@ -1560,7 +1560,7 @@ static void bone_matrix_translate_y(float mat[][4], float y)
}
/* assumes object is Armature with pose */
static void draw_pose_channels(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt)
static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt)
{
RegionView3D *rv3d= ar->regiondata;
Object *ob= base->object;
@ -2380,7 +2380,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
draw_pose_channels(scene, v3d, ar, base, OB_WIRE);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
}
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
@ -2459,7 +2459,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
draw_pose_channels(scene, v3d, ar, base, OB_WIRE);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
}
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
@ -2529,7 +2529,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
draw_pose_channels(scene, v3d, ar, base, OB_WIRE);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
}
}
@ -2544,7 +2544,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
where_is_pose(scene, ob);
draw_pose_channels(scene, v3d, ar, base, OB_WIRE);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE);
}
}
}
@ -2627,7 +2627,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
}
}
}
draw_pose_channels(scene, v3d, ar, base, dt);
draw_pose_bones(scene, v3d, ar, base, dt);
arm->flag &= ~ARM_POSEMODE;
if(ob->mode & OB_MODE_POSE)

@ -504,7 +504,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
split = uiLayoutSplit(layout, 0.8);
if (ptr->type == &RNA_PoseChannel) {
if (ptr->type == &RNA_PoseBone) {
PointerRNA boneptr;
Bone *bone;
@ -591,7 +591,7 @@ static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo
return;
}
RNA_pointer_create(&ob->id, &RNA_PoseChannel, pchan, &pchanptr);
RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &pchanptr);
col= uiLayoutColumn(layout, 0);

@ -347,7 +347,7 @@ extern StructRNA RNA_PointDensityTexture;
extern StructRNA RNA_PointLamp;
extern StructRNA RNA_PointerProperty;
extern StructRNA RNA_Pose;
extern StructRNA RNA_PoseChannel;
extern StructRNA RNA_PoseBone;
extern StructRNA RNA_Property;
extern StructRNA RNA_PropertySensor;
extern StructRNA RNA_PythonConstraint;

@ -193,7 +193,7 @@ static char *rna_Constraint_path(PointerRNA *ptr)
/* if constraint is in the list, the list is for the active bone... */
if ((inList) && (actlist != &ob->constraints) && (pchan))
return BLI_sprintfN("pose.pose_channels[\"%s\"].constraints[\"%s\"]", pchan->name, con->name);
return BLI_sprintfN("pose.bones[\"%s\"].constraints[\"%s\"]", pchan->name, con->name);
else
return BLI_sprintfN("constraints[\"%s\"]", con->name);
}

@ -129,11 +129,13 @@ static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *
rna_iterator_listbase_begin(iter, &bmain->camera, NULL);
}
#if 0
static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain= (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->key, NULL);
}
#endif
static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{

@ -74,9 +74,9 @@ static void rna_Pose_IK_update(bContext *C, PointerRNA *ptr)
BIK_clear_data(ob->pose);
}
static char *rna_PoseChannel_path(PointerRNA *ptr)
static char *rna_PoseBone_path(PointerRNA *ptr)
{
return BLI_sprintfN("pose.pose_channels[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
return BLI_sprintfN("pose.bones[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
}
static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
@ -114,7 +114,7 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
}
}
static IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create)
static IDProperty *rna_PoseBone_idproperties(PointerRNA *ptr, int create)
{
bPoseChannel *pchan= ptr->data;
@ -578,11 +578,11 @@ static void rna_def_pose_channel(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "PoseChannel", NULL);
srna= RNA_def_struct(brna, "PoseBone", NULL);
RNA_def_struct_sdna(srna, "bPoseChannel");
RNA_def_struct_ui_text(srna, "Pose Channel", "Channel defining pose data for a bone in a Pose.");
RNA_def_struct_path_func(srna, "rna_PoseChannel_path");
RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties");
RNA_def_struct_ui_text(srna, "Pose Bone", "Channel defining pose data for a bone in a Pose.");
RNA_def_struct_path_func(srna, "rna_PoseBone_path");
RNA_def_struct_idproperties_func(srna, "rna_PoseBone_idproperties");
/* Bone Constraints */
prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
@ -619,17 +619,17 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bone", "Bone associated with this Pose Channel.");
RNA_def_property_ui_text(prop, "Bone", "Bone associated with this PoseBone.");
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "PoseChannel");
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Parent of this pose channel.");
RNA_def_property_ui_text(prop, "Parent", "Parent of this pose bone.");
prop= RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "PoseChannel");
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Child", "Child of this pose channel.");
RNA_def_property_ui_text(prop, "Child", "Child of this pose bone.");
/* Transformation settings */
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
@ -997,10 +997,10 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Pose", "A collection of pose channels, including settings for animating bones.");
/* pose channels */
prop= RNA_def_property(srna, "pose_channels", PROP_COLLECTION, PROP_NONE);
prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL);
RNA_def_property_struct_type(prop, "PoseChannel");
RNA_def_property_ui_text(prop, "Pose Channels", "Individual pose channels for the armature.");
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature.");
/* bone groups */
prop= RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE);

@ -2176,8 +2176,8 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
FunctionRNA *func;
PropertyRNA *parm;
// FunctionRNA *func;
// PropertyRNA *parm;
RNA_def_property_srna(cprop, "SceneObjects");
srna= RNA_def_struct(brna, "SceneObjects", NULL);
@ -2245,7 +2245,7 @@ void RNA_def_scene(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
PropertyRNA *prop_act;
// PropertyRNA *prop_act;
FunctionRNA *func;
static EnumPropertyItem audio_distance_model_items[] = {

@ -359,7 +359,7 @@ int BL_ArmatureConstraint::py_attr_setattr(void *self_v, const struct KX_PYATTRI
int attr_order = attrdef-Attributes;
int ival;
double dval;
char* sval;
// char* sval;
KX_GameObject *oval;
if (!constraint) {