[Bf-python] Curve API proposal

Willian Padovani Germano wgermano at ig.com.br
Fri May 16 02:21:04 CEST 2003


On Thu, 2003-05-15 at 21:35, guignot wrote:
> hi!
> 
> Here is a proposal for the curve API.
> It gives access to the most important parts of the Curve class.
> 
> Please tell me if it's OK.
> 

Hi, guignot

Looks good : ).  I don't know enough about curves in Blender to be sure
of all someone might want to get access to via Python, but anyway,
that's not a problem.  Extra details can easily be added later.  I'm
also re-reading DNA_curve_types.h now.

Some comments:

Your print function looks a little too detailed, compared to how the
current API handles things (which would be only something like [Curve
"Curve-name"]).  The print method is not a complete solution for
exporting info, it's more like a simple header.

Since there's a getName function already, it'd be good to have a setName
one, too.

getFlag and setFlag, if we follow the current 2.25 API, should be
getMode, setMode.

Your New() method could accept the name of the curve as a parameter.

You ask in the code if setattr is mandatory.  It's not, but as commented
in a previous email to the list, it is the "python" way of doing things
and for consistency we eventually want it in all submodules.

Get(): there's already code in Object.c, by Michel (I already updated it
in the others: Camera, Lamp, etc) to return a list of all objects of the
specific type (curves in your case) when the user calls Get() with no
arguments.

Please don't take these comments as criticism, you've done already quite
a lot of good work, we know it.  Congratulations!  And if you don't have
time or interest in adding some part (like the setattr body), don't
worry, someone else can add that later.

Right now my copy of the exppython code here is a mess

(NMesh is giving me more trouble than I expected, pages of compile error
msgs and warnings, things to change, etc.).

But as soon as I get Blender compiling again here I'll test your files.

As you called it a proposal, I'll ask you to tell us (and send updated
files, if you change them) when we can commit your Curve submodule to
cvs.  Once there, you can have feedback from more people.

Again, nice work : ).  It's great to see exppython evolving beyond 2.25
functionality.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list