selected_pchans --> selected_pose_bones, same for visible_pchans

added use_ prefix to bools offset --> use_offset, tail --> use_tail for eg.
This commit is contained in:
Campbell Barton 2009-11-25 15:00:29 +00:00
parent b129ccf000
commit 553374bd4c
10 changed files with 49 additions and 49 deletions

@ -187,16 +187,16 @@ class ConstraintButtonsPanel(bpy.types.Panel):
col.label(text="Weight:")
col.prop(con, "weight", text="Position", slider=True)
sub = col.column()
sub.active = con.rotation
sub.active = con.use_rotation
sub.prop(con, "orient_weight", text="Rotation", slider=True)
if wide_ui:
col = split.column()
col.prop(con, "tail")
col.prop(con, "stretch")
col.prop(con, "use_tail")
col.prop(con, "use_stretch")
col.separator()
col.prop(con, "targetless")
col.prop(con, "rotation")
col.prop(con, "use_target")
col.prop(con, "use_rotation")
def IK_COPY_POSE(self, context, layout, con, wide_ui):
self.target_template(layout, con, wide_ui)
@ -217,13 +217,13 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.prop(con, "pos_lock_x", text="X")
row.prop(con, "pos_lock_y", text="Y")
row.prop(con, "pos_lock_z", text="Z")
split.active = con.position
split.active = con.use_position
split = layout.split(percentage=0.33)
split.row().prop(con, "rotation")
row = split.row()
row.prop(con, "orient_weight", text="Weight", slider=True)
row.active = con.rotation
row.active = con.use_rotation
split = layout.split(percentage=0.33)
row = split.row()
row.label(text="Lock:")
@ -231,7 +231,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.prop(con, "rot_lock_x", text="X")
row.prop(con, "rot_lock_y", text="Y")
row.prop(con, "rot_lock_z", text="Z")
split.active = con.rotation
split.active = con.use_rotation
def IK_DISTANCE(self, context, layout, con, wide_ui):
self.target_template(layout, con, wide_ui)
@ -257,7 +257,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
if con.use_fixed_position:
col.prop(con, "offset_factor", text="Offset")
else:
col.prop(con, "offset")
col.prop(con, "use_offset")
row = layout.row()
if wide_ui:
@ -419,7 +419,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
sub.active = con.rotate_like_z
sub.prop(con, "invert_z", text="Invert")
layout.prop(con, "offset")
layout.prop(con, "use_offset")
self.space_template(layout, con, wide_ui)
@ -446,7 +446,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
sub.active = con.locate_like_z
sub.prop(con, "invert_z", text="Invert")
layout.prop(con, "offset")
layout.prop(con, "use_offset")
self.space_template(layout, con, wide_ui)
@ -458,7 +458,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row.prop(con, "size_like_y", text="Y")
row.prop(con, "size_like_z", text="Z")
layout.prop(con, "offset")
layout.prop(con, "use_offset")
self.space_template(layout, con, wide_ui)

@ -249,8 +249,8 @@ int CTX_data_visible_bones(const bContext *C, ListBase *list);
int CTX_data_editable_bones(const bContext *C, ListBase *list);
struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C);
int CTX_data_selected_pchans(const bContext *C, ListBase *list);
int CTX_data_visible_pchans(const bContext *C, ListBase *list);
int CTX_data_selected_pose_bones(const bContext *C, ListBase *list);
int CTX_data_visible_bose_bones(const bContext *C, ListBase *list);
#ifdef __cplusplus
}

@ -883,13 +883,13 @@ struct bPoseChannel *CTX_data_active_pose_bone(const bContext *C)
return ctx_data_pointer_get(C, "active_pose_bone");
}
int CTX_data_selected_pchans(const bContext *C, ListBase *list)
int CTX_data_selected_pose_bones(const bContext *C, ListBase *list)
{
return ctx_data_collection_get(C, "selected_pchans", list);
return ctx_data_collection_get(C, "selected_pose_bones", list);
}
int CTX_data_visible_pchans(const bContext *C, ListBase *list)
int CTX_data_visible_pose_bones(const bContext *C, ListBase *list)
{
return ctx_data_collection_get(C, "visible_pchans", list);
return ctx_data_collection_get(C, "visible_pose_bones", list);
}

