# ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # Contributor(s): Campbell Barton, Luca Bonavita # # #**** END GPL LICENSE BLOCK #**** # SCRIPT_HELP_MSG = """ API dump in RST files --------------------- Run this script from blenders root path once you have compiled blender ./blender.bin -b -noaudio -P doc/python_api/sphinx_doc_gen.py This will generate python files in doc/python_api/sphinx-in/ providing ./blender.bin is or links to the blender executable To choose sphinx-in directory: ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -o ../python_api For quick builds: ./blender.bin -b -P doc/python_api/sphinx_doc_gen.py -- -q Sphinx: HTML generation ----------------------- After you have built doc/python_api/sphinx-in (see above), generate html docs by running: cd doc/python_api sphinx-build sphinx-in sphinx-out This requires sphinx 1.0.7 to be installed. Sphinx: PDF generation ---------------------- After you have built doc/python_api/sphinx-in (see above), generate the pdf doc by running: sphinx-build -b latex doc/python_api/sphinx-in doc/python_api/sphinx-out cd doc/python_api/sphinx-out make """ try: import bpy # blender module except: print("\nERROR: this script must run from inside Blender") print(SCRIPT_HELP_MSG) import sys sys.exit() import rna_info # blender module # import rpdb2; rpdb2.start_embedded_debugger('test') import os import sys import inspect import shutil from platform import platform PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows' SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) def handle_args(): ''' Parse the args passed to Blender after "--", ignored by Blender ''' import argparse # When --help is given, print the usage text parser = argparse.ArgumentParser( formatter_class=argparse.RawTextHelpFormatter, usage=SCRIPT_HELP_MSG ) # optional arguments parser.add_argument("-o", "--output", dest="output_dir", type=str, default=SCRIPT_DIR, help="Path of the API docs (default=