# strips the __doc__ strings from Blender-Python
# c.wartmann@gmx.net
# Thanks to Zr for the eval tip
# additions and modifications by Kari Pulli, 2002
import Blender
import sys
import string
from types import IntType, ModuleType, BuiltinFunctionType, NoneType, StringType
typevars = {
'NMeshType' : [['',['name : name of mesh',
'verts : list of NMVerts',
'faces : list of NMFaces',
'mats : list of material names',
'has_col : flag whether mesh has mesh colors',
'has_uvco : flag whether mesh has uv coords']]],
'NMFaceType' : [['',['v : list of NMVerts',
'col : list of NMCols',
'mat : material index',
'smooth : flag whether face is smooth']]],
'NMVertType' : [['',['index : vertex index',
'co : coordinate vector',
'uvco : uv coords',
'no : normal vector']]],
'NMColorType' : [['',['r : red',
'g : green',
'b : blue',
'a : alpha']]],
'IpoCurve' : [['',['name : name',
"type : 'Constant', 'Linear', or 'Bezier'",
"extend : 'Constant', 'Extrapolate', 'Cyclic', or 'CyclicX'",
'points : list of BezTriples']]],
'BezTriple' : [['',['h1 : leftmost handle coordinate vector',
'pt : point coordinate vector',
'h2 : rightmost handle coordinate vector',
'f1 : flag for h1 selection (True==selected)',
'f2 : flag for pt selection (True==selected)',
'f3 : flag for h2 selection (True==selected)',
"h1t : h1 type: 'Free', 'Auto', 'Vect', or 'Align'",
"h2t : h2 type: 'Free', 'Auto', 'Vect', or 'Align'",
]]],
'ButtonType' : [['',['val : current value']]],
'BufferType' : [['',['list : contents of the buffer']]],
'BlockType' : [['Object',
['name : name',
"block_type : 'Object'",
'properties : list of extra data props',
'parent : link to parent',
'track : link to obj that this tracks',
'ipo : link to ipo',
'data : link to data',
'math : object matrix',
'loc : location vector',
'dloc : delta location vector',
'rot : rotation vector',
'drot : delta rotation vector',
'size : size vector',
'dsize : delta size vector',
'LocX : x coordinate',
'LocY : y coordinate',
'LocZ : z coordinate',
'dLocX : delta x coordinate',
'dLocY : delta y coordinate',
'dLocZ : delta z coordinate',
'RotX : x rotation angle',
'RotY : y rotation angle',
'RotZ : z rotation angle',
'dRotX : delta x rotation angle',
'dRotY : delta y rotation angle',
'dRotZ : delta z rotation angle',
'SizeX : x size',
'SizeY : y size',
'SizeZ : z size',
'dSizeX : delta x size',
'dSizeY : delta y size',
'dSizeZ : delta z size',
'EffX : x effector coordinate',
'EffY : y effector coordinate',
'EffZ : z effector coordinate',
'Layer : object layer (bitmask)'
]],
['Lamp',
['name : name',
"block_type : 'Lamp'",
'properties : list of extra data props',
'ipo : link to ipo',
'R : red',
'G : green',
'B : blue',
'Energ : energy',
'Dist : distance',
'SpoSi : spot size',
'SpoBl : spot blend',
'HaInt : halo intensity',
'Quad1 : quad1 value',
'Quad2 : quad1 value',
]],
['Camera',
['name : name',
"block_type : 'Camera'",
'properties : list of extra data props',
'ipo : link to ipo',
'Lens : camera lens value',
'ClSta : clip start',
'ClEnd : clip end',
]],
['Material',
['name : name',
"block_type : 'Material'",
'properties : list of extra data props',
'ipo : link to ipo',
'R : red',
'G : green',
'B : blue',
'SpecR : specular red',
'SpecG : specular green',
'SpecB : specular blue',
'MirR : mirror red',
'MirG : mirror green',
'MirB : mirror blue',
'Ref : reflectivity',
'Alpha : transparency',
'Emit : emittance',
'Amb : ambient',
'Spec : specular',
'SpTra : specular transparency',
'HaSize : halo size',
'Mode : material mode settings',
'Hard : hardness'
]],
['World',
['name : name',
"block_type : 'World'",
'properties : list of extra data props',
'ipo : link to ipo',
'HorR : horizon red',
'HorG : horizon green',
'HorB : horizon blue',
'ZenR : zenith red',
'ZenG : zenith green',
'ZenB : zenith blue',
'Expos : exposure',
'MisSta : mist start',
'MisDi : mist distance',
'MisHi : mist height',
'StarDi : star distance',
'StarSi : star size'
]],
['Ipo',
['name : name',
"block_type : 'Ipo'",
'properties : list of extra data props',
'curves : list of IpoCurves',
]],
],
}
def printmod(module):
for item in dir(module):
if (module == Blender.Lamp and item in ['Modes','Types'] or
module == Blender.NMesh and item in ['Const'] or
module == Blender.Window and item in ['Const'] or
module == Blender.Object and item in ['Types']):
continue
if (module == Blender.Types and item not in ['__doc__', '__name__']):
print "%s%s"%(item, '
')
if typevars.has_key(item):
for i in typevars[item]:
if i[0]:
print "%s%s"%(i[0], '
')
for var in i[1]:
print var, '
'
print "
" print "
" continue try: itemob = eval(module.__name__ + "." + item) itemtype = type(itemob) if (itemtype==IntType): print "Int: ", item, "-", itemob,"
" elif (itemtype==ModuleType): print "
"
printmod(itemob)
elif (itemtype==BuiltinFunctionType):
print ""
s=eval(module.__name__ + "." + item + "." + "__doc__")
if type(s)==StringType:
ss=string.replace(s,"\n","
")
else:
ss="
"
print "%s%s"%(item, ss)
print "
"
elif (itemtype==StringType):
if (item != "__name__" and item != "__doc__"):
print "String: ", item, "-", itemob,"
"
elif (itemtype==NoneType):
print "None: ", item, "-", itemob,"
"
except:
pass
sys.stdout.flush()
# Outfile
dat=open(r"c:\tmp\pydoc.html","w")
std=sys.stdout
sys.stdout=dat
# HTML Header
print "