Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#25081] changes to pose bone selection state via python have no effect.

Date:
2010-12-07 11:33
Priority:
3
State:
Closed
Submitted by:
Josh Wedlake (joshwedlake)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Python
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
changes to pose bone selection state via python have no effect.
Detailed description
see attached file with simplified example.

Basically setting bpy.context.active_object.pose.bones['Bone'].select=True or False has no effect. Maybe this part of context is meant to be read only and return an error? If so is there a correct way to set selection state without using ops?

Thanks,
Josh

Followup

Message
  • Date: 2010-12-07 12:16
  • Sender: Joshua Leung
  • I think what you're seeing, is that the context.selected_pose_bones list always includes the "active" bone too. Hence, even if you manage to unselect the bones, you can't make it non-active.

    Assigning to Campbell for final verification on whether there are any other alternatives via py...
  • Date: 2010-12-07 13:20
  • Sender: Josh Wedlake
  • Hey Aligorith,

    The script tries to deselect all the selected bones, not just the active bone - I should have said in my instructions select 'more than one' not one or more... thanks for pointing that out.

    However just double checking... with objects bpy.context.selected_objects does not contain the active object if it is not selected so I'm not sure whether this should be the case with bones?

    Thanks,
    Josh
  • Date: 2010-12-08 02:15
  • Sender: Campbell Barton
  • Hey Aligorith,

    Could we have Active & Selection be disconnected, just like with object & mesh mode?
    IMHO the way it is now is inconsistent and confusing for the developer and the user.

    The check for POSE_OT_select_all toggle is incorrect at the moment, but I think including an unselected bone in the selected list is just asking for problems.

    Example of how it fails:
    - Add Bone
    - Enter Posebone
    - Akey to toggle selection (Nothing happens)

    While this can be fixed, Id prefer to make selection work like the rest of blender.
  • Date: 2010-12-08 02:41
  • Sender: Campbell Barton
  • Hi Again Aligorith,
    My original intention with adding active bone was that it should behave the same as objects, looking over the code I think this is best.

    Will commit in a bit.
  • Date: 2010-12-08 05:41
  • Sender: Campbell Barton
  • remove pose_bone.select this is only ever used on read/write, use pose_bone.bone.select now.
 

Attached Files:

Name Date Download
bone_select_bug.blend 2010-12-07 11:33 Download

Changes:

Field Old Value Date By
ResolutionInvestigate2010-12-08 05:41campbellbarton
close_date2010-12-08 05:412010-12-08 05:41campbellbarton
status_idOpen2010-12-08 05:41campbellbarton
ResolutionNew2010-12-07 12:16aligorith
assigned_tonone2010-12-07 12:16aligorith
File Added14008: bone_select_bug.blend2010-12-07 11:33joshwedlake