[Bf-python] Partial proposal for armature+bone modules

Willian Padovani Germano wgermano at ig.com.br
Wed May 28 14:58:00 CEST 2003


On Wed, 2003-05-28 at 06:38, Jordi Rovira i Bonet wrote:
> Agreed. It was my mistake: when i tried to implement it returning PyNone 
> i got an "attribute error" and i deduced that this was fired when 
> returning PyNone to python, but it was caused by the ending code in 
> GetAttr callback. Now it's fixed, and i think we could avoid the 
> hasParent query to simplify code and interface.

Ok, your choice : ).  On a second step, after exppython gets integrated
in the official Blender binary, we'll have chance to simplify the API,
but since yours is a new part, you can think about that right now.

> Agreed, "has_prent" is a typo in the mail, sorry. Function name is 
> actually "hasParent()".

Even before downloading all my email now, I was already replying to my
own reply:
---
Please, nevermind, Jordi.  .has_prent() is most obviously a typo, but
when I read the msg it seemed an abbreviation, as if more letters than a
single 'a' were missing. Gee, I must have crossed that line between
productivity and time to go to bed before sending that reply, sorry.
---

> I attach a small patch and 4 files in a .tgz that should be enough to 
> add the armature support to the code. The patch has to be applied from 
> source/blender/python with -p0. I think its ready for testing
Thanks, we'll check and commit them.

> P.S. I've found that the getType function is not implemented in 
> Object.c, is there another way to check for the type of an object or it 
> will be implemented in the future? I'm having trouble with the Object 
> module, necessary to test the armatures (need to get the parent and 
> types...)
> 

That part is probably not finished yet.  It ought to be possible to get
the type from obj.getData().getType(), since we should have objdata in

objdata = obj.getData()

working exactly like the object data "object", I mean:

type(Blender.Object.New("Mesh").getData()) = type(Blender.NMesh.New())

So once finished you should be able to get the obj type from the
obj.data type, as with the current bpython.

But obj.getType() (seeing now Michel included the prototype already)
conforms to the way data modules work and is probably a good shortcut to
have.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list