[Bf-python] Select/isSelect/sel: new patch, whoops

Campbell Barton cbarton at metavr.com
Wed Jun 2 09:10:24 CEST 2004


Hi I just added a line  to 1683 of Object.c

set_active_base(base);

- This is good because it makes the last selected object active, I'll 
need this functionality when I add Object.Join().

Sorry I didnt update the patch, nobody seemed that interested.
- Cam

-

static PyObject *Object_select (BPy_Object *self, PyObject *args)
{
  Base *base;
  int sel;
 
  base= FIRSTBASE;
  if (!PyArg_ParseTuple (args, "i", &sel))
        return EXPP_ReturnPyObjError
           (PyExc_TypeError, "expected an int, 0 or 1");
   
  while (base) {
    if (base->object == self->object)
    {
      if (sel == 1)
      {
        base->flag |= SELECT;
        self->object->flag= base->flag;
        *set_active_base(base);*
      } else {
        base->flag &= ~SELECT;
        self->object->flag= base->flag;
      }
    break;
    }
  base= base->next;
  }
 
    countall(); 
 
  Py_INCREF (Py_None);
  return (Py_None);
}



Stephen Swaney wrote:

>Checked the patch in.
>
>Made a couple of minor text edits.
>
>Changed the name of Object.Select() to select() to follow
>the bpy convention of starting module or class method names
>with an uppercase letter and instance methods with lower case.
>  
>


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241




More information about the Bf-python mailing list