[Bf-python] script registration

Michael Reimpell M.Reimpell at tu-bs.de
Wed Oct 13 11:15:19 CEST 2004


At the moment blender hijacks the python module documentation string and 
abuses it for script registration. This prevents script developers to write 
adequate module documentation. This is especially bad, since this 
documentation string is the place to document global script variables, e.g. 
with epydoc, and global variables may be of most interest to others.

Fortunately changing the script registration header mechanism is no big deal: 
The function "bpymenu_CreateFromDir" 
in /blender/source/blender/python/BPY_menus.c, which is responsible for the 
registration, just uses string comparison and does not rely on the semantics 
of the three double-quotes. I therefore propose to change the registration 
keywords, so that each line begins as an ordinary python comment, e.g:
#!BPY
# """
# Name: 'Script Name'
# Blender: 233
# Group: 'Export'
# Submenu: 'All' all
# Submenu: 'Selected' sel
# Submenu: 'Configure (gui)' gui
# Tooltip: 'Export to some format.'
# """

Regards,
Michael



More information about the Bf-python mailing list