@ -1220,7 +1220,7 @@ static short modifykey_get_context_v3d_data (bContext *C, ListBase *dsources, Ke
//}
#endif
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
/* add a new keying-source */
cks= MEM_callocN(sizeof(bCommonKeySrc), "bCommonKeySrc");

@ -1316,7 +1316,7 @@ static int pose_setflag_exec (bContext *C, wmOperator *op)
int mode= RNA_enum_get(op->ptr, "mode");
/* loop over all selected pchans */
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones)
{
bone_setflag(&pchan->bone->flag, flag, mode);
}
@ -4800,7 +4800,7 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op)
cks.id= &ob->id;
/* only clear those channels that are not locked */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) {
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) {
if ((pchan->protectflag & OB_LOCK_SCALEX)==0)
pchan->size[0]= 1.0f;
if ((pchan->protectflag & OB_LOCK_SCALEY)==0)
@ -4863,7 +4863,7 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op)
cks.id= &ob->id;
/* only clear those channels that are not locked */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) {
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) {
/* clear location */
if ((pchan->protectflag & OB_LOCK_LOCX)==0)
pchan->loc[0]= 0.0f;
@ -4927,7 +4927,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op)
cks.id= &ob->id;
/* only clear those channels that are not locked */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) {
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) {
if (pchan->protectflag & (OB_LOCK_ROTX|OB_LOCK_ROTY|OB_LOCK_ROTZ|OB_LOCK_ROTW)) {
/* check if convert to eulers for locking... */
if (pchan->protectflag & OB_LOCK_ROT4D) {
@ -5068,7 +5068,7 @@ static int pose_select_inverse_exec(bContext *C, wmOperator *op)
{
/* Set the flags */
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pchans) {
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) {
if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) {
pchan->bone->flag ^= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
}
@ -5101,10 +5101,10 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op)
/* Determine if there are any selected bones and therefore whether we are selecting or deselecting */
// NOTE: we have to check for > 1 not > 0, since there is almost always an active bone that can't be cleared...
if (CTX_DATA_COUNT(C, selected_pchans) > 1) sel=0;
if (CTX_DATA_COUNT(C, selected_pose_bones) > 1) sel=0;
/* Set the flags */
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pchans) {
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones) {
/* select pchan only if selectable, but deselect works always */
if (sel==0) {
pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);

@ -178,7 +178,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode)
/* for each Pose-Channel which gets affected, get the F-Curves for that channel
* and set the relevant transform flags...
*/
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
ListBase curves = {NULL, NULL};
int transFlags = action_get_item_transforms(act, pso->ob, pchan, &curves);

@ -1329,7 +1329,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
/* add selected bones to group then */
// NOTE: unfortunately, we cannot use the context-iterators here, since they might not be defined...
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans) {
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) {
pchan->agrp_index= pose->active_group;
done= 1;
}
@ -1388,7 +1388,7 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *op)
/* add selected bones to ungroup then */
// NOTE: unfortunately, we cannot use the context-iterators here, since they might not be defined...
// CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
// CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
// NOTE: sync this view3d_context() in space_view3d.c
@ -1530,7 +1530,7 @@ static int pose_flip_names_exec (bContext *C, wmOperator *op)
arm= ob->data;
/* loop through selected bones, auto-naming them */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
BLI_strncpy(newname, pchan->name, sizeof(newname));
bone_flip_name(newname, 1); // 1 = do strip off number extensions
@ -1577,7 +1577,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
arm= ob->data;
/* loop through selected bones, auto-naming them */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
BLI_strncpy(newname, pchan->name, sizeof(newname));
bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]);
@ -1755,7 +1755,7 @@ static int pose_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt)
/* get layers that are active already */
memset(&layers, 0, sizeof(layers)); /* set all layers to be off by default */
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones)
{
short bit;
@ -1786,7 +1786,7 @@ static int pose_bone_layers_exec (bContext *C, wmOperator *op)
RNA_boolean_get_array(op->ptr, "layers", layers);
/* set layers of pchans based on the values set in the operator props */
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones)
{
/* get pointer for pchan, and write flags this way */
RNA_pointer_create((ID *)arm, &RNA_Bone, pchan->bone, &ptr);

@ -800,7 +800,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
/* free constraints for all selected bones */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
free_constraints(&pchan->constraints);
pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_SPLINEIK|PCHAN_HAS_CONST);
@ -917,7 +917,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o
/* if the active Object is Armature, and we can search for bones, do so... */
if ((obact->type == OB_ARMATURE) && (only_ob == 0)) {
/* search in list of selected Pose-Channels for target */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
/* just use the first one that we encounter, as long as it is not the active one */
if (pchan != pchanact) {
@ -1345,7 +1345,7 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *op)
Object *ob= CTX_data_active_object(C);
/* only remove IK Constraints */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pchans)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
bConstraint *con, *next;

@ -64,7 +64,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
"scene", "selected_objects", "selected_bases",
"selected_editable_objects", "selected_editable_bases",
"visible_bones", "editable_bones", "selected_bones", "selected_editable_bones",
"visible_pchans", "selected_pchans", "active_bone", "active_pose_bone",
"visible_pose_bones", "selected_pose_bones", "active_bone", "active_pose_bone",
"active_base", "active_object", "object", "edit_object",
"sculpt_object", "vertex_paint_object", "weight_paint_object",
"texture_paint_object", "particle_edit_object", NULL};
@ -192,7 +192,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
else if(CTX_data_equals(member, "visible_pchans")) {
else if(CTX_data_equals(member, "visible_pose_bones")) {
bArmature *arm= (obact) ? obact->data : NULL;
bPoseChannel *pchan;
@ -207,7 +207,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
return 1;
}
}
else if(CTX_data_equals(member, "selected_pchans")) {
else if(CTX_data_equals(member, "selected_pose_bones")) {
bArmature *arm= (obact) ? obact->data : NULL;
bPoseChannel *pchan;

@ -478,7 +478,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "tail", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP);
RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@ -489,7 +489,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "position", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_position", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_POS);
RNA_def_property_ui_text(prop, "Position", "Chain follows position of target.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@ -509,7 +509,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "rotation", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT);
RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@ -529,12 +529,12 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Z Rot", "Constraint rotation along Z axis");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "targetless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
RNA_def_property_ui_text(prop, "Targetless", "Use targetless IK.");
prop= RNA_def_property(srna, "use_target", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO);
RNA_def_property_ui_text(prop, "Target", "Disable for targetless IK.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
prop= RNA_def_property(srna, "stretch", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH);
RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update");
@ -662,7 +662,7 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original rotation into copied rotation.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@ -725,7 +725,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
@ -818,7 +818,7 @@ static void rna_def_constraint_size_like(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Like Z", "Copy the target's Z scale.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");
prop= RNA_def_property(srna, "offset", PROP_BOOLEAN, PROP_NONE);
prop= RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET);
RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale.");
RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update");