- More renaming all around to follow our conventions

- Implemented partially Blender.Sys
- Worked on issues related to sys, path
- Took away most "debug" printfs
This commit is contained in:
2003-06-28 07:38:21 +00:00
parent 569a32a2ea
commit eaf1cdd383
44 changed files with 1147 additions and 801 deletions

View File

@@ -1,18 +1,26 @@
# Blender.BGL module (OpenGL wrapper)
"""
The Blender.BGL submodule (the OpenGL wrapper).
The Blender.BGL submodule
=========================
This module wraps OpenGL constants and functions, making them available from
within Blender Python. The complete list can be retrieved from the module
itself, by listing its contents: dir(Blender.BGL). There are too many to be
documented here, but a simple search on the net can point to more than enough
material to teach OpenGL programming, from books to many collections of
tutorials. The I{red book}: "OpenGL Programming Guide", is a very good
resource, even for newcomers.
within Blender Python.
The complete list can be retrieved from the module itself, by listing its
contents: dir(Blender.BGL). There are too many to be documented here, but
a simple search on the net can point to more than enough material to teach
OpenGL programming, from books to many collections of tutorials.
The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
OpenGL}" and the online NeHe tutorials are two of the best resources.
@see: U{www.opengl.org}
Example::
import Blender
from Blender.BGL import *
from Blender import Draw
@@ -44,7 +52,7 @@ Example::
Draw.Redraw(1) # make changes visible.
#
def ev(evt, val): # this is a callback for Draw.Register()
global R,G,B,A # it handles input events
global R,G,B,A # ... it handles input events
if evt == Draw.ESCKEY or evt == Draw.QKEY:
Draw.Exit() # this quits the script
elif evt == Draw.LEFTMOUSE: R = 1 - R

View File

@@ -7,16 +7,30 @@
# Blender.py Camera.py Lamp.py BGL.py etc.
"""
Here goes the Introduction to Blender Python
This is the main Blender module.
Blender Python
==============
Submodules:
-----------
- L{Camera}
- L{Lamp}
- L{BGL}
- L{Window}
- L{Text}
Introduction:
-------------
- What scripting is, why have it
- What Python is, links
- More about what scripting can give us
- Overview of the Blender Python modules
- Links to Blender, Blender Python, later: script lists
Let's see::
- What scripting is, why have it
- What Python is, links
- More about what scripting can give us
- Overview of the Blender Python modules
- Links to Blender, Blender Python, later: script lists
@author: The Blender Python Team
@requires: Blender 2.28 or newer, Python 2.? (2.0, 2.1, 2.2 ???) or newer
@requires: Blender 2.28 or newer.
@version: 0.1
@see: U{www.blender.org<http://www.blender.org>}
@see: U{projects.blender.org<http://projects.blender.org>}

View File

@@ -1,7 +1,10 @@
# Blender.Camera module and the Camera PyType object
"""
The Blender.Camera submodule
The Blender.Camera submodule.
Camera Data
===========
This module provides access to B{Camera Data} objects in Blender.

View File

@@ -1,7 +1,10 @@
# Blender.Lamp module and the Lamp PyType object
"""
The Blender.Lamp submodule
The Blender.Lamp submodule.
Lamp Data
=========
This module provides control over B{Lamp Data} objects in Blender.

View File

@@ -1,7 +1,10 @@
# Blender.Text module and the Text PyType object
"""
The Blender.Text submodule
The Blender.Text submodule.
Text Objects
============
This module provides access to B{Text} objects in Blender.

View File

@@ -0,0 +1,117 @@
# Blender.Window module and the Window PyType object
"""
The Blender.Window submodule.
Window
======
This module provides access to B{Window} functions in Blender.
Example:
--------
FileSelector::
import Blender
from Blender import Window
#
def my_callback(filename): # callback for the FileSelector
print "You chose the file:", filename # do something with the chosen file
#
Window.FileSelector (my_callback, "Choose one!")
Example:
--------
DrawProgressBar::
import Blender
from Blender.Window import DrawProgressBar
#
# substitute the bogus_*() function calls for your own, of course.
#
DrawProgressBar (0.0, "Importing data ...")
bogus_importData()
DrawProgressBar (0.3, "Building something")
bogus_build()
DrawProgressBar (0.8, "Updating Blender")
bogus_update()
DrawProgressBar (1.0, "Finished")
#
# another example:
#
number = 1
while number < 20:
file = filename + "00%d" % number
DrawProgressBar (number / 20.0, "Loading texture: %s" % file)
Blender.Image.Load(file)
number += 1
DrawProgressBar (1.0, "Finished loading")
"""
def Redraw ():
"""
Force a redraw of a specific Window Type (see Window.Types).
"""
def RedrawAll ():
"""
Redraw all windows.
"""
def QRedrawAll ():
"""
Redraw all windows by queue event.
"""
def FileSelector (callback, title = 'SELECT FILE'):
"""
Open the file selector window in Blender. After the user selects a filename,
it is passed as parameter to the function callback given to FileSelector().
Example::
import Blender
#
def my_function(filename):
print 'The selected file was:', filename
#
Blender.Window.FileSelector (my_function, 'SAVE FILE')
@type callback: function that accepts a string: f(str)
@param callback: The function that must be provided to FileSelector() and
will receive the selected filename as parameter.
@type title: string
@param title: The string that appears in the button to confirm the selection
and return from the file selection window.
"""
def ImageSelector (callback, title = 'SELECT IMAGE'):
"""
Open the image selector window in Blender. After the user selects a filename,
it is passed as parameter to the function callback given to ImageSelector().
Example::
import Blender
#
def my_function(imagename):
print 'The selected image was:', imagename
#
Blender.Window.ImageSelector (my_function, 'LOAD IMAGE')
@type callback: function that accepts a string: f(str)
@param callback: The function that must be provided to ImageSelector() and
will receive the selected filename as parameter.
@type title: string
@param title: The string that appears in the button to confirm the selection
and return from the image selection window.
"""
def DrawProgressBar (done, text):
"""
Draw a progress bar in the upper right corner of the screen. To cancel it
prematurely, users can press the "Esc" key.
@type done: float
@param done: A float in [0, 1] that tells the advance in the progress
bar.
@type text: string
@param text: Info about what is currently being done "behind the scenes".
"""