[Bf-python] Change in layout of camera module source

Willian Padovani Germano wgermano at ig.com.br
Mon Jun 16 05:17:31 CEST 2003


Hi, Jonathan

> I just checked out the latest code and noticed that many declarations
> that were previously in Camera.h have been moved to Camera.c.  Why was
> this done?

This was done to headers that needed to be included in more than one file,
like Material.h, Image.h and, more recently, Camera.h, to be included in the
Scene module.  "Public" headers can't have static declarations.

> I thought it was better to have the implementation seperated
> from the interface, as was the case when more was in the .h file.

Yes, don't worry.  The dir structure is still a moving target, we'll fix
that once the basics are done.  It's looking like there should be a single
header for the new types (Object, Camera, Lamp, etc.), maybe use modules.h
and leave the individual headers for static (private) declarations and
doxygen documentation.

>  There
> is no real problem here; I was just writing a Scene module using the
> Camera files as a reference and was surprised to see such a change.

Do you mean the reimplementation of the Scene module available in Blender
2.25 - 2.27 ?  If so, it was already finished and submitted to cvs about a
week ago.  Not that implementing it won't help you learn your way through
Python/C, of course.  And there are more places where you can work if you
want, even adding more functionality to already available modules.  Or
writing completely new ones.

> It should also be noted that a quick look at Lamp.h reveals that the same
> changes were not made there.  Additionally, C_Camera has been changed to
> BPy_Camera.  Is this to be the new naming convention?

Yes, Lamp.h is only used by Lamp.c.  But again, things are not set in stone
and the structure will probably change to a more natural, uniform one.
About the BPy_ prefix, I used it just as a suggestion, because my first try
doesn't look good: C_, for Class.  In Python/C, types are known as PyInt,
PyString, etc., but in Python interpreter msgs they appear as int, string.
So it's natural to call Cameras BPyCamera in the C code and Camera in the
interpreter.  The '_' was added for readability, of course.

These things also haven't been decided yet.  I was just experimenting with
doxygen and went on with some suggestions.  Later we'll discuss here a
default naming convention for the few cases that we have to deal with.

>         As a side note:  are we supposed to be using the functions that
> are prefixed with EXPP or their Python* equivalents?

EXPP_, because later it will be easier to simply change all its occurrences
to BPY_.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list