script to create a man page from blenders --help text, replaced the hand edited man page with this.

This commit is contained in:
Campbell Barton
2010-06-27 00:33:12 +00:00
parent bb07503d89
commit ea4e5a08cd
3 changed files with 376 additions and 134 deletions

View File

@@ -1,10 +1,9 @@
.TH "BLENDER" "1" "June 06, 2010" "Blender 2\&.5\&.2"
.TH "BLENDER" "1" "June 27, 2010" "Blender Blender 2\&.52 (sub 5) "
.SH NAME
blender \- a 3D modelling and rendering package
.SH SYNOPSIS
.B blender [args ...] [file] [args ...]
.br
.SH DESCRIPTION
.PP
@@ -15,209 +14,318 @@ Use Blender to create TV commercials, to make technical visualizations, business
http://www.blender.org
.SH OPTIONS
.SS "Render options:"
Blender 2.52 (sub 5) Build
Usage: blender [args ...] [file] [args ...]
.br
.SS "Render Options:"
.TP
.B \-b, \-\-background <file>
Load <file> in background (often used for UI-less rendering)
.B \-b or \-\-background <file>
.br
Load <file> in background (often used for UI\-less rendering)
.br
.TP
.B \-a, \-\-render-anim
.B \-a or \-\-render\-anim
.br
Render frames from start to end (inclusive)
.br
.TP
.B \-S, \-\-scene <name>
.B \-S or \-\-scene <name>
.br
Set the active scene <name> for rendering
.br
.TP
.B \-f, \-\-render-frame <frame>
Render frame <frame> and save it
.B \-f or \-\-render\-frame <frame>
.br
Render frame <frame> and save it.
.br
+<frame> start frame relative, \-<frame> end frame relative.
.br
.TP
.B \-s, \-\-frame-start <frame>
.B \-s or \-\-frame\-start <frame>
.br
Set start to frame <frame> (use before the \-a argument)
.br
.TP
.B \-e, \-\-frame-end <frame>
.B \-e or \-\-frame\-end <frame>
.br
Set end to frame <frame> (use before the \-a argument)
.br
.TP
.B \-j, \-\-frame-jump <frames>
.B \-j or \-\-frame\-jump <frames>
.br
Set number of frames to step forward after each rendered frame
.br
.TP
.B \-o, --render-output <path>
.B \-o or \-\-render\-output <path>
.br
Set the render path and file name.
.IP
Use // at the start of the path to render relative to the blend file.
.IP
.br
Use // at the start of the path to
.br
render relative to the blend file.
.br
The # characters are replaced by the frame number, and used to define zero padding.
.IP
.br
ani_##_test.png becomes ani_01_test.png
test-######.png becomes test-000001.png
.br
test\-######.png becomes test\-000001.png
.br
When the filename does not contain #, The suffix #### is added to the filename
.IP
.br
The frame number will be added at the end of the filename.
eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a
.br
eg: blender \-b foobar.blend \-o //render_ \-F PNG \-x 1 \-a
.br
//render_ becomes //render_####, writing frames as //render_0001.png//
.br
.HP
.B \-E, \-\-engine <engine>
.TP
.B \-E or \-\-engine <engine>
.br
Specify the render engine
use \fI\-E help\fR to list available engines
.br
use \-E help to list available engines
.br
.SS "Format options:"
.IP
.SS "Format Options:"
.TP
.B \-F, \-\-render-format <format>
Set the render format, valid options are...
.IP
TGA IRIS JPEG MOVIE IRIZ RAWTGA
AVIRAW AVIJPEG PNG BMP FRAMESERVER
.IP
.B \-F or \-\-render\-format <format>
.br
Set the render format, Valid options are...
.br
TGA IRIS JPEG MOVIE IRIZ RAWTGA
.br
AVIRAW AVIJPEG PNG BMP FRAMESERVER
.br
(formats that can be compiled into blender, not available on all systems)
.IP
HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS
.br
HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS
.br
.TP
.B \-x, \-\-use-extension <bool>
.B \-x or \-\-use\-extension <bool>
.br
Set option to add the file extension to the end of the file
.br
.TP
.B \-t, \-\-threads <threads>
.B \-t or \-\-threads <threads>
.br
Use amount of <threads> for rendering in background
[1-BLENDER_MAX_THREADS], 0 for systems processor count.
.br
[1\-BLENDER_MAX_THREADS], 0 for systems processor count.
.br
.SS "Animation options:"
.IP
.SS "Animation Playback Options:"
.TP
.B \-a <options> <file(s)>
.br
Playback <file(s)>, only operates this way when not running in background.
.IP
\-p <sx> <sy> \-\- Open with lower left corner at <sx>, <sy>
.br
\-m \-\- Read from disk (Don't buffer)
\-p <sx> <sy> Open with lower left corner at <sx>, <sy>
.br
\-f <fps> <fps-base> \-\- Specify FPS to start with
\-m Read from disk (Don't buffer)
.br
\-f <fps> <fps\-base> Specify FPS to start with
.br
\-j <frame> Set frame step to <frame>
.br
\-j <frame> \-\- Set frame step to <frame>
.SS "Window options:"
.IP
.SS "Window Options:"
.TP
.B \-w, \-\-window-border
.B \-w or \-\-window\-border
.br
Force opening with borders (default)
.br
.TP
.B \-W, \-\-window-borderless
.B \-W or \-\-window\-borderless
.br
Force opening with without borders
.br
.TP
.B \-p, --window-geometry <sx> <sy> <w> <h>
Open with lower left corner at <sx>, <sy> and width and height <w>, <h>
.B \-p or \-\-window\-geometry <sx> <sy> <w> <h>
.br
Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>
.br
.SS "Game Engine specific options:"
.TP
.B \-g fixedtime
Run on 50 hertz without dropping frames
.TP
.B \-g vertexarrays
Use Vertex Arrays for rendering (usually faster)
.TP
.B \-g nomipmap
No Texture Mipmapping
.TP
.B \-g linearmipmap
Linear Texture Mipmapping instead of Nearest (default)
.SS "Misc options:"
.TP
.B \-d, \-\-debug
Turn debugging on
.IP
Prints every operator call and their arguments
.br
Disables mouse grab (to interact with a debugger in some cases)
.br
Keeps python sys.stdin rather then setting it to None
.SS "Game Engine Specific Options:"
.TP
.B \--debug-fpe
.B \-g Game Engine specific options
.br
\-g fixedtime Run on 50 hertz without dropping frames
.br
\-g vertexarrays Use Vertex Arrays for rendering (usually faster)
.br
\-g nomipmap No Texture Mipmapping
.br
\-g linearmipmap Linear Texture Mipmapping instead of Nearest (default)
.br
.IP
.SS "Misc Options:"
.TP
.B \-d or \-\-debug
.br
Turn debugging on
.br
.IP
* Prints every operator call and their arguments
.br
* Disables mouse grab (to interact with a debugger in some cases)
.br
* Keeps python sys.stdin rather then setting it to None
.br
.TP
.B \-\-debug\-fpe
.br
Enable floating point exceptions
.br
.TP
.B \-noaudio
Disable audio on systems that support audio
.IP
.TP
.B \-nojoystick
.br
Disable joystick support
.br
.TP
.B \-noglsl
.br
Disable GLSL shading
.br
.TP
.B \-y, \-\-enable-autoexec
.B \-noaudio
.br
Force sound system to None
.br
.TP
.B \-setaudio
.br
Force sound system to a specific device
.br
NULL SDL OPENAL JACK
.br
.IP
.TP
.B \-h or \-\-help
.br
Print this help text and exit
.br
.IP
.TP
.B \-y or \-\-enable\-autoexec
.br
Enable automatic python script execution (default)
.br
.TP
.B \-Y, \-\-disable-autoexec
.B \-Y or \-\-disable\-autoexec
.br
Disable automatic python script execution (pydrivers, pyconstraints, pynodes)
.br
.IP
.TP
.B \-P <filename>
.B \-P or \-\-python <filename>
.br
Run the given Python script (filename or Blender Text)
.br
.TP
.B \-\-python-console
.B \-\-python\-console
.br
Run blender with an interactive console
.br
.TP
.B \-v, \-\-version
.B \-v or \-\-version
.br
Print Blender version and exit
.br
.TP
.B \-\-
.br
Ends option processing, following arguments passed unchanged. Access via python's sys.argv
.br
.SS "Other Options:"
.TP
.B \-h, \-\-help
Show a summary of options.
.B /?
.br
Print this help text and exit (windows only)
.br
.TP
.B \-R
.br
Register .blend extension (windows only)
.br
.SS "Argument Parsing:"
arguments must be separated by white space. eg
"blender \-ba test.blend"
...will ignore the 'a'
"blender \-b test.blend \-f8"
...will ignore 8 because there is no space between the \-f and the frame value
.br
.SS "Argument Order:"
Arguments are executed in the order they are given. eg
"blender \-\-background test.blend \-\-render\-frame 1 \-\-render\-output /tmp"
...will not render to /tmp because '\-\-render\-frame 1' renders before the output path is set
"blender \-\-background \-\-render\-output /tmp test.blend \-\-render\-frame 1"
...will not render to /tmp because loading the blend file overwrites the render output that was set
"blender \-\-background test.blend \-\-render\-output /tmp \-\-render\-frame 1" works as expected.
.br
.br
.SH "ENVIRONMENT VARIABLES"
.PP
\fIHOME\fR
.RS 4
Store files such as .blender/ .B.blend .Bfs .Blog here.
.RE
.PP
\fIBLENDERPATH\fR
.RS 4
System directory to use for data files and scripts.
For this build of blender the default BLENDERPATH is...
"/usr/share/blender"
setting the $BLENDERPATH will override this
.RE
.PP
\fITMP\fR or \fITMPDIR\fR
.RS 4
Store temporary files here.
.RE
.PP
\fISDL_AUDIODRIVER\fR
.RS 4
LibSDL audio driver - alsa, esd, alsa, dma.
.RE
.PP
\fIPYTHONHOME\fR
.RS 4
Path to the python directory, eg. /usr/lib/python.
.RE
\fIHOME\fR Store files such as .blender/ .B.blend .Bfs .Blog here.
\fIBLENDERPATH\fR System directory to use for data files and scripts.
For this build of blender the default \fIBLENDERPATH\fR is...
"/usr/local/share/blender/2.5"
setting the \fIBLENDERPATH\fR will override this
\fITMP\fR or \fITMPDIR\fR Store temporary files here.
\fIPYTHONHOME\fR Path to the python directory, eg. /usr/lib/python.
.br
.br
.br
.SH SEE ALSO
@@ -228,5 +336,3 @@ Path to the python directory, eg. /usr/lib/python.
This manpage was written for a Debian GNU/Linux system by Daniel Mester
<mester@uni-bremen.de> and updated by Cyril Brulebois
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.

134
doc/blender.1.py Normal file
View File

@@ -0,0 +1,134 @@
#!/usr/bin/python
# ##### 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.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import subprocess
import os
import time
import datetime
def man_format(data):
data = data.replace("-", "\\-")
data = data.replace("\t", " ")
# data = data.replace("$", "\\fI")
data_ls = []
for w in data.split():
if w.startswith("$"):
w = "\\fI" + w[1:] + "\\fR"
data_ls.append(w)
data = data[:len(data) - len(data.lstrip())] + " ".join(data_ls)
return data
blender_bin = os.path.join(os.path.dirname(__file__), "../blender")
blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode()
blender_version = subprocess.Popen([blender_bin, "--version"], stdout=subprocess.PIPE).communicate()[0].decode().strip()
blender_version = blender_version.split("Build")[0]
date_string = datetime.date.fromtimestamp(time.time()).strftime("%B %d, %Y")
filepath = __file__.replace(".py", "")
file = open(filepath, "w")
fw = file.write
fw('.TH "BLENDER" "1" "%s" "Blender %s"\n' % (date_string, blender_version.replace(".", "\\&.")))
fw('''
.SH NAME
blender \- a 3D modelling and rendering package''')
fw('''
.SH SYNOPSIS
.B blender [args ...] [file] [args ...]''')
fw('''
.br
.SH DESCRIPTION
.PP
.B blender
is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
http://www.blender.org''')
fw('''
.SH OPTIONS''')
fw("\n\n")
lines = [line.rstrip() for line in blender_help.split("\n")]
while lines:
l = lines.pop(0)
if l.startswith("Environment Variables:"):
fw('.SH "ENVIRONMENT VARIABLES"\n')
elif l.endswith(":"): # one line
fw('.SS "%s"\n\n' % l)
elif l.startswith("-") or l.startswith("/"): # can be multi line
fw('.TP\n')
fw('.B %s\n' % man_format(l))
while lines:
# line with no
if lines[0].strip() and len(lines[0].lstrip()) == len(lines[0]): # no white space
break
if not l: # second blank line
fw('.IP\n')
else:
fw('.br\n')
l = lines.pop(0)
l = l[1:] # remove first whitespace (tab)
fw('%s\n' % man_format(l))
else:
if not l.strip():
fw('.br\n')
else:
fw('%s\n' % man_format(l))
# footer
fw('''
.br
.SH SEE ALSO
.B yafaray(1)
.br
.SH AUTHORS
This manpage was written for a Debian GNU/Linux system by Daniel Mester
<mester@uni-bremen.de> and updated by Cyril Brulebois
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.
''')

View File

@@ -234,11 +234,11 @@ static int print_help(int argc, char **argv, void *data)
BLI_argsPrintArgDoc(ba, "--window-geometry");
printf("\n");
printf ("Game Engine specific options:\n");
printf ("Game Engine Specific Options:\n");
BLI_argsPrintArgDoc(ba, "-g");
printf("\n");
printf ("Misc options:\n");
printf ("Misc Options:\n");
BLI_argsPrintArgDoc(ba, "--debug");
BLI_argsPrintArgDoc(ba, "--debug-fpe");
@@ -273,10 +273,25 @@ static int print_help(int argc, char **argv, void *data)
printf ("Other Options:\n");
BLI_argsPrintOtherDoc(ba);
printf ("Argument Parsing:\n");
printf ("\targuments must be separated by white space. eg\n");
printf ("\t\t\"blender -ba test.blend\"\n");
printf ("\t...will ignore the 'a'\n");
printf ("\t\t\"blender -b test.blend -f8\"\n");
printf ("\t...will ignore 8 because there is no space between the -f and the frame value\n\n");
printf ("Argument Order:\n");
printf ("Arguments are executed in the order they are given. eg\n");
printf ("\t\t\"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
printf ("\t...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
printf ("\t\t\"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
printf ("\t...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
printf ("\t\t\"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
printf ("\nEnvironment Variables:\n");
printf (" $HOME\t\t\tStore files such as .blender/ .B.blend .Bfs .Blog here.\n");
printf (" $BLENDERPATH System directory to use for data files and scripts.\n");
printf (" For this build of blender the default BLENDERPATH is...\n");
printf (" For this build of blender the default $BLENDERPATH is...\n");
printf (" \"%s\"\n", blender_path);
printf (" setting the $BLENDERPATH will override this\n");
#ifdef WIN32
@@ -289,19 +304,6 @@ static int print_help(int argc, char **argv, void *data)
#endif
printf (" $PYTHONHOME Path to the python directory, eg. /usr/lib/python.\n\n");
printf ("Note: Arguments must be separated by white space. eg:\n");
printf (" \"blender -ba test.blend\"\n");
printf (" ...will ignore the 'a'\n");
printf (" \"blender -b test.blend -f8\"\n");
printf (" ...will ignore 8 because there is no space between the -f and the frame value\n\n");
printf ("Note: Arguments are executed in the order they are given. eg:\n");
printf (" \"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
printf (" ...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
printf (" \"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
printf (" ...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
printf (" \"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
exit(0);
return 0;