[Bf-python] makeparent()

Willian Padovani Germano wgermano at ig.com.br
Tue Nov 11 03:48:53 CET 2003


Hi Joe,

> This is what I have for makeparent() to make it work.......
>
> .............
>   child->partype = PAROBJECT; ......
>   child->parent = parent;        <------------ add this (it's important).
> This is what actually makes the parent child relationship!
>   //py_obj_child = (BPy_Object *) py_child; <--------- this doesn't seem
to
> serve a purpose bye!
> ..........
> ...........
>   /* We don't need the child object anymore. */
>   //Py_DECREF ((PyObject *) child); <------------- this crashes blender ??
> Its a cast of a datablock pointer to a py_object *?*
> ..............
>
> Correct me if Im wrong on the decref thing :)

You're right, that is not a PyObject.  Good catches btw : ).

Since you've already described them here, could you commit the fixes to
Object.c ?  We have about two weeks to test this well, that should be enough
time.  Blender 2.31 will be in the new Blender book's cd.

Also, you can add a line: "object->id.us = 0;" to Object_New().  When 2.28
came out, I fixed a few places related to object count, but didn't have time
to check it everywhere.  Now we can do this for Object and all obdata types.

Objects should have user count equal to the number of scenes they are linked
to.  And, of course, obdata should have .us equal to the number of objects
they are linked to.

Let's coordinate here what needs to be fixed and make sure we test it all.
BTW, a ".us" (user count) member var could be an interesting addition to
bpython objects.  But not now, let's see this after 2.31.

--
Willian, wgermano at ig.com.br





More information about the Bf-python mailing list