Blender Documentation Volume II - Reference Guide: Last modified March 29 2004 S68 | ||
---|---|---|
<<< Previous | Python API Reference | Next >>> |
This module provides access to Window functions in Blender.
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!") |
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") |
Function Summary | ||
| DrawProgressBar(done, text) Draw a progress bar in the upper right corner of the screen. | |
| FileSelector(callback, title) Open the file selector window in Blender. | |
| ImageSelector(callback, title) Open the image selector window in Blender. | |
| QRedrawAll() Redraw all windows by queue event. | |
| Redraw() Force a redraw of a specific Window Type (see Types). | |
| RedrawAll() Redraw all windows. |
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. Start it with done = 0 and end it with done = 1.
|
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')
|
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')
|
<<< Previous | Home | Next >>> |
Module Window | Up | Module Image |