[Bf-python] API overhaul - irc meeting?
Willian Padovani Germano
wgermano at superig.com.br
Sat Jan 7 15:14:55 CET 2006
Hi, replying to multiple emails:
Ken Hughes wrote:
> * As we go through the process, building some "formal" coding standards
Definitely. We have to decide about many things, from naming conventions
to use of macros / helper functions, etc. I'd like clear policies about
including general helper functions, for example, so that we all can
reuse them properly.
> * Developing a simpler scripting module or interface.
This can and should be done directly in Python imo. We can have a
powerful wrapper for bigger / fancier apps and a simple one for quick,
more intuitive access, as you suggested.
Campbell Barton wrote:
> 1) Documentation- I personaly like epydocs but having a way to
> document things Once is ideal.
Yes, of course.
> Couldent we jenerate the epydocs from docstrings in Blender?
Should be possible if we fix the docs. We can test that when our first
module gets rewritten. I dislike the "\n\", but I can live with that, of
course.
====
Made a quick test, something like this should *eventually* work from
inside Blender (or via blender -b -P thisfile.py) :
# Note: currently this doesn't work, there's an error in
# Effect.c (Particle's Init, seems its name should be
# "Blender.Effect.Particle", not "Blender.Particle".
# Even correcting that is not enough, since the docs are
# not epydoc friendly.
import Blender, types, sys
from epydoc.cli import cli
command = 'epydoc -o BPY_API --url http://www.blender.org -t
API_intro.py -n Blender --no-private --no-frames'
# Collect all modules to document
all_modules = []
def get_modules(mod): # sheesh
global all_modules
modname = mod.__name__
all_modules.append(modname)
print 'name', modname
content = dir(mod)
for c in content:
exec('a = type(%s.%s)' % (modname, c))
if a == types.ModuleType:
print 'get_modules(%s.%s)' % (modname, c)
exec('get_modules(%s.%s)' % (modname, c))
get_modules(Blender)
# prepare the sys.argv that we need in order to call epydoc.cli.cli():
command = command.split()
command.extend(all_modules)
sys.argv = command
cli() # finally run epydoc
======
About the color wrapper, issue was that Blender itself is not consistent
regarding color data representation. Maybe we can / should correct that,
but it's obviously something that would require extra care.
Stephen Swaney wrote:
> My personal preference for the meeting is AFTER the regular Sunday
meeting.
Ok for me, Stephen and Tom (who also stated the same pref). I should be
there earlier, too, anyway.
> I have started a wiki page to discuss the BPy Cleanup.
> http://mediawiki.blender.org/index.php/BPy_API_Cleanup_-_2006
Great start :), thanks.
--
Willian
More information about the Bf-python
mailing list