Merged changes in the trunk up to revision 38543.

Conflicts resolved:
doc/python_api/sphinx_doc_gen.py
source/blender/blenkernel/CMakeLists.txt
source/blender/makesdna/DNA_material_types.h
source/blender/render/intern/source/pipeline.c
source/creator/CMakeLists.txt
This commit is contained in:
2011-07-20 23:33:10 +00:00
395 changed files with 34491 additions and 33122 deletions

View File

@@ -29,15 +29,15 @@ For HTML generation
./blender.bin --background --python doc/python_api/sphinx_doc_gen.py
This will generate python files in doc/python_api/sphinx-in/,
assuming that ./blender.bin is or links to the blender executable
This will generate python files in doc/python_api/sphinx-in/
providing ./blender.bin is or links to the blender executable
- Generate html docs by running...
cd doc/python_api
sphinx-build sphinx-in sphinx-out
assuming that you have sphinx 1.0.7 installed
This requires sphinx 1.0.7 to be installed.
For PDF generation
------------------
@@ -48,6 +48,15 @@ For PDF generation
make
'''
# Check we're running in blender
if __import__("sys").modules.get("bpy") is None:
print("\nError, this script must run from inside blender2.5")
print(script_help_msg)
import sys
sys.exit()
# Switch for quick testing
if 1:
# full build
@@ -58,7 +67,7 @@ if 1:
else:
# for testing so doc-builds dont take so long.
EXCLUDE_MODULES = (
# "bpy.context",
"bpy.context",
"bpy.app",
"bpy.path",
"bpy.data",
@@ -67,8 +76,8 @@ else:
"bpy.context",
"bpy.types", # supports filtering
"bpy.ops", # supports filtering
#"bpy_extras",
"bge",
"bpy_extras",
# "bge",
"aud",
"bgl",
"blf",
@@ -988,6 +997,7 @@ def rna2sphinx(BASEPATH):
fw("\n")
fw("* `Quickstart Intro <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro>`_ if you are new to scripting in blender and want to get you're feet wet!\n")
fw("* `Blender/Python Overview <http://wiki.blender.org/index.php/Dev:2.5/Py/API/Overview>`_ for a more complete explanation of python integration in blender\n")
fw("\n")
fw("===================\n")
fw("Application Modules\n")
@@ -1029,8 +1039,8 @@ def rna2sphinx(BASEPATH):
fw(" mathutils.geometry.rst\n\n")
if "Freestyle" not in EXCLUDE_MODULES:
fw(" Freestyle.rst\n\n")
# XXX TODO
#fw(" bgl.rst\n\n")
if "bgl" not in EXCLUDE_MODULES:
fw(" bgl.rst\n\n")
if "blf" not in EXCLUDE_MODULES:
fw(" blf.rst\n\n")
if "aud" not in EXCLUDE_MODULES:
@@ -1049,7 +1059,9 @@ def rna2sphinx(BASEPATH):
fw(" bge.types.rst\n\n")
fw(" bge.logic.rst\n\n")
fw(" bge.render.rst\n\n")
fw(" bge.texture.rst\n\n")
fw(" bge.events.rst\n\n")
fw(" bge.constraints.rst\n\n")
# rna generated change log
fw("========\n")
@@ -1160,14 +1172,16 @@ def rna2sphinx(BASEPATH):
import mathutils.geometry as module
pymodule2sphinx(BASEPATH, "mathutils.geometry", module, "Geometry Utilities")
if "mathutils.geometry" not in EXCLUDE_MODULES:
if "blf" not in EXCLUDE_MODULES:
import blf as module
pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing")
# XXX TODO
#import bgl as module
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
#del module
if "bgl" not in EXCLUDE_MODULES:
#import bgl as module
#pymodule2sphinx(BASEPATH, "bgl", module, "Blender OpenGl wrapper")
#del module
import shutil
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bgl.rst"), BASEPATH)
if "aud" not in EXCLUDE_MODULES:
import aud as module
@@ -1181,7 +1195,9 @@ def rna2sphinx(BASEPATH):
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.types.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.logic.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.render.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.texture.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.events.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bge.constraints.rst"), BASEPATH)
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "change_log.rst"), BASEPATH)
@@ -1206,72 +1222,67 @@ def rna2sphinx(BASEPATH):
def main():
import bpy
if 'bpy' not in dir():
print("\nError, this script must run from inside blender2.5")
print(script_help_msg)
import shutil
script_dir = os.path.dirname(__file__)
path_in = os.path.join(script_dir, "sphinx-in")
path_out = os.path.join(script_dir, "sphinx-out")
path_examples = os.path.join(script_dir, "examples")
# only for partial updates
path_in_tmp = path_in + "-tmp"
if not os.path.exists(path_in):
os.mkdir(path_in)
for f in os.listdir(path_examples):
if f.endswith(".py"):
EXAMPLE_SET.add(os.path.splitext(f)[0])
# only for full updates
if _BPY_FULL_REBUILD:
shutil.rmtree(path_in, True)
shutil.rmtree(path_out, True)
else:
import shutil
# write here, then move
shutil.rmtree(path_in_tmp, True)
script_dir = os.path.dirname(__file__)
path_in = os.path.join(script_dir, "sphinx-in")
path_out = os.path.join(script_dir, "sphinx-out")
path_examples = os.path.join(script_dir, "examples")
# only for partial updates
path_in_tmp = path_in + "-tmp"
rna2sphinx(path_in_tmp)
if not os.path.exists(path_in):
os.mkdir(path_in)
if not _BPY_FULL_REBUILD:
import filecmp
for f in os.listdir(path_examples):
if f.endswith(".py"):
EXAMPLE_SET.add(os.path.splitext(f)[0])
# now move changed files from 'path_in_tmp' --> 'path_in'
file_list_path_in = set(os.listdir(path_in))
file_list_path_in_tmp = set(os.listdir(path_in_tmp))
# only for full updates
if _BPY_FULL_REBUILD:
shutil.rmtree(path_in, True)
shutil.rmtree(path_out, True)
else:
# write here, then move
shutil.rmtree(path_in_tmp, True)
# remove deprecated files that have been removed.
for f in sorted(file_list_path_in):
if f not in file_list_path_in_tmp:
print("\tdeprecated: %s" % f)
os.remove(os.path.join(path_in, f))
rna2sphinx(path_in_tmp)
# freshen with new files.
for f in sorted(file_list_path_in_tmp):
f_from = os.path.join(path_in_tmp, f)
f_to = os.path.join(path_in, f)
if not _BPY_FULL_REBUILD:
import filecmp
do_copy = True
if f in file_list_path_in:
if filecmp.cmp(f_from, f_to):
do_copy = False
# now move changed files from 'path_in_tmp' --> 'path_in'
file_list_path_in = set(os.listdir(path_in))
file_list_path_in_tmp = set(os.listdir(path_in_tmp))
if do_copy:
print("\tupdating: %s" % f)
shutil.copy(f_from, f_to)
'''else:
print("\tkeeping: %s" % f) # eh, not that useful'''
# remove deprecated files that have been removed.
for f in sorted(file_list_path_in):
if f not in file_list_path_in_tmp:
print("\tdeprecated: %s" % f)
os.remove(os.path.join(path_in, f))
# freshen with new files.
for f in sorted(file_list_path_in_tmp):
f_from = os.path.join(path_in_tmp, f)
f_to = os.path.join(path_in, f)
do_copy = True
if f in file_list_path_in:
if filecmp.cmp(f_from, f_to):
do_copy = False
if do_copy:
print("\tupdating: %s" % f)
shutil.copy(f_from, f_to)
'''else:
print("\tkeeping: %s" % f) # eh, not that useful'''
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
if EXAMPLE_SET_UNUSED:
print("\nUnused examples found in '%s'..." % path_examples)
for f in EXAMPLE_SET_UNUSED:
print(" %s.py" % f)
print(" %d total\n" % len(EXAMPLE_SET_UNUSED))
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
if EXAMPLE_SET_UNUSED:
print("\nUnused examples found in '%s'..." % path_examples)
for f in EXAMPLE_SET_UNUSED:
print(" %s.py" % f)
print(" %d total\n" % len(EXAMPLE_SET_UNUSED))
import sys
sys.exit()