parents ⊗ blenpy modules ⊕ Blender ⊕ blenpy ⊕ editors ⊕ gui ⊕ os ⊕ pprint ⊕ pydoc ⊕ sys ⊕ types classes ∇ DocString ∇ Editor ∇ PythonGui functions ⇒ askdirectory ⇒ blenderCrust ⇒ blenderCrustInventory ⇒ blenderCrustTabs ⇒ dirDialog ⇒ getextEditors ⇒ inspect ⇒ inspectTopic ⇒ inspectType ⇒ inspector ⇒ inspectorBlender ⇒ launchIdle ⇒ pythonLoad | documentation blenpy v0.13 for Blender 2.27
This module provides a graphical user interface for Python in Blender.
Usage (within Blender Text window):
>>> from blenpy.pyGui import PythonGui
>>> PythonGui()
This module can only be used within Blender.
Copyright (C)www.stani.be (19-06-2003)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ints blenpy.pyGui.SPACER = 5
strs blenpy.pyGui.ACTIVESTATE_URL = 'www.ActiveState.com' blenpy.pyGui.BLENDERCRUST_WELCOME = "This is a tweaked version of PyCrust (see www.wxpython.org).
NODE TREE:
Left is an expandable node tree, which enables you to explore all python objects. The most important objects (materials, lamps,...) are already provided in the different tabs. The objects of this session will appear under the 'Namespace tab' node. Double click on any node to open it in a new window.
SHELL:
Above is an advanced python shell with advanced features, such as auto-completion. As a quick start following code is automatically executed:
>>> " blenpy.pyGui.FILE = '#@' blenpy.pyGui.INVENTORY = 'This drawing contains: ' blenpy.pyGui.MODULE_ERROR = 'Error: Module(s) %s required, but not installed (%s)!' blenpy.pyGui.SHELL_WELCOME = "import Blender >>> import blenpy >>> Armatures=Blender.Armature.Get() >>> Cameras=Blender.Camera.Get() >>> Images=Blender.Image.Get() >>> Ipos=Blender.Ipo.Get() >>> Lamps=Blender.Lamp.Get() >>> Materials=Blender.Material.Get() >>> Objects=Blender.Object.Get() >>> Scenes=Blender.Scene.Get() >>> Texts=Blender.Text.Get() >>> Worlds=Blender.World.Get() If you type 'Objects[0]', the first object of the drawing will be returned. " blenpy.pyGui.USER_PATH = 'C:\\Documents and Settings\\sm\\.blenpy' blenpy.pyGui.WORKING_DIR = 'working path' blenpy.pyGui.__file__ = 'D:\\Data\\Python\\blenpy\\gui.pyc' blenpy.pyGui.__intro__ = '
This module provides a graphical user interface for Python in Blender.
Usage (within Blender Text window): >>> from blenpy.pyGui import PythonGui >>> PythonGui() ' blenpy.pyGui.__path__ = 'D:\\Data\\Python\\blenpy' blenpy.pyGui.t = '__name__'
lists blenpy.pyGui.BLENDER_EXTRA_ATTRIBUTES = ['g', 'b', 'a', 'v', 'col', 'mat', 'smooth', 'index', 'co', 'uvco', 'no', 'verts', 'faces', 'mats', 'has_col', 'has_uvco'] blenpy.pyGui.BLENDER_TYPES = [<type 'Blender constant'>, <type 'Curve'>, <type 'Blender NMCol'>, <type 'Blender Text'>, <type 'vector'>, <type 'Blender Bone'>, <type 'Blender Camera'>, <type 'Blender Lamp'>, <type 'rgbTuple'>, <type 'Scene'>, <type 'Ipo'>, <type 'Blender Image'>, <type 'Blender NMVert'>, <type 'Blender Object'>, <type 'buffer'>, <type 'Button'>, <type 'Metaball'>, <type 'Blender Armature'>, <type 'Blender NMFace'>, <type 'Blender NMesh'>, <type 'Blender Material'>] blenpy.pyGui.BUILTIN_TYPES = ['buffer', 'builtin_function_or_method', 'builtin_function_or_method', 'class', 'code', 'complex', 'dict-proxy', 'dict', 'dict', 'ellipsis', 'file', 'float', 'frame', 'function', 'generator', 'instance', 'int', 'function', 'list', 'long', 'instance method', 'module', 'NoneType', 'object', 'slice', 'str', 'traceback', 'tuple', 'type', 'instance method', 'unicode', 'xrange'] blenpy.pyGui.current = []
dicts blenpy.pyGui.BLENDER_ATTRIBUTES = {<type 'Blender constant'>: [], <type 'Curve'>: [], <type 'Blender NMCol'>: ['r', 'g', 'b', 'a'], <type 'Blender Text'>: [], <type 'vector'>: [], <type 'Blender Bone'>: [], <type 'Blender Camera'>: [], <type 'Blender Lamp'>: [], <type 'rgbTuple'>: [], <type 'Scene'>: [], <type 'Ipo'>: [], <type 'Blender Image'>: [], <type 'Blender NMVert'>: ['index', 'co', 'uvco', 'no'], <type 'Blender Object'>: [], <type 'buffer'>: ['list'], <type 'Button'>: ['val'], <type 'Metaball'>: [], <type 'Blender Armature'>: [], <type 'Blender NMFace'>: ['v', 'col', 'mat', 'smooth'], <type 'Blender NMesh'>: ['name', 'verts', 'faces', 'mats', 'has_col', 'has_uvco'], <type 'Blender Material'>: []} blenpy.pyGui.DEFAULT_SETTINGS = {'mouseRightIndex': 7, 'extensions': '.py,.pyw,.leo', 'path_depth': 5, 'paths': [], 'launchIndex': 3, 'mouseLeftIndex': 2, 'mouseMiddleIndex': 3, 'inspect_depth': 6} blenpy.pyGui.extEditors = {'Boa': <blenpy.pyGui.Editor instance at 0x0889F1F8>, 'Idle': <blenpy.pyGui.Editor instance at 0x0889F228>, 'PythonWin': <blenpy.pyGui.Editor instance at 0x0889F2E8>, 'Scintilla': <blenpy.pyGui.Editor instance at 0x0889F618>, 'Leo': <blenpy.pyGui.Editor instance at 0x0889F258>}
functions blenpy.pyGui.askdirectory(initialdir='', title='www.stani.be', mustexist=1, **options) Ask for a directory, and return the file name blenpy.pyGui.blenderCrust(extraObjects={}, blenderImport=1, recursive=7, tab=1) Blender version of PyCrust
extraObjects: Add any object to the extraObjects root as a dictionary. blenderImport: Cameras=Blender.Camera.Get(),Objects=Blender.Object.Get(),etc... recursive: Same as blender Import, but execute recursively the get functions tab: Show Cameras,Objects,... in different tabs
blenpy.pyGui.blenderCrustInventory(data) Return statistics of the Blender Data (how many cameras,objects,...) Helper function for blenderCrust
blenpy.pyGui.blenderCrustTabs(tabs) Returns the tabs as a dictionary tabs[label]=(rootObjects,welcomeString,rootLabel) Helper function for blenderCrust.
blenpy.pyGui.dirDialog(defaultPath='', message='www.stani.be', newDir=1) Launchs a directory selector dialog (wxpython). blenpy.pyGui.getextEditors() blenpy.pyGui.inspect(objects={}, recursive=10, useDocString=1) Returns a dictionary which contains all available Python information. blenpy.pyGui.inspectTopic(object, prefix='', recursive=2, useDocString=0) Private recursive helper function for inspect. blenpy.pyGui.inspectType(object) Returns the name of type. blenpy.pyGui.inspector(object, description='Browse...') Launch a Tkinter window for interactive object browsing. Useful for inspecting during debugging, instead of a print statement.
blenpy.pyGui.inspectorBlender(objects={}) Launchs a tree dialog which contains all available Python information. Maybe also usefull during debugging.
blenpy.pyGui.launchIdle() blenpy.pyGui.pythonLoad(fileName) Load in Blender text window classes
blenpy.pyGui.PythonGui class | parents ⊗ blenpy ⊗ pyGui instance methods ◊ __initActions__ ◊ __initTools__ ◊ __init__ ◊ _color ◊ _control ◊ _key ◊ _mouseX ◊ _mouseY ◊ _prepare ◊ button ◊ clear ◊ color ◊ control ◊ cursor ◊ dirAdd ◊ dirAsk ◊ dirRemove ◊ display ◊ draw ◊ drawBase ◊ drawCaption ◊ drawFiles ◊ drawFilesMouse ◊ drawGetLabel ◊ drawSetKeys ◊ drawSettings ◊ eventLaunch ◊ eventLaunchSelect ◊ eventMouseLeft ◊ eventMouseLeftSelect ◊ eventMouseMiddle ◊ eventMouseMiddleSelect ◊ eventMouseRight ◊ eventMouseRightSelect ◊ eventReloadAll ◊ eventSaveAll ◊ eventSelect ◊ exit ◊ fileY ◊ files ◊ key ◊ menu ◊ nothing ◊ rectangle ◊ redraw ◊ settingsDefaults ◊ settingsLoad ◊ settingsSave ◊ start ◊ string ◊ text | documentation Provides an useful gui interface for Python in Blender base classes Gui
strs blenpy.pyGui.blenpy.pyGui.PythonGui.__module__ = 'blenpy.pyGui'
instance methods blenpy.pyGui.blenpy.pyGui.PythonGui.__initActions__(self) Retrieve actions from the plugin.mouse module. blenpy.pyGui.blenpy.pyGui.PythonGui.__initTools__(self) Retrieve tools from the plugin.mouse module. blenpy.pyGui.blenpy.pyGui.PythonGui.__init__(self, pyExt='.py,.pyw') dirs,editor blenpy.pyGui.blenpy.pyGui.PythonGui._color(self, red=0, green=0, blue=0) Sets the color, but doesn't save as text color. blenpy.pyGui.blenpy.pyGui.PythonGui._control(self, id) Retrieve the actions of the control events (buttons,menus). Private function used by register.
blenpy.pyGui.blenpy.pyGui.PythonGui._key(self, key, val) Retrieve the actions of the key events. Private function used by register.
blenpy.pyGui.blenpy.pyGui.PythonGui._mouseX(self, val) Üpdate mouse x coordinate. blenpy.pyGui.blenpy.pyGui.PythonGui._mouseY(self, val) Üpdate mouse y coordinate & statusbar for fileName.(custom) blenpy.pyGui.blenpy.pyGui.PythonGui._prepare(self, typ, id, action, initial, x, y, dx, dy, width, height, tooltip) Private helper function for controls as strings, menus,... blenpy.pyGui.blenpy.pyGui.PythonGui.button(self, label='', action=0, x=-1, y=-1, dx=-1, dy=-1, width=0, height=0, tooltip=0) Draws a button control, exit is the default action. blenpy.pyGui.blenpy.pyGui.PythonGui.clear(self, r=0.5, g=0.5, b=0.5, a=0.0) Clears the screen with the rgba color blenpy.pyGui.blenpy.pyGui.PythonGui.color(self, red=0, green=0, blue=0) Sets the text color. blenpy.pyGui.blenpy.pyGui.PythonGui.control(self, action) Helper function for buttons, menus and ... blenpy.pyGui.blenpy.pyGui.PythonGui.cursor(self, x=-1, y=-1, dx=-1, dy=-1, width=0, height=0, tooltip=0) Moves the cursor absolutely(x,y) or relatively (dx,dy). blenpy.pyGui.blenpy.pyGui.PythonGui.dirAdd(self) Adds the directory in the edit field to self.paths blenpy.pyGui.blenpy.pyGui.PythonGui.dirAsk(self) Pops up a dialog to ask for a directory. blenpy.pyGui.blenpy.pyGui.PythonGui.dirRemove(self) Removes the directory in the edit field to self.paths blenpy.pyGui.blenpy.pyGui.PythonGui.display(self) Resets all values and draws gui. blenpy.pyGui.blenpy.pyGui.PythonGui.draw(self) Draws the Python script gui. blenpy.pyGui.blenpy.pyGui.PythonGui.drawBase(self) Draws the base menu which is always displayed blenpy.pyGui.blenpy.pyGui.PythonGui.drawCaption(self, steps=100) Draws a caption down with a gradient. blenpy.pyGui.blenpy.pyGui.PythonGui.drawFiles(self) Draws at table of files. blenpy.pyGui.blenpy.pyGui.PythonGui.drawFilesMouse(self, x) Returns the mouse action for the table caption. blenpy.pyGui.blenpy.pyGui.PythonGui.drawGetLabel(self, module, tool) blenpy.pyGui.blenpy.pyGui.PythonGui.drawSetKeys(self) Set key events. blenpy.pyGui.blenpy.pyGui.PythonGui.drawSettings(self) blenpy.pyGui.blenpy.pyGui.PythonGui.eventLaunch(self, keyDown=0) Launches the selected tool. blenpy.pyGui.blenpy.pyGui.PythonGui.eventLaunchSelect(self, keyDown=0, value=-1) Called when the user changes the menu of the tool to launch. blenpy.pyGui.blenpy.pyGui.PythonGui.eventMouseLeft(self, keyDown=0) Launches the action by a left click of the mouse. blenpy.pyGui.blenpy.pyGui.PythonGui.eventMouseLeftSelect(self, keyDown=0, value=-1) Called when the user changes the menu for the left mouse button. blenpy.pyGui.blenpy.pyGui.PythonGui.eventMouseMiddle(self, keyDown=0) Launches the action by a middle click of the mouse. blenpy.pyGui.blenpy.pyGui.PythonGui.eventMouseMiddleSelect(self, keyDown=0, value=-1) Called when the user changes the menu for the middle mouse button. blenpy.pyGui.blenpy.pyGui.PythonGui.eventMouseRight(self, keyDown=0) Launches the action by a right click of the mouse. blenpy.pyGui.blenpy.pyGui.PythonGui.eventMouseRightSelect(self, keyDown=0, value=-1) Called when the user changes the menu for the right mouse button. blenpy.pyGui.blenpy.pyGui.PythonGui.eventReloadAll(self, keyDown=0) Reloads all previous loaded python files. blenpy.pyGui.blenpy.pyGui.PythonGui.eventSaveAll(self, keyDown=0) Saves all previous loaded python files. blenpy.pyGui.blenpy.pyGui.PythonGui.eventSelect(self) Selects the directory of which the Python files will be displayed as buttons. Redraw will look for the files. blenpy.pyGui.blenpy.pyGui.PythonGui.exit(self, forced=0) Exists the gui blenpy.pyGui.blenpy.pyGui.PythonGui.fileY(self) Retrieves which file is under the cursor by the y coordinate. blenpy.pyGui.blenpy.pyGui.PythonGui.files(self, path=0, recursive=-1, sort=1) Returns a list of python files of the selected directory. blenpy.pyGui.blenpy.pyGui.PythonGui.key(self, key=218, action=) "Register a key with an action blenpy.pyGui.blenpy.pyGui.PythonGui.menu(self, label='', id='', action=0, x=-1, y=-1, dx=-1, dy=-1, width=0, height=0, initial=-1, tooltip=0) Draw a menu control. blenpy.pyGui.blenpy.pyGui.PythonGui.nothing(self) Do nothing(pass),usefull for unimplemented buttons. blenpy.pyGui.blenpy.pyGui.PythonGui.rectangle(self, x0, y0, x1, y1, color=(0.5, 0.5, 0.5), border=0, borderColor=(0, 0, 0)) Fills a rectangle with a certain color with an optional border.
Parameters: x0,y0,x1,y1: coordinates of the lower left and upper right corner color: color with which the rectangle is filled border: border width in pixels 0 for no border positive values for expanding border negative values for contracting border
blenpy.pyGui.blenpy.pyGui.PythonGui.redraw(self) Redraw gui. blenpy.pyGui.blenpy.pyGui.PythonGui.settingsDefaults(self, redraw=1) Restore default settings from file. blenpy.pyGui.blenpy.pyGui.PythonGui.settingsLoad(self) Restores menu settings from file. blenpy.pyGui.blenpy.pyGui.PythonGui.settingsSave(self) Saves menu settings to file. blenpy.pyGui.blenpy.pyGui.PythonGui.start(self) Starts the gui. blenpy.pyGui.blenpy.pyGui.PythonGui.string(self, label='', id='', action=0, x=-1, y=-1, dx=-1, dy=-1, width=0, height=0, initial=-1, length=255, tooltip=0) Draw a string control. blenpy.pyGui.blenpy.pyGui.PythonGui.text(self, label='', x=-1, y=-1, dx=-1, dy=-1, width=0, height=0, color=0, bgOffset=(0, 0, 0, 0), bgColor=0) Draws a text on the gui.
Special attribute: bgOffset This specifies in relative units the rectangle for the background rectangle. Important: Everything after '%s' will be executed as Python code. This makes it possible to apply advanced layout techniques. For example: 'blabla#@color=(1,0,0)#@bgColor=self.bgColor' This will print the text 'blabla' in a red color on a background color, defined by self.bgColor.
|
modules blenpy.pyGui.blenpy = <module 'blenpy' from 'D:\Data\Python\blenpy\__init__.pyc'>
|