[Bf-committers] isSelected() property for bones in python API
fab
fab at gnux.info
Sat Sep 10 02:07:54 CEST 2005
here is the patch:
Index: ./source/blender/python/api2_2x/Bone.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Bone.c,v
retrieving revision 1.34
diff -b -B -r1.34 Bone.c
84a85
> static PyObject *Bone_isSelected( BPy_Bone * self );
128a130,131
> {"isSelected", ( PyCFunction ) Bone_isSelected, METH_NOARGS,
> "() - get the Bone Selected flag."},
459a463,464
> else if( strcmp( name, "selected" ) == 0 )
> attr = Bone_isSelected( self );
1588a1594,1613
> }
>
> //--------------- BPy_Bone.isSelected()-------------------------------
> static PyObject *Bone_isSelected( BPy_Bone * self )
> {
> if( !self->bone ) { //test to see if linked to armature
> //use python vars
> if( self->flag & BONE_SELECTED) {
> return EXPP_incr_ret_True();
> } else {
> return EXPP_incr_ret_False();
> }
> } else {
> //use bone datastruct
> if( self->bone->flag & BONE_SELECTED) {
> return EXPP_incr_ret_True();
> } else {
> return EXPP_incr_ret_False();
> }
> }
PS: Thanks to Dandel who gave me precious informations :)
More information about the Bf-committers
mailing list