Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-02-27 13:23:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-02-27 13:23:24 +0300
commitd067c113366ab9b4d378fd978e0acee1d91a0db3 (patch)
treefa7c6a22b6db4400a79c81f2483c78cfd92e51cf /source
parent9d7ace265454a8766450531614e3b9272d49f69f (diff)
added id_attributes.py, this containes ID doc strings, all datablocks that have use ID props import this docstring.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/doc/API_intro.py364
-rw-r--r--source/blender/python/api2_2x/doc/Armature.py472
-rw-r--r--source/blender/python/api2_2x/doc/Camera.py468
-rw-r--r--source/blender/python/api2_2x/doc/Constraint.py406
-rw-r--r--source/blender/python/api2_2x/doc/Curve.py1350
-rw-r--r--source/blender/python/api2_2x/doc/Font.py100
-rw-r--r--source/blender/python/api2_2x/doc/Group.py193
-rw-r--r--source/blender/python/api2_2x/doc/Image.py663
-rw-r--r--source/blender/python/api2_2x/doc/Ipo.py819
-rw-r--r--source/blender/python/api2_2x/doc/Key.py166
-rw-r--r--source/blender/python/api2_2x/doc/Lamp.py991
-rw-r--r--source/blender/python/api2_2x/doc/Lattice.py324
-rw-r--r--source/blender/python/api2_2x/doc/Material.py1946
-rw-r--r--source/blender/python/api2_2x/doc/Mesh.py2209
-rw-r--r--source/blender/python/api2_2x/doc/Metaball.py259
-rw-r--r--source/blender/python/api2_2x/doc/NLA.py385
-rw-r--r--source/blender/python/api2_2x/doc/Object.py3356
-rw-r--r--source/blender/python/api2_2x/doc/Scene.py700
-rw-r--r--source/blender/python/api2_2x/doc/Sound.py248
-rw-r--r--source/blender/python/api2_2x/doc/Text.py226
-rw-r--r--source/blender/python/api2_2x/doc/Text3d.py539
-rw-r--r--source/blender/python/api2_2x/doc/Texture.py699
-rw-r--r--source/blender/python/api2_2x/doc/World.py640
-rw-r--r--source/blender/python/api2_2x/id_attributes.py8
24 files changed, 8751 insertions, 8780 deletions
diff --git a/source/blender/python/api2_2x/doc/API_intro.py b/source/blender/python/api2_2x/doc/API_intro.py
index 8290173a11f..ccdc36d41c0 100644
--- a/source/blender/python/api2_2x/doc/API_intro.py
+++ b/source/blender/python/api2_2x/doc/API_intro.py
@@ -4,224 +4,224 @@
The Blender Python API Reference
================================
- An asterisk (*) means the module has been updated.
-
- for a full list of changes since 2.42 see U{http://mediawiki.blender.org/index.php/Release_Notes/Notes243/Python_API}
-
- Top Module:
- -----------
-
- - L{Blender}
-
- Submodules:
- -----------
- - L{Armature} (*)
- - L{NLA}
- - L{Action<NLA.Action>}
- - L{BezTriple} (*)
- - L{BGL}
- - L{Camera} (*)
- - L{Curve} (*)
- - L{Draw} (*)
- - L{Effect}
- - L{Geometry} (*)
- - L{Group} (*)
- - L{Image} (*)
- - L{Ipo} (*)
- - L{IpoCurve} (*)
- - L{Key} (*)
- - L{Lamp}
- - L{Lattice} (*)
- - L{Library} (*)
- - L{Material} (*)
- - L{Mathutils} (*)
- - L{Mesh} (*)
- - L{MeshPrimitives} (*)
- - L{Metaball} (*)
- - L{NMesh} (*)
- - L{Noise}
- - L{Object} (*)
- - L{Modifier} (*)
- - L{Pose} (*)
- - L{Constraint} (*)
- - L{ActionStrips<NLA>} (*)
- - L{Registry}
- - L{Scene} (*)
- - L{Radio}
- - L{Render} (*)
- - L{Sound} (*)
- - L{Text}
- - L{Text3d}
- - L{Font}
- - L{Texture} (*)
- - L{TimeLine}
- - L{Types}
- - L{Window}
- - L{Theme} (*)
- - L{World}
- - L{sys<Sys>}
-
- Additional information:
- -----------------------
-
- - L{Special features<API_related>}:
- - scripts: registering in menus, documenting, configuring (new);
- - command line examples (new);
- - script links (*), space handler script links, Group module (new).
+ An asterisk (*) means the module has been updated.
+
+ for a full list of changes since 2.42 see U{http://mediawiki.blender.org/index.php/Release_Notes/Notes243/Python_API}
+
+ Top Module:
+ -----------
+
+ - L{Blender}
+
+ Submodules:
+ -----------
+ - L{Armature} (*)
+ - L{NLA}
+ - L{Action<NLA.Action>}
+ - L{BezTriple} (*)
+ - L{BGL}
+ - L{Camera} (*)
+ - L{Curve} (*)
+ - L{Draw} (*)
+ - L{Effect}
+ - L{Geometry} (*)
+ - L{Group} (*)
+ - L{Image} (*)
+ - L{Ipo} (*)
+ - L{IpoCurve} (*)
+ - L{Key} (*)
+ - L{Lamp}
+ - L{Lattice} (*)
+ - L{Library} (*)
+ - L{Material} (*)
+ - L{Mathutils} (*)
+ - L{Mesh} (*)
+ - L{MeshPrimitives} (*)
+ - L{Metaball} (*)
+ - L{NMesh} (*)
+ - L{Noise}
+ - L{Object} (*)
+ - L{Modifier} (*)
+ - L{Pose} (*)
+ - L{Constraint} (*)
+ - L{ActionStrips<NLA>} (*)
+ - L{Registry}
+ - L{Scene} (*)
+ - L{Radio}
+ - L{Render} (*)
+ - L{Sound} (*)
+ - L{Text}
+ - L{Text3d}
+ - L{Font}
+ - L{Texture} (*)
+ - L{TimeLine}
+ - L{Types}
+ - L{Window}
+ - L{Theme} (*)
+ - L{World}
+ - L{sys<Sys>}
+
+ Additional information:
+ -----------------------
+
+ - L{Special features<API_related>}:
+ - scripts: registering in menus, documenting, configuring (new);
+ - command line examples (new);
+ - script links (*), space handler script links, Group module (new).
Introduction:
=============
- This reference documents the Blender Python API, a growing collection of
- Python modules (libraries) that give access to part of the program's internal
- data and functions.
-
- Through scripting Blender can be extended in real-time via
- U{Python <www.python.org>}, an impressive high level, multi-paradigm, open
- source language. Newcomers are recommended to start with the tutorial that
- comes with it.
-
- This opens many interesting possibilities, ranging from automating repetitive
- tasks to adding new functionality to the program: procedural models,
- importers and exporters, even complex applications and so on. Blender itself
- comes with some scripts, but many others can be found in the Scripts & Plugins
- sections and forum posts at the Blender-related sites listed below.
+ This reference documents the Blender Python API, a growing collection of
+ Python modules (libraries) that give access to part of the program's internal
+ data and functions.
+
+ Through scripting Blender can be extended in real-time via
+ U{Python <www.python.org>}, an impressive high level, multi-paradigm, open
+ source language. Newcomers are recommended to start with the tutorial that
+ comes with it.
+
+ This opens many interesting possibilities, ranging from automating repetitive
+ tasks to adding new functionality to the program: procedural models,
+ importers and exporters, even complex applications and so on. Blender itself
+ comes with some scripts, but many others can be found in the Scripts & Plugins
+ sections and forum posts at the Blender-related sites listed below.
Scripting and Blender:
======================
These are the basic ways to execute scripts in Blender:
- 1. They can be loaded or typed as text files in the Text Editor window, then
- executed with ALT+P.
- 2. Via command line: C{blender -P <scriptname>} will start Blender and execute
- the given script. <scriptname> can be a filename in the user's file system or
- the name of a text saved in a .blend Blender file:
- 'blender myfile.blend -P textname'.
- 3. Via command line in I{background mode}: use the '-b' flag (the order is
- important): C{blender -b <blendfile> -P <scriptname>}. <blendfile> can be any
- .blend file, including the default .B.blend that is in Blender's home directory
- L{Blender.Get}('homedir'). In this mode no window will be opened and the
- program will leave as soon as the script finishes execution.
- 4. Properly registered scripts can be selected directly from the program's
- menus.
- 5. Scriptlinks: these are also loaded or typed in the Text Editor window and
- can be linked to objects, materials or scenes using the Scriptlink buttons
- tab. Script links get executed automatically when their events (ONLOAD,
- REDRAW, FRAMECHANGED) are triggered. Normal scripts can create (L{Text}) and
- link other scripts to objects and events, see L{Object.Object.addScriptLink},
- for example.
- 6. A script can call another script (that will run in its own context, with
- its own global dictionary) with the L{Blender.Run} module function.
+ 1. They can be loaded or typed as text files in the Text Editor window, then
+ executed with ALT+P.
+ 2. Via command line: C{blender -P <scriptname>} will start Blender and execute
+ the given script. <scriptname> can be a filename in the user's file system or
+ the name of a text saved in a .blend Blender file:
+ 'blender myfile.blend -P textname'.
+ 3. Via command line in I{background mode}: use the '-b' flag (the order is
+ important): C{blender -b <blendfile> -P <scriptname>}. <blendfile> can be any
+ .blend file, including the default .B.blend that is in Blender's home directory
+ L{Blender.Get}('homedir'). In this mode no window will be opened and the
+ program will leave as soon as the script finishes execution.
+ 4. Properly registered scripts can be selected directly from the program's
+ menus.
+ 5. Scriptlinks: these are also loaded or typed in the Text Editor window and
+ can be linked to objects, materials or scenes using the Scriptlink buttons
+ tab. Script links get executed automatically when their events (ONLOAD,
+ REDRAW, FRAMECHANGED) are triggered. Normal scripts can create (L{Text}) and
+ link other scripts to objects and events, see L{Object.Object.addScriptLink},
+ for example.
+ 6. A script can call another script (that will run in its own context, with
+ its own global dictionary) with the L{Blender.Run} module function.
Interaction with users:
-----------------------
- Scripts can:
- - simply run and exit;
- - pop messages, menus and small number and text input boxes;
- - draw graphical user interfaces (GUIs) with OpenGL calls and native
- program buttons, which stay there accepting user input like any other
- Blender window until the user closes them;
- - attach themselves to a space's event or drawing code (aka space handlers,
- L{check here<API_related>});
- - make changes to the 3D View (set visible layer(s), view point, etc);
- - grab the main input event queue and process (or pass to Blender) selected
- keyboard, mouse, redraw events -- not considered good practice, but still
- available for private use;
- - tell Blender to execute other scripts (see L{Blender.Run}());
- - use external Python libraries, if available.
-
- You can read the documentation for the L{Window}, L{Draw} and L{BGL} modules
- for more information and also check the Python site for external modules that
- might be useful to you. Note though that any imported module will become a
- requirement of your script, since Blender itself does not bundle external
- modules.
+ Scripts can:
+ - simply run and exit;
+ - pop messages, menus and small number and text input boxes;
+ - draw graphical user interfaces (GUIs) with OpenGL calls and native
+ program buttons, which stay there accepting user input like any other
+ Blender window until the user closes them;
+ - attach themselves to a space's event or drawing code (aka space handlers,
+ L{check here<API_related>});
+ - make changes to the 3D View (set visible layer(s), view point, etc);
+ - grab the main input event queue and process (or pass to Blender) selected
+ keyboard, mouse, redraw events -- not considered good practice, but still
+ available for private use;
+ - tell Blender to execute other scripts (see L{Blender.Run}());
+ - use external Python libraries, if available.
+
+ You can read the documentation for the L{Window}, L{Draw} and L{BGL} modules
+ for more information and also check the Python site for external modules that
+ might be useful to you. Note though that any imported module will become a
+ requirement of your script, since Blender itself does not bundle external
+ modules.
Command line mode:
------------------
- Python was embedded in Blender, so to access BPython modules you need to
- run scripts from the program itself: you can't import the Blender module
- into an external Python interpreter.
+ Python was embedded in Blender, so to access BPython modules you need to
+ run scripts from the program itself: you can't import the Blender module
+ into an external Python interpreter.
- On the other hand, for many tasks it's possible to control Blender via
- some automated process using scripts. Interested readers should learn about
- features like "OnLoad" script links, the "-b <blendfile>" (background mode)
- and "-P <script>" (run script) command line options and API calls like
- L{Blender.Save}, L{Blender.Load}, L{Blender.Quit} and the L{Library} and
- L{Render} modules.
+ On the other hand, for many tasks it's possible to control Blender via
+ some automated process using scripts. Interested readers should learn about
+ features like "OnLoad" script links, the "-b <blendfile>" (background mode)
+ and "-P <script>" (run script) command line options and API calls like
+ L{Blender.Save}, L{Blender.Load}, L{Blender.Quit} and the L{Library} and
+ L{Render} modules.
- Note that command line scripts are run before Blender initializes its windows
- (and in '-b' mode no window will be initialized), so many functions that get
- or set window related attributes (like most in L{Window}) don't work here. If
- you need those, use an ONLOAD script link (see L{Scene.Scene.addScriptLink})
- instead -- it's also possible to use a command line script to write or set an
- ONLOAD script link. Check the L{Blender.mode} module var to know if Blender
- is being executed in "background" or "interactive" mode.
+ Note that command line scripts are run before Blender initializes its windows
+ (and in '-b' mode no window will be initialized), so many functions that get
+ or set window related attributes (like most in L{Window}) don't work here. If
+ you need those, use an ONLOAD script link (see L{Scene.Scene.addScriptLink})
+ instead -- it's also possible to use a command line script to write or set an
+ ONLOAD script link. Check the L{Blender.mode} module var to know if Blender
+ is being executed in "background" or "interactive" mode.
- L{Click here for command line and background mode examples<API_related>}.
+ L{Click here for command line and background mode examples<API_related>}.
Demo mode:
----------
- Blender has a demo mode, where once started it can work without user
- intervention, "showing itself off". Demos can render stills and animations,
- play rendered or real-time animations, calculate radiosity simulations and
- do many other nifty things. If you want to turn a .blend file into a demo,
- write a script to run the show and link it as a scene "OnLoad" scriptlink.
- The demo will then be played automatically whenever this .blend file is
- opened, B{unless Blender was started with the "-y" parameter}.
+ Blender has a demo mode, where once started it can work without user
+ intervention, "showing itself off". Demos can render stills and animations,
+ play rendered or real-time animations, calculate radiosity simulations and
+ do many other nifty things. If you want to turn a .blend file into a demo,
+ write a script to run the show and link it as a scene "OnLoad" scriptlink.
+ The demo will then be played automatically whenever this .blend file is
+ opened, B{unless Blender was started with the "-y" parameter}.
The Game Engine API:
--------------------
- Blender has a game engine for users to create and play 3d games. This
- engine lets programmers add scripts to improve game AI, control, etc, making
- more complex interaction and tricks possible. The game engine API is
- separate from the Blender Python API this document references and you can
- find its own ref doc in the doc section of the main sites below.
+ Blender has a game engine for users to create and play 3d games. This
+ engine lets programmers add scripts to improve game AI, control, etc, making
+ more complex interaction and tricks possible. The game engine API is
+ separate from the Blender Python API this document references and you can
+ find its own ref doc in the doc section of the main sites below.
Blender Data Structures:
------------------------
- Programs manipulate data structures. Blender python scripts are no exception.
- Blender uses an Object Oriented architecture. The BPython interface tries to
- present Blender objects and their attributes in the same way you see them
- through the User Interface (the GUI). One key to BPython programming is
- understanding the information presented in Blender's OOPS window where Blender
- objects and their relationships are displayed.
+ Programs manipulate data structures. Blender python scripts are no exception.
+ Blender uses an Object Oriented architecture. The BPython interface tries to
+ present Blender objects and their attributes in the same way you see them
+ through the User Interface (the GUI). One key to BPython programming is
+ understanding the information presented in Blender's OOPS window where Blender
+ objects and their relationships are displayed.
- Each Blender graphic element (Mesh, Lamp, Curve, etc.) is composed from two
- parts: an Object and ObData. The Object holds information about the position,
- rotation and size of the element. This is information that all elements have
- in common. The ObData holds information specific to that particular type of
- element.
+ Each Blender graphic element (Mesh, Lamp, Curve, etc.) is composed from two
+ parts: an Object and ObData. The Object holds information about the position,
+ rotation and size of the element. This is information that all elements have
+ in common. The ObData holds information specific to that particular type of
+ element.
- Each Object has a link to its associated ObData. A single ObData may be
- shared by many Objects. A graphic element also has a link to a list of
- Materials. By default, this list is associated with the ObData.
+ Each Object has a link to its associated ObData. A single ObData may be
+ shared by many Objects. A graphic element also has a link to a list of
+ Materials. By default, this list is associated with the ObData.
- All Blender objects have a unique name. However, the name is qualified by the
- type of the object. This means you can have a Lamp Object called Lamp.001
- (OB:Lamp.001) and a Lamp ObData called Lamp.001 (LA:Lamp.001).
+ All Blender objects have a unique name. However, the name is qualified by the
+ type of the object. This means you can have a Lamp Object called Lamp.001
+ (OB:Lamp.001) and a Lamp ObData called Lamp.001 (LA:Lamp.001).
- For a more in-depth look at Blender internals, and some understanding of why
- Blender works the way it does, see the U{Blender Architecture document
- <http://www.blender3d.org/cms/Blender_Architecture.336.0.html>}.
+ For a more in-depth look at Blender internals, and some understanding of why
+ Blender works the way it does, see the U{Blender Architecture document
+ <http://www.blender3d.org/cms/Blender_Architecture.336.0.html>}.
A note to newbie script writers:
--------------------------------
- Interpreted languages are known to be much slower than compiled code, but for
- many applications the difference is negligible or acceptable. Also, with
- profiling (or even simple direct timing with L{Blender.sys.time<Sys.time>}) to
- identify slow areas and well thought optimizations, the speed can be
- I{considerably} improved in many cases. Try some of the best BPython scripts
- to get an idea of what can be done, you may be surprised.
+ Interpreted languages are known to be much slower than compiled code, but for
+ many applications the difference is negligible or acceptable. Also, with
+ profiling (or even simple direct timing with L{Blender.sys.time<Sys.time>}) to
+ identify slow areas and well thought optimizations, the speed can be
+ I{considerably} improved in many cases. Try some of the best BPython scripts
+ to get an idea of what can be done, you may be surprised.
@author: The Blender Python Team
@requires: Blender 2.43 or newer.
@@ -235,14 +235,14 @@ A note to newbie script writers:
@see: U{www.python.org/doc<http://www.python.org/doc>}
@see: U{Blending into Python<en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python>}: User contributed documentation, featuring a blender/python cookbook with many examples.
@note: this documentation was generated by epydoc, which can output html and
- pdf. For pdf it requires a working LaTeX environment.
+ pdf. For pdf it requires a working LaTeX environment.
@note: the official version of this reference guide is only updated for each
- new Blender release. But you can build the current CVS
- version yourself: install epydoc, grab all files in the
- source/blender/python/api2_2x/doc/ folder of Blender's CVS and use the
- epy_docgen.sh script also found there to generate the html docs.
- Naturally you will also need a recent Blender binary to try the new
- features. If you prefer not to compile it yourself, there is a testing
- builds forum at U{blender.org<http://www.blender.org>}.
+ new Blender release. But you can build the current CVS
+ version yourself: install epydoc, grab all files in the
+ source/blender/python/api2_2x/doc/ folder of Blender's CVS and use the
+ epy_docgen.sh script also found there to generate the html docs.
+ Naturally you will also need a recent Blender binary to try the new
+ features. If you prefer not to compile it yourself, there is a testing
+ builds forum at U{blender.org<http://www.blender.org>}.
"""
diff --git a/source/blender/python/api2_2x/doc/Armature.py b/source/blender/python/api2_2x/doc/Armature.py
index c6a5608f7d1..8e179e22583 100644
--- a/source/blender/python/api2_2x/doc/Armature.py
+++ b/source/blender/python/api2_2x/doc/Armature.py
@@ -114,249 +114,245 @@ def Get (name = None):
"""
def New (name = None):
- """
- Return a new armature.
- @type name: string or nothing
- @param name: The string name of the new armature.
- @rtype: Blender Armature.
- @return: A new armature.
- """
+ """
+ Return a new armature.
+ @type name: string or nothing
+ @param name: The string name of the new armature.
+ @rtype: Blender Armature.
+ @return: A new armature.
+ """
class Armature:
- """
- The Armature object
- ===================
- This object gives access to Armature-specific data in Blender.
- @ivar name: The Armature name.
- @type name: String
- @ivar bones: A Dictionary of Bones (BonesDict) that make up this armature.
- @type bones: BonesDict Object
- @ivar vertexGroups: Whether vertex groups define deformation
- @type vertexGroups: Bool
- @ivar envelopes: Whether bone envelopes define deformation
- @type envelopes: Bool
- @ivar restPosition: Show rest position (no posing possible)
- @type restPosition: Bool
- @ivar delayDeform: Don't deform children when manipulating bones
- @type delayDeform: Bool
- @ivar drawAxes: Draw bone axes
- @type drawAxes: Bool
- @ivar drawNames: Draw bone names
- @type drawNames: Bool
- @ivar ghost: Draw ghosts around frame for current Action
- @type ghost: Bool
- @ivar ghostStep: Number of frames between ghosts
- @type ghostStep: Int
- @ivar drawType: The drawing type that is used to display the armature
- Acceptable values are:
- - Armature.OCTAHEDRON: bones drawn as octahedrons
- - Armature.STICK: bones drawn as sticks
- - Armature.BBONE: bones drawn as b-bones
- - Armature.ENVELOPE: bones drawn as sticks with envelopes
- @type drawType: Constant Object
- @ivar mirrorEdit: X-axis mirrored editing
- @type mirrorEdit: Bool
- @ivar autoIK: Adds temporary IK chains while grabbing bones
- @type autoIK: Bool
- @ivar users: The number of users of the armature. Read-only.
- @type users: int
- @ivar fakeUser: The fake user status.
- Enabling this will keep it in the blend even if there are no users.
- @type fakeUser: bool
- """
-
- def __init__(name = 'myArmature'):
- """
- Initializer for the Armature TypeObject.
- Example::
- myNewArmature = Blender.Armature.Armature('AR_1')
- @param name: The name for the new armature
- @type name: string
- @return: New Armature Object
- @rtype: Armature Object
- """
-
- def makeEditable():
- """
- Put the armature into EditMode for editing purposes. (Enters Editmode)
- @warning: Using Window.Editmode() to switch the editmode manually will cause problems and possibly even crash Blender.
- @warning: This is only needed for operations such as adding and removing bones.
- @warning: Do access pose data until you have called update() or settings will be lost.
- @warning: The armature should not be in manual editmode
- prior to calling this method. The armature must be parented
- to an object prior to editing.
- @rtype: None
- """
-
- def update():
- """
- Save all changes and update the armature. (Leaves Editmode)
- @note: Must have called makeEditable() first.
- @rtype: None
- """
+ """
+ The Armature object
+ ===================
+ This object gives access to Armature-specific data in Blender.
+ @ivar bones: A Dictionary of Bones (BonesDict) that make up this armature.
+ @type bones: BonesDict Object
+ @ivar vertexGroups: Whether vertex groups define deformation
+ @type vertexGroups: Bool
+ @ivar envelopes: Whether bone envelopes define deformation
+ @type envelopes: Bool
+ @ivar restPosition: Show rest position (no posing possible)
+ @type restPosition: Bool
+ @ivar delayDeform: Don't deform children when manipulating bones
+ @type delayDeform: Bool
+ @ivar drawAxes: Draw bone axes
+ @type drawAxes: Bool
+ @ivar drawNames: Draw bone names
+ @type drawNames: Bool
+ @ivar ghost: Draw ghosts around frame for current Action
+ @type ghost: Bool
+ @ivar ghostStep: Number of frames between ghosts
+ @type ghostStep: Int
+ @ivar drawType: The drawing type that is used to display the armature
+ Acceptable values are:
+ - Armature.OCTAHEDRON: bones drawn as octahedrons
+ - Armature.STICK: bones drawn as sticks
+ - Armature.BBONE: bones drawn as b-bones
+ - Armature.ENVELOPE: bones drawn as sticks with envelopes
+ @type drawType: Constant Object
+ @ivar mirrorEdit: X-axis mirrored editing
+ @type mirrorEdit: Bool
+ @ivar autoIK: Adds temporary IK chains while grabbing bones
+ @type autoIK: Bool
+ """
+
+ def __init__(name = 'myArmature'):
+ """
+ Initializer for the Armature TypeObject.
+ Example::
+ myNewArmature = Blender.Armature.Armature('AR_1')
+ @param name: The name for the new armature
+ @type name: string
+ @return: New Armature Object
+ @rtype: Armature Object
+ """
+
+ def makeEditable():
+ """
+ Put the armature into EditMode for editing purposes. (Enters Editmode)
+ @warning: Using Window.Editmode() to switch the editmode manually will cause problems and possibly even crash Blender.
+ @warning: This is only needed for operations such as adding and removing bones.
+ @warning: Do access pose data until you have called update() or settings will be lost.
+ @warning: The armature should not be in manual editmode
+ prior to calling this method. The armature must be parented
+ to an object prior to editing.
+ @rtype: None
+ """
+
+ def update():
+ """
+ Save all changes and update the armature. (Leaves Editmode)
+ @note: Must have called makeEditable() first.
+ @rtype: None
+ """
+
+import id_generics
+Armature.__doc__ += id_generics.attributes
class BonesDict:
- """
- The BonesDict object
- ====================
- This object gives gives dictionary like access to the bones in an armature.
- It is internal to blender but is called as 'Armature.bones'
-
- Removing a bone:
- Example::
- del myArmature.bones['bone_name']
- Adding a bone:
- Example::
- myEditBone = Armature.Editbone()
- myArmature.bones['bone_name'] = myEditBone
- """
-
- def items():
- """
- Return the key, value pairs in this dictionary
- @rtype: string, BPy_bone
- @return: All strings, and py_bones in the armature (in that order)
- """
-
- def keys():
- """
- Return the keys in this dictionary
- @rtype: string
- @return: All strings representing the bone names
- """
-
- def values():
- """
- Return the values in this dictionary
- @rtype: BPy_bone
- @return: All BPy_bones in this dictionary
- """
+ """
+ The BonesDict object
+ ====================
+ This object gives gives dictionary like access to the bones in an armature.
+ It is internal to blender but is called as 'Armature.bones'
+
+ Removing a bone:
+ Example::
+ del myArmature.bones['bone_name']
+ Adding a bone:
+ Example::
+ myEditBone = Armature.Editbone()
+ myArmature.bones['bone_name'] = myEditBone
+ """
+
+ def items():
+ """
+ Return the key, value pairs in this dictionary
+ @rtype: string, BPy_bone
+ @return: All strings, and py_bones in the armature (in that order)
+ """
+
+ def keys():
+ """
+ Return the keys in this dictionary
+ @rtype: string
+ @return: All strings representing the bone names
+ """
+
+ def values():
+ """
+ Return the values in this dictionary
+ @rtype: BPy_bone
+ @return: All BPy_bones in this dictionary
+ """
class Bone:
- """
- The Bone object
- ===============
- This object gives access to Bone-specific data in Blender. This object
- cannot be instantiated but is returned by BonesDict when the armature is not in editmode.
- @ivar name: The name of this Bone.
- @type name: String
- @ivar roll: This Bone's roll value.
- Keys are:
- - 'ARMATURESPACE' - this roll in relation to the armature
- - 'BONESPACE' - the roll in relation to itself
- @type roll: Dictionary
- @ivar head: This Bone's "head" ending position when in rest state.
- Keys are:
- - 'ARMATURESPACE' - this head position in relation to the armature
- - 'BONESPACE' - the head position in relation to itself
- @type head: Dictionary
- @ivar tail: This Bone's "tail" ending position when in rest state.
- Keys are:
- - 'ARMATURESPACE' - this tail position in relation to the armature
- - 'BONESPACE' - the tail position in relation to itself
- @type tail: Dictionary
- @ivar matrix: This Bone's matrix. This cannot be set.
- Keys are:
- - 'ARMATURESPACE' - this matrix of the bone in relation to the armature
- - 'BONESPACE' - the matrix of the bone in relation to itself
- @type matrix: Matrix Object
- @ivar parent: The parent Bone.
- @type parent: Bone Object
- @ivar children: The children directly attached to this bone.
- @type children: List of Bone Objects
- @ivar weight: The bone's weight.
- @type weight: Float
- @ivar options: Various bone options which can be:
- - Armature.CONNECTED: IK to parent
- - Armature.HINGE: No parent rotation or scaling
- - Armature.NO_DEFORM: The bone does not deform geometry
- - Armature.MULTIPLY: Multiply vgroups by envelope
- - Armature.HIDDEN_EDIT: Hide bones in editmode
- - Armature.ROOT_SELECTED: Selection of root ball of bone
- - Armature.BONE_SELECTED: Selection of bone
- - Armature.TIP_SELECTED: Selection of tip ball of bone
- @type options: List of Constants
- @ivar subdivision: The number of bone subdivisions.
- @type subdivision: Int
- @ivar deformDist: The deform distance of the bone
- @type deformDist: Float
- @ivar length: The length of the bone. This cannot be set.
- @type length: Float
- @ivar headRadius: The radius of this bones head (used for envalope bones)
- @type headRadius: Float
- @ivar tailRadius: The radius of this bones head (used for envalope bones)
- @type tailRadius: Float
- """
-
- def hasParent():
- """
- Whether or not this bone has a parent
- @rtype: Bool
- """
-
- def hasChildren():
- """
- Whether or not this bone has children
- @rtype: Bool
- """
-
- def getAllChildren():
- """
- Gets all the children under this bone including the children's children.
- @rtype: List of Bone object
- @return: all bones under this one
- """
+ """
+ The Bone object
+ ===============
+ This object gives access to Bone-specific data in Blender. This object
+ cannot be instantiated but is returned by BonesDict when the armature is not in editmode.
+ @ivar name: The name of this Bone.
+ @type name: String
+ @ivar roll: This Bone's roll value.
+ Keys are:
+ - 'ARMATURESPACE' - this roll in relation to the armature
+ - 'BONESPACE' - the roll in relation to itself
+ @type roll: Dictionary
+ @ivar head: This Bone's "head" ending position when in rest state.
+ Keys are:
+ - 'ARMATURESPACE' - this head position in relation to the armature
+ - 'BONESPACE' - the head position in relation to itself
+ @type head: Dictionary
+ @ivar tail: This Bone's "tail" ending position when in rest state.
+ Keys are:
+ - 'ARMATURESPACE' - this tail position in relation to the armature
+ - 'BONESPACE' - the tail position in relation to itself
+ @type tail: Dictionary
+ @ivar matrix: This Bone's matrix. This cannot be set.
+ Keys are:
+ - 'ARMATURESPACE' - this matrix of the bone in relation to the armature
+ - 'BONESPACE' - the matrix of the bone in relation to itself
+ @type matrix: Matrix Object
+ @ivar parent: The parent Bone.
+ @type parent: Bone Object
+ @ivar children: The children directly attached to this bone.
+ @type children: List of Bone Objects
+ @ivar weight: The bone's weight.
+ @type weight: Float
+ @ivar options: Various bone options which can be:
+ - Armature.CONNECTED: IK to parent
+ - Armature.HINGE: No parent rotation or scaling
+ - Armature.NO_DEFORM: The bone does not deform geometry
+ - Armature.MULTIPLY: Multiply vgroups by envelope
+ - Armature.HIDDEN_EDIT: Hide bones in editmode
+ - Armature.ROOT_SELECTED: Selection of root ball of bone
+ - Armature.BONE_SELECTED: Selection of bone
+ - Armature.TIP_SELECTED: Selection of tip ball of bone
+ @type options: List of Constants
+ @ivar subdivision: The number of bone subdivisions.
+ @type subdivision: Int
+ @ivar deformDist: The deform distance of the bone
+ @type deformDist: Float
+ @ivar length: The length of the bone. This cannot be set.
+ @type length: Float
+ @ivar headRadius: The radius of this bones head (used for envalope bones)
+ @type headRadius: Float
+ @ivar tailRadius: The radius of this bones head (used for envalope bones)
+ @type tailRadius: Float
+ """
+
+ def hasParent():
+ """
+ Whether or not this bone has a parent
+ @rtype: Bool
+ """
+
+ def hasChildren():
+ """
+ Whether or not this bone has children
+ @rtype: Bool
+ """
+
+ def getAllChildren():
+ """
+ Gets all the children under this bone including the children's children.
+ @rtype: List of Bone object
+ @return: all bones under this one
+ """
class Editbone:
- """
- The Editbone Object
- ===================
- This object is a wrapper for editbone data and is used only in the manipulation
- of the armature in editmode.
- @ivar name: The name of this Bone.
- @type name: String
- @ivar roll: This Bone's roll value (armaturespace).
- @type roll: Float
- @ivar head: This Bone's "head" ending position when in rest state (armaturespace).
- @type head: Vector Object
- @ivar tail: This Bone's "tail" ending position when in rest state (armaturespace).
- @type tail: Vector Object
- @ivar matrix: This Bone's matrix. (armaturespace)
- @type matrix: Matrix Object
- @ivar parent: The parent Bone.
- @type parent: Editbone Object
- @ivar weight: The bone's weight.
- @type weight: Float
- @ivar options: Various bone options which can be:
- - Armature.CONNECTED: IK to parent
- - Armature.HINGE: No parent rotation or scaling
- - Armature.NO_DEFORM: The bone does not deform geometry
- - Armature.MULTIPLY: Multiply vgroups by envelope
- - Armature.HIDDEN_EDIT: Hide bones in editmode
- - Armature.ROOT_SELECTED: Selection of root ball of bone
- - Armature.BONE_SELECTED: Selection of bone
- - Armature.TIP_SELECTED: Selection of tip ball of bone
- @type options: List of Constants
- @ivar subdivision: The number of bone subdivisions.
- @type subdivision: Int
- @ivar deformDist: The deform distance of the bone
- @type deformDist: Float
- @ivar length: The length of the bone. This cannot be set.
- @type length: Float
- @ivar headRadius: The radius of this bones head (used for envalope bones)
- @type headRadius: Float
- @ivar tailRadius: The radius of this bones head (used for envalope bones)
- @type tailRadius: Float
- """
-
- def hasParent():
- """
- Whether or not this bone has a parent
- @rtype: Bool
- """
-
- def clearParent():
- """
- Set the parent to None
- @rtype: None
- """
+ """
+ The Editbone Object
+ ===================
+ This object is a wrapper for editbone data and is used only in the manipulation
+ of the armature in editmode.
+ @ivar name: The name of this Bone.
+ @type name: String
+ @ivar roll: This Bone's roll value (armaturespace).
+ @type roll: Float
+ @ivar head: This Bone's "head" ending position when in rest state (armaturespace).
+ @type head: Vector Object
+ @ivar tail: This Bone's "tail" ending position when in rest state (armaturespace).
+ @type tail: Vector Object
+ @ivar matrix: This Bone's matrix. (armaturespace)
+ @type matrix: Matrix Object
+ @ivar parent: The parent Bone.
+ @type parent: Editbone Object
+ @ivar weight: The bone's weight.
+ @type weight: Float
+ @ivar options: Various bone options which can be:
+ - Armature.CONNECTED: IK to parent
+ - Armature.HINGE: No parent rotation or scaling
+ - Armature.NO_DEFORM: The bone does not deform geometry
+ - Armature.MULTIPLY: Multiply vgroups by envelope
+ - Armature.HIDDEN_EDIT: Hide bones in editmode
+ - Armature.ROOT_SELECTED: Selection of root ball of bone
+ - Armature.BONE_SELECTED: Selection of bone
+ - Armature.TIP_SELECTED: Selection of tip ball of bone
+ @type options: List of Constants
+ @ivar subdivision: The number of bone subdivisions.
+ @type subdivision: Int
+ @ivar deformDist: The deform distance of the bone
+ @type deformDist: Float
+ @ivar length: The length of the bone. This cannot be set.
+ @type length: Float
+ @ivar headRadius: The radius of this bones head (used for envalope bones)
+ @type headRadius: Float
+ @ivar tailRadius: The radius of this bones head (used for envalope bones)
+ @type tailRadius: Float
+ """
+
+ def hasParent():
+ """
+ Whether or not this bone has a parent
+ @rtype: Bool
+ """
+
+ def clearParent():
+ """
+ Set the parent to None
+ @rtype: None
+ """
diff --git a/source/blender/python/api2_2x/doc/Camera.py b/source/blender/python/api2_2x/doc/Camera.py
index 01dc4525d59..5d4b5670822 100644
--- a/source/blender/python/api2_2x/doc/Camera.py
+++ b/source/blender/python/api2_2x/doc/Camera.py
@@ -12,243 +12,245 @@ This module provides access to B{Camera Data} objects in Blender.
Example::
- from Blender import Camera, Object, Scene
- cam = Camera.New('ortho') # create new ortho camera data
- cam.scale = 6.0 # set scale value for ortho view
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.new(cam) # add a new camera object from the data
- scn.setCurrentCamera(ob) # make this camera the active
+ from Blender import Camera, Object, Scene
+ cam = Camera.New('ortho') # create new ortho camera data
+ cam.scale = 6.0 # set scale value for ortho view
+ scn = Scene.GetCurrent() # get current scene
+ ob = scn.objects.new(cam) # add a new camera object from the data
+ scn.setCurrentCamera(ob) # make this camera the active
"""
def New (type = 'persp', name = 'CamData'):
- """
- Create a new Camera Data object.
- @type type: string
- @param type: The Camera type: 'persp' or 'ortho'.
- @type name: string
- @param name: The Camera Data name.
- @rtype: Blender Camera
- @return: The created Camera Data object.
- """
+ """
+ Create a new Camera Data object.
+ @type type: string
+ @param type: The Camera type: 'persp' or 'ortho'.
+ @type name: string
+ @param name: The Camera Data name.
+ @rtype: Blender Camera
+ @return: The created Camera Data object.
+ """
def Get (name = None):
- """
- Get the Camera Data object(s) from Blender.
- @type name: string
- @param name: The name of the Camera Data.
- @rtype: Blender Camera or a list of Blender Cameras
- @return: It depends on the I{name} parameter:
- - (name): The Camera Data object with the given I{name};
- - (): A list with all Camera Data objects in the current scene.
- """
+ """
+ Get the Camera Data object(s) from Blender.
+ @type name: string
+ @param name: The name of the Camera Data.
+ @rtype: Blender Camera or a list of Blender Cameras
+ @return: It depends on the I{name} parameter:
+ - (name): The Camera Data object with the given I{name};
+ - (): A list with all Camera Data objects in the current scene.
+ """
class Camera:
- """
- The Camera Data object
- ======================
- This object gives access to Camera-specific data in Blender.
- @ivar name: The Camera Data name.
- @ivar type: The Camera type: 'persp' or 'ortho'
- @ivar mode: The mode flags: B{ORed value}: 'showLimits':1, 'showMist':2.
- @ivar lens: The lens value in [1.0, 250.0], only relevant to *persp* cameras.
- @ivar scale: The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
- @ivar clipStart: The clip start value in [0.0, 100.0].
- @ivar clipEnd: The clip end value in [1.0, 5000.0].
- @ivar dofDist: The dofDist value in [0.0, 5000.0].
- @ivar shiftx: The horizontal offset of the camera [-2.0, 2.0].
- @ivar shifty: The vertical offset of the camera [-2.0, 2.0].
- @ivar alpha: The PassePart alpha [0.0, 1.0].
- @ivar drawSize: The display size for the camera an the 3d view [0.1, 10.0].
- @type ipo: Blender Ipo
- @ivar ipo: The "camera data" ipo linked to this camera data object.
- Set to None to clear the ipo.
-
- @ivar drawLimits: Toggle the option to show limits in the 3d view.
- @ivar drawName: Toggle the option to show the camera name in the 3d view.
- @ivar drawMist: Toggle the option to show mist in the 3d view.
- @ivar drawTileSafe: Toggle the option to show tile safe in the 3d view.
- @ivar drawPassepartout: Toggle the option to show pass part out in the 3d view.
-
- @warning: Most member variables assume values in some [Min, Max] interval.
- When trying to set them, the given parameter will be clamped to lie in
- that range: if val < Min, then val = Min, if val > Max, then val = Max.
- """
-
- def getName():
- """
- Get the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
- @type name: string
- @param name: The new name.
- """
-
- def getIpo():
- """
- Get the Ipo associated with this camera data object, if any. (B{deprecated})
- @rtype: Ipo
- @return: the wrapped ipo or None. (B{deprecated}) See the L{ipo} attribute.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this camera data object. (B{deprecated}) See the L{ipo} attribute.
- @type ipo: Blender Ipo
- @param ipo: a "camera data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this camera data object. (B{deprecated}) See the L{ipo} attribute.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def getType():
- """
- Get this Camera's type. (B{deprecated}) See the L{type} attribute.
- @rtype: int
- @return: 0 for 'persp' or 1 for 'ortho'.
- """
-
- def setType(type):
- """
- Set this Camera's type. (B{deprecated}) See the L{type} attribute.
- @type type: string
- @param type: The Camera type: 'persp' or 'ortho'.
- """
-
- def getMode():
- """
- Get this Camera's mode flags. (B{deprecated}) See the L{mode} attribute.
- @rtype: int
- @return: B{OR'ed value}: 'showLimits' is 1, 'showMist' is 2, or
- respectively, 01 and 10 in binary.
- """
-
- def setMode(mode1 = None, mode2 = None):
- """
- Set this Camera's mode flags. Mode strings given are turned 'on'. (B{deprecated}) See the L{mode} attribute.
- Those not provided are turned 'off', so cam.setMode() -- without
- arguments -- turns off all mode flags for Camera cam.
- @type mode1: string
- @type mode2: string
- @param mode1: A mode flag: 'showLimits' or 'showMist'.
- @param mode2: A mode flag: 'showLimits' or 'showMist'.
- """
-
- def getLens():
- """
- Get the lens value. (B{deprecated}) See the L{lens} attribute.
- @rtype: float
- @warn: lens is only relevant for perspective (L{getType}) cameras.
- """
-
- def setLens(lens):
- """
- Set the lens value. (B{deprecated}) See the L{lens} attribute.
- @type lens: float
- @param lens: The new lens value.
- @warn: lens is only relevant for perspective (L{type}) cameras.
- """
-
- def getScale():
- """
- Get the scale value. (B{deprecated}) See the L{scale} attribute.
- @rtype: float
- @warn: scale is only relevant for ortho (L{type}) cameras.
- """
-
- def setScale(scale):
- """
- Set the scale value. (B{deprecated}) See the L{scale} attribute.
- @type scale: float
- @param scale: The new scale value in [0.01, 1000.00].
- @warn: scale is only relevant for ortho (L{getType}) cameras.
- """
-
- def getClipStart():
- """
- Get the clip start value. (B{deprecated}) See the L{clipStart} attribute.
- @rtype: float
- """
-
- def setClipStart(clipstart):
- """
- Set the clip start value. (B{deprecated}) See the L{clipStart} attribute.
- @type clipstart: float
- @param clipstart: The new lens value.
- """
-
- def getClipEnd():
- """
- Get the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
- @rtype: float
- """
-
- def setClipEnd(clipend):
- """
- Set the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
- @type clipend: float
- @param clipend: The new clip end value.
- """
-
- def getDrawSize():
- """
- Get the draw size value. (B{deprecated}) See the L{drawSize} attribute.
- @rtype: float
- """
-
- def setDrawSize(drawsize):
- """
- Set the draw size value. (B{deprecated}) See the L{drawSize} attribute.
- @type drawsize: float
- @param drawsize: The new draw size value.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Camera's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Camera. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Camera.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in camera ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -LENS
- -CLIPPING
- @return: py_none
- """
-
- def __copy__ ():
- """
- Make a copy of this camera
- @rtype: Camera
- @return: a copy of this camera
- """ \ No newline at end of file
+ """
+ The Camera Data object
+ ======================
+ This object gives access to Camera-specific data in Blender.
+ @ivar type: The Camera type: 'persp' or 'ortho'
+ @ivar mode: The mode flags: B{ORed value}: 'showLimits':1, 'showMist':2.
+ @ivar lens: The lens value in [1.0, 250.0], only relevant to *persp* cameras.
+ @ivar scale: The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
+ @ivar clipStart: The clip start value in [0.0, 100.0].
+ @ivar clipEnd: The clip end value in [1.0, 5000.0].
+ @ivar dofDist: The dofDist value in [0.0, 5000.0].
+ @ivar shiftx: The horizontal offset of the camera [-2.0, 2.0].
+ @ivar shifty: The vertical offset of the camera [-2.0, 2.0].
+ @ivar alpha: The PassePart alpha [0.0, 1.0].
+ @ivar drawSize: The display size for the camera an the 3d view [0.1, 10.0].
+ @type ipo: Blender Ipo
+ @ivar ipo: The "camera data" ipo linked to this camera data object.
+ Set to None to clear the ipo.
+
+ @ivar drawLimits: Toggle the option to show limits in the 3d view.
+ @ivar drawName: Toggle the option to show the camera name in the 3d view.
+ @ivar drawMist: Toggle the option to show mist in the 3d view.
+ @ivar drawTileSafe: Toggle the option to show tile safe in the 3d view.
+ @ivar drawPassepartout: Toggle the option to show pass part out in the 3d view.
+
+ @warning: Most member variables assume values in some [Min, Max] interval.
+ When trying to set them, the given parameter will be clamped to lie in
+ that range: if val < Min, then val = Min, if val > Max, then val = Max.
+ """
+
+ def getName():
+ """
+ Get the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getIpo():
+ """
+ Get the Ipo associated with this camera data object, if any. (B{deprecated})
+ @rtype: Ipo
+ @return: the wrapped ipo or None. (B{deprecated}) See the L{ipo} attribute.
+ """
+
+ def setIpo(ipo):
+ """
+ Link an ipo to this camera data object. (B{deprecated}) See the L{ipo} attribute.
+ @type ipo: Blender Ipo
+ @param ipo: a "camera data" ipo.
+ """
+
+ def clearIpo():
+ """
+ Unlink the ipo from this camera data object. (B{deprecated}) See the L{ipo} attribute.
+ @return: True if there was an ipo linked or False otherwise.
+ """
+
+ def getType():
+ """
+ Get this Camera's type. (B{deprecated}) See the L{type} attribute.
+ @rtype: int
+ @return: 0 for 'persp' or 1 for 'ortho'.
+ """
+
+ def setType(type):
+ """
+ Set this Camera's type. (B{deprecated}) See the L{type} attribute.
+ @type type: string
+ @param type: The Camera type: 'persp' or 'ortho'.
+ """
+
+ def getMode():
+ """
+ Get this Camera's mode flags. (B{deprecated}) See the L{mode} attribute.
+ @rtype: int
+ @return: B{OR'ed value}: 'showLimits' is 1, 'showMist' is 2, or
+ respectively, 01 and 10 in binary.
+ """
+
+ def setMode(mode1 = None, mode2 = None):
+ """
+ Set this Camera's mode flags. Mode strings given are turned 'on'. (B{deprecated}) See the L{mode} attribute.
+ Those not provided are turned 'off', so cam.setMode() -- without
+ arguments -- turns off all mode flags for Camera cam.
+ @type mode1: string
+ @type mode2: string
+ @param mode1: A mode flag: 'showLimits' or 'showMist'.
+ @param mode2: A mode flag: 'showLimits' or 'showMist'.
+ """
+
+ def getLens():
+ """
+ Get the lens value. (B{deprecated}) See the L{lens} attribute.
+ @rtype: float
+ @warn: lens is only relevant for perspective (L{getType}) cameras.
+ """
+
+ def setLens(lens):
+ """
+ Set the lens value. (B{deprecated}) See the L{lens} attribute.
+ @type lens: float
+ @param lens: The new lens value.
+ @warn: lens is only relevant for perspective (L{type}) cameras.
+ """
+
+ def getScale():
+ """
+ Get the scale value. (B{deprecated}) See the L{scale} attribute.
+ @rtype: float
+ @warn: scale is only relevant for ortho (L{type}) cameras.
+ """
+
+ def setScale(scale):
+ """
+ Set the scale value. (B{deprecated}) See the L{scale} attribute.
+ @type scale: float
+ @param scale: The new scale value in [0.01, 1000.00].
+ @warn: scale is only relevant for ortho (L{getType}) cameras.
+ """
+
+ def getClipStart():
+ """
+ Get the clip start value. (B{deprecated}) See the L{clipStart} attribute.
+ @rtype: float
+ """
+
+ def setClipStart(clipstart):
+ """
+ Set the clip start value. (B{deprecated}) See the L{clipStart} attribute.
+ @type clipstart: float
+ @param clipstart: The new lens value.
+ """
+
+ def getClipEnd():
+ """
+ Get the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
+ @rtype: float
+ """
+
+ def setClipEnd(clipend):
+ """
+ Set the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
+ @type clipend: float
+ @param clipend: The new clip end value.
+ """
+
+ def getDrawSize():
+ """
+ Get the draw size value. (B{deprecated}) See the L{drawSize} attribute.
+ @rtype: float
+ """
+
+ def setDrawSize(drawsize):
+ """
+ Set the draw size value. (B{deprecated}) See the L{drawSize} attribute.
+ @type drawsize: float
+ @param drawsize: The new draw size value.
+ """
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Camera's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks (links = None):
+ """
+ Delete script links from this Camera. If no list is specified, all
+ script links are deleted.
+ @type links: list of strings
+ @param links: None (default) or a list of Blender L{Text} names.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Camera.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ """
+
+ def insertIpoKey(keytype):
+ """
+ Inserts keytype values in camera ipo at curframe. Uses module constants.
+ @type keytype: Integer
+ @param keytype:
+ -LENS
+ -CLIPPING
+ @return: py_none
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this camera
+ @rtype: Camera
+ @return: a copy of this camera
+ """
+
+import id_generics
+Camera.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Constraint.py b/source/blender/python/api2_2x/doc/Constraint.py
index 5e6586218b7..da69fb23c06 100644
--- a/source/blender/python/api2_2x/doc/Constraint.py
+++ b/source/blender/python/api2_2x/doc/Constraint.py
@@ -4,223 +4,223 @@
The Blender.Constraint submodule
B{New}:
- - provides access to Blender's constraint stack
+ - provides access to Blender's constraint stack
This module provides access to the Constraint Data in Blender.
Examples::
- from Blender import *
-
- ob = Object.Get('Cube')
- if len(ob.constraints) > 0:
- const = ob.constraints[0]
- if const.type == Constraint.Type.FLOOR:
- offs = const[Constraint.Settings.OFFSET]
-
+ from Blender import *
+
+ ob = Object.Get('Cube')
+ if len(ob.constraints) > 0:
+ const = ob.constraints[0]
+ if const.type == Constraint.Type.FLOOR:
+ offs = const[Constraint.Settings.OFFSET]
+
Or to print all the constraints attached to each bone in a pose::
- from Blender import *
-
- ob = Object.Get('Armature')
- pose = ob.getPose()
- for bonename in pose.bones.keys():
- bone = pose.bones[bonename]
- for const in bone.constraints:
- print bone.name,'=>',const
+ from Blender import *
+
+ ob = Object.Get('Armature')
+ pose = ob.getPose()
+ for bonename in pose.bones.keys():
+ bone = pose.bones[bonename]
+ for const in bone.constraints:
+ print bone.name,'=>',const
@type Type: readonly dictionary
@var Type: Constant Constraint dict used by L{Constraints.append()} and
- for comparison with L{Constraint.type}. Values are
- TRACKTO, IKSOLVER, FOLLOWPATH, COPYROT, COPYLOC, COPYSIZE, ACTION,
- LOCKTRACK, STRETCHTO, FLOOR, LIMITLOC, LIMITROT, LIMITSIZE, NULL
+ for comparison with L{Constraint.type}. Values are
+ TRACKTO, IKSOLVER, FOLLOWPATH, COPYROT, COPYLOC, COPYSIZE, ACTION,
+ LOCKTRACK, STRETCHTO, FLOOR, LIMITLOC, LIMITROT, LIMITSIZE, NULL
@type Settings: readonly dictionary
@var Settings: Constant dict used for changing constraint settings.
- - Used for all constraints
- - TARGET (Object) (Note: not used by Limit Location (LIMITLOC),
- Limit Rotation (LIMITROT), Limit Scale (LIMITSIZE))
- - BONE (string): name of Bone sub-target (for armature targets) (Note: not
- used by Stretch To (STRETCHTO), Limit Location (LIMITLOC), Limit Rotation
- (LIMITROT), Limit Scale (LIMITSIZE))
- - Used by IK Solver (IKSOLVER) constraint:
- - TOLERANCE (float): clamped to [0.0001:1.0]
- - ITERATIONS (int): clamped to [1,10000]
- - CHAINLEN (int): clamped to [0,255]
- - POSWEIGHT (float): clamped to [0.01,1.0]
- - ROTWEIGHT (float): clamped to [0.01,1.0]
- - ROTATE (bool)
- - USETIP (bool)
- - Used by Action (ACTION) constraint:
- - ACTION (Action Object)
- - LOCAL (bool)
- - START (int): clamped to [1,maxframe]
- - END (int): clamped to [1,maxframe]
- - MIN (float): clamped to [-180.0,180.0]
- - MAX (float): clamped to [-180.0,180.0]
- - KEYON (int): values are XROT, YROT, ZROT
- - Used by Track To (TRACKTO) constraint:
- - TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
- TRACKNEGY, TRACKNEGZ
- - UP (int): values are UPX, UPY, UPZ
- - Used by Stretch To (STRETCHTO) constraint:
- - RESTLENGTH (float): clamped to [0.0:100.0]
- - VOLVARIATION (float): clamped to [0.0:100.0]
- - VOLUMEMODE (int): values are VOLUMEXZ, VOLUMEX, VOLUMEZ,
- VOLUMENONE
- - PLANE (int): values are PLANEX, PLANEZ
- - Used by Follow Path (FOLLOWPATH) constraint:
- - FOLLOW (bool)
- - OFFSET (float): clamped to [-maxframe:maxframe]
- - FORWARD (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
- TRACKNEGY, TRACKNEGZ
- - UP (int): values are UPX, UPY, UPZ
- - Used by Lock Track (FOLLOWPATH) constraint:
- - TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
- TRACKNEGY, TRACKNEGZ
- - LOCK (int): values are LOCKX, LOCKY, LOCKZ
- - Used by Floor (FLOOR) constraint:
- - MINMAX (int): values are MINX, MINY, MINZ, MAXX, MAXY, MAXZ
- - OFFSET (float): clamped to [-100.0,100.0]
- - STICKY (bool)
- - Used by Copy Location (COPYLOC) and Copy Rotation (COPYROT)
- - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
- - LOCAL (bool): Only for constraints which Armature targets.
- - Used by Copy Size (COPYSIZE) constraint:
- - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
- - Used by Limit Location (LIMITLOC) constraint:
- - LIMIT (bitfield): any combination of LIMIT_XMIN, LIMIT_XMAX,
- LIMIT_YMIN, LIMIT_YMAX, LIMIT_ZMIN, LIMIT_ZMAX
- - LIMIT_LOCAL_BONE (boolean): USE WITH CAUTION. Only do something
- with this value if constraint is assigned to a bone.
- - LIMIT_LOCAL_NOPARENT (boolean): USE WITH CAUTION. Only do something
- with this value if constraint is assigned to an object with that
- has been parented to something.
- - XMIN (float): clamped to [-1000.0,1000.0]
- - XMAX (float): clamped to [-1000.0,1000.0]
- - YMIN (float): clamped to [-1000.0,1000.0]
- - YMAX (float): clamped to [-1000.0,1000.0]
- - ZMIN (float): clamped to [-1000.0,1000.0]
- - ZMAX (float): clamped to [-1000.0,1000.0]
- - Used by Limit Rotation (LIMITROT) constraint:
- - LIMIT (bitfield): any combination of LIMIT_XROT, LIMIT_YROT,
- LIMIT_ZROT
- - LIMIT_LOCAL_BONE (boolean): USE WITH CAUTION. Only do something
- with this value if constraint is assigned to a bone.
- - XMIN (float): clamped to [-360.0,360.0]
- - XMAX (float): clamped to [-360.0,360.0]
- - YMIN (float): clamped to [-360.0,360.0]
- - YMAX (float): clamped to [-360.0,360.0]
- - ZMIN (float): clamped to [-360.0,360.0]
- - ZMAX (float): clamped to [-360.0,360.0]
- - Used by Limit Scale (LIMITSIZE) constraint:
- - LIMIT (bitfield): any combination of LIMIT_XMIN, LIMIT_XMAX,
- LIMIT_YMIN, LIMIT_YMAX, LIMIT_ZMIN, LIMIT_ZMAX
- - XMIN (float): clamped to [-1000.0,1000.0]
- - XMAX (float): clamped to [-1000.0,1000.0]
- - YMIN (float): clamped to [-1000.0,1000.0]
- - YMAX (float): clamped to [-1000.0,1000.0]
- - ZMIN (float): clamped to [-1000.0,1000.0]
- - ZMAX (float): clamped to [-1000.0,1000.0]
+ - Used for all constraints
+ - TARGET (Object) (Note: not used by Limit Location (LIMITLOC),
+ Limit Rotation (LIMITROT), Limit Scale (LIMITSIZE))
+ - BONE (string): name of Bone sub-target (for armature targets) (Note: not
+ used by Stretch To (STRETCHTO), Limit Location (LIMITLOC), Limit Rotation
+ (LIMITROT), Limit Scale (LIMITSIZE))
+ - Used by IK Solver (IKSOLVER) constraint:
+ - TOLERANCE (float): clamped to [0.0001:1.0]
+ - ITERATIONS (int): clamped to [1,10000]
+ - CHAINLEN (int): clamped to [0,255]
+ - POSWEIGHT (float): clamped to [0.01,1.0]
+ - ROTWEIGHT (float): clamped to [0.01,1.0]
+ - ROTATE (bool)
+ - USETIP (bool)
+ - Used by Action (ACTION) constraint:
+ - ACTION (Action Object)
+ - LOCAL (bool)
+ - START (int): clamped to [1,maxframe]
+ - END (int): clamped to [1,maxframe]
+ - MIN (float): clamped to [-180.0,180.0]
+ - MAX (float): clamped to [-180.0,180.0]
+ - KEYON (int): values are XROT, YROT, ZROT
+ - Used by Track To (TRACKTO) constraint:
+ - TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
+ TRACKNEGY, TRACKNEGZ
+ - UP (int): values are UPX, UPY, UPZ
+ - Used by Stretch To (STRETCHTO) constraint:
+ - RESTLENGTH (float): clamped to [0.0:100.0]
+ - VOLVARIATION (float): clamped to [0.0:100.0]
+ - VOLUMEMODE (int): values are VOLUMEXZ, VOLUMEX, VOLUMEZ,
+ VOLUMENONE
+ - PLANE (int): values are PLANEX, PLANEZ
+ - Used by Follow Path (FOLLOWPATH) constraint:
+ - FOLLOW (bool)
+ - OFFSET (float): clamped to [-maxframe:maxframe]
+ - FORWARD (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
+ TRACKNEGY, TRACKNEGZ
+ - UP (int): values are UPX, UPY, UPZ
+ - Used by Lock Track (FOLLOWPATH) constraint:
+ - TRACK (int): values are TRACKX, TRACKY, TRACKZ, TRACKNEGX,
+ TRACKNEGY, TRACKNEGZ
+ - LOCK (int): values are LOCKX, LOCKY, LOCKZ
+ - Used by Floor (FLOOR) constraint:
+ - MINMAX (int): values are MINX, MINY, MINZ, MAXX, MAXY, MAXZ
+ - OFFSET (float): clamped to [-100.0,100.0]
+ - STICKY (bool)
+ - Used by Copy Location (COPYLOC) and Copy Rotation (COPYROT)
+ - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
+ - LOCAL (bool): Only for constraints which Armature targets.
+ - Used by Copy Size (COPYSIZE) constraint:
+ - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
+ - Used by Limit Location (LIMITLOC) constraint:
+ - LIMIT (bitfield): any combination of LIMIT_XMIN, LIMIT_XMAX,
+ LIMIT_YMIN, LIMIT_YMAX, LIMIT_ZMIN, LIMIT_ZMAX
+ - LIMIT_LOCAL_BONE (boolean): USE WITH CAUTION. Only do something
+ with this value if constraint is assigned to a bone.
+ - LIMIT_LOCAL_NOPARENT (boolean): USE WITH CAUTION. Only do something
+ with this value if constraint is assigned to an object with that
+ has been parented to something.
+ - XMIN (float): clamped to [-1000.0,1000.0]
+ - XMAX (float): clamped to [-1000.0,1000.0]
+ - YMIN (float): clamped to [-1000.0,1000.0]
+ - YMAX (float): clamped to [-1000.0,1000.0]
+ - ZMIN (float): clamped to [-1000.0,1000.0]
+ - ZMAX (float): clamped to [-1000.0,1000.0]
+ - Used by Limit Rotation (LIMITROT) constraint:
+ - LIMIT (bitfield): any combination of LIMIT_XROT, LIMIT_YROT,
+ LIMIT_ZROT
+ - LIMIT_LOCAL_BONE (boolean): USE WITH CAUTION. Only do something
+ with this value if constraint is assigned to a bone.
+ - XMIN (float): clamped to [-360.0,360.0]
+ - XMAX (float): clamped to [-360.0,360.0]
+ - YMIN (float): clamped to [-360.0,360.0]
+ - YMAX (float): clamped to [-360.0,360.0]
+ - ZMIN (float): clamped to [-360.0,360.0]
+ - ZMAX (float): clamped to [-360.0,360.0]
+ - Used by Limit Scale (LIMITSIZE) constraint:
+ - LIMIT (bitfield): any combination of LIMIT_XMIN, LIMIT_XMAX,
+ LIMIT_YMIN, LIMIT_YMAX, LIMIT_ZMIN, LIMIT_ZMAX
+ - XMIN (float): clamped to [-1000.0,1000.0]
+ - XMAX (float): clamped to [-1000.0,1000.0]
+ - YMIN (float): clamped to [-1000.0,1000.0]
+ - YMAX (float): clamped to [-1000.0,1000.0]
+ - ZMIN (float): clamped to [-1000.0,1000.0]
+ - ZMAX (float): clamped to [-1000.0,1000.0]
"""
class Constraints:
- """
- The Constraints object
- ======================
- This object provides access to sequence of
- L{constraints<Constraint.Constraint>} for a particular object.
- They can be accessed from L{Object.constraints<Object.Object.constraints>}.
- or L{PoseBone.constraints<Pose.PoseBone.constraints>}.
- """
-
- def __getitem__(index):
- """
- This operator returns one of the constraints in the stack.
- @type index: int
- @return: an Constraint object
- @rtype: Constraint
- @raise KeyError: index was out of range
- """
-
- def __len__():
- """
- Returns the number of constraints in the constraint stack.
- @return: number of Constraints
- @rtype: int
- """
-
- def append(type):
- """
- Appends a new constraint to the end of the constraint stack.
- @param type: a constant specifying the type of constraint to create. as from L{Type}
- @type type: int constant
- @rtype: Constraint
- @return: the new Constraint
- """
-
- def remove(con):
- """
- Remove a constraint from this objects constraint sequence.
- @param con: a constraint from this sequence to remove.
- @type con: Constraint
- @note: Accessing attributes of the constraint after it is removed will
- throw an exception.
- """
-
- def moveUp(con):
- """
- Moves the constraint up in the object's constraint stack.
- @param con: a constraint from this sequence to remove.
- @type con: Constraint
- @rtype: None
- """
-
- def moveDown(con):
- """
- Moves the constraint down in the object's constraint stack.
- @param con: a constraint from this sequence to remove.
- @type con: Constraint
- @rtype: None
- """
+ """
+ The Constraints object
+ ======================
+ This object provides access to sequence of
+ L{constraints<Constraint.Constraint>} for a particular object.
+ They can be accessed from L{Object.constraints<Object.Object.constraints>}.
+ or L{PoseBone.constraints<Pose.PoseBone.constraints>}.
+ """
+
+ def __getitem__(index):
+ """
+ This operator returns one of the constraints in the stack.
+ @type index: int
+ @return: an Constraint object
+ @rtype: Constraint
+ @raise KeyError: index was out of range
+ """
+
+ def __len__():
+ """
+ Returns the number of constraints in the constraint stack.
+ @return: number of Constraints
+ @rtype: int
+ """
+
+ def append(type):
+ """
+ Appends a new constraint to the end of the constraint stack.
+ @param type: a constant specifying the type of constraint to create. as from L{Type}
+ @type type: int constant
+ @rtype: Constraint
+ @return: the new Constraint
+ """
+
+ def remove(con):
+ """
+ Remove a constraint from this objects constraint sequence.
+ @param con: a constraint from this sequence to remove.
+ @type con: Constraint
+ @note: Accessing attributes of the constraint after it is removed will
+ throw an exception.
+ """
+
+ def moveUp(con):
+ """
+ Moves the constraint up in the object's constraint stack.
+ @param con: a constraint from this sequence to remove.
+ @type con: Constraint
+ @rtype: None
+ """
+
+ def moveDown(con):
+ """
+ Moves the constraint down in the object's constraint stack.
+ @param con: a constraint from this sequence to remove.
+ @type con: Constraint
+ @rtype: None
+ """
class Constraint:
- """
- The Constraint object
- =====================
- This object provides access to a constraint for a particular object
- accessed from L{Constraints}.
- @ivar name: The name of this constraint. 29 chars max.
- @type name: string
- @ivar type: The type of this constraint. Read-only. The returned value
- matches the types in L{Type}.
- @type type: int
- @ivar influence: The influence value of the constraint. Valid values
- are in the range [0.0,1.0].
- @type influence: float
- """
-
- def __getitem__(key):
- """
- This operator returns one of the constraint's data attributes.
- @param key: value from constraint's L{Constraint.Settings} constant
- @type key: int constant
- @return: the requested data
- @rtype: varies
- @raise KeyError: the key does not exist for the constraint
- """
-
- def __setitem__(key):
- """
- This operator changes one of the constraint's data attributes.
- @param key: value from constraint's L{Constraint.Settings} constant
- @type key: int constant
- @raise KeyError: the key does not exist for the constraint
- """
-
- def insertKey(frame):
- """
- Adds an influence keyframe for the constraint Ipo.
- @rtype: None
- @param frame: the frame number at which to insert the key.
- @type frame: float
- """
+ """
+ The Constraint object
+ =====================
+ This object provides access to a constraint for a particular object
+ accessed from L{Constraints}.
+ @ivar name: The name of this constraint. 29 chars max.
+ @type name: string
+ @ivar type: The type of this constraint. Read-only. The returned value
+ matches the types in L{Type}.
+ @type type: int
+ @ivar influence: The influence value of the constraint. Valid values
+ are in the range [0.0,1.0].
+ @type influence: float
+ """
+
+ def __getitem__(key):
+ """
+ This operator returns one of the constraint's data attributes.
+ @param key: value from constraint's L{Constraint.Settings} constant
+ @type key: int constant
+ @return: the requested data
+ @rtype: varies
+ @raise KeyError: the key does not exist for the constraint
+ """
+
+ def __setitem__(key):
+ """
+ This operator changes one of the constraint's data attributes.
+ @param key: value from constraint's L{Constraint.Settings} constant
+ @type key: int constant
+ @raise KeyError: the key does not exist for the constraint
+ """
+
+ def insertKey(frame):
+ """
+ Adds an influence keyframe for the constraint Ipo.
+ @rtype: None
+ @param frame: the frame number at which to insert the key.
+ @type frame: float
+ """
diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py
index cc1b1647d50..84996d47380 100644
--- a/source/blender/python/api2_2x/doc/Curve.py
+++ b/source/blender/python/api2_2x/doc/Curve.py
@@ -20,694 +20,694 @@ Python B{for} statement.
Add a Curve to a Scene Example::
- from Blender import Curve, Object, Scene
- cu = Curve.New() # create new curve data
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.new(cu) # make a new curve from the curve data
+ from Blender import Curve, Object, Scene
+ cu = Curve.New() # create new curve data
+ scn = Scene.GetCurrent() # get current scene
+ ob = scn.objects.new(cu) # make a new curve from the curve data
Iterator Example::
- from Blender import Curve, Object, Scene
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.active
- curvedata = ob.data
- for curnurb in curvedata:
- print type( curnurb ), curnurb
- for point in curnurb:
- print type( point ), point
+ from Blender import Curve, Object, Scene
+ scn = Scene.GetCurrent() # get current scene
+ ob = scn.objects.active
+ curvedata = ob.data
+ for curnurb in curvedata:
+ print type( curnurb ), curnurb
+ for point in curnurb:
+ print type( point ), point
Creating a Curve from a list of Vec triples Examples::
- from Blender import *
- def bezList2Curve(bezier_vecs):
- '''
- Take a list or vector triples and converts them into a bezier curve object
- '''
-
- def bezFromVecs(vecs):
- '''
- Bezier triple from 3 vecs, shortcut functon
- '''
- bt= BezTriple.New(\
- vecs[0].x, vecs[0].y, vecs[0].z,\
- vecs[1].x, vecs[1].y, vecs[1].z,\
- vecs[2].x, vecs[2].y, vecs[2].z)
-
- bt.handleTypes= (BezTriple.HandleTypes.FREE, BezTriple.HandleTypes.FREE)
-
- return bt
-
- # Create the curve data with one point
- cu= Curve.New()
- cu.appendNurb(bezFromVecs(bezier_vecs[0])) # We must add with a point to start with
- cu_nurb= cu[0] # Get the first curve just added in the CurveData
-
-
- i= 1 # skip first vec triple because it was used to init the curve
- while i<len(bezier_vecs):
- bt_vec_triple= bezier_vecs[i]
- bt= bezFromVecs(bt_vec_triple)
- cu_nurb.append(bt)
- i+=1
-
- # Add the Curve into the scene
- scn= Scene.GetCurrent()
- ob = scn.objects.new(cu)
- return ob
+ from Blender import *
+ def bezList2Curve(bezier_vecs):
+ '''
+ Take a list or vector triples and converts them into a bezier curve object
+ '''
+
+ def bezFromVecs(vecs):
+ '''
+ Bezier triple from 3 vecs, shortcut functon
+ '''
+ bt= BezTriple.New(\
+ vecs[0].x, vecs[0].y, vecs[0].z,\
+ vecs[1].x, vecs[1].y, vecs[1].z,\
+ vecs[2].x, vecs[2].y, vecs[2].z)
+
+ bt.handleTypes= (BezTriple.HandleTypes.FREE, BezTriple.HandleTypes.FREE)
+
+ return bt
+
+ # Create the curve data with one point
+ cu= Curve.New()
+ cu.appendNurb(bezFromVecs(bezier_vecs[0])) # We must add with a point to start with
+ cu_nurb= cu[0] # Get the first curve just added in the CurveData
+
+
+ i= 1 # skip first vec triple because it was used to init the curve
+ while i<len(bezier_vecs):
+ bt_vec_triple= bezier_vecs[i]
+ bt= bezFromVecs(bt_vec_triple)
+ cu_nurb.append(bt)
+ i+=1
+
+ # Add the Curve into the scene
+ scn= Scene.GetCurrent()
+ ob = scn.objects.new(cu)
+ return ob
"""
def New ( name):
- """
- Create a new Curve Data object.
- @type name: string
- @param name: The Curve Data name.
- @rtype: Blender Curve
- @return: The created Curve Data object.
- """
+ """
+ Create a new Curve Data object.
+ @type name: string
+ @param name: The Curve Data name.
+ @rtype: Blender Curve
+ @return: The created Curve Data object.
+ """
def Get (name = None):
- """
- Get the Curve Data object(s) from Blender.
- @type name: string
- @param name: The name of the Curve Data.
- @rtype: Blender Curve or a list of Blender Curves
- @return: It depends on the 'name' parameter:
- - (name): The Curve Data object with the given name;
- - (): A list with all Curve Data objects in the current scene.
- """
+ """
+ Get the Curve Data object(s) from Blender.
+ @type name: string
+ @param name: The name of the Curve Data.
+ @rtype: Blender Curve or a list of Blender Curves
+ @return: It depends on the 'name' parameter:
+ - (name): The Curve Data object with the given name;
+ - (): A list with all Curve Data objects in the current scene.
+ """
class Curve:
- """
- The Curve Data object
- =====================
- This object gives access to Curve and Surface data linked from Blender Objects.
-
- @ivar name: The Curve Data name.
- @type name: string
- @ivar pathlen: The Curve Data path length, used to set the number of frames for an animation (not the physical length).
- @type pathlen: int
- @ivar totcol: The Curve Data maximal number of linked materials. Read-only.
- @type totcol: int
- @ivar flag: The Curve Data flag value; see L{getFlag()} for the semantics.
- @ivar bevresol: The Curve Data bevel resolution. [0 - 32]
- @type bevresol: int
- @ivar resolu: The Curve Data U-resolution (used for curve and surface resolution) [0 - 1024].
- @type resolu: int
- @ivar resolv: The Curve Data V-resolution (used for surface resolution) [0 - 1024].
- @type resolv: int
- @ivar width: The Curve Data width [0 - 2].
- @type width: float
- @ivar ext1: The Curve Data extent1 (for bevels).
- @type ext1: float
- @ivar ext2: The Curve Data extent2 (for bevels).
- @type ext2: float
- @ivar loc: The Curve Data location(from the center).
- @type loc: list of 3 floats
- @ivar rot: The Curve Data rotation(from the center).
- @type rot: list of 3 floats
- @ivar size: The Curve Data size(from the center).
- @type size: list of 3 floats
- @ivar bevob: The Curve Bevel Object
- @type bevob: Blender L{Object<Object.Object>} or None
- @ivar key: The Key object associated with this Curve, if any.
- @type key: Blender L{Key<Key.Key>}
- @ivar materials: The curves's materials. Each curve can reference up to
- 16 materials. Empty slots in the curve's list are represented by B{None}.
- B{Note}: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
- for each object in order for these materials to be used instead of
- the object's materials.
- B{Note}: The list that's returned is I{not} linked to the original curve.
- curve.materials.append(material) won't do anything.
- Use curve.materials += [material] instead.
- @type materials: list of L{Material}s
- """
-
- def getName():
- """
- Get the name of this Curve Data object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Curve Data object.
- @rtype: None
- @type name: string
- @param name: The new name.
- """
-
- def getPathLen():
- """
- Get this Curve's path frame length, used for an animated path.
- @rtype: int
- @return: the path length.
- """
-
- def setPathLen(len):
- """
- Set this Curve's path length.
- @rtype: None
- @type len: int
- @param len: the new curve's length.
- """
-
- def getTotcol():
- """
- Get the number of materials linked to the Curve.
- @rtype: int
- @return: number of materials linked.
- """
-
- def setTotcol(totcol):
- """
- Set the number of materials linked to the Curve. B{Note}: this method
- will probably be deprecated in the future.
- @rtype: None
- @type totcol: int
- @param totcol: number of materials linked.
- @warn: It is not advisable to use this method unless you know what you
- are doing; it's possible to
- corrupt a .blend file if you don't know what you're doing. If you want
- to change the number of materials, use the L{materials} attribute.
- """
-
- def getFlag():
- """
- Get the Curve flag value.
- This item is a bitfield whose value is a combination of the following parameters.
- - Bit 0 : "3D" is set
- - Bit 1 : "Front" is set
- - Bit 2 : "Back" is set
- - Bit 3 : "CurvePath" is set.
- - Bit 4 : "CurveFollow" is set.
-
- @rtype: integer bitfield
- """
-
- def setFlag(val):
- """
- Set the Curve flag value. The flag corresponds to the Blender settings for 3D, Front, Back, CurvePath and CurveFollow. This parameter is a bitfield.
- @rtype: None
- @type val: integer bitfield
- @param val : The Curve's flag bits. See L{getFlag} for the meaning of the individual bits.
- """
-
- def getBevresol():
- """
- Get the Curve's bevel resolution value.
- @rtype: float
- """
-
- def setBevresol(bevelresol):
- """
- Set the Curve's bevel resolution value.
- @rtype: None
- @type bevelresol: float
- @param bevelresol: The new Curve's bevel resolution value.
- """
-
- def getResolu():
- """
- Get the Curve's U-resolution value.
- @rtype: float
- """
-
- def setResolu(resolu):
- """
- Set the Curve's U-resolution value. [0 - 1024]
- This is used for surfaces and curves.
- @rtype: None
- @type resolu: float
- @param resolu: The new Curve's U-resolution value.
- """
-
- def getResolv():
- """
- Get the Curve's V-resolution value.
- @rtype: float
- """
-
- def setResolv(resolv):
- """
- Set the Curve's V-resolution value. [0 - 1024].
- This is used for surfaces only.
- @rtype: None
- @type resolv: float
- @param resolv: The new Curve's V-resolution value.
- """
-
- def getWidth():
- """
- Get the Curve's width value.
- @rtype: float
- """
-
- def setWidth(width):
- """
- Set the Curve's width value.
- @rtype: None
- @type width: float
- @param width: The new Curve's width value.
- """
-
- def getExt1():
- """
- Get the Curve's ext1 value.
- @rtype: float
- """
-
- def setExt1(ext1):
- """
- Set the Curve's ext1 value.
- @rtype: None
- @type ext1: float
- @param ext1: The new Curve's ext1 value.
- """
-
- def getExt2():
- """
- Get the Curve's ext2 value.
- @rtype: float
- """
-
- def setExt2(ext2):
- """
- Set the Curve's ext2 value.
- @rtype: None
- @type ext2: float
- @param ext2: The new Curve's ext2 value.
- """
-
- def getControlPoint(numcurve,numpoint):
- """
- Get the curve's control point value (B{deprecated}). The numpoint arg
- is an index into the list of points and starts with 0. B{Note}: new
- scripts should use the [] operator on Curves and CurNurbs. Example::
- curve = Blender.Curve.Get('Curve')
- p0 = curve[0][0] # get first point from first nurb
- # -- OR --
- nurb = curve[0] # get first nurb
- p0 = nurb[0] # get nurb's first point
-
- @type numcurve: int
- @type numpoint: int
- @rtype: list of floats
- @return: depends upon the curve's type.
- - type Bezier : a list of nine floats. Values are x, y, z for handle-1, vertex and handle-2
- - type Nurb : a list of 4 floats. Values are x, y, z, w.
-
- """
-
- def setControlPoint( numcurve, numpoint, controlpoint):
- """
- Set the Curve's controlpoint value. The numpoint arg is an index into the list of points and starts with 0.
- @rtype: None
- @type numcurve: int
- @type numpoint: int
- @type controlpoint: list
- @param numcurve: index for spline in Curve, starting from 0
- @param numpoint: index for point in spline, starting from 0
- @param controlpoint: The new controlpoint value.
- See L{getControlPoint} for the length of the list.
- """
-
- def appendPoint( numcurve, new_control_point ):
- """
- Add a new control point to the indicated curve (B{deprecated}).
- New scripts should use L{CurNurb.append()}.
- @rtype: None
- @type numcurve: int
- @type new_control_point: list of floats or BezTriple
- @param numcurve: index for spline in Curve, starting from 0
- @param new_control_point: depends on curve's type.
- - type Bezier: a BezTriple
- - type Nurb: a list of four or five floats for the xyzw values
- @raise AttributeError: throws exception if numcurve is out of range.
- """
-
- def appendNurb( new_point ):
- """
- add a new curve to this Curve. The new point is added to the new curve. Blender does not support a curve with zero points. The new curve is added to the end of the list of curves in the Curve.
- @rtype: CurNurb
- @return: the newly added spline
- @type new_point: BezTriple or list of xyzw coordinates for a Nurb curve.
- @param new_point: see L{CurNurb.append} for description of parameter.
- """
-
- def getLoc():
- """
- Get the curve's location value.
- @rtype: a list of 3 floats.
- """
-
- def setLoc(location):
- """
- Set the curve's location value.
- @rtype: None
- @type location: list[3]
- @param location: The new Curve's location values.
- """
-
- def getRot():
- """
- Get the curve's rotation value.
- @rtype: a list of 3 floats.
- """
-
- def setRot(rotation):
- """
- Set the Curve's rotation value.
- @rtype: None
- @type rotation: list[3]
- @param rotation: The new Curve's rotation values.
- """
-
- def getSize():
- """
- Get the curve's size value.
- @rtype: a list of 3 floats.
- """
-
- def setSize(size):
- """
- Set the curve size value.
- @rtype: None
- @type size: list[3]
- @param size: The new Curve's size values.
- """
-
- def getMaterials():
- """
- Returns a list of materials assigned to the Curve.
- @rtype: list of Material Objects
- @return: list of Material Objects assigned to the Curve.
- """
-
- def getBevOb():
- """
- Returns the Bevel Object (BevOb) assigned to the Curve.
- @rtype: Blender Object or None
- @return: Bevel Object (BevOb) assigned to the Curve.
- """
-
- def setBevOb( object ):
- """
- Assign a Bevel Object (BevOb) to the Curve. Passing None as the object parameter removes the bevel.
- @rtype: None
- @return: None
- @type object: Curve type Blender Object
- @param object: Blender Object to assign as Bevel Object (BevOb)
- @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or None
- """
-
- def getTaperOb():
- """
- Returns the Taper Object (TaperOb) assigned to the Curve.
- @rtype: Blender Object or None
- @return: Taper Object (TaperOb) assigned to the Curve.
- """
-
- def setTaperOb( object ):
- """
- Assign a Taper Object (TaperOb) to the Curve. Passing None as the object parameter removes the taper.
- @rtype: None
- @return: None
- @type object: Curve type Blender Object
- @param object: Blender Object to assign as Taper Object (TaperOb)
- @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or None
- """
-
- def update():
- """
- Updates display list for a Curve.
- Used after making changes to control points.
- You B{must} use this if you want to see your changes!
- @rtype: None
- @return: None
- """
-
- def isNurb( curve_num ):
- """
- Tells type of a CurNurb (B{deprecated}).
- New scripts should use L{CurNurb.isNurb()}.
-
- @rtype: integer
- @return: Zero if curve is type Bezier, one if curve is of type Nurb.
- @type curve_num: integer
- @param curve_num: zero-based index into list of curves in this Curve.
- @raise AttributeError: throws exception if curve_num is out of range.
- """
-
- def isCyclic( curve_num ):
- """
- Tells whether or not a CurNurb is cyclic (closed) (B{deprecated}).
- New scripts should use L{CurNurb.isCyclic()}.
-
- @rtype: boolean
- @return: True if is cyclic, False if not
- @type curve_num: integer
- @param curve_num: zero-based index into list of curves in this Curve
- @raise AttributeError: throws exception if curve_num is out of range.
- """
-
- def switchDirection( ):
- """
- Reverse the direction of a curve.
- @return: None
-
- I{B{Example:}}
- # This example switches the direction of all curves on the active object.
- from Blender import *
- scn = Scene.GetCurrent()
- ob = scn.objects.active # must be a curve
- data = ob.data
- for cu in data: cu.switchDirection()
- """
-
- def getNumCurves():
- """
- Get the number of curves in this Curve Data object.
- @rtype: integer
- """
-
- def getNumPoints( curve_num ):
- """
- Get the number of control points in the curve (B{deprecated}).
- New scripts should use the len operator (I{len(curve)}).
- @type curve_num: integer
- @param curve_num: zero-based index into list of curves in this Curve
- @rtype: integer
- """
-
- def getKey():
- """
- Return the L{Key<Key.Key>} object containing the keyframes for this
- curve, if any.
- @rtype: L{Key<Key.Key>} object or None
- """
-
- def recalc():
- """
- Recalculate control point handles after a curve has been changed.
- @rtype: None
- """
-
- def __copy__ ():
- """
- Make a copy of this curve
- @rtype: Curve
- @return: a copy of this curve
- """
+ """
+ The Curve Data object
+ =====================
+ This object gives access to Curve and Surface data linked from Blender Objects.
+
+ @ivar name: The Curve Data name.
+ @type name: string
+ @ivar pathlen: The Curve Data path length, used to set the number of frames for an animation (not the physical length).
+ @type pathlen: int
+ @ivar totcol: The Curve Data maximal number of linked materials. Read-only.
+ @type totcol: int
+ @ivar flag: The Curve Data flag value; see L{getFlag()} for the semantics.
+ @ivar bevresol: The Curve Data bevel resolution. [0 - 32]
+ @type bevresol: int
+ @ivar resolu: The Curve Data U-resolution (used for curve and surface resolution) [0 - 1024].
+ @type resolu: int
+ @ivar resolv: The Curve Data V-resolution (used for surface resolution) [0 - 1024].
+ @type resolv: int
+ @ivar width: The Curve Data width [0 - 2].
+ @type width: float
+ @ivar ext1: The Curve Data extent1 (for bevels).
+ @type ext1: float
+ @ivar ext2: The Curve Data extent2 (for bevels).
+ @type ext2: float
+ @ivar loc: The Curve Data location(from the center).
+ @type loc: list of 3 floats
+ @ivar rot: The Curve Data rotation(from the center).
+ @type rot: list of 3 floats
+ @ivar size: The Curve Data size(from the center).
+ @type size: list of 3 floats
+ @ivar bevob: The Curve Bevel Object
+ @type bevob: Blender L{Object<Object.Object>} or None
+ @ivar key: The Key object associated with this Curve, if any.
+ @type key: Blender L{Key<Key.Key>}
+ @ivar materials: The curves's materials. Each curve can reference up to
+ 16 materials. Empty slots in the curve's list are represented by B{None}.
+ B{Note}: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
+ for each object in order for these materials to be used instead of
+ the object's materials.
+ B{Note}: The list that's returned is I{not} linked to the original curve.
+ curve.materials.append(material) won't do anything.
+ Use curve.materials += [material] instead.
+ @type materials: list of L{Material}s
+ """
+
+ def getName():
+ """
+ Get the name of this Curve Data object.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Curve Data object.
+ @rtype: None
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getPathLen():
+ """
+ Get this Curve's path frame length, used for an animated path.
+ @rtype: int
+ @return: the path length.
+ """
+
+ def setPathLen(len):
+ """
+ Set this Curve's path length.
+ @rtype: None
+ @type len: int
+ @param len: the new curve's length.
+ """
+
+ def getTotcol():
+ """
+ Get the number of materials linked to the Curve.
+ @rtype: int
+ @return: number of materials linked.
+ """
+
+ def setTotcol(totcol):
+ """
+ Set the number of materials linked to the Curve. B{Note}: this method
+ will probably be deprecated in the future.
+ @rtype: None
+ @type totcol: int
+ @param totcol: number of materials linked.
+ @warn: It is not advisable to use this method unless you know what you
+ are doing; it's possible to
+ corrupt a .blend file if you don't know what you're doing. If you want
+ to change the number of materials, use the L{materials} attribute.
+ """
+
+ def getFlag():
+ """
+ Get the Curve flag value.
+ This item is a bitfield whose value is a combination of the following parameters.
+ - Bit 0 : "3D" is set
+ - Bit 1 : "Front" is set
+ - Bit 2 : "Back" is set
+ - Bit 3 : "CurvePath" is set.
+ - Bit 4 : "CurveFollow" is set.
+
+ @rtype: integer bitfield
+ """
+
+ def setFlag(val):
+ """
+ Set the Curve flag value. The flag corresponds to the Blender settings for 3D, Front, Back, CurvePath and CurveFollow. This parameter is a bitfield.
+ @rtype: None
+ @type val: integer bitfield
+ @param val : The Curve's flag bits. See L{getFlag} for the meaning of the individual bits.
+ """
+
+ def getBevresol():
+ """
+ Get the Curve's bevel resolution value.
+ @rtype: float
+ """
+
+ def setBevresol(bevelresol):
+ """
+ Set the Curve's bevel resolution value.
+ @rtype: None
+ @type bevelresol: float
+ @param bevelresol: The new Curve's bevel resolution value.
+ """
+
+ def getResolu():
+ """
+ Get the Curve's U-resolution value.
+ @rtype: float
+ """
+
+ def setResolu(resolu):
+ """
+ Set the Curve's U-resolution value. [0 - 1024]
+ This is used for surfaces and curves.
+ @rtype: None
+ @type resolu: float
+ @param resolu: The new Curve's U-resolution value.
+ """
+
+ def getResolv():
+ """
+ Get the Curve's V-resolution value.
+ @rtype: float
+ """
+
+ def setResolv(resolv):
+ """
+ Set the Curve's V-resolution value. [0 - 1024].
+ This is used for surfaces only.
+ @rtype: None
+ @type resolv: float
+ @param resolv: The new Curve's V-resolution value.
+ """
+
+ def getWidth():
+ """
+ Get the Curve's width value.
+ @rtype: float
+ """
+
+ def setWidth(width):
+ """
+ Set the Curve's width value.
+ @rtype: None
+ @type width: float
+ @param width: The new Curve's width value.
+ """
+
+ def getExt1():
+ """
+ Get the Curve's ext1 value.
+ @rtype: float
+ """
+
+ def setExt1(ext1):
+ """
+ Set the Curve's ext1 value.
+ @rtype: None
+ @type ext1: float
+ @param ext1: The new Curve's ext1 value.
+ """
+
+ def getExt2():
+ """
+ Get the Curve's ext2 value.
+ @rtype: float
+ """
+
+ def setExt2(ext2):
+ """
+ Set the Curve's ext2 value.
+ @rtype: None
+ @type ext2: float
+ @param ext2: The new Curve's ext2 value.
+ """
+
+ def getControlPoint(numcurve,numpoint):
+ """
+ Get the curve's control point value (B{deprecated}). The numpoint arg
+ is an index into the list of points and starts with 0. B{Note}: new
+ scripts should use the [] operator on Curves and CurNurbs. Example::
+ curve = Blender.Curve.Get('Curve')
+ p0 = curve[0][0] # get first point from first nurb
+ # -- OR --
+ nurb = curve[0] # get first nurb
+ p0 = nurb[0] # get nurb's first point
+
+ @type numcurve: int
+ @type numpoint: int
+ @rtype: list of floats
+ @return: depends upon the curve's type.
+ - type Bezier : a list of nine floats. Values are x, y, z for handle-1, vertex and handle-2
+ - type Nurb : a list of 4 floats. Values are x, y, z, w.
+
+ """
+
+ def setControlPoint( numcurve, numpoint, controlpoint):
+ """
+ Set the Curve's controlpoint value. The numpoint arg is an index into the list of points and starts with 0.
+ @rtype: None
+ @type numcurve: int
+ @type numpoint: int
+ @type controlpoint: list
+ @param numcurve: index for spline in Curve, starting from 0
+ @param numpoint: index for point in spline, starting from 0
+ @param controlpoint: The new controlpoint value.
+ See L{getControlPoint} for the length of the list.
+ """
+
+ def appendPoint( numcurve, new_control_point ):
+ """
+ Add a new control point to the indicated curve (B{deprecated}).
+ New scripts should use L{CurNurb.append()}.
+ @rtype: None
+ @type numcurve: int
+ @type new_control_point: list of floats or BezTriple
+ @param numcurve: index for spline in Curve, starting from 0
+ @param new_control_point: depends on curve's type.
+ - type Bezier: a BezTriple
+ - type Nurb: a list of four or five floats for the xyzw values
+ @raise AttributeError: throws exception if numcurve is out of range.
+ """
+
+ def appendNurb( new_point ):
+ """
+ add a new curve to this Curve. The new point is added to the new curve. Blender does not support a curve with zero points. The new curve is added to the end of the list of curves in the Curve.
+ @rtype: CurNurb
+ @return: the newly added spline
+ @type new_point: BezTriple or list of xyzw coordinates for a Nurb curve.
+ @param new_point: see L{CurNurb.append} for description of parameter.
+ """
+
+ def getLoc():
+ """
+ Get the curve's location value.
+ @rtype: a list of 3 floats.
+ """
+
+ def setLoc(location):
+ """
+ Set the curve's location value.
+ @rtype: None
+ @type location: list[3]
+ @param location: The new Curve's location values.
+ """
+
+ def getRot():
+ """
+ Get the curve's rotation value.
+ @rtype: a list of 3 floats.
+ """
+
+ def setRot(rotation):
+ """
+ Set the Curve's rotation value.
+ @rtype: None
+ @type rotation: list[3]
+ @param rotation: The new Curve's rotation values.
+ """
+
+ def getSize():
+ """
+ Get the curve's size value.
+ @rtype: a list of 3 floats.
+ """
+
+ def setSize(size):
+ """
+ Set the curve size value.
+ @rtype: None
+ @type size: list[3]
+ @param size: The new Curve's size values.
+ """
+
+ def getMaterials():
+ """
+ Returns a list of materials assigned to the Curve.
+ @rtype: list of Material Objects
+ @return: list of Material Objects assigned to the Curve.
+ """
+
+ def getBevOb():
+ """
+ Returns the Bevel Object (BevOb) assigned to the Curve.
+ @rtype: Blender Object or None
+ @return: Bevel Object (BevOb) assigned to the Curve.
+ """
+
+ def setBevOb( object ):
+ """
+ Assign a Bevel Object (BevOb) to the Curve. Passing None as the object parameter removes the bevel.
+ @rtype: None
+ @return: None
+ @type object: Curve type Blender Object
+ @param object: Blender Object to assign as Bevel Object (BevOb)
+ @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or None
+ """
+
+ def getTaperOb():
+ """
+ Returns the Taper Object (TaperOb) assigned to the Curve.
+ @rtype: Blender Object or None
+ @return: Taper Object (TaperOb) assigned to the Curve.
+ """
+
+ def setTaperOb( object ):
+ """
+ Assign a Taper Object (TaperOb) to the Curve. Passing None as the object parameter removes the taper.
+ @rtype: None
+ @return: None
+ @type object: Curve type Blender Object
+ @param object: Blender Object to assign as Taper Object (TaperOb)
+ @raise TypeError: throws exception if the parameter is not a Curve type Blender Object or None
+ """
+
+ def update():
+ """
+ Updates display list for a Curve.
+ Used after making changes to control points.
+ You B{must} use this if you want to see your changes!
+ @rtype: None
+ @return: None
+ """
+
+ def isNurb( curve_num ):
+ """
+ Tells type of a CurNurb (B{deprecated}).
+ New scripts should use L{CurNurb.isNurb()}.
+
+ @rtype: integer
+ @return: Zero if curve is type Bezier, one if curve is of type Nurb.
+ @type curve_num: integer
+ @param curve_num: zero-based index into list of curves in this Curve.
+ @raise AttributeError: throws exception if curve_num is out of range.
+ """
+
+ def isCyclic( curve_num ):
+ """
+ Tells whether or not a CurNurb is cyclic (closed) (B{deprecated}).
+ New scripts should use L{CurNurb.isCyclic()}.
+
+ @rtype: boolean
+ @return: True if is cyclic, False if not
+ @type curve_num: integer
+ @param curve_num: zero-based index into list of curves in this Curve
+ @raise AttributeError: throws exception if curve_num is out of range.
+ """
+
+ def switchDirection( ):
+ """
+ Reverse the direction of a curve.
+ @return: None
+
+ I{B{Example:}}
+ # This example switches the direction of all curves on the active object.
+ from Blender import *
+ scn = Scene.GetCurrent()
+ ob = scn.objects.active # must be a curve
+ data = ob.data
+ for cu in data: cu.switchDirection()
+ """
+
+ def getNumCurves():
+ """
+ Get the number of curves in this Curve Data object.
+ @rtype: integer
+ """
+
+ def getNumPoints( curve_num ):
+ """
+ Get the number of control points in the curve (B{deprecated}).
+ New scripts should use the len operator (I{len(curve)}).
+ @type curve_num: integer
+ @param curve_num: zero-based index into list of curves in this Curve
+ @rtype: integer
+ """
+
+ def getKey():
+ """
+ Return the L{Key<Key.Key>} object containing the keyframes for this
+ curve, if any.
+ @rtype: L{Key<Key.Key>} object or None
+ """
+
+ def recalc():
+ """
+ Recalculate control point handles after a curve has been changed.
+ @rtype: None
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this curve
+ @rtype: Curve
+ @return: a copy of this curve
+ """
class CurNurb:
- """
- The CurNurb Object
- ==================
- This object provides access to the control points of the curves that make up a Blender Curve ObData.
-
- The CurNurb supports the python iterator protocol which means you can use a python for statement to access the points in a curve.
-
- The CurNurb also supports the sequence protocol which means you can access the control points of a CurNurb using the [] operator.
-
- Note that CurNurb is used for accesing poly, bezier and nurbs type curves.
-
- @ivar flagU: The CurNurb knot flag U. See L{setFlagU} for description.
- @type flagU: int
- @ivar flagV: The CurNurb knot flag V. See L{setFlagU} for description.
- @type flagV: int
- @ivar type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4)
- @type type: int
- """
-
- def __setitem__( n, point ):
- """
- Replace the Nth point in the curve. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
- @rtype: None
- @return: None
- @type n: integer
- @param n: the index of the element to replace
- @type point: BezTriple or list of 4 floats (optional 5th float is the tilt value in radians)
- @param point: the point that will replace the one in the curve. The point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
- """
-
- def __getitem__( n ):
- """
- Get the Nth element in the curve. For Bezier curves, that element is a BezTriple. For the rest (Poly and Nurbs), it is a list of 5 floats: x, y, z, weight, tilt (in radians). NOTE 1: This element is independent on the curve, modifying it will not affect the curve. NOTE 2: Each successive call returns a new object.
- @rtype: BezTriple (Bezier Curve) or List of 5 floats [x, y, z, w, t] for Poly or Nurbs
- @return: The Nth element in the curve
- @type n: integer
- @param n: the index of the element to return
- """
-
- def append( new_point ):
- """
- Appends a new point to a curve. This method appends points to both Bezier and Nurb curves. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
- @rtype: None
- @return: None
- @type new_point: BezTriple or list of 4 floats (optional 5th float is the tilt value in radians)
- @param new_point: the new point to be appended to the curve. The new point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
- """
-
- def setMatIndex( index ):
- """
- Sets the Material index for this CurNurb.
- @rtype: None
- @return: None
- @type index: integer
- @param index: the new value for the Material number of this CurNurb. No range checking is done.
- """
-
- def getMatIndex():
- """
- Returns the Material index for this CurNurb.
- @rtype: integer
- @return: integer
- """
-
- def isNurb():
- """
- Boolean method used to determine whether a CurNurb is of type Bezier or of type Nurb.
- @rtype: boolean
- @return: True or False
- """
-
- def isCyclic():
- """
- Boolean method checks whether a CurNurb is cyclic (a closed curve) or not.
- @rtype: boolean
- @return: True or False
- """
-
- def getFlagU():
- """
- Get the CurNurb knot flag U.
- @rtype: integer
- @return: See L{setFlagU} for description of return value.
- """
-
- def setFlagU( flag ):
- """
- Set the entire CurNurb knot flag U (knots are recalculated automatically).
- The flag can be one of six values:
- - 0 or 1: uniform knots
- - 2 or 3: endpoints knots
- - 4 or 5: bezier knots
- Bit 0 controls whether or not the curve is cyclic (1 = cyclic).
- @type flag: integer
- @param flag: CurNurb knot flag
- @rtype: None
- @return: None
- """
-
- def getFlagV():
- """
- Get the CurNurb knot flag V.
- @rtype: integer
- @return: See L{setFlagU} for description of return value.
- """
-
- def setFlagV( value ):
- """
- Set the CurNurb knot flag V (knots are recalculated automatically).
- @type value: integer
- @param value: See L{setFlagU} for description of return.
- @rtype: None
- @return: None
- """
-
- def getType():
- """
- Get the type of the curve.
- @rtype: integer
- @return: 0 - Poly, 1 - Bezier, 4 - NURBS
- """
-
- def setType( value ):
- """
- Set the type of the curve and converts the curve to its new type if needed
- @type value: integer
- @param value: CurNurb type flag (0 - Poly, 1 - Bezier, 4 - NURBS)
- @rtype: None
- @return: None
- """
+ """
+ The CurNurb Object
+ ==================
+ This object provides access to the control points of the curves that make up a Blender Curve ObData.
+
+ The CurNurb supports the python iterator protocol which means you can use a python for statement to access the points in a curve.
+
+ The CurNurb also supports the sequence protocol which means you can access the control points of a CurNurb using the [] operator.
+
+ Note that CurNurb is used for accesing poly, bezier and nurbs type curves.
+
+ @ivar flagU: The CurNurb knot flag U. See L{setFlagU} for description.
+ @type flagU: int
+ @ivar flagV: The CurNurb knot flag V. See L{setFlagU} for description.
+ @type flagV: int
+ @ivar type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4)
+ @type type: int
+ """
+
+ def __setitem__( n, point ):
+ """
+ Replace the Nth point in the curve. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
+ @rtype: None
+ @return: None
+ @type n: integer
+ @param n: the index of the element to replace
+ @type point: BezTriple or list of 4 floats (optional 5th float is the tilt value in radians)
+ @param point: the point that will replace the one in the curve. The point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
+ """
+
+ def __getitem__( n ):
+ """
+ Get the Nth element in the curve. For Bezier curves, that element is a BezTriple. For the rest (Poly and Nurbs), it is a list of 5 floats: x, y, z, weight, tilt (in radians). NOTE 1: This element is independent on the curve, modifying it will not affect the curve. NOTE 2: Each successive call returns a new object.
+ @rtype: BezTriple (Bezier Curve) or List of 5 floats [x, y, z, w, t] for Poly or Nurbs
+ @return: The Nth element in the curve
+ @type n: integer
+ @param n: the index of the element to return
+ """
+
+ def append( new_point ):
+ """
+ Appends a new point to a curve. This method appends points to both Bezier and Nurb curves. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
+ @rtype: None
+ @return: None
+ @type new_point: BezTriple or list of 4 floats (optional 5th float is the tilt value in radians)
+ @param new_point: the new point to be appended to the curve. The new point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
+ """
+
+ def setMatIndex( index ):
+ """
+ Sets the Material index for this CurNurb.
+ @rtype: None
+ @return: None
+ @type index: integer
+ @param index: the new value for the Material number of this CurNurb. No range checking is done.
+ """
+
+ def getMatIndex():
+ """
+ Returns the Material index for this CurNurb.
+ @rtype: integer
+ @return: integer
+ """
+
+ def isNurb():
+ """
+ Boolean method used to determine whether a CurNurb is of type Bezier or of type Nurb.
+ @rtype: boolean
+ @return: True or False
+ """
+
+ def isCyclic():
+ """
+ Boolean method checks whether a CurNurb is cyclic (a closed curve) or not.
+ @rtype: boolean
+ @return: True or False
+ """
+
+ def getFlagU():
+ """
+ Get the CurNurb knot flag U.
+ @rtype: integer
+ @return: See L{setFlagU} for description of return value.
+ """
+
+ def setFlagU( flag ):
+ """
+ Set the entire CurNurb knot flag U (knots are recalculated automatically).
+ The flag can be one of six values:
+ - 0 or 1: uniform knots
+ - 2 or 3: endpoints knots
+ - 4 or 5: bezier knots
+ Bit 0 controls whether or not the curve is cyclic (1 = cyclic).
+ @type flag: integer
+ @param flag: CurNurb knot flag
+ @rtype: None
+ @return: None
+ """
+
+ def getFlagV():
+ """
+ Get the CurNurb knot flag V.
+ @rtype: integer
+ @return: See L{setFlagU} for description of return value.
+ """
+
+ def setFlagV( value ):
+ """
+ Set the CurNurb knot flag V (knots are recalculated automatically).
+ @type value: integer
+ @param value: See L{setFlagU} for description of return.
+ @rtype: None
+ @return: None
+ """
+
+ def getType():
+ """
+ Get the type of the curve.
+ @rtype: integer
+ @return: 0 - Poly, 1 - Bezier, 4 - NURBS
+ """
+
+ def setType( value ):
+ """
+ Set the type of the curve and converts the curve to its new type if needed
+ @type value: integer
+ @param value: CurNurb type flag (0 - Poly, 1 - Bezier, 4 - NURBS)
+ @rtype: None
+ @return: None
+ """
class SurfNurb:
- """
- The SurfNurb Object
- ===================
- This object provides access to the control points of the surfaces that make
- up a Blender Curve.
-
- The SurfNurb supports the Python iterator and sequence protocols which
- means you can use a python B{for} statement or [] operator to access the
- points in a surface. Points are accessed linearly; for a N-by-M UV surface,
- the first N control points correspond to V=0, then second N to V=1, and so
- on.
-
- @ivar flagU: The knot flag U. Changing the knot type automatically
- recalculates the knots. The flag can be one of three values:
- - 0 : uniform knots
- - 1 : endpoints knots
- - 2 : bezier knots
- @type flagU: int
- @ivar flagV: The knot flag V. See L{flagU} for description.
- @type flagV: int
- @ivar pointsU: The number of control points in the U direction (read only).
- @type pointsU: int
- @ivar pointsV: The number of control points in the V direction (read only).
- @type pointsV: int
- @ivar cyclicU: The cyclic setting for the U direction (True = cyclic).
- @type cyclicU: boolean
- @ivar cyclicV: The cyclic setting for the V direction (True = cyclic).
- @type cyclicV: boolean
- @ivar orderU: The order setting for the U direction. Values are clamped
- to the range [2:6] and not greater than the U dimension.
- @type orderU: int
- @ivar orderV: The order setting for the V direction. Values are clamped
- to the range [2:6] and not greater than the V dimension.
- @type orderV: int
- """
-
- def __setitem__( n, point ):
- """
- Set the Nth control point in the surface.
- @rtype: None
- @return: None
- @type n: integer
- @param n: the index of the point to replace
- @type point: list of 4 floats (optional 5th float is the tilt value
- in radians)
- @param point: the point that will replace the one in the curve. The
- point is list of 4 floats in x,y,z,w (optionally tilt in radians as
- 5th value) format.
- """
-
- def __getitem__( n ):
- """
- Get the Nth control point in the surface.
- @rtype: List of 5 floats [x, y, z, w, t] for Poly or Nurbs
- @return: The Nth point in the curve
- @type n: integer
- @param n: the index of the point to return
- @note: This returned value is independent on the curve; modifying it will not affect the curve.
- @note: Each successive call returns a new object.
- """
+ """
+ The SurfNurb Object
+ ===================
+ This object provides access to the control points of the surfaces that make
+ up a Blender Curve.
+
+ The SurfNurb supports the Python iterator and sequence protocols which
+ means you can use a python B{for} statement or [] operator to access the
+ points in a surface. Points are accessed linearly; for a N-by-M UV surface,
+ the first N control points correspond to V=0, then second N to V=1, and so
+ on.
+
+ @ivar flagU: The knot flag U. Changing the knot type automatically
+ recalculates the knots. The flag can be one of three values:
+ - 0 : uniform knots
+ - 1 : endpoints knots
+ - 2 : bezier knots
+ @type flagU: int
+ @ivar flagV: The knot flag V. See L{flagU} for description.
+ @type flagV: int
+ @ivar pointsU: The number of control points in the U direction (read only).
+ @type pointsU: int
+ @ivar pointsV: The number of control points in the V direction (read only).
+ @type pointsV: int
+ @ivar cyclicU: The cyclic setting for the U direction (True = cyclic).
+ @type cyclicU: boolean
+ @ivar cyclicV: The cyclic setting for the V direction (True = cyclic).
+ @type cyclicV: boolean
+ @ivar orderU: The order setting for the U direction. Values are clamped
+ to the range [2:6] and not greater than the U dimension.
+ @type orderU: int
+ @ivar orderV: The order setting for the V direction. Values are clamped
+ to the range [2:6] and not greater than the V dimension.
+ @type orderV: int
+ """
+
+ def __setitem__( n, point ):
+ """
+ Set the Nth control point in the surface.
+ @rtype: None
+ @return: None
+ @type n: integer
+ @param n: the index of the point to replace
+ @type point: list of 4 floats (optional 5th float is the tilt value
+ in radians)
+ @param point: the point that will replace the one in the curve. The
+ point is list of 4 floats in x,y,z,w (optionally tilt in radians as
+ 5th value) format.
+ """
+
+ def __getitem__( n ):
+ """
+ Get the Nth control point in the surface.
+ @rtype: List of 5 floats [x, y, z, w, t] for Poly or Nurbs
+ @return: The Nth point in the curve
+ @type n: integer
+ @param n: the index of the point to return
+ @note: This returned value is independent on the curve; modifying it will not affect the curve.
+ @note: Each successive call returns a new object.
+ """
diff --git a/source/blender/python/api2_2x/doc/Font.py b/source/blender/python/api2_2x/doc/Font.py
index 0cc561aaff6..c0ad66d0462 100644
--- a/source/blender/python/api2_2x/doc/Font.py
+++ b/source/blender/python/api2_2x/doc/Font.py
@@ -9,61 +9,61 @@ Text3d.Font Objects
This module provides access to B{Font} objects in Blender.
Example::
- import Blender
- from Blender import Text3d
-
- # Load a font
- myfont= Text3d.Font.Load('/usr/share/fonts/ttf/verdana.ttf')
-
- #
- for font in Text3d.Font.Get():
- print font.name, font.filename, font.packed
+ import Blender
+ from Blender import Text3d
+
+ # Load a font
+ myfont= Text3d.Font.Load('/usr/share/fonts/ttf/verdana.ttf')
+
+ #
+ for font in Text3d.Font.Get():
+ print font.name, font.filename, font.packed
"""
def Load (filename):
- """
- Create a new Text3d.Font object.
- @type filename: string
- @param filename: file of the font
- @rtype: Blender Text3d.Font
- @return: The created Text3d.Font Data object.
- """
+ """
+ Create a new Text3d.Font object.
+ @type filename: string
+ @param filename: file of the font
+ @rtype: Blender Text3d.Font
+ @return: The created Text3d.Font Data object.
+ """
def Get (name = None):
- """
- Get the Text3d.Font object(s) from Blender.
- @type name: string
- @param name: The name of the Text3d object.
- @rtype: Blender Text3d or a list of Blender Text3ds
- @return: It depends on the 'name' parameter:
- - (name): The Text3d object with the given name;
- - (): A list with all Font objects in the current .blend file.
- """
+ """
+ Get the Text3d.Font object(s) from Blender.
+ @type name: string
+ @param name: The name of the Text3d object.
+ @rtype: Blender Text3d or a list of Blender Text3ds
+ @return: It depends on the 'name' parameter:
+ - (name): The Text3d object with the given name;
+ - (): A list with all Font objects in the current .blend file.
+ """
class Font:
- """
- The Text3d.Font object
- ======================
- This object gives access Blender's B{Font} objects
- @ivar name: The Font name.
- @ivar filename: The filename (path) of the file loaded into this Font.
- @ivar packed: Boolean, True when the sample is packed (readonly).
- @ivar users: The number of users this font has (read only)
- """
+ """
+ The Text3d.Font object
+ ======================
+ This object gives access Blender's B{Font} objects
+ @ivar filename: The filename (path) of the file loaded into this Font.
+ @type filename: string
+ @ivar packed: Boolean, True when the sample is packed (readonly).
+ @type packed: string
+ """
- def pack():
- """
- Packs the sound into the current blend file.
- @note: An error will be raised if the sound is already packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- """
+ def pack():
+ """
+ Packs the sound into the current blend file.
+ @note: An error will be raised if the sound is already packed or the filename path does not exist.
+ @returns: nothing
+ @rtype: none
+ """
- def unpack(mode):
- """
- Unpacks the sound to the samples filename.
- @param mode: One of the values in Blender.UnpackModes dict.
- @note: An error will be raised if the sound is not packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- @type mode: int
- """
+ def unpack(mode):
+ """
+ Unpacks the sound to the samples filename.
+ @param mode: One of the values in Blender.UnpackModes dict.
+ @note: An error will be raised if the sound is not packed or the filename path does not exist.
+ @returns: nothing
+ @rtype: none
+ @type mode: int
+ """
diff --git a/source/blender/python/api2_2x/doc/Group.py b/source/blender/python/api2_2x/doc/Group.py
index 8e04518fe35..aca7c56b4a5 100644
--- a/source/blender/python/api2_2x/doc/Group.py
+++ b/source/blender/python/api2_2x/doc/Group.py
@@ -10,121 +10,118 @@ This module provides access to B{Group} data in Blender.
Example::
- # Make Dupli's Real, as a python script.
+ # Make Dupli's Real, as a python script.
- from Blender import *
+ from Blender import *
- scn= Scene.GetCurrent()
- for ob in scn.objects:
- print 'Object Group Settings'
- print ob.name, ob.type
- print 'enableDupVerts:', ob.enableDupVerts
- print 'enableDupFrames:', ob.enableDupFrames
- print 'enableDupGroup:', ob.enableDupGroup
- print 'DupGroup:', ob.DupGroup
- dupe_obs= ob.DupObjects
- print 'num dup obs:', len(dupe_obs)
+ scn= Scene.GetCurrent()
+ for ob in scn.objects:
+ print 'Object Group Settings'
+ print ob.name, ob.type
+ print 'enableDupVerts:', ob.enableDupVerts
+ print 'enableDupFrames:', ob.enableDupFrames
+ print 'enableDupGroup:', ob.enableDupGroup
+ print 'DupGroup:', ob.DupGroup
+ dupe_obs= ob.DupObjects
+ print 'num dup obs:', len(dupe_obs)
- for dup_ob, dup_matrix in dupe_obs:
- print '\tDupOb', dup_ob.name
- scn.objects.new(dup_ob.data)
- new_ob.setMatrix(dup_matrix)
- new_ob.sel= 1 # select all real instances.
+ for dup_ob, dup_matrix in dupe_obs:
+ print '\tDupOb', dup_ob.name
+ scn.objects.new(dup_ob.data)
+ new_ob.setMatrix(dup_matrix)
+ new_ob.sel= 1 # select all real instances.
- ob.sel=0 # Desel the original object
+ ob.sel=0 # Desel the original object
- Window.RedrawAll()
+ Window.RedrawAll()
Example::
- # Make a new group with the selected objects, and add an instance of this group.
-
- from Blender import *
-
- scn= Scene.GetCurrent()
-
- # New Group
- grp= Group.New('mygroup')
- grp.objects= scn.objects
-
- # Instance the group at an empty using dupligroups
- ob= scn.objects.new(None)
- ob.enableDupGroup= True
- ob.DupGroup= grp
- Window.RedrawAll()
-
-
+ # Make a new group with the selected objects, and add an instance of this group.
+
+ from Blender import *
+
+ scn= Scene.GetCurrent()
+
+ # New Group
+ grp= Group.New('mygroup')
+ grp.objects= scn.objects
+
+ # Instance the group at an empty using dupligroups
+ ob= scn.objects.new(None)
+ ob.enableDupGroup= True
+ ob.DupGroup= grp
+ Window.RedrawAll()
+
+
Example::
- # Remove all non mesh objects from a group.
-
- from Blender import *
-
- scn= Scene.GetCurrent()
-
- # New Group
- grp= Group.Get('mygroup')
- for ob in list(grp.objects): # Convert to a list before looping because we are removing items
- if ob.type != 'Mesh':
- grp.objects.unlink(ob)
+ # Remove all non mesh objects from a group.
+
+ from Blender import *
+
+ scn= Scene.GetCurrent()
+
+ # New Group
+ grp= Group.Get('mygroup')
+ for ob in list(grp.objects): # Convert to a list before looping because we are removing items
+ if ob.type != 'Mesh':
+ grp.objects.unlink(ob)
"""
def New (name = None):
- """
- Make a new empty group, name optional, default is "Group"
- @type name: string
- @param name: The name of the new group.
- @rtype: Blender Group
- @return: A Empty Blender Group object
- """
+ """
+ Make a new empty group, name optional, default is "Group"
+ @type name: string
+ @param name: The name of the new group.
+ @rtype: Blender Group
+ @return: A Empty Blender Group object
+ """
def Get (name = None):
- """
- Get the Group object(s) from Blender.
- @type name: string
- @param name: The name of the Group object.
- @rtype: Blender Group or a list of Blender Groups
- @return: It depends on the I{name} parameter:
- - (name): The Group object called I{name}, Exception if it is not found.
- - (): A list with all Group objects in the current blend file.
- """
+ """
+ Get the Group object(s) from Blender.
+ @type name: string
+ @param name: The name of the Group object.
+ @rtype: Blender Group or a list of Blender Groups
+ @return: It depends on the I{name} parameter:
+ - (name): The Group object called I{name}, Exception if it is not found.
+ - (): A list with all Group objects in the current blend file.
+ """
def Unlink (group):
- """
- Unlink (delete) this group from Blender.
- @Note: No objects will be removed, just the group that references them.
- @type group: group
- @param group: A group to remove from this blend file, does not remove objects that this group uses.
- """
+ """
+ Unlink (delete) this group from Blender.
+ @Note: No objects will be removed, just the group that references them.
+ @type group: group
+ @param group: A group to remove from this blend file, does not remove objects that this group uses.
+ """
class Group:
- """
- The Group object
- ================
- This object gives access to Groups in Blender.
- @ivar name: The name of this Group object.
- @type name: string
- @ivar users: Number of users this group has (read only)
- @type users: int
- @ivar fakeUser: The fake user status.
- Enabling this will keep it in the blend even if there are no users.
- @type fakeUser: bool
- @ivar layers: Layer bitmask for this group.
- @type layers: int
- @ivar objects: Objects that this group uses.
- This is a sequence with-list like access so use list(grp.objects) if you need to use a list (where grp is a group).
- The groups objects can be set by assigning a list or iterator of objects to the groups objects.
- objects.link() and objects.unlink() also work with the the objects iterator just like with lists.
-
- B{Note}: append() and remove() have been deprecated and replaced by link() and unlink(),
- after Blender 2.43 append() and remove() will not be available.
- @type objects: custom object sequence
- """
-
- def __copy__ ():
- """
- Make a copy of this group
- @rtype: Group
- @return: a copy of this group
- """ \ No newline at end of file
+ """
+ The Group object
+ ================
+ This object gives access to Groups in Blender.
+ @ivar layers: Layer bitmask for this group.
+ @type layers: int
+ @ivar objects: Objects that this group uses.
+ This is a sequence with-list like access so use list(grp.objects) if you need to use a list (where grp is a group).
+ The groups objects can be set by assigning a list or iterator of objects to the groups objects.
+ objects.link() and objects.unlink() also work with the the objects iterator just like with lists.
+
+ B{Note}: append() and remove() have been deprecated and replaced by link() and unlink(),
+ after Blender 2.43 append() and remove() will not be available.
+ @type objects: custom object sequence
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this group
+ @rtype: Group
+ @return: a copy of this group
+ """
+
+import id_generics
+Group.__doc__ += id_generics.attributes
+
diff --git a/source/blender/python/api2_2x/doc/Image.py b/source/blender/python/api2_2x/doc/Image.py
index ef5fe04dbca..d22cffbe1e8 100644
--- a/source/blender/python/api2_2x/doc/Image.py
+++ b/source/blender/python/api2_2x/doc/Image.py
@@ -11,348 +11,345 @@ B{New}: L{Image.setFilename}.
This module provides access to B{Image} objects in Blender.
Example::
- import Blender
- from Blender import Image
- #
- image = Image.Load("/path/to/my/image.png") # load an image file
- print "Image from", image.getFilename(),
- print "loaded to obj", image.getName())
- image.setXRep(4) # set x tiling factor
- image.setYRep(2) # set y tiling factor
- print "All Images available now:", Image.Get()
+ import Blender
+ from Blender import Image
+ #
+ image = Image.Load("/path/to/my/image.png") # load an image file
+ print "Image from", image.getFilename(),
+ print "loaded to obj", image.getName())
+ image.setXRep(4) # set x tiling factor
+ image.setYRep(2) # set y tiling factor
+ print "All Images available now:", Image.Get()
"""
def Load (filename):
- """
- Load the image called 'filename' into an Image object.
- @type filename: string
- @param filename: The full path to the image file.
- @rtype: Blender Image
- @return: A Blender Image object with the data from I{filename}.
- """
+ """
+ Load the image called 'filename' into an Image object.
+ @type filename: string
+ @param filename: The full path to the image file.
+ @rtype: Blender Image
+ @return: A Blender Image object with the data from I{filename}.
+ """
def New (name, width, height, depth):
- """
- Create a new Image object.
- @type name: string
- @param name: The name of the new Image object.
- @type width: int
- @param width: The width of the new Image object, between 1 and 5000.
- @type height: int
- @param height: The height of the new Image object, between 1 and 5000.
- @type depth: int
- @param depth: The colour depth of the new Image object. (8:Grey, 24:RGB, 32:RGBA). (Not implimented yet, all new images will be 24bit)
- @rtype: Blender Image
- @return: A new Blender Image object.
- """
+ """
+ Create a new Image object.
+ @type name: string
+ @param name: The name of the new Image object.
+ @type width: int
+ @param width: The width of the new Image object, between 1 and 5000.
+ @type height: int
+ @param height: The height of the new Image object, between 1 and 5000.
+ @type depth: int
+ @param depth: The colour depth of the new Image object. (8:Grey, 24:RGB, 32:RGBA). (Not implimented yet, all new images will be 24bit)
+ @rtype: Blender Image
+ @return: A new Blender Image object.
+ """
def Get (name = None):
- """
- Get the Image object(s) from Blender.
- @type name: string
- @param name: The name of the Image object.
- @rtype: Blender Image or a list of Blender Images
- @return: It depends on the I{name} parameter:
- - (name): The Image object called I{name}, None if not found;
- - (): A list with all Image objects in the current scene.
- """
+ """
+ Get the Image object(s) from Blender.
+ @type name: string
+ @param name: The name of the Image object.
+ @rtype: Blender Image or a list of Blender Images
+ @return: It depends on the I{name} parameter:
+ - (name): The Image object called I{name}, None if not found;
+ - (): A list with all Image objects in the current scene.
+ """
def GetCurrent ():
- """
- Get the currently displayed Image from Blenders UV/Image window.
- When multiple images are displayed, the last active UV/Image windows image is used.
- @rtype: Blender Image
- @return: The Current Blender Image, If there is no current image it returns None.
- """
+ """
+ Get the currently displayed Image from Blenders UV/Image window.
+ When multiple images are displayed, the last active UV/Image windows image is used.
+ @rtype: Blender Image
+ @return: The Current Blender Image, If there is no current image it returns None.
+ """
from IDProp import IDGroup, IDArray
class Image:
- """
- The Image object
- ================
- This object gives access to Images in Blender.
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- image's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
- @ivar name: The name of this Image object.
- @type name: string
- @ivar filename: The filename (path) to the image file loaded into this Image
- object.
- @type filename: string
- @ivar size: The [width, height] dimensions of the image (in pixels).
- @type size: list
- @ivar depth: The pixel depth of the image. [8, 16, 18, 24, 32]
- @type depth: int
- @ivar xrep: Texture tiling: the number of repetitions in the x (horizontal)
- axis. [1, 16].
- @ivar yrep: Texture tiling: the number of repetitions in the y (vertical)
- axis [1, 16].
- @type xrep: int
- @type yrep: int
- @ivar start: Texture's animation start frame [0, 128].
- @type start: int
- @ivar end: Texture's animation end frame [0, 128].
- @type end: int
- @ivar speed: Texture's animation speed [1, 100].
- @type speed: int
- @ivar packed: True when the Texture is packed (readonly).
- @type packed: boolean
- @ivar has_data: True when the image has pixel data (readonly).
- @type has_data: boolean
- @ivar fields: enable or disable the fields option for this image.
- @type fields: boolean
- @ivar fields_odd: enable or disable the odd fields option for this image.
- @type fields_odd: boolean
- @ivar antialias: enable or disable the antialias option for this image.
- @type antialias: boolean
- @ivar bindcode: Texture's bind code (readonly).
- @type bindcode: int
- """
-
- def getName():
- """
- Get the name of this Image object.
- @rtype: string
- """
-
- def getFilename():
- """
- Get the filename of the image file loaded into this Image object.
- @rtype: string
- """
-
- def getSize():
- """
- Get the [width, height] dimensions (in pixels) of this image.
- @rtype: list of 2 ints
- """
-
- def getDepth():
- """
- Get the pixel depth of this image.
- @rtype: int
- """
-
- def getPixelF(x, y):
- """
- Get the the colors of the current pixel in the form [r,g,b,a].
- Returned values are floats normalized to 0.0 - 1.0.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @returns: [ r, g, b, a]
- @rtype: list of 4 floats
- @type x: int
- @type y: int
- @param x: the x coordinate of pixel.
- @param y: the y coordinate of pixel.
- """
- def getPixelI(x, y):
- """
- Get the the colors of the current pixel in the form [r,g,b,a].
- Returned values are ints normalized to 0 - 255.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @returns: [ r, g, b, a]
- @rtype: list of 4 ints
- @type x: int
- @type y: int
- @param x: the x coordinate of pixel.
- @param y: the y coordinate of pixel.
- """
-
- def getMaxXY():
- """
- Get the x & y size for the image. Image coordinates range from 0 to size-1.
- @returns: [x, y]
- @rtype: list of 2 ints
- """
-
- def getMinXY():
- """
- Get the x & y origin for the image. Image coordinates range from 0 to size-1.
- @returns: [x, y]
- @rtype: list of 2 ints
- """
-
- def getXRep():
- """
- Get the number of repetitions in the x (horizontal) axis for this Image.
- This is for texture tiling.
- @rtype: int
- """
-
- def getYRep():
- """
- Get the number of repetitions in the y (vertical) axis for this Image.
- This is for texture tiling.
- @rtype: int
- """
-
- def getBindCode():
- """
- Get the Image's bindcode. This is for texture loading using BGL calls.
- See, for example, L{BGL.glBindTexture} and L{glLoad}.
- @rtype: int
- """
-
- def getStart():
- """
- Get the Image's start frame. Used for animated textures.
- @rtype: int
- """
-
- def getEnd():
- """
- Get the Image's end frame. Used for animated textures.
- @rtype: int
- """
-
- def getSpeed():
- """
- Get the Image's speed (fps). Used for animated textures.
- @rtype: int
- """
-
- def reload():
- """
- Reloads this image from the filesystem. If used within a loop you need to
- redraw the Window to see the change in the image, e.g. with
- Window.RedrawAll().
- @warn: if the image file is corrupt or still being written, it will be
- replaced by a blank image in Blender, but no error will be returned.
- @returns: None
- """
-
- def glLoad():
- """
- Load this image's data into OpenGL texture memory, if it is not already
- loaded (image.bindcode is 0 if it is not loaded yet).
- @note: Usually you don't need to call this method. It is only necessary
- if you want to draw textured objects in the Scripts window and the
- image's bind code is zero at that moment, otherwise Blender itself can
- take care of binding / unbinding textures. Calling this method for an
- image with nonzero bind code simply returns the image's bind code value
- (see L{getBindCode}).
- @rtype: int
- @returns: the texture's bind code.
- """
-
- def glFree():
- """
- Delete this image's data from OpenGL texture memory, only (the image itself
- is not removed from Blender's memory). Internally, glDeleteTextures (see
- L{BGL.glDeleteTextures}) is used, but this method also updates Blender's
- Image object so that its bind code is set to 0. See also L{Image.glLoad},
- L{Image.getBindCode}.
- """
-
- def setName(name):
- """
- Set the name of this Image object.
- @type name: string
- @param name: The new name.
- """
-
- def setFilename(name):
- """
- Change the filename of this Image object.
- @type name: string
- @param name: The new full filename.
- @warn: use this with caution and note that the filename is truncated if
- larger than 160 characters.
- """
-
- def setXRep(xrep):
- """
- Texture tiling: set the number of x repetitions for this Image.
- @type xrep: int
- @param xrep: The new value in [1, 16].
- """
-
- def setYRep(yrep):
- """
- Texture tiling: set the number of y repetitions for this Image.
- @type yrep: int
- @param yrep: The new value in [1, 16].
- """
-
- def setStart(start):
- """
- Get the Image's start frame. Used for animated textures.
- @type start: int
- @param start: The new value in [0, 128].
- """
-
- def setEnd(end):
- """
- Set the Image's end frame. Used for animated textures.
- @type end: int
- @param end: The new value in [0, 128].
- """
-
- def setSpeed(speed):
- """
- Set the Image's speed (fps). Used for animated textures.
- @type speed: int
- @param speed: The new value in [1, 100].
- """
-
- def setPixelF(x, y, (r, g, b,a )):
- """
- Set the the colors of the current pixel in the form [r,g,b,a].
- Color values must be floats in the range 0.0 - 1.0.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @type x: int
- @type y: int
- @type r: float
- @type g: float
- @type b: float
- @type a: float
- @returns: nothing
- @rtype: none
- """
-
- def setPixelI(x, y, (r, g, b, a)):
- """
- Set the the colors of the current pixel in the form [r,g,b,a].
- Color values must be ints in the range 0 - 255.
- Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
- @type x: int
- @type y: int
- @type r: int
- @type g: int
- @type b: int
- @type a: int
- @returns: nothing
- @rtype: none
- """
-
- def save():
- """
- Saves the current image.
- @returns: nothing
- @rtype: none
- """
-
- def pack():
- """
- Packs the image into the current blend file.
- @note: An error will be raised if the image is already packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- """
-
- def unpack(mode):
- """
- Unpacks the image to the images filename.
- @param mode: One of the values in Blender.Unpackmodes dict.
- @note: An error will be raised if the image is not packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- @type mode: int
- """
- def makeCurrent():
- """
- Set the currently displayed Image from Blenders UV/Image window.
- When multiple images are displayed, the last active UV/Image windows image is used.
- @rtype: bool
- @return: True if the current image could be set, if no window was available, return False.
- """
+ """
+ The Image object
+ ================
+ This object gives access to Images in Blender.
+ @ivar filename: The filename (path) to the image file loaded into this Image
+ object.
+ @type filename: string
+ @ivar size: The [width, height] dimensions of the image (in pixels).
+ @type size: list
+ @ivar depth: The pixel depth of the image. [8, 16, 18, 24, 32]
+ @type depth: int
+ @ivar xrep: Texture tiling: the number of repetitions in the x (horizontal)
+ axis. [1, 16].
+ @ivar yrep: Texture tiling: the number of repetitions in the y (vertical)
+ axis [1, 16].
+ @type xrep: int
+ @type yrep: int
+ @ivar start: Texture's animation start frame [0, 128].
+ @type start: int
+ @ivar end: Texture's animation end frame [0, 128].
+ @type end: int
+ @ivar speed: Texture's animation speed [1, 100].
+ @type speed: int
+ @ivar packed: True when the Texture is packed (readonly).
+ @type packed: boolean
+ @ivar has_data: True when the image has pixel data (readonly).
+ @type has_data: boolean
+ @ivar fields: enable or disable the fields option for this image.
+ @type fields: boolean
+ @ivar fields_odd: enable or disable the odd fields option for this image.
+ @type fields_odd: boolean
+ @ivar antialias: enable or disable the antialias option for this image.
+ @type antialias: boolean
+ @ivar bindcode: Texture's bind code (readonly).
+ @type bindcode: int
+ """
+
+ def getName():
+ """
+ Get the name of this Image object.
+ @rtype: string
+ """
+
+ def getFilename():
+ """
+ Get the filename of the image file loaded into this Image object.
+ @rtype: string
+ """
+
+ def getSize():
+ """
+ Get the [width, height] dimensions (in pixels) of this image.
+ @rtype: list of 2 ints
+ """
+
+ def getDepth():
+ """
+ Get the pixel depth of this image.
+ @rtype: int
+ """
+
+ def getPixelF(x, y):
+ """
+ Get the the colors of the current pixel in the form [r,g,b,a].
+ Returned values are floats normalized to 0.0 - 1.0.
+ Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
+ @returns: [ r, g, b, a]
+ @rtype: list of 4 floats
+ @type x: int
+ @type y: int
+ @param x: the x coordinate of pixel.
+ @param y: the y coordinate of pixel.
+ """
+ def getPixelI(x, y):
+ """
+ Get the the colors of the current pixel in the form [r,g,b,a].
+ Returned values are ints normalized to 0 - 255.
+ Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
+ @returns: [ r, g, b, a]
+ @rtype: list of 4 ints
+ @type x: int
+ @type y: int
+ @param x: the x coordinate of pixel.
+ @param y: the y coordinate of pixel.
+ """
+
+ def getMaxXY():
+ """
+ Get the x & y size for the image. Image coordinates range from 0 to size-1.
+ @returns: [x, y]
+ @rtype: list of 2 ints
+ """
+
+ def getMinXY():
+ """
+ Get the x & y origin for the image. Image coordinates range from 0 to size-1.
+ @returns: [x, y]
+ @rtype: list of 2 ints
+ """
+
+ def getXRep():
+ """
+ Get the number of repetitions in the x (horizontal) axis for this Image.
+ This is for texture tiling.
+ @rtype: int
+ """
+
+ def getYRep():
+ """
+ Get the number of repetitions in the y (vertical) axis for this Image.
+ This is for texture tiling.
+ @rtype: int
+ """
+
+ def getBindCode():
+ """
+ Get the Image's bindcode. This is for texture loading using BGL calls.
+ See, for example, L{BGL.glBindTexture} and L{glLoad}.
+ @rtype: int
+ """
+
+ def getStart():
+ """
+ Get the Image's start frame. Used for animated textures.
+ @rtype: int
+ """
+
+ def getEnd():
+ """
+ Get the Image's end frame. Used for animated textures.
+ @rtype: int
+ """
+
+ def getSpeed():
+ """
+ Get the Image's speed (fps). Used for animated textures.
+ @rtype: int
+ """
+
+ def reload():
+ """
+ Reloads this image from the filesystem. If used within a loop you need to
+ redraw the Window to see the change in the image, e.g. with
+ Window.RedrawAll().
+ @warn: if the image file is corrupt or still being written, it will be
+ replaced by a blank image in Blender, but no error will be returned.
+ @returns: None
+ """
+
+ def glLoad():
+ """
+ Load this image's data into OpenGL texture memory, if it is not already
+ loaded (image.bindcode is 0 if it is not loaded yet).
+ @note: Usually you don't need to call this method. It is only necessary
+ if you want to draw textured objects in the Scripts window and the
+ image's bind code is zero at that moment, otherwise Blender itself can
+ take care of binding / unbinding textures. Calling this method for an
+ image with nonzero bind code simply returns the image's bind code value
+ (see L{getBindCode}).
+ @rtype: int
+ @returns: the texture's bind code.
+ """
+
+ def glFree():
+ """
+ Delete this image's data from OpenGL texture memory, only (the image itself
+ is not removed from Blender's memory). Internally, glDeleteTextures (see
+ L{BGL.glDeleteTextures}) is used, but this method also updates Blender's
+ Image object so that its bind code is set to 0. See also L{Image.glLoad},
+ L{Image.getBindCode}.
+ """
+
+ def setName(name):
+ """
+ Set the name of this Image object.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def setFilename(name):
+ """
+ Change the filename of this Image object.
+ @type name: string
+ @param name: The new full filename.
+ @warn: use this with caution and note that the filename is truncated if
+ larger than 160 characters.
+ """
+
+ def setXRep(xrep):
+ """
+ Texture tiling: set the number of x repetitions for this Image.
+ @type xrep: int
+ @param xrep: The new value in [1, 16].
+ """
+
+ def setYRep(yrep):
+ """
+ Texture tiling: set the number of y repetitions for this Image.
+ @type yrep: int
+ @param yrep: The new value in [1, 16].
+ """
+
+ def setStart(start):
+ """
+ Get the Image's start frame. Used for animated textures.
+ @type start: int
+ @param start: The new value in [0, 128].
+ """
+
+ def setEnd(end):
+ """
+ Set the Image's end frame. Used for animated textures.
+ @type end: int
+ @param end: The new value in [0, 128].
+ """
+
+ def setSpeed(speed):
+ """
+ Set the Image's speed (fps). Used for animated textures.
+ @type speed: int
+ @param speed: The new value in [1, 100].
+ """
+
+ def setPixelF(x, y, (r, g, b,a )):
+ """
+ Set the the colors of the current pixel in the form [r,g,b,a].
+ Color values must be floats in the range 0.0 - 1.0.
+ Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
+ @type x: int
+ @type y: int
+ @type r: float
+ @type g: float
+ @type b: float
+ @type a: float
+ @returns: nothing
+ @rtype: none
+ """
+
+ def setPixelI(x, y, (r, g, b, a)):
+ """
+ Set the the colors of the current pixel in the form [r,g,b,a].
+ Color values must be ints in the range 0 - 255.
+ Pixel coordinates are in the range from 0 to N-1. See L{getMaxXY}
+ @type x: int
+ @type y: int
+ @type r: int
+ @type g: int
+ @type b: int
+ @type a: int
+ @returns: nothing
+ @rtype: none
+ """
+
+ def save():
+ """
+ Saves the current image.
+ @returns: nothing
+ @rtype: none
+ """
+
+ def pack():
+ """
+ Packs the image into the current blend file.
+ @note: An error will be raised if the image is already packed or the filename path does not exist.
+ @returns: nothing
+ @rtype: none
+ """
+
+ def unpack(mode):
+ """
+ Unpacks the image to the images filename.
+ @param mode: One of the values in Blender.Unpackmodes dict.
+ @note: An error will be raised if the image is not packed or the filename path does not exist.
+ @returns: nothing
+ @rtype: none
+ @type mode: int
+ """
+ def makeCurrent():
+ """
+ Set the currently displayed Image from Blenders UV/Image window.
+ When multiple images are displayed, the last active UV/Image windows image is used.
+ @rtype: bool
+ @return: True if the current image could be set, if no window was available, return False.
+ """
+import id_generics
+Image.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py
index 86de771ee2d..8658f9cda1c 100644
--- a/source/blender/python/api2_2x/doc/Ipo.py
+++ b/source/blender/python/api2_2x/doc/Ipo.py
@@ -4,62 +4,62 @@
The Blender.Ipo submodule
B{New}:
- - Ipo updates to both the program and Bpython access.
- - access to Blender's new Ipo driver capabilities.
- - Ipo now supports the mapping operator [] to access IpoCurves
+ - Ipo updates to both the program and Bpython access.
+ - access to Blender's new Ipo driver capabilities.
+ - Ipo now supports the mapping operator [] to access IpoCurves
This module provides access to the Ipo Data in Blender. An Ipo is composed of
several IpoCurves, and an IpoCurve is composed of several BezTriples.
Example::
- from Blender import Ipo
-
- ob = Ipo.Get('ObIpo') # retrieves an Ipo object
- ob.name = 'ipo1' # change the Ipo's name
- icu = ipo[Ipo.OB_LOCX] # request X Location Ipo curve object
- if icu != None and len(icu.bezierPoints) > 0: # if curve exists and has BezTriple points
- val = icu[2.5] # get the curve's value at time 2.5
- icu[Ipo.OB_LOCX] = None # delete the ipo curve
-
+ from Blender import Ipo
+
+ ob = Ipo.Get('ObIpo') # retrieves an Ipo object
+ ob.name = 'ipo1' # change the Ipo's name
+ icu = ipo[Ipo.OB_LOCX] # request X Location Ipo curve object
+ if icu != None and len(icu.bezierPoints) > 0: # if curve exists and has BezTriple points
+ val = icu[2.5] # get the curve's value at time 2.5
+ icu[Ipo.OB_LOCX] = None # delete the ipo curve
+
Each type of Ipo has different types Ipocurves. With the exception of Shape
Key Ipos, constants are used to specify all Ipocurves. There are two ways
to tell which Ipo curves go with which Ipo type:
- - all constants start with a two-character identifier for their Ipo type;
- for example, "OB_LOCX" is the LocX curve for an Object Ipo
- - each Ipo now has a read-only attribute L{Ipo.curveConsts}, which returns
- the valid Ipo curve types for that specific Ipo
+ - all constants start with a two-character identifier for their Ipo type;
+ for example, "OB_LOCX" is the LocX curve for an Object Ipo
+ - each Ipo now has a read-only attribute L{Ipo.curveConsts}, which returns
+ the valid Ipo curve types for that specific Ipo
The valid IpoCurve constants are:
- 1. Material Ipo: MA_R, MA_G, MA_B, MA_SPECR, MA_SPECG, MA_SPECB,
- MA_MIRR, MA_MIRG, MA_MIRB, MA_REF, MA_ALPHA, MA_EMIT, MA_AMB,
- MA_SPEC, MA_HARD, MA_SPTRA, MA_IOR, MA_MODE, MA_HASIZE, MA_TRANSLU,
- MA_RAYMIR, MA_FRESMIR, MA_FRESMIRI, MA_FRESTRA, MA_FRESTRAI,
- MA_TRAGLOW, MA_OFSX, MA_OFSY, MA_OFSZ, MA_SIZEX, MA_SIZEY, MA_SIZEZ,
- MA_TEXR, MA_TEXG, MA_TEXB, MA_DEFVAR, MA_COL, MA_NOR, MA_VAR, MA_DISP
- 2. Lamp Ipo: LA_ENERG, LA_R, LA_G, LA_B, LA_DIST, LA_SPOSI, LA_SPOBL,
- LA_QUAD1, LA_QUAD2, LA_HAINT, LA_OFSX, LA_OFSY, LA_OFSZ, LA_SIZEX,
- LA_SIZEY, LA_SIZEZ, LA_TEXR, LA_TEXG, LA_TEXB, LA_DEFVAR, LA_COL
- 3. World Ipo: WO_HORR, WO_HORG, WO_HORB, WO_ZENR, WO_ZENG, WO_ZENB,
- WO_EXPOS, WO_MISI, WO_MISDI, WO_MISSTA, WO_MISHI, WO_STARR,
- WO_STARB, WO_STARG, WO_STARDI, WO_STARSI, WO_OFSX, WO_OFSY,
- WO_OFSZ, WO_SIZEX, WO_SIZEY, WO_SIZEZ, WO_TEXR, WO_TEXG,
- WO_TEXB, WO_DEFVAR, WO_COL, WO_NOR, WO_VAR
- 4. Camera Ipo: CA_LENS, CA_CLSTA, CA_CLEND, CA_APERT, CA_FDIST
- 5. Object Ipo: OB_LOCX, OB_LOCY, OB_LOCZ, OB_DLOCX, OB_DLOCY, OB_DLOCZ,
- OB_ROTX, OB_ROTY, OB_ROTZ, OB_DROTX, OB_DROTY, OB_DROTZ,
- OB_SIZEX, OB_SIZEY, OB_SIZEZ, OB_DSIZEX, OB_DSIZEY, OB_DSIZEZ,
- OB_LAYER, OB_TIME, OB_COLR, OB_COLG, OB_COLB, OB_COLA,
- OB_FSTRENG, OB_FFALL, OB_RDAMP, OB_DAMPING, OB_PERM
- 6. Curve Ipo: CU_SPEED
- 7. Constraint Ipo: CO_INF
- 8. Texture Ipo: TE_NSIZE, TE_NDEPTH, TE_NTYPE, TE_TURB, TE_VNW1, TE_VNW2,
- TE_VNW3, TE_VNW4, TE_MINKMEXP, TE_DISTM, TE_COLT, TE_ISCALE,
- TE_DISTA, TE_MGTYPE, TE_MGH, TE_LACU, TE_OCT, TE_MGOFF,
- TE_MGGAIN, TE_NBASE1, TE_NBASE2, TE_COLR, TE_COLG, TE_COLB,
- TE_BRIGHT, TE_CONTRAS
- 9. Pose/Action Ipo: PO_LOCX, PO_LOCY, PO_LOCZ, PO_SIZEX, PO_SIZEY,
- PO_SIZEZ, PO_QUATW, PO_QUATX, PO_QUATY, PO_QUATZ
- 10. Sequence Ipo: SQ_FAC
+ 1. Material Ipo: MA_R, MA_G, MA_B, MA_SPECR, MA_SPECG, MA_SPECB,
+ MA_MIRR, MA_MIRG, MA_MIRB, MA_REF, MA_ALPHA, MA_EMIT, MA_AMB,
+ MA_SPEC, MA_HARD, MA_SPTRA, MA_IOR, MA_MODE, MA_HASIZE, MA_TRANSLU,
+ MA_RAYMIR, MA_FRESMIR, MA_FRESMIRI, MA_FRESTRA, MA_FRESTRAI,
+ MA_TRAGLOW, MA_OFSX, MA_OFSY, MA_OFSZ, MA_SIZEX, MA_SIZEY, MA_SIZEZ,
+ MA_TEXR, MA_TEXG, MA_TEXB, MA_DEFVAR, MA_COL, MA_NOR, MA_VAR, MA_DISP
+ 2. Lamp Ipo: LA_ENERG, LA_R, LA_G, LA_B, LA_DIST, LA_SPOSI, LA_SPOBL,
+ LA_QUAD1, LA_QUAD2, LA_HAINT, LA_OFSX, LA_OFSY, LA_OFSZ, LA_SIZEX,
+ LA_SIZEY, LA_SIZEZ, LA_TEXR, LA_TEXG, LA_TEXB, LA_DEFVAR, LA_COL
+ 3. World Ipo: WO_HORR, WO_HORG, WO_HORB, WO_ZENR, WO_ZENG, WO_ZENB,
+ WO_EXPOS, WO_MISI, WO_MISDI, WO_MISSTA, WO_MISHI, WO_STARR,
+ WO_STARB, WO_STARG, WO_STARDI, WO_STARSI, WO_OFSX, WO_OFSY,
+ WO_OFSZ, WO_SIZEX, WO_SIZEY, WO_SIZEZ, WO_TEXR, WO_TEXG,
+ WO_TEXB, WO_DEFVAR, WO_COL, WO_NOR, WO_VAR
+ 4. Camera Ipo: CA_LENS, CA_CLSTA, CA_CLEND, CA_APERT, CA_FDIST
+ 5. Object Ipo: OB_LOCX, OB_LOCY, OB_LOCZ, OB_DLOCX, OB_DLOCY, OB_DLOCZ,
+ OB_ROTX, OB_ROTY, OB_ROTZ, OB_DROTX, OB_DROTY, OB_DROTZ,
+ OB_SIZEX, OB_SIZEY, OB_SIZEZ, OB_DSIZEX, OB_DSIZEY, OB_DSIZEZ,
+ OB_LAYER, OB_TIME, OB_COLR, OB_COLG, OB_COLB, OB_COLA,
+ OB_FSTRENG, OB_FFALL, OB_RDAMP, OB_DAMPING, OB_PERM
+ 6. Curve Ipo: CU_SPEED
+ 7. Constraint Ipo: CO_INF
+ 8. Texture Ipo: TE_NSIZE, TE_NDEPTH, TE_NTYPE, TE_TURB, TE_VNW1, TE_VNW2,
+ TE_VNW3, TE_VNW4, TE_MINKMEXP, TE_DISTM, TE_COLT, TE_ISCALE,
+ TE_DISTA, TE_MGTYPE, TE_MGH, TE_LACU, TE_OCT, TE_MGOFF,
+ TE_MGGAIN, TE_NBASE1, TE_NBASE2, TE_COLR, TE_COLG, TE_COLB,
+ TE_BRIGHT, TE_CONTRAS
+ 9. Pose/Action Ipo: PO_LOCX, PO_LOCY, PO_LOCZ, PO_SIZEX, PO_SIZEY,
+ PO_SIZEZ, PO_QUATW, PO_QUATX, PO_QUATY, PO_QUATZ
+ 10. Sequence Ipo: SQ_FAC
Shape Key Ipos are handled differently from other Ipos. The user can rename
the curves, so string are used to access them instead of constants. The
@@ -68,371 +68,370 @@ key names.
"""
def New (type, name):
- """
- Creates a new Ipo.
- @type type: string
- @type name: string
- @param type: The Ipo's blocktype. Depends on the object the Ipo will be
- linked to. Currently supported types are Object, Camera, World,
- Material, Texture, Lamp, Action, Constraint, Sequence, Curve, Key.
- @param name: The name for this Ipo.
- @rtype: Blender Ipo
- @return: The created Ipo.
- """
+ """
+ Creates a new Ipo.
+ @type type: string
+ @type name: string
+ @param type: The Ipo's blocktype. Depends on the object the Ipo will be
+ linked to. Currently supported types are Object, Camera, World,
+ Material, Texture, Lamp, Action, Constraint, Sequence, Curve, Key.
+ @param name: The name for this Ipo.
+ @rtype: Blender Ipo
+ @return: The created Ipo.
+ """
def Get (name = None):
- """
- Get the Ipo from Blender.
- @type name: string
- @param name: The name of the requested Ipo, or nothing.
- @rtype: Blender Ipo or a list of Blender Ipos
- @return: It depends on the 'name' parameter:
- - (name): The Ipo with the given name;
- - (): A list with all Ipos in the current scene.
- """
+ """
+ Get the Ipo from Blender.
+ @type name: string
+ @param name: The name of the requested Ipo, or nothing.
+ @rtype: Blender Ipo or a list of Blender Ipos
+ @return: It depends on the 'name' parameter:
+ - (name): The Ipo with the given name;
+ - (): A list with all Ipos in the current scene.
+ """
class Ipo:
- """
- The Ipo object
- ==============
- This object gives access to Ipo data from all objects in Blender.
- @Note: Blender Materials, Lamps and Worlds have I{texture channels} which
- allow the user to assign textures to them. The Blender Ipo Window allows
- the user to access the IpoCurves for these channels by specifying a number
- between 0 and 9 (the number appears next to the Ipo type in the window
- header). Prior to Version 2.42, the BPy API did not allow users to access
- these texture channels in a predictable manner. A new attribute named
- L{channel} was added to the API in Version 2.42 to correct this problem.
-
- The current channel setting has an effect on the operators B{[]}, B{len()}
- and others. For example, suppose a Material has three IpoCurves
- (R, G, and B), and two texture channels (numbered 0 and 1), and furthermore
- channel 0 has one Ipocurve (Col). The IpoCurve Col can only be
- "seen" through the API when B{ipo.channel} is 0. Setting B{ipo.channel} to
- 1 will cause this curve to be ignored by B{len(ipo)}::
-
- from Blender import Ipo
-
- ipo = Ipo.Get('MatIpo')
- for channel in xrange(2):
- ipo.channel = channel
- print 'channel is',channel
- print ' len is',len(ipo)
- names = dict([(x[1],x[0]) for x in ipo.curveConsts.items()])
- for curve in [Ipo.MA_R,Ipo.MA_COL]:
- print ' ',names[curve],'is',curve in ipo
-
- will output::
- channel is 0
- len is 4
- MA_R is True
- MA_COL is True
- channel is 1
- len is 3
- MA_R is True
- MA_COL is False
-
- @ivar name: The Ipo datablock's name
- @type name: string
- @ivar curves: Ipo curves currently defined for the Ipo.
- @type curves: list of Ipocurves.
- @ivar curveConsts: The valid Ipo curves for this Ipo. These can be used
- by the [] mapping operator. The value
- depends on the Ipo curve type. If the Ipo is any type other than a Key or
- Shape Ipo, this attribute returns a set of constants that can be
- used to specify a particular curve. For Key or Shape Ipos, the attribute
- returns a list of all defined keys by name.
- @type curveConsts: constant or list of strings. Read-only.
- @ivar channel: the current texture channel for Blender object which support
- textures (materials, lamps and worlds). Returns None if the Ipo does
- not support texture channels. Value must be in the range [0,9].
- @type channel: int or None
- """
-
- def __contains__():
- """
- The "in" operator for Ipos. It returns B{True} if the specified
- IpoCurve exists for the Ipo. This operator B{should not} be used to
- test for whether a curve constant is valid for a particular Ipo type.
- Many constants for different Ipo types have the same value, and it is
- the constant's value used internally.
- No exceptions are raised if the argument is not a valid curve constant or
- or string, nor does the operator return B{True} when the curve
- constant is valid but does not currently exist. As such, it should only be
- used to test for specific curves when the Ipo type is known::
- ipo = Object.Get('Cube').ipo # get Object-type Ipo
- if ipo:
- print Ipo.OB_LOCX in ipo # prints "True" if 'LocX' curve exists
- print Ipo.MA_R in ipo # also prints "True" since MA_R and OB_LOCX are have the same value
- print 'hiccup' in ipo # always prints "False" since argument is not a constant
-
- @return: see above.
- @rtype: Boolean
- """
-
- def __getitem__():
- """
- This operator is similar to the Python dictionary mapping operator [],
- except that the user cannot assign arbitrary keys. Each Ipo type has
- a pre-defined set of IpoCurves which may or may not exist at a given time. This operator
- will either return an IpoCurve object if the specified curve exists,
- return None if the curve does not exists, or throws a KeyError exception
- if the curve is not valid for this Ipo type.
- @return: an IpoCurve object if it exists
- @rtype: IpoCurve or None
- @raise KeyError: an undefined IpoCurve was specified for the Ipo
- """
-
- def __iter__():
- """
- Iterator for Ipos. It returns all the defined IpoCurve objects associated
- with the Ipo. For example::
- from Blender import Ipo
-
- ipo = Ipo.Get()
- if len(ipo) > 0:
- ipo = ipo[0]
- print 'ipo name is',ipo.name
- for icu in ipo:
- print ' curve name is',icu.name
- might result in::
- ipo name is ObIpo
- curve name is LocX
- curve name is LocY
- curve name is LocZ
-
- @return: an IpoCurve object
- @rtype: IpoCurve
- """
-
- def __len__():
- """
- Returns the number of curves defined for the Ipo.
- @return: number of defined IpoCurves
- @rtype: int
- """
-
- def getName():
- """
- Gets the name of the Ipo (B{deprecated}). See the L{name} attribute.
- @rtype: string
- @return: the name of the Ipo.
- """
-
- def setName(newname):
- """
- Sets the name of the Ipo (B{deprecated}). See the L{name} attribute.
- @type newname: string
- @rtype: None
- @return: None
- """
-
- def getCurves():
- """
- Gets all the IpoCurves of the Ipo (B{deprecated}). Use the
- L{iterator operator []<__iter__>} instead.
- @rtype: list of IpoCurves
- @return: A list (possibly empty) containing all the IpoCurves associated
- to the Ipo object.
- """
-
- def getCurve(curve):
- """
- Return the specified IpoCurve (B{deprecated}). Use the L{mapping
- operator B{[]}<__getitem__>} instead.
- If the curve does not exist in the Ipo,
- None is returned. I{curve} can be either a string or an integer,
- denoting either the name of the Ipo curve or its internal adrcode.
- The possible Ipo curve names are:
-
- 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
- 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
- Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
- RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
- OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
- Disp.
- 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
- dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ,
- Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
- RDamp, Perm.
- 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
- SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
- SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
- 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
- MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
- MgOff, MgGain, NBase1, NBase2.
- 7. Curve Ipo: Speed.
- 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
- QuatZ, QuatW.
- 9. Sequence Ipo: Fac.
- 10. Constraint Ipo: Inf.
-
- The adrcode for the Ipo curve can also be given; this is useful for
- accessing curves for Shape Key Ipos. The adrcodes for Shape Key Ipo are
- numbered consecutively starting at 0.
- @type curve : string or int
- @rtype: IpoCurve object
- @return: the corresponding IpoCurve, or None.
- @raise ValueError: I{curve} is not a valid name or adrcode for this Ipo
- type.
- """
-
- def addCurve(curvename):
- """
- Add a new curve to the Ipo object. The possible values for I{curvename} are:
- 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
- 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
- Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
- RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
- OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
- Disp.
- 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
- dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ,
- Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
- RDamp, Perm.
- 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
- SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
- 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
- MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
- SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
- 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
- MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
- MgOff, MgGain, NBase1, NBase2.
- 7. Curve Ipo: Speed.
- 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
- QuatZ, QuatW.
- 9. Sequence Ipo: Fac.
- 10. Constraint Ipo: Inf.
-
- For Key IPOs, the name must be an existing KeyBlock name. Use
- L{curveConsts} to determine the set of valid names.
-
- @type curvename : string
- @rtype: IpoCurve object
- @return: the corresponding IpoCurve, or None.
- @raise ValueError: I{curvename} is not valid or already exists
- """
-
- def delCurve(curvename):
- """
- Delete an existing curve from the Ipo object (B{deprecated}).
- Use the L{mapping operator B{[]}<__getitem__>} instead::
- from Blender import Ipo
-
- ipo = Ipo.Get('ObIpo')
- ipo[Ipo.LOCX] = None
-
- @type curvename : string
- @rtype: None
- @return: None.
- """
-
- def getBlocktype():
- """
- Gets the blocktype of the Ipo.
- @rtype: int
- @return: the blocktype of the Ipo.
- """
-
- def setBlocktype(newblocktype):
- """
- Sets the blocktype of the Ipo.
- @type newblocktype: int
- @rtype: None
- @return: None
- @warn: 'newblocktype' should not be changed unless you really know what
- you are doing ...
- """
-
- def getRctf():
- """
- Gets the rctf of the Ipo.
- Kind of bounding box...
- @rtype: list of floats
- @return: the rctf of the Ipo.
- """
-
- def setRctf(newrctf):
- """
- Sets the rctf of the Ipo.
- @type newrctf: four floats.
- @rtype: None
- @return: None
- @warn: rctf should not be changed unless you really know what you are
- doing ...
- """
-
- def getNcurves():
- """
- Gets the number of curves of the Ipo (B{deprecated}). Use
- L{len(ipo)<__len__>} instead.
- @rtype: int
- @return: the number of curve of the Ipo.
- """
-
- def getCurveBP(curvepos):
- """
- This method is unsupported. BPoint Ipo curves are not implemented.
- Calling this method throws a NotImplementedError exception.
- @raise NotImplementedError: this method B{always} raises an exception
- """
-
- def getBeztriple(curvepos,pointpos):
- """
- Gets a beztriple of the Ipo (B{deprecated}). B{Note}:
- Use L{IpoCurve.bezierPoints<IpoCurve.IpoCurve.bezierPoints>} instead.
- @type curvepos: int
- @param curvepos: the position of the curve in the Ipo.
- @type pointpos: int
- @param pointpos: the position of the point in the curve.
- @rtype: list of 9 floats
- @return: the beztriple of the Ipo, or an error is raised.
- """
-
- def setBeztriple(curvepos,pointpos,newbeztriple):
- """
- Sets the beztriple of the Ipo (B{deprecated}). B{Note}: use
- L{IpoCurve.bezierPoints<IpoCurve.IpoCurve.bezierPoints>} to get a
- BezTriple point, then use the
- L{BezTriple} API to set the point's attributes.
- @type curvepos: int
- @param curvepos: the position of the curve in the Ipo.
- @type pointpos: int
- @param pointpos: the position of the point in the curve.
- @type newbeztriple: list of 9 floats
- @param newbeztriple: the new value for the point
- @rtype: None
- @return: None
- """
-
- def getCurveCurval(curvepos):
- """
- Gets the current value of a curve of the Ipo (B{deprecated}). B{Note}:
- new scripts should use L{IpoCurve.evaluate()<IpoCurve.IpoCurve.evaluate>}.
- @type curvepos: int or string
- @param curvepos: the position of the curve in the Ipo or the name of the
- curve
- @rtype: float
- @return: the current value of the selected curve of the Ipo.
- """
-
- def EvaluateCurveOn(curvepos,time):
- """
- Gets the value at a specific time of a curve of the Ipo (B{deprecated}).
- B{Note}: new scripts should use
- L{IpoCurve.evaluate()<IpoCurve.IpoCurve.evaluate>}.
- @type curvepos: int
- @param curvepos: the position of the curve in the Ipo.
- @type time: float
- @param time: the desired time.
- @rtype: float
- @return: the current value of the selected curve of the Ipo at the given
- time.
- """
-
+ """
+ The Ipo object
+ ==============
+ This object gives access to Ipo data from all objects in Blender.
+ @Note: Blender Materials, Lamps and Worlds have I{texture channels} which
+ allow the user to assign textures to them. The Blender Ipo Window allows
+ the user to access the IpoCurves for these channels by specifying a number
+ between 0 and 9 (the number appears next to the Ipo type in the window
+ header). Prior to Version 2.42, the BPy API did not allow users to access
+ these texture channels in a predictable manner. A new attribute named
+ L{channel} was added to the API in Version 2.42 to correct this problem.
+
+ The current channel setting has an effect on the operators B{[]}, B{len()}
+ and others. For example, suppose a Material has three IpoCurves
+ (R, G, and B), and two texture channels (numbered 0 and 1), and furthermore
+ channel 0 has one Ipocurve (Col). The IpoCurve Col can only be
+ "seen" through the API when B{ipo.channel} is 0. Setting B{ipo.channel} to
+ 1 will cause this curve to be ignored by B{len(ipo)}::
+
+ from Blender import Ipo
+
+ ipo = Ipo.Get('MatIpo')
+ for channel in xrange(2):
+ ipo.channel = channel
+ print 'channel is',channel
+ print ' len is',len(ipo)
+ names = dict([(x[1],x[0]) for x in ipo.curveConsts.items()])
+ for curve in [Ipo.MA_R,Ipo.MA_COL]:
+ print ' ',names[curve],'is',curve in ipo
+
+ will output::
+ channel is 0
+ len is 4
+ MA_R is True
+ MA_COL is True
+ channel is 1
+ len is 3
+ MA_R is True
+ MA_COL is False
+
+ @ivar curves: Ipo curves currently defined for the Ipo.
+ @type curves: list of Ipocurves.
+ @ivar curveConsts: The valid Ipo curves for this Ipo. These can be used
+ by the [] mapping operator. The value
+ depends on the Ipo curve type. If the Ipo is any type other than a Key or
+ Shape Ipo, this attribute returns a set of constants that can be
+ used to specify a particular curve. For Key or Shape Ipos, the attribute
+ returns a list of all defined keys by name.
+ @type curveConsts: constant or list of strings. Read-only.
+ @ivar channel: the current texture channel for Blender object which support
+ textures (materials, lamps and worlds). Returns None if the Ipo does
+ not support texture channels. Value must be in the range [0,9].
+ @type channel: int or None
+ """
+
+ def __contains__():
+ """
+ The "in" operator for Ipos. It returns B{True} if the specified
+ IpoCurve exists for the Ipo. This operator B{should not} be used to
+ test for whether a curve constant is valid for a particular Ipo type.
+ Many constants for different Ipo types have the same value, and it is
+ the constant's value used internally.
+ No exceptions are raised if the argument is not a valid curve constant or
+ or string, nor does the operator return B{True} when the curve
+ constant is valid but does not currently exist. As such, it should only be
+ used to test for specific curves when the Ipo type is known::
+ ipo = Object.Get('Cube').ipo # get Object-type Ipo
+ if ipo:
+ print Ipo.OB_LOCX in ipo # prints "True" if 'LocX' curve exists
+ print Ipo.MA_R in ipo # also prints "True" since MA_R and OB_LOCX are have the same value
+ print 'hiccup' in ipo # always prints "False" since argument is not a constant
+
+ @return: see above.
+ @rtype: Boolean
+ """
+
+ def __getitem__():
+ """
+ This operator is similar to the Python dictionary mapping operator [],
+ except that the user cannot assign arbitrary keys. Each Ipo type has
+ a pre-defined set of IpoCurves which may or may not exist at a given time. This operator
+ will either return an IpoCurve object if the specified curve exists,
+ return None if the curve does not exists, or throws a KeyError exception
+ if the curve is not valid for this Ipo type.
+ @return: an IpoCurve object if it exists
+ @rtype: IpoCurve or None
+ @raise KeyError: an undefined IpoCurve was specified for the Ipo
+ """
+
+ def __iter__():
+ """
+ Iterator for Ipos. It returns all the defined IpoCurve objects associated
+ with the Ipo. For example::
+ from Blender import Ipo
+
+ ipo = Ipo.Get()
+ if len(ipo) > 0:
+ ipo = ipo[0]
+ print 'ipo name is',ipo.name
+ for icu in ipo:
+ print ' curve name is',icu.name
+ might result in::
+ ipo name is ObIpo
+ curve name is LocX
+ curve name is LocY
+ curve name is LocZ
+
+ @return: an IpoCurve object
+ @rtype: IpoCurve
+ """
+
+ def __len__():
+ """
+ Returns the number of curves defined for the Ipo.
+ @return: number of defined IpoCurves
+ @rtype: int
+ """
+
+ def getName():
+ """
+ Gets the name of the Ipo (B{deprecated}). See the L{name} attribute.
+ @rtype: string
+ @return: the name of the Ipo.
+ """
+
+ def setName(newname):
+ """
+ Sets the name of the Ipo (B{deprecated}). See the L{name} attribute.
+ @type newname: string
+ @rtype: None
+ @return: None
+ """
+
+ def getCurves():
+ """
+ Gets all the IpoCurves of the Ipo (B{deprecated}). Use the
+ L{iterator operator []<__iter__>} instead.
+ @rtype: list of IpoCurves
+ @return: A list (possibly empty) containing all the IpoCurves associated
+ to the Ipo object.
+ """
+
+ def getCurve(curve):
+ """
+ Return the specified IpoCurve (B{deprecated}). Use the L{mapping
+ operator B{[]}<__getitem__>} instead.
+ If the curve does not exist in the Ipo,
+ None is returned. I{curve} can be either a string or an integer,
+ denoting either the name of the Ipo curve or its internal adrcode.
+ The possible Ipo curve names are:
+
+ 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
+ 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
+ Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
+ RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
+ OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
+ Disp.
+ 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
+ dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ,
+ Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
+ RDamp, Perm.
+ 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
+ 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
+ MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
+ SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
+ 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
+ MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
+ SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
+ 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
+ MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
+ MgOff, MgGain, NBase1, NBase2.
+ 7. Curve Ipo: Speed.
+ 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
+ QuatZ, QuatW.
+ 9. Sequence Ipo: Fac.
+ 10. Constraint Ipo: Inf.
+
+ The adrcode for the Ipo curve can also be given; this is useful for
+ accessing curves for Shape Key Ipos. The adrcodes for Shape Key Ipo are
+ numbered consecutively starting at 0.
+ @type curve : string or int
+ @rtype: IpoCurve object
+ @return: the corresponding IpoCurve, or None.
+ @raise ValueError: I{curve} is not a valid name or adrcode for this Ipo
+ type.
+ """
+
+ def addCurve(curvename):
+ """
+ Add a new curve to the Ipo object. The possible values for I{curvename} are:
+ 1. Camera Ipo: Lens, ClSta, ClEnd, Apert, FDist.
+ 2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref,
+ Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu,
+ RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY,
+ OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var,
+ Disp.
+ 3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ,
+ dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ,
+ Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping,
+ RDamp, Perm.
+ 4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt.
+ 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
+ MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ,
+ SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var.
+ 5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi,
+ MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i
+ SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var.
+ 6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4,
+ MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct,
+ MgOff, MgGain, NBase1, NBase2.
+ 7. Curve Ipo: Speed.
+ 8. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY,
+ QuatZ, QuatW.
+ 9. Sequence Ipo: Fac.
+ 10. Constraint Ipo: Inf.
+
+ For Key IPOs, the name must be an existing KeyBlock name. Use
+ L{curveConsts} to determine the set of valid names.
+
+ @type curvename : string
+ @rtype: IpoCurve object
+ @return: the corresponding IpoCurve, or None.
+ @raise ValueError: I{curvename} is not valid or already exists
+ """
+
+ def delCurve(curvename):
+ """
+ Delete an existing curve from the Ipo object (B{deprecated}).
+ Use the L{mapping operator B{[]}<__getitem__>} instead::
+ from Blender import Ipo
+
+ ipo = Ipo.Get('ObIpo')
+ ipo[Ipo.LOCX] = None
+
+ @type curvename : string
+ @rtype: None
+ @return: None.
+ """
+
+ def getBlocktype():
+ """
+ Gets the blocktype of the Ipo.
+ @rtype: int
+ @return: the blocktype of the Ipo.
+ """
+
+ def setBlocktype(newblocktype):
+ """
+ Sets the blocktype of the Ipo.
+ @type newblocktype: int
+ @rtype: None
+ @return: None
+ @warn: 'newblocktype' should not be changed unless you really know what
+ you are doing ...
+ """
+
+ def getRctf():
+ """
+ Gets the rctf of the Ipo.
+ Kind of bounding box...
+ @rtype: list of floats
+ @return: the rctf of the Ipo.
+ """
+
+ def setRctf(newrctf):
+ """
+ Sets the rctf of the Ipo.
+ @type newrctf: four floats.
+ @rtype: None
+ @return: None
+ @warn: rctf should not be changed unless you really know what you are
+ doing ...
+ """
+
+ def getNcurves():
+ """
+ Gets the number of curves of the Ipo (B{deprecated}). Use
+ L{len(ipo)<__len__>} instead.
+ @rtype: int
+ @return: the number of curve of the Ipo.
+ """
+
+ def getCurveBP(curvepos):
+ """
+ This method is unsupported. BPoint Ipo curves are not implemented.
+ Calling this method throws a NotImplementedError exception.
+ @raise NotImplementedError: this method B{always} raises an exception
+ """
+
+ def getBeztriple(curvepos,pointpos):
+ """
+ Gets a beztriple of the Ipo (B{deprecated}). B{Note}:
+ Use L{IpoCurve.bezierPoints<IpoCurve.IpoCurve.bezierPoints>} instead.
+ @type curvepos: int
+ @param curvepos: the position of the curve in the Ipo.
+ @type pointpos: int
+ @param pointpos: the position of the point in the curve.
+ @rtype: list of 9 floats
+ @return: the beztriple of the Ipo, or an error is raised.
+ """
+
+ def setBeztriple(curvepos,pointpos,newbeztriple):
+ """
+ Sets the beztriple of the Ipo (B{deprecated}). B{Note}: use
+ L{IpoCurve.bezierPoints<IpoCurve.IpoCurve.bezierPoints>} to get a
+ BezTriple point, then use the
+ L{BezTriple} API to set the point's attributes.
+ @type curvepos: int
+ @param curvepos: the position of the curve in the Ipo.
+ @type pointpos: int
+ @param pointpos: the position of the point in the curve.
+ @type newbeztriple: list of 9 floats
+ @param newbeztriple: the new value for the point
+ @rtype: None
+ @return: None
+ """
+
+ def getCurveCurval(curvepos):
+ """
+ Gets the current value of a curve of the Ipo (B{deprecated}). B{Note}:
+ new scripts should use L{IpoCurve.evaluate()<IpoCurve.IpoCurve.evaluate>}.
+ @type curvepos: int or string
+ @param curvepos: the position of the curve in the Ipo or the name of the
+ curve
+ @rtype: float
+ @return: the current value of the selected curve of the Ipo.
+ """
+
+ def EvaluateCurveOn(curvepos,time):
+ """
+ Gets the value at a specific time of a curve of the Ipo (B{deprecated}).
+ B{Note}: new scripts should use
+ L{IpoCurve.evaluate()<IpoCurve.IpoCurve.evaluate>}.
+ @type curvepos: int
+ @param curvepos: the position of the curve in the Ipo.
+ @type time: float
+ @param time: the desired time.
+ @rtype: float
+ @return: the current value of the selected curve of the Ipo at the given
+ time.
+ """
+import id_generics
+Ipo.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Key.py b/source/blender/python/api2_2x/doc/Key.py
index d3dddc104ce..584a7f066b1 100644
--- a/source/blender/python/api2_2x/doc/Key.py
+++ b/source/blender/python/api2_2x/doc/Key.py
@@ -8,97 +8,97 @@ This module provides access to B{Key} objects in Blender.
@type Types: readonly dictionary
@var Types: The type of a key owner, indicating the type of data in the
data blocks.
- - MESH - the key is a Mesh key; data blocks contain
- L{NMVert<NMesh.NMVert>} vertices.
- - CURVE - the key is a Curve key; data blocks contains either
- L{BezTriples<BezTriple.BezTriple>} or points (represented by a list of
- 3 floating point numbers).
- - LATTICE - the key is a Lattice key; data blocks contain
- BPoints, each point represented by a list of 3 floating point numbers.
+ - MESH - the key is a Mesh key; data blocks contain
+ L{NMVert<NMesh.NMVert>} vertices.
+ - CURVE - the key is a Curve key; data blocks contains either
+ L{BezTriples<BezTriple.BezTriple>} or points (represented by a list of
+ 3 floating point numbers).
+ - LATTICE - the key is a Lattice key; data blocks contain
+ BPoints, each point represented by a list of 3 floating point numbers.
"""
def Get(name = None):
- """
- Get the named Key object from Blender. If the name is omitted, it
- will retrieve a list of all keys in Blender.
- @type name: string
- @param name: the name of the requested key
- @return: If name was given, return that Key object (or None if not
- found). If a name was not given, return a list of every Key object
- in Blender.
- """
+ """
+ Get the named Key object from Blender. If the name is omitted, it
+ will retrieve a list of all keys in Blender.
+ @type name: string
+ @param name: the name of the requested key
+ @return: If name was given, return that Key object (or None if not
+ found). If a name was not given, return a list of every Key object
+ in Blender.
+ """
class Key:
- """
- The Key object
- ==============
- An object with keyframes (L{Lattice}, L{NMesh} or
- L{Curve}) will contain a Key object representing the
- keyframe data.
-
- @ivar ipo: Key Ipo. Contains the Ipo if one is assigned to the
- object, B{None} otherwise. Setting to B{None} clears the current Ipo.
- @type ipo: Blender Ipo
- @ivar value: The value of the key. Read-only.
- @type value: float
- @ivar type: An integer from the L{Types} dictionary
- representing the Key type. Read-only.
- @type type: int
- @ivar blocks: A list of KeyBlocks for the key. Read-only.
- @type blocks: Blender KeyBlock.
- @ivar relative: Indicates whether the key is relative(=True) or normal.
- @type relative: bool
- """
+ """
+ The Key object
+ ==============
+ An object with keyframes (L{Lattice}, L{NMesh} or
+ L{Curve}) will contain a Key object representing the
+ keyframe data.
+
+ @ivar ipo: Key Ipo. Contains the Ipo if one is assigned to the
+ object, B{None} otherwise. Setting to B{None} clears the current Ipo.
+ @type ipo: Blender Ipo
+ @ivar value: The value of the key. Read-only.
+ @type value: float
+ @ivar type: An integer from the L{Types} dictionary
+ representing the Key type. Read-only.
+ @type type: int
+ @ivar blocks: A list of KeyBlocks for the key. Read-only.
+ @type blocks: Blender KeyBlock.
+ @ivar relative: Indicates whether the key is relative(=True) or normal.
+ @type relative: bool
+ """
- def getIpo():
- """
- Get the L{Ipo} object associated with this key.
- """
- def getBlocks():
- """
- Get a list of L{KeyBlock}s, containing the keyframes defined for
- this Key.
- """
+ def getIpo():
+ """
+ Get the L{Ipo} object associated with this key.
+ """
+ def getBlocks():
+ """
+ Get a list of L{KeyBlock}s, containing the keyframes defined for
+ this Key.
+ """
class KeyBlock:
- """
- The KeyBlock object
- ===================
- Each Key object has a list of KeyBlocks attached, each KeyBlock
- representing a keyframe.
+ """
+ The KeyBlock object
+ ===================
+ Each Key object has a list of KeyBlocks attached, each KeyBlock
+ representing a keyframe.
- @ivar curval: Current value of the corresponding IpoCurve. Read-only.
- @type curval: float
- @ivar name: The name of the Keyblock. Truncated to 32 characters.
- @type name: string
- @ivar pos: The position of the keyframe.
- @type pos: float
- @ivar slidermin: The minimum value for the action slider.
- Value is clamped to the range [-10.0,10.0].
- @type slidermin: float
- @ivar slidermax: The maximum value for the action slider.
- Value is clamped to the range [-10.0,10.0].
- @type slidermax: float
- @ivar vgroup: The assigned VGroup for the Key Block.
- @type vgroup: string
- @ivar data: The data of the KeyBlock (see L{getData}). This
- attribute is read-only.
- @type data: varies
- """
+ @ivar curval: Current value of the corresponding IpoCurve. Read-only.
+ @type curval: float
+ @ivar name: The name of the Keyblock. Truncated to 32 characters.
+ @type name: string
+ @ivar pos: The position of the keyframe.
+ @type pos: float
+ @ivar slidermin: The minimum value for the action slider.
+ Value is clamped to the range [-10.0,10.0].
+ @type slidermin: float
+ @ivar slidermax: The maximum value for the action slider.
+ Value is clamped to the range [-10.0,10.0].
+ @type slidermax: float
+ @ivar vgroup: The assigned VGroup for the Key Block.
+ @type vgroup: string
+ @ivar data: The data of the KeyBlock (see L{getData}). This
+ attribute is read-only.
+ @type data: varies
+ """
- def getData():
- """
- Get the data of a KeyBlock, as a list of data items. Each item
- will have a different data type depending on the type of this
- Key.
- - Mesh keys have a list of L{NMVert<NMesh.NMVert>} objects in the data
- block.
- - Lattice keys have a list of BPoints in the data block. These
- don't have corresponding Python objects yet, so each BPoint is
- represented using a list of three floating-point numbers (the
- coordinate for each lattice vertex).
- - Curve keys return either a list of L{BezTriple<BezTriple.BezTriple>}
- objects in the data if the curve is a Bezier curve, otherwise it
- returns lists of three floats for each NURB or poly coordinate.
- """
+ def getData():
+ """
+ Get the data of a KeyBlock, as a list of data items. Each item
+ will have a different data type depending on the type of this
+ Key.
+ - Mesh keys have a list of L{NMVert<NMesh.NMVert>} objects in the data
+ block.
+ - Lattice keys have a list of BPoints in the data block. These
+ don't have corresponding Python objects yet, so each BPoint is
+ represented using a list of three floating-point numbers (the
+ coordinate for each lattice vertex).
+ - Curve keys return either a list of L{BezTriple<BezTriple.BezTriple>}
+ objects in the data if the curve is a Bezier curve, otherwise it
+ returns lists of three floats for each NURB or poly coordinate.
+ """
diff --git a/source/blender/python/api2_2x/doc/Lamp.py b/source/blender/python/api2_2x/doc/Lamp.py
index 865cf7a152f..b65fe253530 100644
--- a/source/blender/python/api2_2x/doc/Lamp.py
+++ b/source/blender/python/api2_2x/doc/Lamp.py
@@ -12,511 +12,510 @@ This module provides control over B{Lamp Data} objects in Blender.
Example::
- from Blender import Lamp, Scene
- l = Lamp.New('Spot') # create new 'Spot' lamp data
- l.setMode('Square', 'Shadow') # set these two lamp mode flags
- scn = Scene.GetCurrent()
- ob = scn.objects.new(l)
+ from Blender import Lamp, Scene
+ l = Lamp.New('Spot') # create new 'Spot' lamp data
+ l.setMode('Square', 'Shadow') # set these two lamp mode flags
+ scn = Scene.GetCurrent()
+ ob = scn.objects.new(l)
@type Types: read-only dictionary
@var Types: The lamp types.
- - 'Lamp': 0
- - 'Sun' : 1
- - 'Spot': 2
- - 'Hemi': 3
- - 'Area': 4
- - 'Photon': 5
+ - 'Lamp': 0
+ - 'Sun' : 1
+ - 'Spot': 2
+ - 'Hemi': 3
+ - 'Area': 4
+ - 'Photon': 5
@type Modes: read-only dictionary
@var Modes: The lamp modes. Modes may be ORed together.
- - 'Shadows'
- - 'Halo'
- - 'Layer'
- - 'Quad'
- - 'Negative'
- - 'OnlyShadow'
- - 'Sphere'
- - 'Square'
- - 'NoDiffuse'
- - 'NoSpecular'
- - 'RayShadow'
-
- Example::
- from Blender import Lamp, Object
- # Change the mode of selected lamp objects.
- for ob in Object.GetSelected(): # Loop through the current selection
- if ob.getType() == "Lamp": # if this is a lamp.
- lamp = ob.getData() # get the lamp data.
- if lamp.type == Lamp.Types["Spot"]: # Lamp type is not a flag
- lamp.mode &= ~Lamp.Modes["RayShadow"] # Disable RayShadow.
- lamp.mode |= Lamp.Modes["Shadows"] # Enable Shadowbuffer shadows
+ - 'Shadows'
+ - 'Halo'
+ - 'Layer'
+ - 'Quad'
+ - 'Negative'
+ - 'OnlyShadow'
+ - 'Sphere'
+ - 'Square'
+ - 'NoDiffuse'
+ - 'NoSpecular'
+ - 'RayShadow'
+
+ Example::
+ from Blender import Lamp, Object
+ # Change the mode of selected lamp objects.
+ for ob in Object.GetSelected(): # Loop through the current selection
+ if ob.getType() == "Lamp": # if this is a lamp.
+ lamp = ob.getData() # get the lamp data.
+ if lamp.type == Lamp.Types["Spot"]: # Lamp type is not a flag
+ lamp.mode &= ~Lamp.Modes["RayShadow"] # Disable RayShadow.
+ lamp.mode |= Lamp.Modes["Shadows"] # Enable Shadowbuffer shadows
"""
def New (type = 'Lamp', name = 'LampData'):
- """
- Create a new Lamp Data object.
- @type type: string
- @param type: The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'.
- @type name: string
- @param name: The Lamp Data name.
- @rtype: Blender Lamp
- @return: The created Lamp Data object.
- """
+ """
+ Create a new Lamp Data object.
+ @type type: string
+ @param type: The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'.
+ @type name: string
+ @param name: The Lamp Data name.
+ @rtype: Blender Lamp
+ @return: The created Lamp Data object.
+ """
def Get (name = None):
- """
- Get the Lamp Data object(s) from Blender.
- @type name: string
- @param name: The name of the Lamp Data.
- @rtype: Blender Lamp or a list of Blender Lamps
- @return: It depends on the I{name} parameter:
- - (name): The Lamp Data object with the given I{name};
- - (): A list with all Lamp Data objects in the current scene.
- """
+ """
+ Get the Lamp Data object(s) from Blender.
+ @type name: string
+ @param name: The name of the Lamp Data.
+ @rtype: Blender Lamp or a list of Blender Lamps
+ @return: It depends on the I{name} parameter:
+ - (name): The Lamp Data object with the given I{name};
+ - (): A list with all Lamp Data objects in the current scene.
+ """
class Lamp:
- """
- The Lamp Data object
- ====================
- This object gives access to Lamp-specific data in Blender.
-
- @ivar B: Lamp color blue component.
- Value is clamped to the range [0.0,1.0].
- @type B: float
- @ivar G: Lamp color green component.
- Value is clamped to the range [0.0,1.0].
- @type G: float
- @ivar R: Lamp color red component.
- Value is clamped to the range [0.0,1.0].
- @type R: float
- @ivar bias: Lamp shadow map sampling bias.
- Value is clamped to the range [0.01,5.0].
- @type bias: float
- @ivar bufferSize: Lamp shadow buffer size.
- Value is clamped to the range [512,5120].
- @type bufferSize: int
- @ivar clipEnd: Lamp shadow map clip end.
- Value is clamped to the range [1.0,5000.0].
- @type clipEnd: float
- @ivar clipStart: Lamp shadow map clip start.
- Value is clamped to the range [0.1,1000.0].
- @type clipStart: float
- @ivar col: Lamp RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type col: RGB tuple
- @ivar dist: Lamp clipping distance.
- Value is clamped to the range [0.1,5000.0].
- @type dist: float
- @ivar energy: Lamp light intensity.
- Value is clamped to the range [0.0,10.0].
- @type energy: float
- @ivar haloInt: Lamp spotlight halo intensity.
- Value is clamped to the range [0.0,5.0].
- @type haloInt: float
- @ivar haloStep: Lamp volumetric halo sampling frequency.
- Value is clamped to the range [0,12].
- @type haloStep: int
- @ivar ipo: Lamp Ipo.
- Contains the Ipo if one is assigned to the object, B{None} otherwise. Setting to B{None} clears the current Ipo..
- @type ipo: Blender Ipo
- @ivar mode: Lamp mode bitfield. See L{Modes} for values.
- @type mode: int
- @ivar name: Lamp data name.
- @type name: str
- @ivar quad1: Quad lamp linear distance attenuation.
- Value is clamped to the range [0.0,1.0].
- @type quad1: float
- @ivar quad2: Quad lamp quadratic distance attenuation.
- Value is clamped to the range [0.0,1.0].
- @type quad2: float
- @ivar samples: Lamp shadow map samples.
- Value is clamped to the range [1,16].
- @type samples: int
- @ivar raySamplesX: Lamp raytracing X samples (X is used for the Y axis with square area lamps).
- Value is clamped to the range [1,16].
- @type raySamplesX: int
- @ivar raySamplesY: Lamp raytracing Y samples (Y is only used for rectangle area lamps).
- Value is clamped to the range [1,16].
- @type raySamplesY: int
- @ivar areaSizeX: Lamp X size (X is used for the Y axis with square area lamps)
- Value is clamped to the range [0.01,100.0].
- @type areaSizeX: float
- @ivar areaSizeY: Lamp Y size (Y is only used for rectangle area lamps).
- Value is clamped to the range [0.01,100.0].
- @type areaSizeY: float
- @ivar softness: Lamp shadow sample area size.
- Value is clamped to the range [1.0,100.0].
- @type softness: float
- @ivar spotBlend: Lamp spotlight edge softness.
- Value is clamped to the range [0.0,1.0].
- @type spotBlend: float
- @ivar spotSize: Lamp spotlight beam angle (in degrees).
- Value is clamped to the range [1.0,180.0].
- @type spotSize: float
- @ivar type: Lamp type. See L{Types} for values.
- @type type: int
- @ivar users: Number of lamp users.
- @type users: int
-
- @warning: Most member variables assume values in some [Min, Max] interval.
- When trying to set them, the given parameter will be clamped to lie in
- that range: if val < Min, then val = Min, if val > Max, then val = Max.
- """
-
- def getName():
- """
- Get the name of this Lamp Data object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Lamp Data object.
- @type name: string
- @param name: The new name.
- """
-
- def getType():
- """
- Get this Lamp's type.
- @rtype: int
- """
-
- def setType(type):
- """
- Set this Lamp's type.
- @type type: string
- @param type: The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'
- """
-
- def getMode():
- """
- Get this Lamp's mode flags.
- @rtype: int
- @return: B{OR'ed value}. Use the Modes dictionary to check which flags
- are 'on'.
-
- Example::
- flags = mylamp.getMode()
- if flags & mylamp.Modes['Shadows']:
- print "This lamp produces shadows"
- else:
- print "The 'Shadows' flag is off"
- """
-
- def setMode(m = None, m2 = None, m3 = None, m4 = None,
- m5 = None, m6 = None, m7 = None, m8 = None):
- """
- Set this Lamp's mode flags. Mode strings given are turned 'on'.
- Those not provided are turned 'off', so lamp.setMode() -- without
- arguments -- turns off all mode flags for Lamp lamp.
- @type m: string
- @param m: A mode flag. From 1 to 8 can be set at the same time.
- """
-
- def getSamples():
- """
- Get this lamp's samples value.
- @rtype: int
- """
-
- def setSamples(samples):
- """
- Set the samples value.
- @type samples: int
- @param samples: The new samples value.
- """
-
- def getRaySamplesX():
- """
- Get this lamp's raytracing sample value on the X axis.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def setRaySamplesX():
- """
- Set the lamp's raytracing sample value on the X axis, between 1 and 16.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def getRaySamplesY():
- """
- Get this lamp's raytracing sample value on the Y axis.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def setRaySamplesY():
- """
- Set the lamp's raytracing sample value on the Y axis, between 1 and 16.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def getAreaSizeX():
- """
- Get this lamp's size on the X axis.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def setAreaSizeX():
- """
- Set this lamp's size on the X axis.
- This value is only used for area lamps.
- @rtype: int
- """
-
- def getAreaSizeY():
- """
- Get this lamp's size on the Y axis.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def setAreaSizeY():
- """
- Set this lamp's size on the Y axis.
- This value is only used for rectangle area lamps.
- @rtype: int
- """
-
- def getBufferSize():
- """
- Get this lamp's buffer size.
- @rtype: int
- """
-
- def setBufferSize(bufsize):
- """
- Set the buffer size value.
- @type bufsize: int
- @param bufsize: The new buffer size value.
- """
-
- def getHaloStep():
- """
- Get this lamp's halo step value.
- @rtype: int
- """
-
- def setHaloStep(hastep):
- """
- Set the halo step value.
- @type hastep: int
- @param hastep: The new halo step value.
- """
-
- def getEnergy():
- """
- Get this lamp's energy intensity value.
- @rtype: float
- """
-
- def setEnergy(energy):
- """
- Set the energy intensity value.
- @type energy: float
- @param energy: The new energy value.
- """
-
- def getDist():
- """
- Get this lamp's distance value.
- @rtype: float
- """
-
- def setDist(distance):
- """
- Set the distance value.
- @type distance: float
- @param distance: The new distance value.
- """
-
- def getSpotSize():
- """
- Get this lamp's spot size value.
- @rtype: float
- """
-
- def setSpotSize(spotsize):
- """
- Set the spot size value.
- @type spotsize: float
- @param spotsize: The new spot size value.
- """
-
- def getSpotBlend():
- """
- Get this lamp's spot blend value.
- @rtype: float
- """
-
- def setSpotBlend(spotblend):
- """
- Set the spot blend value.
- @type spotblend: float
- @param spotblend: The new spot blend value.
- """
-
- def getClipStart():
- """
- Get this lamp's clip start value.
- @rtype: float
- """
-
- def setClipStart(clipstart):
- """
- Set the clip start value.
- @type clipstart: float
- @param clipstart: The new clip start value.
- """
-
- def getClipEnd():
- """
- Get this lamp's clip end value.
- @rtype: float
- """
-
- def setClipEnd(clipend):
- """
- Set the clip end value.
- @type clipend: float
- @param clipend: The new clip end value.
- """
-
- def getBias():
- """
- Get this lamp's bias value.
- @rtype: float
- """
-
- def setBias(bias):
- """
- Set the bias value.
- @type bias: float
- @param bias: The new bias value.
- """
-
- def getSoftness():
- """
- Get this lamp's softness value.
- @rtype: float
- """
-
- def setSoftness(softness):
- """
- Set the softness value.
- @type softness: float
- @param softness: The new softness value.
- """
-
- def getHaloInt():
- """
- Get this lamp's halo intensity value.
- @rtype: float
- """
-
- def setHaloInt(haloint):
- """
- Set the halo intensity value.
- @type haloint: float
- @param haloint: The new halo intensity value.
- """
-
- def getQuad1():
- """
- Get this lamp's quad 1 value.
- @rtype: float
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def setQuad1(quad1):
- """
- Set the quad 1 value.
- @type quad1: float
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def getQuad2():
- """
- Get this lamp's quad 2 value.
- @rtype: float
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def setQuad2(quad2):
- """
- Set the quad 2 value.
- @type quad2: float
- @param quad2: The new quad 2 value.
- @warning: this only applies to Lamps with the 'Quad' flag on.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Lamp's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Lamp. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Lamp.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def getIpo():
- """
- Get the Ipo associated with this Lamp object, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this Lamp object.
- @type ipo: Blender Ipo
- @param ipo: a "lamp data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this Lamp object.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in lamp ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -RGB
- -ENERGY
- -SPOTSIZE
- -OFFSET
- -SIZE
- @return: py_none
- """
-
- def __copy__ ():
- """
- Make a copy of this lamp
- @rtype: Lamp
- @return: a copy of this lamp
- """ \ No newline at end of file
+ """
+ The Lamp Data object
+ ====================
+ This object gives access to Lamp-specific data in Blender.
+
+ @ivar B: Lamp color blue component.
+ Value is clamped to the range [0.0,1.0].
+ @type B: float
+ @ivar G: Lamp color green component.
+ Value is clamped to the range [0.0,1.0].
+ @type G: float
+ @ivar R: Lamp color red component.
+ Value is clamped to the range [0.0,1.0].
+ @type R: float
+ @ivar bias: Lamp shadow map sampling bias.
+ Value is clamped to the range [0.01,5.0].
+ @type bias: float
+ @ivar bufferSize: Lamp shadow buffer size.
+ Value is clamped to the range [512,5120].
+ @type bufferSize: int
+ @ivar clipEnd: Lamp shadow map clip end.
+ Value is clamped to the range [1.0,5000.0].
+ @type clipEnd: float
+ @ivar clipStart: Lamp shadow map clip start.
+ Value is clamped to the range [0.1,1000.0].
+ @type clipStart: float
+ @ivar col: Lamp RGB color triplet.
+ Components are clamped to the range [0.0,1.0].
+ @type col: RGB tuple
+ @ivar dist: Lamp clipping distance.
+ Value is clamped to the range [0.1,5000.0].
+ @type dist: float
+ @ivar energy: Lamp light intensity.
+ Value is clamped to the range [0.0,10.0].
+ @type energy: float
+ @ivar haloInt: Lamp spotlight halo intensity.
+ Value is clamped to the range [0.0,5.0].
+ @type haloInt: float
+ @ivar haloStep: Lamp volumetric halo sampling frequency.
+ Value is clamped to the range [0,12].
+ @type haloStep: int
+ @ivar ipo: Lamp Ipo.
+ Contains the Ipo if one is assigned to the object, B{None} otherwise. Setting to B{None} clears the current Ipo..
+ @type ipo: Blender Ipo
+ @ivar mode: Lamp mode bitfield. See L{Modes} for values.
+ @type mode: int
+ @ivar quad1: Quad lamp linear distance attenuation.
+ Value is clamped to the range [0.0,1.0].
+ @type quad1: float
+ @ivar quad2: Quad lamp quadratic distance attenuation.
+ Value is clamped to the range [0.0,1.0].
+ @type quad2: float
+ @ivar samples: Lamp shadow map samples.
+ Value is clamped to the range [1,16].
+ @type samples: int
+ @ivar raySamplesX: Lamp raytracing X samples (X is used for the Y axis with square area lamps).
+ Value is clamped to the range [1,16].
+ @type raySamplesX: int
+ @ivar raySamplesY: Lamp raytracing Y samples (Y is only used for rectangle area lamps).
+ Value is clamped to the range [1,16].
+ @type raySamplesY: int
+ @ivar areaSizeX: Lamp X size (X is used for the Y axis with square area lamps)
+ Value is clamped to the range [0.01,100.0].
+ @type areaSizeX: float
+ @ivar areaSizeY: Lamp Y size (Y is only used for rectangle area lamps).
+ Value is clamped to the range [0.01,100.0].
+ @type areaSizeY: float
+ @ivar softness: Lamp shadow sample area size.
+ Value is clamped to the range [1.0,100.0].
+ @type softness: float
+ @ivar spotBlend: Lamp spotlight edge softness.
+ Value is clamped to the range [0.0,1.0].
+ @type spotBlend: float
+ @ivar spotSize: Lamp spotlight beam angle (in degrees).
+ Value is clamped to the range [1.0,180.0].
+ @type spotSize: float
+ @ivar type: Lamp type. See L{Types} for values.
+ @type type: int
+
+ @warning: Most member variables assume values in some [Min, Max] interval.
+ When trying to set them, the given parameter will be clamped to lie in
+ that range: if val < Min, then val = Min, if val > Max, then val = Max.
+ """
+
+ def getName():
+ """
+ Get the name of this Lamp Data object.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Lamp Data object.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getType():
+ """
+ Get this Lamp's type.
+ @rtype: int
+ """
+
+ def setType(type):
+ """
+ Set this Lamp's type.
+ @type type: string
+ @param type: The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'
+ """
+
+ def getMode():
+ """
+ Get this Lamp's mode flags.
+ @rtype: int
+ @return: B{OR'ed value}. Use the Modes dictionary to check which flags
+ are 'on'.
+
+ Example::
+ flags = mylamp.getMode()
+ if flags & mylamp.Modes['Shadows']:
+ print "This lamp produces shadows"
+ else:
+ print "The 'Shadows' flag is off"
+ """
+
+ def setMode(m = None, m2 = None, m3 = None, m4 = None,
+ m5 = None, m6 = None, m7 = None, m8 = None):
+ """
+ Set this Lamp's mode flags. Mode strings given are turned 'on'.
+ Those not provided are turned 'off', so lamp.setMode() -- without
+ arguments -- turns off all mode flags for Lamp lamp.
+ @type m: string
+ @param m: A mode flag. From 1 to 8 can be set at the same time.
+ """
+
+ def getSamples():
+ """
+ Get this lamp's samples value.
+ @rtype: int
+ """
+
+ def setSamples(samples):
+ """
+ Set the samples value.
+ @type samples: int
+ @param samples: The new samples value.
+ """
+
+ def getRaySamplesX():
+ """
+ Get this lamp's raytracing sample value on the X axis.
+ This value is only used for area lamps.
+ @rtype: int
+ """
+
+ def setRaySamplesX():
+ """
+ Set the lamp's raytracing sample value on the X axis, between 1 and 16.
+ This value is only used for area lamps.
+ @rtype: int
+ """
+
+ def getRaySamplesY():
+ """
+ Get this lamp's raytracing sample value on the Y axis.
+ This value is only used for rectangle area lamps.
+ @rtype: int
+ """
+
+ def setRaySamplesY():
+ """
+ Set the lamp's raytracing sample value on the Y axis, between 1 and 16.
+ This value is only used for rectangle area lamps.
+ @rtype: int
+ """
+
+ def getAreaSizeX():
+ """
+ Get this lamp's size on the X axis.
+ This value is only used for area lamps.
+ @rtype: int
+ """
+
+ def setAreaSizeX():
+ """
+ Set this lamp's size on the X axis.
+ This value is only used for area lamps.
+ @rtype: int
+ """
+
+ def getAreaSizeY():
+ """
+ Get this lamp's size on the Y axis.
+ This value is only used for rectangle area lamps.
+ @rtype: int
+ """
+
+ def setAreaSizeY():
+ """
+ Set this lamp's size on the Y axis.
+ This value is only used for rectangle area lamps.
+ @rtype: int
+ """
+
+ def getBufferSize():
+ """
+ Get this lamp's buffer size.
+ @rtype: int
+ """
+
+ def setBufferSize(bufsize):
+ """
+ Set the buffer size value.
+ @type bufsize: int
+ @param bufsize: The new buffer size value.
+ """
+
+ def getHaloStep():
+ """
+ Get this lamp's halo step value.
+ @rtype: int
+ """
+
+ def setHaloStep(hastep):
+ """
+ Set the halo step value.
+ @type hastep: int
+ @param hastep: The new halo step value.
+ """
+
+ def getEnergy():
+ """
+ Get this lamp's energy intensity value.
+ @rtype: float
+ """
+
+ def setEnergy(energy):
+ """
+ Set the energy intensity value.
+ @type energy: float
+ @param energy: The new energy value.
+ """
+
+ def getDist():
+ """
+ Get this lamp's distance value.
+ @rtype: float
+ """
+
+ def setDist(distance):
+ """
+ Set the distance value.
+ @type distance: float
+ @param distance: The new distance value.
+ """
+
+ def getSpotSize():
+ """
+ Get this lamp's spot size value.
+ @rtype: float
+ """
+
+ def setSpotSize(spotsize):
+ """
+ Set the spot size value.
+ @type spotsize: float
+ @param spotsize: The new spot size value.
+ """
+
+ def getSpotBlend():
+ """
+ Get this lamp's spot blend value.
+ @rtype: float
+ """
+
+ def setSpotBlend(spotblend):
+ """
+ Set the spot blend value.
+ @type spotblend: float
+ @param spotblend: The new spot blend value.
+ """
+
+ def getClipStart():
+ """
+ Get this lamp's clip start value.
+ @rtype: float
+ """
+
+ def setClipStart(clipstart):
+ """
+ Set the clip start value.
+ @type clipstart: float
+ @param clipstart: The new clip start value.
+ """
+
+ def getClipEnd():
+ """
+ Get this lamp's clip end value.
+ @rtype: float
+ """
+
+ def setClipEnd(clipend):
+ """
+ Set the clip end value.
+ @type clipend: float
+ @param clipend: The new clip end value.
+ """
+
+ def getBias():
+ """
+ Get this lamp's bias value.
+ @rtype: float
+ """
+
+ def setBias(bias):
+ """
+ Set the bias value.
+ @type bias: float
+ @param bias: The new bias value.
+ """
+
+ def getSoftness():
+ """
+ Get this lamp's softness value.
+ @rtype: float
+ """
+
+ def setSoftness(softness):
+ """
+ Set the softness value.
+ @type softness: float
+ @param softness: The new softness value.
+ """
+
+ def getHaloInt():
+ """
+ Get this lamp's halo intensity value.
+ @rtype: float
+ """
+
+ def setHaloInt(haloint):
+ """
+ Set the halo intensity value.
+ @type haloint: float
+ @param haloint: The new halo intensity value.
+ """
+
+ def getQuad1():
+ """
+ Get this lamp's quad 1 value.
+ @rtype: float
+ @warning: this only applies to Lamps with the 'Quad' flag on.
+ """
+
+ def setQuad1(quad1):
+ """
+ Set the quad 1 value.
+ @type quad1: float
+ @warning: this only applies to Lamps with the 'Quad' flag on.
+ """
+
+ def getQuad2():
+ """
+ Get this lamp's quad 2 value.
+ @rtype: float
+ @warning: this only applies to Lamps with the 'Quad' flag on.
+ """
+
+ def setQuad2(quad2):
+ """
+ Set the quad 2 value.
+ @type quad2: float
+ @param quad2: The new quad 2 value.
+ @warning: this only applies to Lamps with the 'Quad' flag on.
+ """
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Lamp's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks (links = None):
+ """
+ Delete script links from this Lamp. If no list is specified, all
+ script links are deleted.
+ @type links: list of strings
+ @param links: None (default) or a list of Blender L{Text} names.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Lamp.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ """
+
+ def getIpo():
+ """
+ Get the Ipo associated with this Lamp object, if any.
+ @rtype: Ipo
+ @return: the wrapped ipo or None.
+ """
+
+ def setIpo(ipo):
+ """
+ Link an ipo to this Lamp object.
+ @type ipo: Blender Ipo
+ @param ipo: a "lamp data" ipo.
+ """
+
+ def clearIpo():
+ """
+ Unlink the ipo from this Lamp object.
+ @return: True if there was an ipo linked or False otherwise.
+ """
+
+ def insertIpoKey(keytype):
+ """
+ Inserts keytype values in lamp ipo at curframe. Uses module constants.
+ @type keytype: Integer
+ @param keytype:
+ -RGB
+ -ENERGY
+ -SPOTSIZE
+ -OFFSET
+ -SIZE
+ @return: None
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this lamp
+ @rtype: Lamp
+ @return: a copy of this lamp
+ """
+
+import id_generics
+Lamp.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Lattice.py b/source/blender/python/api2_2x/doc/Lattice.py
index 00412b34970..8666254ec0d 100644
--- a/source/blender/python/api2_2x/doc/Lattice.py
+++ b/source/blender/python/api2_2x/doc/Lattice.py
@@ -41,169 +41,169 @@ Example::
"""
def New (name = None):
- """
- Create a new Lattice object.
- Passing a name to this function will name the Lattice
- datablock, otherwise the Lattice data will be given a
- default name.
- @type name: string
- @param name: The Lattice name.
- @rtype: Blender Lattice
- @return: The created Lattice Data object.
- """
+ """
+ Create a new Lattice object.
+ Passing a name to this function will name the Lattice
+ datablock, otherwise the Lattice data will be given a
+ default name.
+ @type name: string
+ @param name: The Lattice name.
+ @rtype: Blender Lattice
+ @return: The created Lattice Data object.
+ """
def Get (name = None):
- """
- Get the Lattice object(s) from Blender.
- @type name: string
- @param name: The name of the Lattice object.
- @rtype: Blender Lattice or a list of Blender Lattices
- @return: It depends on the 'name' parameter:
- - (name): The Lattice object with the given name;
- - (): A list with all Lattice objects in the current scene.
- """
+ """
+ Get the Lattice object(s) from Blender.
+ @type name: string
+ @param name: The name of the Lattice object.
+ @rtype: Blender Lattice or a list of Blender Lattices
+ @return: It depends on the 'name' parameter:
+ - (name): The Lattice object with the given name;
+ - (): A list with all Lattice objects in the current scene.
+ """
class Lattice:
- """
- The Lattice object
- ==================
- This object gives access to Lattices in Blender.
- @ivar name: The Lattice name.
- @ivar width: The number of x dimension partitions.
- @ivar height: The number of y dimension partitions.
- @ivar depth: The number of z dimension partitions.
- @ivar widthType: The x dimension key type.
- @ivar heightType: The y dimension key type.
- @ivar depthType: The z dimension key type.
- @ivar mode: The current mode of the Lattice.
- @ivar latSize: The number of points in this Lattice.
- @cvar key: The L{Key.Key} object associated with this Lattice or None.
- """
-
- def getName():
- """
- Get the name of this Lattice datablock.
- @rtype: string
- @return: The name of the Lattice datablock.
- """
-
- def setName(name):
- """
- Set the name of this Lattice datablock.
- @type name: string
- @param name: The new name.
- """
-
- def getPartitions():
- """
- Gets the number of 'walls' or partitions that the Lattice has
- in the x, y, and z dimensions.
- @rtype: list of ints
- @return: A list corresponding to the number of partitions: [x,y,z]
- """
-
- def setPartitions(x,y,z):
- """
- Set the number of 'walls' or partitions that the
- Lattice will be created with in the x, y, and z dimensions.
- @type x: int
- @param x: The number of partitions in the x dimension of the Lattice.
- @type y: int
- @param y: The number of partitions in the y dimension of the Lattice.
- @type z: int
- @param z: The number of partitions in the z dimension of the Lattice.
- """
-
- def getKeyTypes():
- """
- Returns the deformation key types for the x, y, and z dimensions of the
- Lattice.
- @rtype: list of strings
- @return: A list corresponding to the key types will be returned: [x,y,z]
- """
-
- def setKeyTypes(xType,yType,zType):
- """
- Sets the deformation key types for the x, y, and z dimensions of the
- Lattice.
- There are three key types possible:
- - Lattice.CARDINAL
- - Lattice.LINEAR
- - Lattice.BSPLINE
- @type xType: enum constant
- @param xType: the deformation key type for the x dimension of the Lattice
- @type yType: enum constant
- @param yType: the deformation key type for the y dimension of the Lattice
- @type zType: enum constant
- @param zType: the deformation key type for the z dimension of the Lattice
- """
-
- def getMode():
- """
- Returns the current Lattice mode
- @rtype: string
- @return: A string representing the current Lattice mode
- """
-
- def setMode(modeType):
- """
- Sets the current Lattice mode
- There are two Lattice modes possible:
- - Lattice.GRID
- - Lattice.OUTSIDE
- @type modeType: enum constant
- @param modeType: the Lattice mode
- """
-
- def getPoint(index):
- """
- Returns the coordinates of a point in the Lattice by index.
- @type index: int
- @param index: The index of the point on the Lattice you want returned
- @rtype: list of floats
- @return: The x,y,z coordiates of the Lattice point : [x,y,z]
- """
-
- def setPoint(index, position):
- """
- Sets the coordinates of a point in the Lattice by index.
- @type index: int
- @param index: The index of the point on the Lattice you want set
- @type position: list of floats
- @param position: The x,y,z coordinates that you want the point to be: [x,y,z]
- """
-
- def getKey():
- """
- Returns the L{Key.Key} object associated with this Lattice.
- @rtype: L{Key.Key}
- @return: A key object representing the keyframes of the lattice or None.
- """
-
- def insertKey(frame):
- """
- Inserts the current state of the Lattice as a new absolute keyframe
-
- B{Example}::
- for z in range(5):
- for y in range(125):
- vec = myLat.getPoint(y)
- co1 = vec[0] + vec[2]
- co2 = vec[1] - vec[2]
- co3 = vec[2] + vec[1]
- myLat.setPoint(y,[co1,co2,co3])
- w = (z + 1) * 10
- myLat.insertKey(w)
-
- @type frame: int
- @param frame: the frame at which the Lattice will be set as a keyframe
- """
-
- def __copy__ ():
- """
- Make a copy of this lattice
- @rtype: Lattice
- @return: a copy of this lattice
- """
-
-
+ """
+ The Lattice object
+ ==================
+ This object gives access to Lattices in Blender.
+ @ivar width: The number of x dimension partitions.
+ @ivar height: The number of y dimension partitions.
+ @ivar depth: The number of z dimension partitions.
+ @ivar widthType: The x dimension key type.
+ @ivar heightType: The y dimension key type.
+ @ivar depthType: The z dimension key type.
+ @ivar mode: The current mode of the Lattice.
+ @ivar latSize: The number of points in this Lattice (width*height*depth).
+ @cvar key: The L{Key.Key} object associated with this Lattice or None.
+ """
+
+ def getName():
+ """
+ Get the name of this Lattice datablock.
+ @rtype: string
+ @return: The name of the Lattice datablock.
+ """
+
+ def setName(name):
+ """
+ Set the name of this Lattice datablock.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getPartitions():
+ """
+ Gets the number of 'walls' or partitions that the Lattice has
+ in the x, y, and z dimensions.
+ @rtype: list of ints
+ @return: A list corresponding to the number of partitions: [x,y,z]
+ """
+
+ def setPartitions(x,y,z):
+ """
+ Set the number of 'walls' or partitions that the
+ Lattice will be created with in the x, y, and z dimensions.
+ @type x: int
+ @param x: The number of partitions in the x dimension of the Lattice.
+ @type y: int
+ @param y: The number of partitions in the y dimension of the Lattice.
+ @type z: int
+ @param z: The number of partitions in the z dimension of the Lattice.
+ """
+
+ def getKeyTypes():
+ """
+ Returns the deformation key types for the x, y, and z dimensions of the
+ Lattice.
+ @rtype: list of strings
+ @return: A list corresponding to the key types will be returned: [x,y,z]
+ """
+
+ def setKeyTypes(xType,yType,zType):
+ """
+ Sets the deformation key types for the x, y, and z dimensions of the
+ Lattice.
+ There are three key types possible:
+ - Lattice.CARDINAL
+ - Lattice.LINEAR
+ - Lattice.BSPLINE
+ @type xType: enum constant
+ @param xType: the deformation key type for the x dimension of the Lattice
+ @type yType: enum constant
+ @param yType: the deformation key type for the y dimension of the Lattice
+ @type zType: enum constant
+ @param zType: the deformation key type for the z dimension of the Lattice
+ """
+
+ def getMode():
+ """
+ Returns the current Lattice mode
+ @rtype: string
+ @return: A string representing the current Lattice mode
+ """
+
+ def setMode(modeType):
+ """
+ Sets the current Lattice mode
+ There are two Lattice modes possible:
+ - Lattice.GRID
+ - Lattice.OUTSIDE
+ @type modeType: enum constant
+ @param modeType: the Lattice mode
+ """
+
+ def getPoint(index):
+ """
+ Returns the coordinates of a point in the Lattice by index.
+ @type index: int
+ @param index: The index of the point on the Lattice you want returned
+ @rtype: list of floats
+ @return: The x,y,z coordiates of the Lattice point : [x,y,z]
+ """
+
+ def setPoint(index, position):
+ """
+ Sets the coordinates of a point in the Lattice by index.
+ @type index: int
+ @param index: The index of the point on the Lattice you want set
+ @type position: list of floats
+ @param position: The x,y,z coordinates that you want the point to be: [x,y,z]
+ """
+
+ def getKey():
+ """
+ Returns the L{Key.Key} object associated with this Lattice.
+ @rtype: L{Key.Key}
+ @return: A key object representing the keyframes of the lattice or None.
+ """
+
+ def insertKey(frame):
+ """
+ Inserts the current state of the Lattice as a new absolute keyframe
+
+ B{Example}::
+ for z in range(5):
+ for y in range(125):
+ vec = myLat.getPoint(y)
+ co1 = vec[0] + vec[2]
+ co2 = vec[1] - vec[2]
+ co3 = vec[2] + vec[1]
+ myLat.setPoint(y,[co1,co2,co3])
+ w = (z + 1) * 10
+ myLat.insertKey(w)
+
+ @type frame: int
+ @param frame: the frame at which the Lattice will be set as a keyframe
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this lattice
+ @rtype: Lattice
+ @return: a copy of this lattice
+ """
+
+import id_generics
+Lattice.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py
index a487fd5e062..5eb47271934 100644
--- a/source/blender/python/api2_2x/doc/Material.py
+++ b/source/blender/python/api2_2x/doc/Material.py
@@ -11,994 +11,988 @@ Material
This module provides access to B{Material} objects in Blender.
Example::
- import Blender
- from Blender import Material
- mat = Material.New('newMat') # create a new Material called 'newMat'
- print mat.rgbCol # print its rgb color triplet sequence
- mat.rgbCol = [0.8, 0.2, 0.2] # change its color
- mat.setAlpha(0.2) # mat.alpha = 0.2 -- almost transparent
- mat.emit = 0.7 # equivalent to mat.setEmit(0.8)
- mat.mode |= Material.Modes.ZTRANSP # turn on Z-Buffer transparency
- mat.setName('RedBansheeSkin') # change its name
- mat.setAdd(0.8) # make it glow
- mat.setMode('Halo') # turn 'Halo' "on" and all others "off"
+ import Blender
+ from Blender import Material
+ mat = Material.New('newMat') # create a new Material called 'newMat'
+ print mat.rgbCol # print its rgb color triplet sequence
+ mat.rgbCol = [0.8, 0.2, 0.2] # change its color
+ mat.setAlpha(0.2) # mat.alpha = 0.2 -- almost transparent
+ mat.emit = 0.7 # equivalent to mat.setEmit(0.8)
+ mat.mode |= Material.Modes.ZTRANSP # turn on Z-Buffer transparency
+ mat.setName('RedBansheeSkin') # change its name
+ mat.setAdd(0.8) # make it glow
+ mat.setMode('Halo') # turn 'Halo' "on" and all others "off"
@type Modes: readonly dictionary
@var Modes: The available Material Modes.
- B{Note}: Some Modes are only available when the 'Halo' mode is I{off} and
- others only when it is I{on}. But these two subsets of modes share the same
- numerical values in their Blender C #defines. So, for example, if 'Halo' is
- on, then 'NoMist' is actually interpreted as 'HaloShaded'. We marked all
- such possibilities in the Modes dict below: each halo-related mode that
- uses an already taken value is preceded by "+" and appear below the normal
- mode which also uses that value.
-
- - TRACEABLE - Make Material visible for shadow lamps.
- - SHADOW - Enable Material for shadows.
- - SHADOWBUF - Enable Material to cast shadows with shadow buffers.
- - SHADELESS - Make Material insensitive to light or shadow.
- - WIRE - Render only the edges of faces.
- - VCOL_LIGHT - Add vertex colors as extra light.
- - VCOL_PAINT - Replace basic colors with vertex colors.
- - HALO - Render as a halo.
- - ZTRANSP - Z-buffer transparent faces.
- - ZINVERT - Render with inverted Z-buffer.
- - + HALORINGS - Render rings over the basic halo.
- - ENV - Do not render Material.
- - + HALOLINES - Render star shaped lines over the basic halo.
- - ONLYSHADOW - Let alpha be determined on the degree of shadow.
- - + HALOXALPHA - Use extreme alpha.
- - TEXFACE - UV-Editor assigned texture gives color and texture info for faces.
- - + HALOSTAR - Render halo as a star.
- - NOMIST - Set the Material insensitive to mist.
- - + HALOSHADED - Let halo receive light.
- - HALOTEX - Give halo a texture.
- - HALOPUNO - Use the vertex normal to specify the dimension of the halo.
- - HALOFLARE - Render halo as a lens flare.
- - RAYMIRROR - Enables raytracing for mirror reflection rendering.
- - RAYTRANSP - Enables raytracing for transparency rendering.
- - RAYBIAS - Prevent ray traced shadow errors with Phong interpolated normals.
- - RAMPCOL - Status of colorband ramp for Material's diffuse color. This is a read-only bit.
- - RAMPSPEC - Status of colorband ramp for Material's specular color. This is a read-only bit.
- - TANGENTSTR - Uses direction of strands as normal for tangent-shading.
- - TRANSPSHADOW - Lets Material receive transparent shadows based on material color and alpha.
- - FULLOSA - Force rendering of all OSA samples.
- - TANGENT_V - Use the tangent vector in V direction for shading
- - NMAP_TS - Tangent space normal mapping.
- - GROUP_EXCLUSIVE - Light from this group even if the lights are on a hidden Layer.
+ B{Note}: Some Modes are only available when the 'Halo' mode is I{off} and
+ others only when it is I{on}. But these two subsets of modes share the same
+ numerical values in their Blender C #defines. So, for example, if 'Halo' is
+ on, then 'NoMist' is actually interpreted as 'HaloShaded'. We marked all
+ such possibilities in the Modes dict below: each halo-related mode that
+ uses an already taken value is preceded by "+" and appear below the normal
+ mode which also uses that value.
+
+ - TRACEABLE - Make Material visible for shadow lamps.
+ - SHADOW - Enable Material for shadows.
+ - SHADOWBUF - Enable Material to cast shadows with shadow buffers.
+ - SHADELESS - Make Material insensitive to light or shadow.
+ - WIRE - Render only the edges of faces.
+ - VCOL_LIGHT - Add vertex colors as extra light.
+ - VCOL_PAINT - Replace basic colors with vertex colors.
+ - HALO - Render as a halo.
+ - ZTRANSP - Z-buffer transparent faces.
+ - ZINVERT - Render with inverted Z-buffer.
+ - + HALORINGS - Render rings over the basic halo.
+ - ENV - Do not render Material.
+ - + HALOLINES - Render star shaped lines over the basic halo.
+ - ONLYSHADOW - Let alpha be determined on the degree of shadow.
+ - + HALOXALPHA - Use extreme alpha.
+ - TEXFACE - UV-Editor assigned texture gives color and texture info for faces.
+ - + HALOSTAR - Render halo as a star.
+ - NOMIST - Set the Material insensitive to mist.
+ - + HALOSHADED - Let halo receive light.
+ - HALOTEX - Give halo a texture.
+ - HALOPUNO - Use the vertex normal to specify the dimension of the halo.
+ - HALOFLARE - Render halo as a lens flare.
+ - RAYMIRROR - Enables raytracing for mirror reflection rendering.
+ - RAYTRANSP - Enables raytracing for transparency rendering.
+ - RAYBIAS - Prevent ray traced shadow errors with Phong interpolated normals.
+ - RAMPCOL - Status of colorband ramp for Material's diffuse color. This is a read-only bit.
+ - RAMPSPEC - Status of colorband ramp for Material's specular color. This is a read-only bit.
+ - TANGENTSTR - Uses direction of strands as normal for tangent-shading.
+ - TRANSPSHADOW - Lets Material receive transparent shadows based on material color and alpha.
+ - FULLOSA - Force rendering of all OSA samples.
+ - TANGENT_V - Use the tangent vector in V direction for shading
+ - NMAP_TS - Tangent space normal mapping.
+ - GROUP_EXCLUSIVE - Light from this group even if the lights are on a hidden Layer.
@type Shaders: readonly dictionary
@var Shaders: The available Material Shaders.
- - DIFFUSE_LAMBERT - Make Material use the lambert diffuse shader.
- - DIFFUSE_ORENNAYAR - Make Material use the Oren-Nayer diffuse shader.
- - DIFFUSE_TOON - Make Material use the toon diffuse shader.
- - DIFFUSE_MINNAERT - Make Material use the minnaert diffuse shader.
- - SPEC_COOKTORR - Make Material use the Cook-Torr specular shader.
- - SPEC_PHONG - Make Material use the Phong specular shader.
- - SPEC_BLINN - Make Material use the Blinn specular shader.
- - SPEC_TOON - Make Material use the toon specular shader.
- - SPEC_WARDISO - Make Material use the Ward-iso specular shader.
+ - DIFFUSE_LAMBERT - Make Material use the lambert diffuse shader.
+ - DIFFUSE_ORENNAYAR - Make Material use the Oren-Nayer diffuse shader.
+ - DIFFUSE_TOON - Make Material use the toon diffuse shader.
+ - DIFFUSE_MINNAERT - Make Material use the minnaert diffuse shader.
+ - SPEC_COOKTORR - Make Material use the Cook-Torr specular shader.
+ - SPEC_PHONG - Make Material use the Phong specular shader.
+ - SPEC_BLINN - Make Material use the Blinn specular shader.
+ - SPEC_TOON - Make Material use the toon specular shader.
+ - SPEC_WARDISO - Make Material use the Ward-iso specular shader.
"""
def New (name = 'Mat'):
- """
- Create a new Material object.
- @type name: string
- @param name: The Material name.
- @rtype: Blender Material
- @return: The created Material object.
- """
+ """
+ Create a new Material object.
+ @type name: string
+ @param name: The Material name.
+ @rtype: Blender Material
+ @return: The created Material object.
+ """
def Get (name = None):
- """
- Get the Material object(s) from Blender.
- @type name: string
- @param name: The name of the Material.
- @rtype: Blender Material or a list of Blender Materials
- @return: It depends on the 'name' parameter:
- - (name): The Material object with the given name;
- - (): A list with all Material objects in the current scene.
- """
+ """
+ Get the Material object(s) from Blender.
+ @type name: string
+ @param name: The name of the Material.
+ @rtype: Blender Material or a list of Blender Materials
+ @return: It depends on the 'name' parameter:
+ - (name): The Material object with the given name;
+ - (): A list with all Material objects in the current scene.
+ """
class Material:
- """
- The Material object
- ===================
- This object gives access to Materials in Blender.
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- material's ID Properties.
- @ivar B: Diffuse color (L{rgbCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type B: float
- @ivar G: Diffuse color (L{rgbCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type G: float
- @ivar IOR: Angular index of refraction for raytrace.
- Value is clamped to the range [1.0,3.0].
- @type IOR: float
- @ivar R: Diffuse color (L{rgbCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type R: float
- @ivar add: Strength of the add effect.
- Value is clamped to the range [0.0,1.0].
- @type add: float
- @ivar alpha: Alpha (translucency) component of the material.
- Value is clamped to the range [0.0,1.0].
- @type alpha: float
- @ivar shadAlpha: Shadow Alpha for irregular shadow buffer.
- Value is clamped to the range [0.0,1.0].
- @type shadAlpha: float
- @ivar amb: Amount of global ambient color material receives.
- Value is clamped to the range [0.0,1.0].
- @type amb: float
- @ivar diffuseDarkness: Material's diffuse darkness ("Minnaert" diffuse shader only).
- Value is clamped to the range [0.0,2.0].
- @type diffuseDarkness: float
- @ivar diffuseShader: Diffuse shader type (see L{Shaders}).
- Value must be in the range [0,3].
- @type diffuseShader: int
- @ivar diffuseSize: Material's diffuse area size ("Toon" diffuse shader only).
- Value is clamped to the range [0.0,3.14].
- @type diffuseSize: float
- @ivar diffuseSmooth: Material's diffuse area smoothing ("Toon" diffuse shader only).
- Value is clamped to the range [0.0,1.0].
- @type diffuseSmooth: float
- @ivar emit: Amount of light the material emits.
- Value is clamped to the range [0.0,1.0].
- @type emit: float
- @ivar filter: Amount of filtering when transparent raytrace is enabled.
- Value is clamped to the range [0.0,1.0].
- @type filter: float
- @ivar flareBoost: Flare's extra strength.
- Value is clamped to the range [0.1,1.0].
- @type flareBoost: float
- @ivar flareSeed: Offset in the flare seed table.
- Value is clamped to the range [1,255].
- @type flareSeed: int
- @ivar flareSize: Ratio of flare size to halo size.
- Value is clamped to the range [0.1,25.0].
- @type flareSize: float
- @ivar fresnelDepth: Power of Fresnel for mirror reflection.
- Value is clamped to the range [0.0,5.0].
- @type fresnelDepth: float
- @ivar fresnelDepthFac: Blending factor for Fresnel mirror.
- Value is clamped to the range [1.0,5.0].
- @type fresnelDepthFac: float
- @ivar fresnelTrans: Power of Fresnel for transparency.
- Value is clamped to the range [0.0,5.0].
- @type fresnelTrans: float
- @ivar fresnelTransFac: Blending factor for Fresnel transparency.
- Value is clamped to the range [1.0,5.0].
- @type fresnelTransFac: float
- @ivar rbFriction: Rigid Body Friction coefficient.
- Value is clamped to the range [0.0,100.0].
- @type rbFriction: float
- @ivar rbRestitution: Rigid Body Friction restitution.
- Value is clamped to the range [0.0,1.0].
- @type rbRestitution: float
- @ivar haloSeed: Randomizes halo ring dimension and line location.
- Value is clamped to the range [1,255].
- @type haloSeed: int
- @ivar haloSize: Dimension of the halo.
- Value is clamped to the range [0.0,100.0].
- @type haloSize: float
- @ivar hard: Hardness of the specularity.
- Value is clamped to the range [1,255].
- @type hard: int
- @ivar ipo: Material Ipo data.
- Contains the Ipo if one is assigned to the object, None otherwise. Setting to None clears the current Ipo.
- @type ipo: Blender Ipo
- @ivar mirB: Mirror color (L{mirCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type mirB: float
- @ivar mirCol: Mirror RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type mirCol: list of 3 floats
- @ivar mirG: Mirror color (L{mirCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type mirG: float
- @ivar mirR: Mirror color (L{mirCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type mirR: float
- @ivar mode: Mode mode bitfield. See L{the Modes dictionary<Modes>} keys and descriptions.
- @type mode: int
- @ivar nFlares: Number of subflares with halo.
- Value is clamped to the range [1,32].
- @type nFlares: int
- @ivar nLines: Number of star-shaped lines with halo.
- Value is clamped to the range [0,250].
- @type nLines: int
- @ivar nRings: Number of rings with halo.
- Value is clamped to the range [0,24].
- @type nRings: int
- @ivar nStars: Number of star points with halo.
- Value is clamped to the range [3,50].
- @type nStars: int
- @ivar name: Material data name.
- @type name: str
- @ivar oopsLoc: Material OOPs location. Returns None if material not found in list.
- @type oopsLoc: list of 2 floats
- @ivar oopsSel: Material OOPs selection flag.
- Value must be in the range [0,1].
- @type oopsSel: int
- @ivar rayMirr: Mirror reflection amount for raytrace.
- Value is clamped to the range [0.0,1.0].
- @type rayMirr: float
- @ivar rayMirrDepth: Amount of raytrace inter-reflections.
- Value is clamped to the range [0,10].
- @type rayMirrDepth: int
- @ivar ref: Amount of reflections (for shader).
- Value is clamped to the range [0.0,1.0].
- @type ref: float
- @ivar refracIndex: Material's Index of Refraction (applies to the "Blinn" Specular Shader only.
- Value is clamped to the range [1.0,10.0].
- @type refracIndex: float
- @ivar rgbCol: Diffuse RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type rgbCol: list of 3 floats
- @ivar rms: Material's surface slope standard deviation ("WardIso" specular shader only).
- Value is clamped to the range [0.0,0.4].
- @type rms: float
- @ivar roughness: Material's roughness ("Oren Nayar" diffuse shader only).
- Value is clamped to the range [0.0,3.14].
- @type roughness: float
- @ivar spec: Degree of specularity.
- Value is clamped to the range [0.0,2.0].
- @type spec: float
- @ivar specB: Specular color (L{specCol}) blue component.
- Value is clamped to the range [0.0,1.0].
- @type specB: float
- @ivar specCol: Specular RGB color triplet.
- Components are clamped to the range [0.0,1.0].
- @type specCol: list of 3 floats
- @ivar specG: Specular color (L{specCol}) green component.
- Value is clamped to the range [0.0,1.0].
- @type specG: float
- @ivar specR: Specular color (L{specCol}) red component.
- Value is clamped to the range [0.0,1.0].
- @type specR: float
- @ivar specShader: Specular shader type. See L{Shaders}.
- Value must be in the range [0,4].
- @type specShader: int
- @ivar specSize: Material's specular area size ("Toon" specular shader only).
- Value is clamped to the range [0.0,1.53].
- @type specSize: float
- @ivar specSmooth: Sets the smoothness of specular toon area.
- Value is clamped to the range [0.0,1.0].
- @type specSmooth: float
- @ivar specTransp: Makes specular areas opaque on transparent materials.
- Value is clamped to the range [0.0,1.0].
- @type specTransp: float
- @ivar subSize: Dimension of subflares, dots and circles.
- Value is clamped to the range [0.1,25.0].
- @type subSize: float
- @ivar transDepth: calculated maximal. Amount of refractions for raytrace.
- Value is clamped to the range [0,10].
- @type transDepth: int
- @ivar translucency: Amount of diffuse shading of the back side.
- Value is clamped to the range [0.0,1.0].
- @type translucency: float
- @ivar users: Number of material users.
- @type users: int
- @ivar fakeUser: The fake user status.
- enabling this will keep it in the blend even if there are no users.
- @type fakeUser: bool
- @ivar zOffset: Artificial offset in the Z buffer (for Ztransp option).
- Value is clamped to the range [0.0,10.0].
- @type zOffset: float
- @ivar lightGroup: Limits lights that affect this material to a group.
- @type lightGroup: Group or None
- @ivar uvlayer: The uv layer name to use, when UV mapping is enabled.
- @type uvlayer: string
- @warning: Most member variables assume values in some [Min, Max] interval.
- When trying to set them, the given parameter will be clamped to lie in
- that range: if val < Min, then val = Min, if val > Max, then val = Max.
- """
-
- def getName():
- """
- Get the name of this Material object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Material object.
- @type name: string
- @param name: The new name.
- """
-
- def getIpo():
- """
- Get the Ipo associated with this material, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this material.
- @type ipo: Blender Ipo
- @param ipo: a material type ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this material.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in material ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -RGB
- -ALPHA
- -HALOSIZE
- -MODE
- -ALLCOLOR
- -ALLMIRROR
- -OFS
- -SIZE
- -ALLMAPPING
- @return: py_none
- """
-
- def getMode():
- """
- Get this Material's mode flags.
- @rtype: int
- @return: B{OR'ed value}. Use the Modes dictionary to check which flags
- are 'on'.
-
- Example::
- import Blender
- from Blender import Material
- flags = mymat.getMode()
- if flags & Material.Modes['HALO']:
- print "This material is rendered as a halo"
- else:
- print "Not a halo"
- """
-
- def setMode(param, stringN=None):
- """
- Set this Material's mode flags. Up to 22 mode strings can be given
- and specify the modes which are turned 'on'. Those not provided are
- turned 'off', so mat.setMode() -- without arguments -- turns off all
- mode flags for Material mat. Valid mode strings are "Traceable",
- "Shadow", "Shadeless", "Wire", "VColLight", "VColPaint", "Halo",
- "ZTransp", "ZInvert", "HaloRings", "HaloLines", "OnlyShadow",
- "HaloXAlpha", "HaloStar", "TexFace", "HaloTex", "HaloPuno", "NoMist",
- "HaloShaded", "HaloFlare", "Radio", "RayMirr", "ZTransp", "RayTransp",
- "Env"
-
- An integer can also be given, which directly sets the mode flag. The
- Modes dictionary keys can (and should) be added or ORed to specify
- which modes to turn 'on'. The value returned from getMode() can
- also be modified and input to this method.
-
- @type param: string, None or int
- @param param: A mode value (int) or flag (string). Can also be None.
- @type stringN: string
- @param stringN: A mode flag. Up to 22 flags can be set at the same time.
- """
-
- def getRGBCol():
- """
- Get the rgb color triplet sequence.
- @rtype: list of 3 floats
- @return: [r, g, b]
- """
-
- def setRGBCol(rgb = None):
- """
- Set the rgb color triplet sequence. If B{rgb} is None, set the color to black.
- @type rgb: three floats or a list of three floats
- @param rgb: The rgb color values in [0.0, 1.0] as:
- - a list of three floats: setRGBCol ([r, g, b]) B{or}
- - three floats as separate parameters: setRGBCol (r,g,b).
- """
+ """
+ The Material object
+ ===================
+ This object gives access to Materials in Blender.
+ @ivar B: Diffuse color (L{rgbCol}) blue component.
+ Value is clamped to the range [0.0,1.0].
+ @type B: float
+ @ivar G: Diffuse color (L{rgbCol}) green component.
+ Value is clamped to the range [0.0,1.0].
+ @type G: float
+ @ivar IOR: Angular index of refraction for raytrace.
+ Value is clamped to the range [1.0,3.0].
+ @type IOR: float
+ @ivar R: Diffuse color (L{rgbCol}) red component.
+ Value is clamped to the range [0.0,1.0].
+ @type R: float
+ @ivar add: Strength of the add effect.
+ Value is clamped to the range [0.0,1.0].
+ @type add: float
+ @ivar alpha: Alpha (translucency) component of the material.
+ Value is clamped to the range [0.0,1.0].
+ @type alpha: float
+ @ivar shadAlpha: Shadow Alpha for irregular shadow buffer.
+ Value is clamped to the range [0.0,1.0].
+ @type shadAlpha: float
+ @ivar amb: Amount of global ambient color material receives.
+ Value is clamped to the range [0.0,1.0].
+ @type amb: float
+ @ivar diffuseDarkness: Material's diffuse darkness ("Minnaert" diffuse shader only).
+ Value is clamped to the range [0.0,2.0].
+ @type diffuseDarkness: float
+ @ivar diffuseShader: Diffuse shader type (see L{Shaders}).
+ Value must be in the range [0,3].
+ @type diffuseShader: int
+ @ivar diffuseSize: Material's diffuse area size ("Toon" diffuse shader only).
+ Value is clamped to the range [0.0,3.14].
+ @type diffuseSize: float
+ @ivar diffuseSmooth: Material's diffuse area smoothing ("Toon" diffuse shader only).
+ Value is clamped to the range [0.0,1.0].
+ @type diffuseSmooth: float
+ @ivar emit: Amount of light the material emits.
+ Value is clamped to the range [0.0,1.0].
+ @type emit: float
+ @ivar filter: Amount of filtering when transparent raytrace is enabled.
+ Value is clamped to the range [0.0,1.0].
+ @type filter: float
+ @ivar flareBoost: Flare's extra strength.
+ Value is clamped to the range [0.1,1.0].
+ @type flareBoost: float
+ @ivar flareSeed: Offset in the flare seed table.
+ Value is clamped to the range [1,255].
+ @type flareSeed: int
+ @ivar flareSize: Ratio of flare size to halo size.
+ Value is clamped to the range [0.1,25.0].
+ @type flareSize: float
+ @ivar fresnelDepth: Power of Fresnel for mirror reflection.
+ Value is clamped to the range [0.0,5.0].
+ @type fresnelDepth: float
+ @ivar fresnelDepthFac: Blending factor for Fresnel mirror.
+ Value is clamped to the range [1.0,5.0].
+ @type fresnelDepthFac: float
+ @ivar fresnelTrans: Power of Fresnel for transparency.
+ Value is clamped to the range [0.0,5.0].
+ @type fresnelTrans: float
+ @ivar fresnelTransFac: Blending factor for Fresnel transparency.
+ Value is clamped to the range [1.0,5.0].
+ @type fresnelTransFac: float
+ @ivar rbFriction: Rigid Body Friction coefficient.
+ Value is clamped to the range [0.0,100.0].
+ @type rbFriction: float
+ @ivar rbRestitution: Rigid Body Friction restitution.
+ Value is clamped to the range [0.0,1.0].
+ @type rbRestitution: float
+ @ivar haloSeed: Randomizes halo ring dimension and line location.
+ Value is clamped to the range [1,255].
+ @type haloSeed: int
+ @ivar haloSize: Dimension of the halo.
+ Value is clamped to the range [0.0,100.0].
+ @type haloSize: float
+ @ivar hard: Hardness of the specularity.
+ Value is clamped to the range [1,255].
+ @type hard: int
+ @ivar ipo: Material Ipo data.
+ Contains the Ipo if one is assigned to the object, None otherwise. Setting to None clears the current Ipo.
+ @type ipo: Blender Ipo
+ @ivar mirB: Mirror color (L{mirCol}) blue component.
+ Value is clamped to the range [0.0,1.0].
+ @type mirB: float
+ @ivar mirCol: Mirror RGB color triplet.
+ Components are clamped to the range [0.0,1.0].
+ @type mirCol: list of 3 floats
+ @ivar mirG: Mirror color (L{mirCol}) green component.
+ Value is clamped to the range [0.0,1.0].
+ @type mirG: float
+ @ivar mirR: Mirror color (L{mirCol}) red component.
+ Value is clamped to the range [0.0,1.0].
+ @type mirR: float
+ @ivar mode: Mode mode bitfield. See L{the Modes dictionary<Modes>} keys and descriptions.
+ @type mode: int
+ @ivar nFlares: Number of subflares with halo.
+ Value is clamped to the range [1,32].
+ @type nFlares: int
+ @ivar nLines: Number of star-shaped lines with halo.
+ Value is clamped to the range [0,250].
+ @type nLines: int
+ @ivar nRings: Number of rings with halo.
+ Value is clamped to the range [0,24].
+ @type nRings: int
+ @ivar nStars: Number of star points with halo.
+ Value is clamped to the range [3,50].
+ @type nStars: int
+ @ivar oopsLoc: Material OOPs location. Returns None if material not found in list.
+ @type oopsLoc: list of 2 floats
+ @ivar oopsSel: Material OOPs selection flag.
+ Value must be in the range [0,1].
+ @type oopsSel: int
+ @ivar rayMirr: Mirror reflection amount for raytrace.
+ Value is clamped to the range [0.0,1.0].
+ @type rayMirr: float
+ @ivar rayMirrDepth: Amount of raytrace inter-reflections.
+ Value is clamped to the range [0,10].
+ @type rayMirrDepth: int
+ @ivar ref: Amount of reflections (for shader).
+ Value is clamped to the range [0.0,1.0].
+ @type ref: float
+ @ivar refracIndex: Material's Index of Refraction (applies to the "Blinn" Specular Shader only.
+ Value is clamped to the range [1.0,10.0].
+ @type refracIndex: float
+ @ivar rgbCol: Diffuse RGB color triplet.
+ Components are clamped to the range [0.0,1.0].
+ @type rgbCol: list of 3 floats
+ @ivar rms: Material's surface slope standard deviation ("WardIso" specular shader only).
+ Value is clamped to the range [0.0,0.4].
+ @type rms: float
+ @ivar roughness: Material's roughness ("Oren Nayar" diffuse shader only).
+ Value is clamped to the range [0.0,3.14].
+ @type roughness: float
+ @ivar spec: Degree of specularity.
+ Value is clamped to the range [0.0,2.0].
+ @type spec: float
+ @ivar specB: Specular color (L{specCol}) blue component.
+ Value is clamped to the range [0.0,1.0].
+ @type specB: float
+ @ivar specCol: Specular RGB color triplet.
+ Components are clamped to the range [0.0,1.0].
+ @type specCol: list of 3 floats
+ @ivar specG: Specular color (L{specCol}) green component.
+ Value is clamped to the range [0.0,1.0].
+ @type specG: float
+ @ivar specR: Specular color (L{specCol}) red component.
+ Value is clamped to the range [0.0,1.0].
+ @type specR: float
+ @ivar specShader: Specular shader type. See L{Shaders}.
+ Value must be in the range [0,4].
+ @type specShader: int
+ @ivar specSize: Material's specular area size ("Toon" specular shader only).
+ Value is clamped to the range [0.0,1.53].
+ @type specSize: float
+ @ivar specSmooth: Sets the smoothness of specular toon area.
+ Value is clamped to the range [0.0,1.0].
+ @type specSmooth: float
+ @ivar specTransp: Makes specular areas opaque on transparent materials.
+ Value is clamped to the range [0.0,1.0].
+ @type specTransp: float
+ @ivar subSize: Dimension of subflares, dots and circles.
+ Value is clamped to the range [0.1,25.0].
+ @type subSize: float
+ @ivar transDepth: calculated maximal. Amount of refractions for raytrace.
+ Value is clamped to the range [0,10].
+ @type transDepth: int
+ @ivar translucency: Amount of diffuse shading of the back side.
+ Value is clamped to the range [0.0,1.0].
+ @type translucency: float
+ @ivar zOffset: Artificial offset in the Z buffer (for Ztransp option).
+ Value is clamped to the range [0.0,10.0].
+ @type zOffset: float
+ @ivar lightGroup: Limits lights that affect this material to a group.
+ @type lightGroup: Group or None
+ @ivar uvlayer: The uv layer name to use, when UV mapping is enabled.
+ @type uvlayer: string
+ @warning: Most member variables assume values in some [Min, Max] interval.
+ When trying to set them, the given parameter will be clamped to lie in
+ that range: if val < Min, then val = Min, if val > Max, then val = Max.
+ """
+
+ def getName():
+ """
+ Get the name of this Material object.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Material object.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getIpo():
+ """
+ Get the Ipo associated with this material, if any.
+ @rtype: Ipo
+ @return: the wrapped ipo or None.
+ """
+
+ def setIpo(ipo):
+ """
+ Link an ipo to this material.
+ @type ipo: Blender Ipo
+ @param ipo: a material type ipo.
+ """
+
+ def clearIpo():
+ """
+ Unlink the ipo from this material.
+ @return: True if there was an ipo linked or False otherwise.
+ """
+
+ def insertIpoKey(keytype):
+ """
+ Inserts keytype values in material ipo at curframe. Uses module constants.
+ @type keytype: Integer
+ @param keytype:
+ -RGB
+ -ALPHA
+ -HALOSIZE
+ -MODE
+ -ALLCOLOR
+ -ALLMIRROR
+ -OFS
+ -SIZE
+ -ALLMAPPING
+ @return: py_none
+ """
+
+ def getMode():
+ """
+ Get this Material's mode flags.
+ @rtype: int
+ @return: B{OR'ed value}. Use the Modes dictionary to check which flags
+ are 'on'.
+
+ Example::
+ import Blender
+ from Blender import Material
+ flags = mymat.getMode()
+ if flags & Material.Modes['HALO']:
+ print "This material is rendered as a halo"
+ else:
+ print "Not a halo"
+ """
+
+ def setMode(param, stringN=None):
+ """
+ Set this Material's mode flags. Up to 22 mode strings can be given
+ and specify the modes which are turned 'on'. Those not provided are
+ turned 'off', so mat.setMode() -- without arguments -- turns off all
+ mode flags for Material mat. Valid mode strings are "Traceable",
+ "Shadow", "Shadeless", "Wire", "VColLight", "VColPaint", "Halo",
+ "ZTransp", "ZInvert", "HaloRings", "HaloLines", "OnlyShadow",
+ "HaloXAlpha", "HaloStar", "TexFace", "HaloTex", "HaloPuno", "NoMist",
+ "HaloShaded", "HaloFlare", "Radio", "RayMirr", "ZTransp", "RayTransp",
+ "Env"
+
+ An integer can also be given, which directly sets the mode flag. The
+ Modes dictionary keys can (and should) be added or ORed to specify
+ which modes to turn 'on'. The value returned from getMode() can
+ also be modified and input to this method.
+
+ @type param: string, None or int
+ @param param: A mode value (int) or flag (string). Can also be None.
+ @type stringN: string
+ @param stringN: A mode flag. Up to 22 flags can be set at the same time.
+ """
+
+ def getRGBCol():
+ """
+ Get the rgb color triplet sequence.
+ @rtype: list of 3 floats
+ @return: [r, g, b]
+ """
+
+ def setRGBCol(rgb = None):
+ """
+ Set the rgb color triplet sequence. If B{rgb} is None, set the color to black.
+ @type rgb: three floats or a list of three floats
+ @param rgb: The rgb color values in [0.0, 1.0] as:
+ - a list of three floats: setRGBCol ([r, g, b]) B{or}
+ - three floats as separate parameters: setRGBCol (r,g,b).
+ """
- def getSpecCol():
- """
- Get the specular color triplet sequence.
- @rtype: list of 3 floats
- @return: [specR, specG, specB]
- """
-
- def setSpecCol(rgb = None):
- """
- Set the specular color triplet sequence. If B{rgb} is None, set the color to black.
- @type rgb: three floats or a list of three floats
- @param rgb: The rgb color values in [0.0, 1.0] as:
- - a list of three floats: setSpecCol ([r, g, b]) B{or}
- - three floats as separate parameters: setSpecCol (r,g,b).
- """
-
- def getMirCol():
- """
- Get the mirror color triplet sequence.
- @rtype: list of 3 floats
- @return: [mirR, mirG, mirb]
- """
-
- def setMirCol(rgb = None):
- """
- Set the mirror color triplet sequence. If B{rgb} is None, set the color to black.
- @type rgb: three floats or a list of three floats
- @param rgb: The rgb color values in [0.0, 1.0] as:
- - a list of three floats: setMirCol ([r, g, b]) B{or}
- - three floats as separate parameters: setMirCol (r,g,b).
- """
-
- def getAlpha():
- """
- Get the alpha (transparency) value.
- @rtype: float
- """
-
- def setAlpha(alpha):
- """
- Set the alpha (transparency) value.
- @type alpha: float
- @param alpha: The new value in [0.0, 1.0].
- """
-
- def getAmb():
- """
- Get the ambient color blend factor.
- @rtype: float
- """
-
- def setAmb(amb):
- """
- Set the ambient color blend factor.
- @type amb: float
- @param amb: The new value in [0.0, 1.0].
- """
-
- def getEmit():
- """
- Get the emitting light intensity.
- @rtype: float
- """
-
- def setEmit(emit):
- """
- Set the emitting light intensity.
- @type emit: float
- @param emit: The new value in [0.0, 1.0].
- """
-
- def getRef():
- """
- Get the reflectivity value.
- @rtype: float
- """
-
- def setRef(ref):
- """
- Set the reflectivity value.
- @type ref: float
- @param ref: The new value in [0.0, 1.0].
- """
-
- def getSpec():
- """
- Get the specularity value.
- @rtype: float
- """
-
- def setSpec(spec):
- """
- Set the specularity value.
- @type spec: float
- @param spec: The new value in [0.0, 2.0].
- """
-
- def getSpecTransp():
- """
- Get the specular transparency.
- @rtype: float
- """
-
- def setSpecTransp(spectransp):
- """
- Set the specular transparency.
- @type spectransp: float
- @param spectransp: The new value in [0.0, 1.0].
- """
-
- def setSpecShader(specShader):
- """
- Set the material's specular shader from one of the shaders in Material.Shaders dict.
- @type specShader: int
- @param specShader: The new value in [0, 4].
- """
-
- def getSpecShader(specShader):
- """
- Get the material's specular shader from one of the shaders in Material.Shaders dict.
- @rtype: int
- """
-
- def setDiffuseShader(diffuseShader):
- """
- Set the material's diffuse shader from one of the shaders in Material.Shaders dict.
- @type diffuseShader: int
- @param diffuseShader: The new value in [0, 3].
- """
-
- def getDiffuseShader():
- """
- Get the material's diffuse shader from one of the shaders in Material.Shaders dict.
- @rtype: int
- """
-
- def setRoughness(roughness):
- """
- Set the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only)
- @type roughness: float
- @param roughness: The new value in [0.0, 3.14].
- """
-
- def getRoughness():
- """
- Get the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only)
- @rtype: float
- """
-
- def setSpecSize(specSize):
- """
- Set the material's size of specular area (applies to the \"Toon\" Specular Shader only)
- @type specSize: float
- @param specSize: The new value in [0.0, 1.53].
- """
-
- def getSpecSize():
- """
- Get the material's size of specular area (applies to the \"Toon\" Specular Shader only)
- @rtype specSize: float
- """
-
- def setSpecSize(diffuseSize):
- """
- Set the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @type diffuseSize: float
- @param diffuseSize: The new value in [0.0, 3.14].
- """
-
- def getSpecSize():
- """
- Get the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @rtype: float
- """
-
- def setSpecSmooth(specSmooth):
- """
- Set the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)
- @type specSmooth: float
- @param specSmooth: The new value in [0.0, 1.0].
- """
-
- def getSpecSmooth():
- """
- Get the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)
- @rtype: float
- """
-
- def setDiffuseSmooth(diffuseSmooth):
- """
- Set the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @type diffuseSmooth: float
- @param diffuseSmooth: The new value in [0.0, 1.0].
- """
-
- def getDiffuseSmooth():
- """
- Get the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)
- @rtype: float
- """
-
- def setDiffuseDarkness(diffuseDarkness):
- """
- Set the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)
- @type diffuseDarkness: float
- @param diffuseDarkness: The new value in [0.0, 2.0].
- """
-
- def getDiffuseDarkness():
- """
- Get the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)
- @rtype: float
- """
-
- def setRefracIndex(refracIndex):
- """
- Set the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)
- @type refracIndex: float
- @param refracIndex: The new value in [1.0, 10.0].
- """
-
- def getRefracIndex():
- """
- Get the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)
- @rtype: float
- """
-
- def setRms(rms):
- """
- Set the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)
- @type rms: float
- @param rms: The new value in [0.0, 0.4].
- """
-
- def getRms():
- """
- Get the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)
- @rtype: float
- """
-
- def setFilter(filter):
- """
- Set the material's amount of filtering when transparent raytrace is enabled
- @type filter: float
- @param filter: The new value in [0.0, 1.0].
- """
-
- def getFilter():
- """
- Get the material's amount of filtering when transparent raytrace is enabled
- @rtype: float
- """
-
- def setTranslucency(translucency):
- """
- Set the material's amount of diffuse shading of the back side
- @type translucency: float
- @param translucency: The new value in [0.0, 1.0].
- """
-
- def getTranslucency():
- """
- Get the material's amount of diffuse shading of the back side
- @rtype: float
- """
-
- def getAdd():
- """
- Get the glow factor.
- @rtype: float
- """
-
- def setAdd(add):
- """
- Set the glow factor.
- @type add: float
- @param add: The new value in [0.0, 1.0].
- """
-
- def getZOffset():
- """
- Get the artificial offset for faces with this Material.
- @rtype: float
- """
-
- def setZOffset(zoffset):
- """
- Set the artificial offset for faces with this Material.
- @type zoffset: float
- @param zoffset: The new value in [0.0, 10.0].
- """
-
- def getHaloSize():
- """
- Get the halo size.
- @rtype: float
- """
-
- def setHaloSize(halosize):
- """
- Set the halo size.
- @type halosize: float
- @param halosize: The new value in [0.0, 100.0].
- """
-
- def getHaloSeed():
- """
- Get the seed for random ring dimension and line location in halos.
- @rtype: int
- """
-
- def setHaloSeed(haloseed):
- """
- Set the seed for random ring dimension and line location in halos.
- @type haloseed: int
- @param haloseed: The new value in [0, 255].
- """
-
- def getFlareSize():
- """
- Get the ratio: flareSize / haloSize.
- @rtype: float
- """
-
- def setFlareSize(flaresize):
- """
- Set the ratio: flareSize / haloSize.
- @type flaresize: float
- @param flaresize: The new value in [0.1, 25.0].
- """
-
- def getFlareSeed():
- """
- Get flare's offset in the seed table.
- @rtype: int
- """
-
- def setFlareSeed(flareseed):
- """
- Set flare's offset in the seed table.
- @type flareseed: int
- @param flareseed: The new value in [0, 255].
- """
-
- def getFlareBoost():
- """
- Get the flare's extra strength.
- @rtype: float
- """
-
- def setFlareBoost(flareboost):
- """
- Set the flare's extra strength.
- @type flareboost: float
- @param flareboost: The new value in [0.1, 10.0].
- """
-
- def getSubSize():
- """
- Get the dimension of subflare, dots and circles.
- @rtype: float
- """
-
- def setSubSize(subsize):
- """
- Set the dimension of subflare, dots and circles.
- @type subsize: float
- @param subsize: The new value in [0.1, 25.0].
- """
-
- def getHardness():
- """
- Get the hardness of the specularity.
- @rtype: int
- """
-
- def setHardness(hardness):
- """
- Set the hardness of the specularity.
- @type hardness: int
- @param hardness: The new value in [1, 511].
- """
-
- def getNFlares():
- """
- Get the number of halo subflares.
- @rtype: int
- """
-
- def setNFlares(nflares):
- """
- Set the number of halo subflares.
- @type nflares: int
- @param nflares: The new value in [1, 32].
- """
-
- def getNStars():
- """
- Get the number of points in the halo stars.
- @rtype: int
- """
-
- def setNStars(nstars):
- """
- Set the number of points in the halo stars.
- @type nstars: int
- @param nstars: The new value in [3, 50].
- """
-
- def getNLines():
- """
- Get the number of star shaped lines on each halo.
- @rtype: int
- """
-
- def setNLines(nlines):
- """
- Set the number of star shaped lines on each halo.
- @type nlines: int
- @param nlines: The new value in [0, 250].
- """
-
- def getNRings():
- """
- Get the number of rings on each halo.
- @rtype: int
- """
-
- def setNRings(nrings):
- """
- Set the number of rings on each halo.
- @type nrings: int
- @param nrings: The new value in [0, 24].
- """
-
- def getRayMirr():
- """
- Get amount mirror reflection for raytrace.
- @rtype: float
- """
-
- def setRayMirr(nrmirr):
- """
- Set amount mirror reflection for raytrace.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getRayMirrDepth():
- """
- Get amount of inter-reflections calculated maximal.
- @rtype: int
- """
-
- def setRayMirrDepth(nrmirr):
- """
- Set amount mirror reflection for raytrace.
- @type nrmirr: int
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelMirr():
- """
- Get power of Fresnel for mirror reflection.
- @rtype: float
- """
-
- def setFresnelMirr(nrmirr):
- """
- Set power of Fresnel for mirror reflection.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelMirrFac():
- """
- Get the number of Ray Mirror.
- @rtype: float
- """
-
- def setFresnelMirrFac(nrmirr):
- """
- Set the number of ray mirror
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getIOR():
- """
- Get the angular index of refraction for raytrace.
- @rtype: float
- """
-
- def setIOR(nrmirr):
- """
- Set the angular index of refraction for raytrace.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getTransDepth():
- """
- Get amount of refractions calculated maximal.
- @rtype: int
- """
-
- def setTransDepth(nrmirr):
- """
- Set amount of refractions calculated maximal.
- @type nrmirr: int
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelTrans():
- """
- Get power of Fresnel for transparency.
- @rtype: float
- """
-
- def setFresnelTrans(nrmirr):
- """
- Set power of Fresnel for transparency.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def getFresnelTransFac():
- """
- Get blending factor for Fresnel.
- @rtype: float
- """
-
- def setFresnelTransFac(nrmirr):
- """
- Set blending factor for Fresnel.
- @type nrmirr: float
- @param nrmirr: The new value in [0.0, 1.0].
- """
-
- def setTexture(index, texture, texco, mapto):
- """
- Assign a Blender Texture object to slot number 'number'.
- @type index: int
- @param index: material's texture index in [0, 9].
- @type texture: Blender Texture
- @param texture: a Blender Texture object.
- @type texco: int
- @param texco: optional ORed bitflag -- defaults to TexCo.ORCO. See TexCo var in L{Texture}.
- @type mapto: int
- @param mapto: optional ORed bitflag -- defaults to MapTo.COL. See MapTo var in L{Texture}.
- """
-
- def clearTexture(index):
- """
- Clear the ith (given by 'index') texture channel of this material.
- @type index: int
- @param index: material's texture channel index in [0, 9].
- """
-
- def getTextures ():
- """
- Get this Material's Texture list.
- @rtype: list of MTex
- @return: a list of Blender MTex objects. None is returned for each empty
- texture slot.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Material's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged" or "Redraw".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Material. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Material.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged" or "Redraw".
- """
-
- def __copy__ ():
- """
- Make a copy of this material
- @rtype: Material
- @return: a copy of this material
- """ \ No newline at end of file
+ def getSpecCol():
+ """
+ Get the specular color triplet sequence.
+ @rtype: list of 3 floats
+ @return: [specR, specG, specB]
+ """
+
+ def setSpecCol(rgb = None):
+ """
+ Set the specular color triplet sequence. If B{rgb} is None, set the color to black.
+ @type rgb: three floats or a list of three floats
+ @param rgb: The rgb color values in [0.0, 1.0] as:
+ - a list of three floats: setSpecCol ([r, g, b]) B{or}
+ - three floats as separate parameters: setSpecCol (r,g,b).
+ """
+
+ def getMirCol():
+ """
+ Get the mirror color triplet sequence.
+ @rtype: list of 3 floats
+ @return: [mirR, mirG, mirb]
+ """
+
+ def setMirCol(rgb = None):
+ """
+ Set the mirror color triplet sequence. If B{rgb} is None, set the color to black.
+ @type rgb: three floats or a list of three floats
+ @param rgb: The rgb color values in [0.0, 1.0] as:
+ - a list of three floats: setMirCol ([r, g, b]) B{or}
+ - three floats as separate parameters: setMirCol (r,g,b).
+ """
+
+ def getAlpha():
+ """
+ Get the alpha (transparency) value.
+ @rtype: float
+ """
+
+ def setAlpha(alpha):
+ """
+ Set the alpha (transparency) value.
+ @type alpha: float
+ @param alpha: The new value in [0.0, 1.0].
+ """
+
+ def getAmb():
+ """
+ Get the ambient color blend factor.
+ @rtype: float
+ """
+
+ def setAmb(amb):
+ """
+ Set the ambient color blend factor.
+ @type amb: float
+ @param amb: The new value in [0.0, 1.0].
+ """
+
+ def getEmit():
+ """
+ Get the emitting light intensity.
+ @rtype: float
+ """
+
+ def setEmit(emit):
+ """
+ Set the emitting light intensity.
+ @type emit: float
+ @param emit: The new value in [0.0, 1.0].
+ """
+
+ def getRef():
+ """
+ Get the reflectivity value.
+ @rtype: float
+ """
+
+ def setRef(ref):
+ """
+ Set the reflectivity value.
+ @type ref: float
+ @param ref: The new value in [0.0, 1.0].
+ """
+
+ def getSpec():
+ """
+ Get the specularity value.
+ @rtype: float
+ """
+
+ def setSpec(spec):
+ """
+ Set the specularity value.
+ @type spec: float
+ @param spec: The new value in [0.0, 2.0].
+ """
+
+ def getSpecTransp():
+ """
+ Get the specular transparency.
+ @rtype: float
+ """
+
+ def setSpecTransp(spectransp):
+ """
+ Set the specular transparency.
+ @type spectransp: float
+ @param spectransp: The new value in [0.0, 1.0].
+ """
+
+ def setSpecShader(specShader):
+ """
+ Set the material's specular shader from one of the shaders in Material.Shaders dict.
+ @type specShader: int
+ @param specShader: The new value in [0, 4].
+ """
+
+ def getSpecShader(specShader):
+ """
+ Get the material's specular shader from one of the shaders in Material.Shaders dict.
+ @rtype: int
+ """
+
+ def setDiffuseShader(diffuseShader):
+ """
+ Set the material's diffuse shader from one of the shaders in Material.Shaders dict.
+ @type diffuseShader: int
+ @param diffuseShader: The new value in [0, 3].
+ """
+
+ def getDiffuseShader():
+ """
+ Get the material's diffuse shader from one of the shaders in Material.Shaders dict.
+ @rtype: int
+ """
+
+ def setRoughness(roughness):
+ """
+ Set the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only)
+ @type roughness: float
+ @param roughness: The new value in [0.0, 3.14].
+ """
+
+ def getRoughness():
+ """
+ Get the material's roughness (applies to the \"Oren Nayar\" Diffuse Shader only)
+ @rtype: float
+ """
+
+ def setSpecSize(specSize):
+ """
+ Set the material's size of specular area (applies to the \"Toon\" Specular Shader only)
+ @type specSize: float
+ @param specSize: The new value in [0.0, 1.53].
+ """
+
+ def getSpecSize():
+ """
+ Get the material's size of specular area (applies to the \"Toon\" Specular Shader only)
+ @rtype specSize: float
+ """
+
+ def setSpecSize(diffuseSize):
+ """
+ Set the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)
+ @type diffuseSize: float
+ @param diffuseSize: The new value in [0.0, 3.14].
+ """
+
+ def getSpecSize():
+ """
+ Get the material's size of diffuse area (applies to the \"Toon\" Diffuse Shader only)
+ @rtype: float
+ """
+
+ def setSpecSmooth(specSmooth):
+ """
+ Set the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)
+ @type specSmooth: float
+ @param specSmooth: The new value in [0.0, 1.0].
+ """
+
+ def getSpecSmooth():
+ """
+ Get the material's smoothing of specular area (applies to the \"Toon\" Specular Shader only)
+ @rtype: float
+ """
+
+ def setDiffuseSmooth(diffuseSmooth):
+ """
+ Set the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)
+ @type diffuseSmooth: float
+ @param diffuseSmooth: The new value in [0.0, 1.0].
+ """
+
+ def getDiffuseSmooth():
+ """
+ Get the material's smoothing of diffuse area (applies to the \"Toon\" Diffuse Shader only)
+ @rtype: float
+ """
+
+ def setDiffuseDarkness(diffuseDarkness):
+ """
+ Set the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)
+ @type diffuseDarkness: float
+ @param diffuseDarkness: The new value in [0.0, 2.0].
+ """
+
+ def getDiffuseDarkness():
+ """
+ Get the material's diffuse darkness (applies to the \"Minnaert\" Diffuse Shader only)
+ @rtype: float
+ """
+
+ def setRefracIndex(refracIndex):
+ """
+ Set the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)
+ @type refracIndex: float
+ @param refracIndex: The new value in [1.0, 10.0].
+ """
+
+ def getRefracIndex():
+ """
+ Get the material's Index of Refraction (applies to the \"Blinn\" Specular Shader only)
+ @rtype: float
+ """
+
+ def setRms(rms):
+ """
+ Set the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)
+ @type rms: float
+ @param rms: The new value in [0.0, 0.4].
+ """
+
+ def getRms():
+ """
+ Get the material's standard deviation of surface slope (applies to the \"WardIso\" Specular Shader only)
+ @rtype: float
+ """
+
+ def setFilter(filter):
+ """
+ Set the material's amount of filtering when transparent raytrace is enabled
+ @type filter: float
+ @param filter: The new value in [0.0, 1.0].
+ """
+
+ def getFilter():
+ """
+ Get the material's amount of filtering when transparent raytrace is enabled
+ @rtype: float
+ """
+
+ def setTranslucency(translucency):
+ """
+ Set the material's amount of diffuse shading of the back side
+ @type translucency: float
+ @param translucency: The new value in [0.0, 1.0].
+ """
+
+ def getTranslucency():
+ """
+ Get the material's amount of diffuse shading of the back side
+ @rtype: float
+ """
+
+ def getAdd():
+ """
+ Get the glow factor.
+ @rtype: float
+ """
+
+ def setAdd(add):
+ """
+ Set the glow factor.
+ @type add: float
+ @param add: The new value in [0.0, 1.0].
+ """
+
+ def getZOffset():
+ """
+ Get the artificial offset for faces with this Material.
+ @rtype: float
+ """
+
+ def setZOffset(zoffset):
+ """
+ Set the artificial offset for faces with this Material.
+ @type zoffset: float
+ @param zoffset: The new value in [0.0, 10.0].
+ """
+
+ def getHaloSize():
+ """
+ Get the halo size.
+ @rtype: float
+ """
+
+ def setHaloSize(halosize):
+ """
+ Set the halo size.
+ @type halosize: float
+ @param halosize: The new value in [0.0, 100.0].
+ """
+
+ def getHaloSeed():
+ """
+ Get the seed for random ring dimension and line location in halos.
+ @rtype: int
+ """
+
+ def setHaloSeed(haloseed):
+ """
+ Set the seed for random ring dimension and line location in halos.
+ @type haloseed: int
+ @param haloseed: The new value in [0, 255].
+ """
+
+ def getFlareSize():
+ """
+ Get the ratio: flareSize / haloSize.
+ @rtype: float
+ """
+
+ def setFlareSize(flaresize):
+ """
+ Set the ratio: flareSize / haloSize.
+ @type flaresize: float
+ @param flaresize: The new value in [0.1, 25.0].
+ """
+
+ def getFlareSeed():
+ """
+ Get flare's offset in the seed table.
+ @rtype: int
+ """
+
+ def setFlareSeed(flareseed):
+ """
+ Set flare's offset in the seed table.
+ @type flareseed: int
+ @param flareseed: The new value in [0, 255].
+ """
+
+ def getFlareBoost():
+ """
+ Get the flare's extra strength.
+ @rtype: float
+ """
+
+ def setFlareBoost(flareboost):
+ """
+ Set the flare's extra strength.
+ @type flareboost: float
+ @param flareboost: The new value in [0.1, 10.0].
+ """
+
+ def getSubSize():
+ """
+ Get the dimension of subflare, dots and circles.
+ @rtype: float
+ """
+
+ def setSubSize(subsize):
+ """
+ Set the dimension of subflare, dots and circles.
+ @type subsize: float
+ @param subsize: The new value in [0.1, 25.0].
+ """
+
+ def getHardness():
+ """
+ Get the hardness of the specularity.
+ @rtype: int
+ """
+
+ def setHardness(hardness):
+ """
+ Set the hardness of the specularity.
+ @type hardness: int
+ @param hardness: The new value in [1, 511].
+ """
+
+ def getNFlares():
+ """
+ Get the number of halo subflares.
+ @rtype: int
+ """
+
+ def setNFlares(nflares):
+ """
+ Set the number of halo subflares.
+ @type nflares: int
+ @param nflares: The new value in [1, 32].
+ """
+
+ def getNStars():
+ """
+ Get the number of points in the halo stars.
+ @rtype: int
+ """
+
+ def setNStars(nstars):
+ """
+ Set the number of points in the halo stars.
+ @type nstars: int
+ @param nstars: The new value in [3, 50].
+ """
+
+ def getNLines():
+ """
+ Get the number of star shaped lines on each halo.
+ @rtype: int
+ """
+
+ def setNLines(nlines):
+ """
+ Set the number of star shaped lines on each halo.
+ @type nlines: int
+ @param nlines: The new value in [0, 250].
+ """
+
+ def getNRings():
+ """
+ Get the number of rings on each halo.
+ @rtype: int
+ """
+
+ def setNRings(nrings):
+ """
+ Set the number of rings on each halo.
+ @type nrings: int
+ @param nrings: The new value in [0, 24].
+ """
+
+ def getRayMirr():
+ """
+ Get amount mirror reflection for raytrace.
+ @rtype: float
+ """
+
+ def setRayMirr(nrmirr):
+ """
+ Set amount mirror reflection for raytrace.
+ @type nrmirr: float
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getRayMirrDepth():
+ """
+ Get amount of inter-reflections calculated maximal.
+ @rtype: int
+ """
+
+ def setRayMirrDepth(nrmirr):
+ """
+ Set amount mirror reflection for raytrace.
+ @type nrmirr: int
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getFresnelMirr():
+ """
+ Get power of Fresnel for mirror reflection.
+ @rtype: float
+ """
+
+ def setFresnelMirr(nrmirr):
+ """
+ Set power of Fresnel for mirror reflection.
+ @type nrmirr: float
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getFresnelMirrFac():
+ """
+ Get the number of Ray Mirror.
+ @rtype: float
+ """
+
+ def setFresnelMirrFac(nrmirr):
+ """
+ Set the number of ray mirror
+ @type nrmirr: float
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getIOR():
+ """
+ Get the angular index of refraction for raytrace.
+ @rtype: float
+ """
+
+ def setIOR(nrmirr):
+ """
+ Set the angular index of refraction for raytrace.
+ @type nrmirr: float
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getTransDepth():
+ """
+ Get amount of refractions calculated maximal.
+ @rtype: int
+ """
+
+ def setTransDepth(nrmirr):
+ """
+ Set amount of refractions calculated maximal.
+ @type nrmirr: int
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getFresnelTrans():
+ """
+ Get power of Fresnel for transparency.
+ @rtype: float
+ """
+
+ def setFresnelTrans(nrmirr):
+ """
+ Set power of Fresnel for transparency.
+ @type nrmirr: float
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def getFresnelTransFac():
+ """
+ Get blending factor for Fresnel.
+ @rtype: float
+ """
+
+ def setFresnelTransFac(nrmirr):
+ """
+ Set blending factor for Fresnel.
+ @type nrmirr: float
+ @param nrmirr: The new value in [0.0, 1.0].
+ """
+
+ def setTexture(index, texture, texco, mapto):
+ """
+ Assign a Blender Texture object to slot number 'number'.
+ @type index: int
+ @param index: material's texture index in [0, 9].
+ @type texture: Blender Texture
+ @param texture: a Blender Texture object.
+ @type texco: int
+ @param texco: optional ORed bitflag -- defaults to TexCo.ORCO. See TexCo var in L{Texture}.
+ @type mapto: int
+ @param mapto: optional ORed bitflag -- defaults to MapTo.COL. See MapTo var in L{Texture}.
+ """
+
+ def clearTexture(index):
+ """
+ Clear the ith (given by 'index') texture channel of this material.
+ @type index: int
+ @param index: material's texture channel index in [0, 9].
+ """
+
+ def getTextures ():
+ """
+ Get this Material's Texture list.
+ @rtype: list of MTex
+ @return: a list of Blender MTex objects. None is returned for each empty
+ texture slot.
+ """
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Material's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks (links = None):
+ """
+ Delete script links from this Material. If no list is specified, all
+ script links are deleted.
+ @type links: list of strings
+ @param links: None (default) or a list of Blender L{Text} names.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Material.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this material
+ @rtype: Material
+ @return: a copy of this material
+ """
+
+import id_generics
+Material.__doc__ += id_generics.attributes \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py
index 841e7058766..ff92e1fcf66 100644
--- a/source/blender/python/api2_2x/doc/Mesh.py
+++ b/source/blender/python/api2_2x/doc/Mesh.py
@@ -16,30 +16,29 @@ usage. The example below creates a simple pyramid, and sets some of the
face's attributes (the vertex color):
Example::
+ from Blender import *
- from Blender import *
+ editmode = Window.EditMode() # are we in edit mode? If so ...
+ if editmode: Window.EditMode(0) # leave edit mode before getting the mesh
- editmode = Window.EditMode() # are we in edit mode? If so ...
- if editmode: Window.EditMode(0) # leave edit mode before getting the mesh
+ # define vertices and faces for a pyramid
+ coords=[ [-1,-1,-1], [1,-1,-1], [1,1,-1], [-1,1,-1], [0,0,1] ]
+ faces= [ [3,2,1,0], [0,1,4], [1,2,4], [2,3,4], [3,0,4] ]
- # define vertices and faces for a pyramid
- coords=[ [-1,-1,-1], [1,-1,-1], [1,1,-1], [-1,1,-1], [0,0,1] ]
- faces= [ [3,2,1,0], [0,1,4], [1,2,4], [2,3,4], [3,0,4] ]
+ me = Mesh.New('myMesh') # create a new mesh
- me = Mesh.New('myMesh') # create a new mesh
+ me.verts.extend(coords) # add vertices to mesh
+ me.faces.extend(faces) # add faces to the mesh (also adds edges)
- me.verts.extend(coords) # add vertices to mesh
- me.faces.extend(faces) # add faces to the mesh (also adds edges)
+ me.vertexColors = 1 # enable vertex colors
+ me.faces[1].col[0].r = 255 # make each vertex a different color
+ me.faces[1].col[1].g = 255
+ me.faces[1].col[2].b = 255
- me.vertexColors = 1 # enable vertex colors
- me.faces[1].col[0].r = 255 # make each vertex a different color
- me.faces[1].col[1].g = 255
- me.faces[1].col[2].b = 255
+ scn = Scene.GetCurrent() # link object to current scene
+ ob = scn.objects.new(me, 'myObj')
- scn = Scene.GetCurrent() # link object to current scene
- ob = scn.objects.new(me, 'myObj')
-
- if editmode: Window.EditMode(1) # optional, just being nice
+ if editmode: Window.EditMode(1) # optional, just being nice
Vertices, edges and faces are added to a mesh using the .extend() methods.
For best speed and efficiency, gather all vertices, edges or faces into a
@@ -52,58 +51,58 @@ done once.
@type FaceModes: readonly dictionary
@type FaceTranspModes: readonly dictionary
@var Modes: The available mesh modes.
- - NOVNORMALSFLIP - no flipping of vertex normals during render.
- - TWOSIDED - double sided mesh.
- - AUTOSMOOTH - turn auto smoothing of faces "on".
- - note: SUBSURF and OPTIMAL have been removed, use Modifiers to apply subsurf.
+ - NOVNORMALSFLIP - no flipping of vertex normals during render.
+ - TWOSIDED - double sided mesh.
+ - AUTOSMOOTH - turn auto smoothing of faces "on".
+ - note: SUBSURF and OPTIMAL have been removed, use Modifiers to apply subsurf.
@var FaceFlags: The available *texture face* (uv face select mode) selection
- flags. Note: these refer to TexFace faces, available if mesh.faceUV
- returns true.
- - SELECT - selected.
- - HIDE - hidden.
- - ACTIVE - the active face, read only - Use L{mesh.activeFace<Mesh.Mesh.activeFace>} to set.
+ flags. Note: these refer to TexFace faces, available if mesh.faceUV
+ returns true.
+ - SELECT - selected.
+ - HIDE - hidden.
+ - ACTIVE - the active face, read only - Use L{mesh.activeFace<Mesh.Mesh.activeFace>} to set.
@var FaceModes: The available *texture face* modes. Note: these are only
- meaningful if mesh.faceUV returns true, since in Blender this info is
- stored at the TexFace (TexFace button in Edit Mesh buttons) structure.
- - ALL - set all modes at once.
- - BILLBOARD - always orient after camera.
- - HALO - halo face, always point to camera.
- - DYNAMIC - respond to collisions.
- - INVISIBLE - invisible face.
- - LIGHT - dynamic lighting.
- - OBCOL - use object color instead of vertex colors.
- - SHADOW - shadow type.
- - SHAREDVERT - apparently unused in Blender.
- - SHAREDCOL - shared vertex colors (per vertex).
- - TEX - has texture image.
- - TILES - uses tiled image.
- - TWOSIDE - two-sided face.
+ meaningful if mesh.faceUV returns true, since in Blender this info is
+ stored at the TexFace (TexFace button in Edit Mesh buttons) structure.
+ - ALL - set all modes at once.
+ - BILLBOARD - always orient after camera.
+ - HALO - halo face, always point to camera.
+ - DYNAMIC - respond to collisions.
+ - INVISIBLE - invisible face.
+ - LIGHT - dynamic lighting.
+ - OBCOL - use object color instead of vertex colors.
+ - SHADOW - shadow type.
+ - SHAREDVERT - apparently unused in Blender.
+ - SHAREDCOL - shared vertex colors (per vertex).
+ - TEX - has texture image.
+ - TILES - uses tiled image.
+ - TWOSIDE - two-sided face.
@var FaceTranspModes: The available face transparency modes. Note: these are
- enumerated values (enums), they can't be combined (ANDed, ORed, etc) like a bit vector.
- - SOLID - draw solid.
- - ADD - add to background (halo).
- - ALPHA - draw with transparency.
- - SUB - subtract from background.
+ enumerated values (enums), they can't be combined (ANDed, ORed, etc) like a bit vector.
+ - SOLID - draw solid.
+ - ADD - add to background (halo).
+ - ALPHA - draw with transparency.
+ - SUB - subtract from background.
@var EdgeFlags: The available edge flags.
- - SELECT - selected (B{deprecated}). Use edge.sel attribute instead.
- - EDGEDRAW - edge is drawn out of edition mode.
- - EDGERENDER - edge is drawn out of edition mode.
- - SEAM - edge is a seam for UV unwrapping
- - FGON - edge is part of a F-Gon.
- - LOOSE - Edge is not a part of a face (only set on leaving editmode)
- - SHARP - Edge will be rendered sharp when used with the "Edge Split" modifier.
+ - SELECT - selected (B{deprecated}). Use edge.sel attribute instead.
+ - EDGEDRAW - edge is drawn out of edition mode.
+ - EDGERENDER - edge is drawn out of edition mode.
+ - SEAM - edge is a seam for UV unwrapping
+ - FGON - edge is part of a F-Gon.
+ - LOOSE - Edge is not a part of a face (only set on leaving editmode)
+ - SHARP - Edge will be rendered sharp when used with the "Edge Split" modifier.
@type AssignModes: readonly dictionary.
@var AssignModes: The available vertex group assignment modes, used by
- L{mesh.assignVertsToGroup()<Mesh.Mesh.assignVertsToGroup>}.
- - ADD: if the vertex in the list is not assigned to the group
- already, this creates a new association between this vertex and the
- group with the weight specified, otherwise the weight given is added to
- the current weight of an existing association between the vertex and
- group.
- - SUBTRACT: will attempt to subtract the weight passed from a vertex
- already associated with a group, else it does nothing.\n
- - REPLACE: attempts to replace a weight with the new weight value
- for an already associated vertex/group, else it does nothing.
+ L{mesh.assignVertsToGroup()<Mesh.Mesh.assignVertsToGroup>}.
+ - ADD: if the vertex in the list is not assigned to the group
+ already, this creates a new association between this vertex and the
+ group with the weight specified, otherwise the weight given is added to
+ the current weight of an existing association between the vertex and
+ group.
+ - SUBTRACT: will attempt to subtract the weight passed from a vertex
+ already associated with a group, else it does nothing.\n
+ - REPLACE: attempts to replace a weight with the new weight value
+ for an already associated vertex/group, else it does nothing.
@type SelectModes: readonly dictionary.
@var SelectModes: The available edit select modes.
- VERTEX: vertex select mode.
@@ -114,1072 +113,1064 @@ done once.
AssignModes = {'REPLACE':1}
def Get(name=None):
- """
- Get the mesh data object called I{name} from Blender.
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: Mesh
- @return: If a name is given, it returns either the requested mesh or None.
- If no parameter is given, it returns all the meshes in the current scene.
- """
+ """
+ Get the mesh data object called I{name} from Blender.
+ @type name: string
+ @param name: The name of the mesh data object.
+ @rtype: Mesh
+ @return: If a name is given, it returns either the requested mesh or None.
+ If no parameter is given, it returns all the meshes in the current scene.
+ """
def New(name='Mesh'):
- """
- Create a new mesh data object called I{name}.
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: Mesh
- @return: a new Blender mesh.
- @note: if the mesh is not linked to an object, its datablock will be deleted
- when the object is deallocated.
- """
+ """
+ Create a new mesh data object called I{name}.
+ @type name: string
+ @param name: The name of the mesh data object.
+ @rtype: Mesh
+ @return: a new Blender mesh.
+ @note: if the mesh is not linked to an object, its datablock will be deleted
+ when the object is deallocated.
+ """
def Mode(mode=0):
- """
- Get and/or set the selection modes for mesh editing. These are the modes
- visible in the 3D window when a mesh is in Edit Mode.
- @type mode: int
- @param mode: The desired selection mode. See L{SelectModes} for values.
- Modes can be combined. If omitted, the selection mode is not changed.
- @rtype: int
- @return: the current selection mode.
- @note: The selection mode is an attribute of the current scene. If the
- scene is changed, the selection mode may not be the same.
- """
+ """
+ Get and/or set the selection modes for mesh editing. These are the modes
+ visible in the 3D window when a mesh is in Edit Mode.
+ @type mode: int
+ @param mode: The desired selection mode. See L{SelectModes} for values.
+ Modes can be combined. If omitted, the selection mode is not changed.
+ @rtype: int
+ @return: the current selection mode.
+ @note: The selection mode is an attribute of the current scene. If the
+ scene is changed, the selection mode may not be the same.
+ """
def Unlink(name):
- """
- Delete an unused mesh from Blender's database. The mesh must not have
- any users (i.e., it must not be linked to any object).
- @type name: string
- @param name: The name of the mesh data object.
- @rtype: None
- @note: This function may be a temporary solution; it may be replaced
- in the future by a more general unlink function for many datablock types.
- Hopefully this will be decided prior to the 2.42 release of Blender.
- """
+ """
+ Delete an unused mesh from Blender's database. The mesh must not have
+ any users (i.e., it must not be linked to any object).
+ @type name: string
+ @param name: The name of the mesh data object.
+ @rtype: None
+ @note: This function may be a temporary solution; it may be replaced
+ in the future by a more general unlink function for many datablock types.
+ Hopefully this will be decided prior to the 2.42 release of Blender.
+ """
class MCol:
- """
- The MCol object
- ===============
- This object is four ints representing an RGBA color.
- @ivar r: The Red component in [0, 255].
- @type r: int
- @ivar g: The Green component in [0, 255].
- @type g: int
- @ivar b: The Blue component in [0, 255].
- @type b: int
- @ivar a: The Alpha (transparency) component in [0, 255].
- @type a: int
- """
+ """
+ The MCol object
+ ===============
+ This object is four ints representing an RGBA color.
+ @ivar r: The Red component in [0, 255].
+ @type r: int
+ @ivar g: The Green component in [0, 255].
+ @type g: int
+ @ivar b: The Blue component in [0, 255].
+ @type b: int
+ @ivar a: The Alpha (transparency) component in [0, 255].
+ @type a: int
+ """
class MVert:
- """
- The MVert object
- ================
- This object holds mesh vertex data.
- @ivar co: The vertex coordinates (x, y, z).
- @type co: vector (WRAPPED DATA)
- @ivar no: The vertex's unit normal vector (x, y, z).
- B{Note}: if vertex coordinates are changed, it may be necessary to use
- L{Mesh.calcNormals()} to update the vertex normals.
- B{Note}: Vertex normals can be set, but are not wrapped so modifying a normal
- vector will not effect the verts normal. The result is only visible
- when faces have the smooth option enabled.
- Example::
- # This won't work.
- for v in me.verts:
- v.no.x= 0
- v.no.y= 0
- v.no.z= 1
- # This will work
- no= Blender.Mathutils.Vector(0,0,1)
- for v in me.verts:
- v.no= no
- @type no: vector
- @ivar uvco: The vertex texture "sticky" coordinates (x, y),
- if present. Available for MVerts only.
- Use L{Mesh.vertexUV} to test for presence before trying to access;
- otherwise an exception will may be thrown.
- (Sticky coordinates can be set when the object is in the Edit mode;
- from the Editing Panel (F9), look under the "Mesh" properties for the
- "Sticky" button).
- @type uvco: vector (WRAPPED DATA)
- @ivar index: The vertex's index within the mesh (MVerts only). Read-only.
- @type index: int
- @ivar sel: The vertex's selection state (selected=1).
- B{Note}: a Mesh will return the selection state of the mesh when EditMode
- was last exited. A Python script operating in EditMode must exit EditMode
- before getting the current selection state of the mesh.
- @type sel: int
- @ivar hide: The face's B{edit mode} visibility state (hidden=1).
- @type hide: int
- @warn: There are two kinds of UV texture coordinates in Blender: per vertex
- ("sticky") and per face vertex (UV in L{MFace}). In the first, there's
- only one UV pair of coordinates for each vertex in the mesh. In the
- second, for each face it belongs to, a vertex can have different UV
- coordinates. This makes the per face option more flexible, since two
- adjacent faces won't have to be mapped to a continuous region in an image:
- each face can be independently mapped to any part of its texture.
- """
-
- def __init__(coord):
- """
- Create a new PVert object.
-
- @note: PVert-type objects are designed to be used for creating and
- modifying a mesh's vertex list, but since they do not "wrap" any Blender
- data there are some differences. The B{index} and B{uvco} attributes
- are not defined for PVerts, and the B{no} attribute contains valid
- data only if the PVert was created from an MVert (using a slice
- operation on the mesh's vertex list.) PVerts also cannot be used as an
- argument to any method which expects data wrapping a Blender mesh, such
- as L{MVertSeq.delete()}.
-
- Example::
- v = Blender.Mesh.MVert(1,0,0)
- v = Blender.Mesh.MVert(Blender.Mathutils.Vector([1,0,0]))
-
- m = Blender.Mesh.Get('Mesh')
- vlist = m.verts[:] # slice operation also returns PVerts
-
- @type coord: three floats or a Vector object
- @param coord: the coordinate values for the new vertex
- @rtype: PVert
- @return: a new PVert object
-
- """
+ """
+ The MVert object
+ ================
+ This object holds mesh vertex data.
+ @ivar co: The vertex coordinates (x, y, z).
+ @type co: vector (WRAPPED DATA)
+ @ivar no: The vertex's unit normal vector (x, y, z).
+ B{Note}: if vertex coordinates are changed, it may be necessary to use
+ L{Mesh.calcNormals()} to update the vertex normals.
+ B{Note}: Vertex normals can be set, but are not wrapped so modifying a normal
+ vector will not effect the verts normal. The result is only visible
+ when faces have the smooth option enabled.
+ Example::
+ # This won't work.
+ for v in me.verts:
+ v.no.x= 0
+ v.no.y= 0
+ v.no.z= 1
+ # This will work
+ no= Blender.Mathutils.Vector(0,0,1)
+ for v in me.verts:
+ v.no= no
+ @type no: vector
+ @ivar uvco: The vertex texture "sticky" coordinates (x, y),
+ if present. Available for MVerts only.
+ Use L{Mesh.vertexUV} to test for presence before trying to access;
+ otherwise an exception will may be thrown.
+ (Sticky coordinates can be set when the object is in the Edit mode;
+ from the Editing Panel (F9), look under the "Mesh" properties for the
+ "Sticky" button).
+ @type uvco: vector (WRAPPED DATA)
+ @ivar index: The vertex's index within the mesh (MVerts only). Read-only.
+ @type index: int
+ @ivar sel: The vertex's selection state (selected=1).
+ B{Note}: a Mesh will return the selection state of the mesh when EditMode
+ was last exited. A Python script operating in EditMode must exit EditMode
+ before getting the current selection state of the mesh.
+ @type sel: int
+ @ivar hide: The face's B{edit mode} visibility state (hidden=1).
+ @type hide: int
+ @warn: There are two kinds of UV texture coordinates in Blender: per vertex
+ ("sticky") and per face vertex (UV in L{MFace}). In the first, there's
+ only one UV pair of coordinates for each vertex in the mesh. In the
+ second, for each face it belongs to, a vertex can have different UV
+ coordinates. This makes the per face option more flexible, since two
+ adjacent faces won't have to be mapped to a continuous region in an image:
+ each face can be independently mapped to any part of its texture.
+ """
+
+ def __init__(coord):
+ """
+ Create a new PVert object.
+
+ @note: PVert-type objects are designed to be used for creating and
+ modifying a mesh's vertex list, but since they do not "wrap" any Blender
+ data there are some differences. The B{index} and B{uvco} attributes
+ are not defined for PVerts, and the B{no} attribute contains valid
+ data only if the PVert was created from an MVert (using a slice
+ operation on the mesh's vertex list.) PVerts also cannot be used as an
+ argument to any method which expects data wrapping a Blender mesh, such
+ as L{MVertSeq.delete()}.
+
+ Example::
+ v = Blender.Mesh.MVert(1,0,0)
+ v = Blender.Mesh.MVert(Blender.Mathutils.Vector([1,0,0]))
+
+ m = Blender.Mesh.Get('Mesh')
+ vlist = m.verts[:] # slice operation also returns PVerts
+
+ @type coord: three floats or a Vector object
+ @param coord: the coordinate values for the new vertex
+ @rtype: PVert
+ @return: a new PVert object
+
+ """
class MVertSeq:
- """
- The MVertSeq object
- ===================
- This object provides sequence and iterator access to the mesh's vertices.
- Access and assignment of single items and slices are also supported.
- When a single item in the vertex list is accessed, the operator[] returns
- a MVert object which "wraps" the actual vertex in the mesh; changing any
- of the vertex's attributes will immediately change the data in the mesh.
- When a slice of the vertex list is accessed, however, the operator[]
- returns a list of PVert objects which are copies of the mesh's vertex
- data. Changes to these objects have no effect on the mesh; they must be
- assigned back to the mesh's vertex list.
-
- Slice assignments cannot change the vertex list size. The size of the
- list being assigned must be the same as the specified slice; otherwise an
- exception is thrown.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- vert = me.verts[0] # vert accesses actual mesh data
- vert.co[0] += 2 # change the vertex's X location
- pvert = me.verts[-2:] # pvert is COPY of mesh's last two verts
- pvert[0].co[0] += 2 # change the vertex's X location
- pvert[1].co[0] += 2 # change the vertex's X location
- me.verts[-1] = pvert[1] # put change to second vertex into mesh
-
- @note: The mesh can be "cleared" by assigning B{None} to the mesh's vertex
- list. This does not delete the Blender mesh object, it only deletes all
- the memory allocated to the mesh. The result is equivalent to calling
- Mesh.New(). The intent is to allow users writing exporters to free memory
- after it is used in a quick and simple way.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- me.verts = None # delete all the mesh's attributes
-
- """
-
- def extend(coords):
- """
- Append zero or more vertices to the mesh. Unlike L{MEdgeSeq.extend()} and
- L{MFaceSeq.extend()} no attempt is made to check for duplicate vertices in
- the parameter list, or for vertices already in the mesh.
-
- Example::
- import Blender
- from Blender import Mesh
- from Blender.Mathutils import Vector
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- me.verts.extend(1,1,1) # add one vertex
- l=[(.1,.1,.1),Vector([2,2,.5])]
- me.verts.extend(l) # add multiple vertices
-
- @type coords: sequences(s) of floats or vectors
- @param coords: coords can be
- - a sequence of three floats,
- - a 3D vector, or
- - a sequence (list or tuple) of either of the above.
- """
-
- def delete(verts):
- """
- Deletes one or more vertices from the mesh. Any edge or face which
- uses the specified vertices are also deleted.
-
- @type verts: multiple ints or MVerts
- @param verts: can be
- - a single MVert belonging to the mesh (B{note:} will not work with
- PVerts)
- - a single integer, specifying an index into the mesh's vertex list
- - a sequence (list or tuple) containing two or more of either of
- the above.
- """
-
- def selected():
- """
- Get selected vertices.
- @return: a list of the indices for all vertices selected in edit mode.
- @rtype: list of ints
- """
+ """
+ The MVertSeq object
+ ===================
+ This object provides sequence and iterator access to the mesh's vertices.
+ Access and assignment of single items and slices are also supported.
+ When a single item in the vertex list is accessed, the operator[] returns
+ a MVert object which "wraps" the actual vertex in the mesh; changing any
+ of the vertex's attributes will immediately change the data in the mesh.
+ When a slice of the vertex list is accessed, however, the operator[]
+ returns a list of PVert objects which are copies of the mesh's vertex
+ data. Changes to these objects have no effect on the mesh; they must be
+ assigned back to the mesh's vertex list.
+
+ Slice assignments cannot change the vertex list size. The size of the
+ list being assigned must be the same as the specified slice; otherwise an
+ exception is thrown.
+
+ Example::
+ import Blender
+ from Blender import Mesh
+
+ me = Mesh.Get("Plane") # get the mesh data called "Plane"
+ vert = me.verts[0] # vert accesses actual mesh data
+ vert.co[0] += 2 # change the vertex's X location
+ pvert = me.verts[-2:] # pvert is COPY of mesh's last two verts
+ pvert[0].co[0] += 2 # change the vertex's X location
+ pvert[1].co[0] += 2 # change the vertex's X location
+ me.verts[-1] = pvert[1] # put change to second vertex into mesh
+
+ @note: The mesh can be "cleared" by assigning B{None} to the mesh's vertex
+ list. This does not delete the Blender mesh object, it only deletes all
+ the memory allocated to the mesh. The result is equivalent to calling
+ Mesh.New(). The intent is to allow users writing exporters to free memory
+ after it is used in a quick and simple way.
+
+ Example::
+ import Blender
+ from Blender import Mesh
+
+ me = Mesh.Get("Plane") # get the mesh data called "Plane"
+ me.verts = None # delete all the mesh's attributes
+
+ """
+
+ def extend(coords):
+ """
+ Append zero or more vertices to the mesh. Unlike L{MEdgeSeq.extend()} and
+ L{MFaceSeq.extend()} no attempt is made to check for duplicate vertices in
+ the parameter list, or for vertices already in the mesh.
+
+ Example::
+ import Blender
+ from Blender import Mesh
+ from Blender.Mathutils import Vector
+
+ me = Mesh.Get("Plane") # get the mesh data called "Plane"
+ me.verts.extend(1,1,1) # add one vertex
+ l=[(.1,.1,.1),Vector([2,2,.5])]
+ me.verts.extend(l) # add multiple vertices
+
+ @type coords: sequences(s) of floats or vectors
+ @param coords: coords can be
+ - a sequence of three floats,
+ - a 3D vector, or
+ - a sequence (list or tuple) of either of the above.
+ """
+
+ def delete(verts):
+ """
+ Deletes one or more vertices from the mesh. Any edge or face which
+ uses the specified vertices are also deleted.
+
+ @type verts: multiple ints or MVerts
+ @param verts: can be
+ - a single MVert belonging to the mesh (B{note:} will not work with
+ PVerts)
+ - a single integer, specifying an index into the mesh's vertex list
+ - a sequence (list or tuple) containing two or more of either of
+ the above.
+ """
+
+ def selected():
+ """
+ Get selected vertices.
+ @return: a list of the indices for all vertices selected in edit mode.
+ @rtype: list of ints
+ """
class MEdge:
- """
- The MEdge object
- ================
- This object holds mesh edge data.
- @ivar v1: The first vertex of the edge.
- @type v1: MVert
- @ivar v2: The second vertex of the edge.
- @type v2: MVert
- @ivar length: The length of the edge, same as (ed.v1.co-ed.v2.co).length where "ed" is an MEdge.
- @type length: float
- @ivar crease: The crease value of the edge. It is in the range [0,255].
- @type crease: int
- @ivar flag: The bitfield describing edge properties. See L{EdgeFlags}.
- Example::
- # This script counts fgon and non fgon edges
- from Blender import Scene, Mesh
- scn= Scene.GetCurrent() # Current scene, important to be scene aware
- ob= scn.getActiveObject() # last selected object
- me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh
-
- total_fgon_eds= total_nor_eds= 0
-
- # Look through the edges and find any fgon edges, then print the findings to the console
- for ed in me.edges: # all meshes have edge data now
- if ed.flag & Mesh.EdgeFlags.FGON:
- total_fgon_eds+=1
- else:
- total_nor_eds+=1
-
- print 'Blender has', total_fgon_eds, 'fgon edges and', total_nor_eds, 'non fgon edges'
- @type flag: int
- @ivar index: The edge's index within the mesh. Read-only.
- @type index: int
- @ivar sel: The edge's B{edit mode} selection state (selected=1). B{Note}:
- changing the select state of an edge changes the select state of the edge's
- vertices.
- @type sel: int
- @ivar key: The edge's vert indices in an ordered tuple, which can be used
- as a dictionary key. Read-only.
- This is the same as (min(ed.v1.index, ed.v2.index), max(ed.v1.index, ed.v2.index))
- @type key: tuple
- """
-
- def __iter__():
- """
- Iterator for MEdge. It iterates over the MVerts of the edge, returning
- v1 then v2.
- @return: one of the edge's vertices
- @rtype: MVert
- """
+ """
+ The MEdge object
+ ================
+ This object holds mesh edge data.
+ @ivar v1: The first vertex of the edge.
+ @type v1: MVert
+ @ivar v2: The second vertex of the edge.
+ @type v2: MVert
+ @ivar length: The length of the edge, same as (ed.v1.co-ed.v2.co).length where "ed" is an MEdge.
+ @type length: float
+ @ivar crease: The crease value of the edge. It is in the range [0,255].
+ @type crease: int
+ @ivar flag: The bitfield describing edge properties. See L{EdgeFlags}.
+ Example::
+ # This script counts fgon and non fgon edges
+ from Blender import Scene, Mesh
+ scn= Scene.GetCurrent() # Current scene, important to be scene aware
+ ob= scn.objects.active # last selected object
+ me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh
+
+ total_fgon_eds= total_nor_eds= 0
+
+ # Look through the edges and find any fgon edges, then print the findings to the console
+ for ed in me.edges: # all meshes have edge data now
+ if ed.flag & Mesh.EdgeFlags.FGON:
+ total_fgon_eds+=1
+ else:
+ total_nor_eds+=1
+
+ print 'Blender has', total_fgon_eds, 'fgon edges and', total_nor_eds, 'non fgon edges'
+ @type flag: int
+ @ivar index: The edge's index within the mesh. Read-only.
+ @type index: int
+ @ivar sel: The edge's B{edit mode} selection state (selected=1). B{Note}:
+ changing the select state of an edge changes the select state of the edge's
+ vertices.
+ @type sel: int
+ @ivar key: The edge's vert indices in an ordered tuple, which can be used
+ as a dictionary key. Read-only.
+ This is the same as (min(ed.v1.index, ed.v2.index), max(ed.v1.index, ed.v2.index))
+ @type key: tuple
+ """
+
+ def __iter__():
+ """
+ Iterator for MEdge. It iterates over the MVerts of the edge, returning
+ v1 then v2.
+ @return: one of the edge's vertices
+ @rtype: MVert
+ """
class MEdgeSeq:
- """
- The MEdgeSeq object
- ===================
- This object provides sequence and iterator access to the mesh's edges.
- """
-
- def extend(vertseq):
- """
- Add zero or more edges to the mesh. Edges which already exist in the
- mesh or with both vertices the same are ignored. If three or four verts
- are specified in any sequence, an edge is also created between the first
- and last vertices (this is useful when adding faces).
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- v = me.verts # get vertices
- if len(v) >= 6: # if there are enough vertices...
- me.edges.extend(v[0],v[1]) # add a single edge
- l=[(v[1],v[2],v[3]),[0,2,4,5]]
- me.edges.extend(l) # add multiple edges
-
- @type vertseq: sequence(s) of ints or MVerts
- @param vertseq: either two to four ints or MVerts, or sequence
- (list or tuple) of sequences each containing two to four ints or MVerts.
- """
-
- def delete(edges):
- """
- Deletes one or more edges from the mesh. In addition, also delete:
- - any faces which uses the specified edge(s)
- - any "orphan" vertices (belonging only to specified edge(s))
-
- @type edges: multiple ints or MEdges
- @param edges: can be
- - a single MEdge belonging to the mesh
- - a single integer, specifying an index into the mesh's edge list
- - a sequence (list or tuple) containing two or more of either of
- the above.
- """
-
- def selected():
- """
- Get selected edges.
- Selected edges are those for which both vertices are selected.
- @return: a list of the indices for all edges selected in edit mode.
- @rtype: list of ints
- """
+ """
+ The MEdgeSeq object
+ ===================
+ This object provides sequence and iterator access to the mesh's edges.
+ """
+
+ def extend(vertseq):
+ """
+ Add zero or more edges to the mesh. Edges which already exist in the
+ mesh or with both vertices the same are ignored. If three or four verts
+ are specified in any sequence, an edge is also created between the first
+ and last vertices (this is useful when adding faces).
+
+ Example::
+ import Blender
+ from Blender import Mesh
+
+ me = Mesh.Get("Plane") # get the mesh data called "Plane"
+ v = me.verts # get vertices
+ if len(v) >= 6: # if there are enough vertices...
+ me.edges.extend(v[0],v[1]) # add a single edge
+ l=[(v[1],v[2],v[3]),[0,2,4,5]]
+ me.edges.extend(l) # add multiple edges
+
+ @type vertseq: sequence(s) of ints or MVerts
+ @param vertseq: either two to four ints or MVerts, or sequence
+ (list or tuple) of sequences each containing two to four ints or MVerts.
+ """
+
+ def delete(edges):
+ """
+ Deletes one or more edges from the mesh. In addition, also delete:
+ - any faces which uses the specified edge(s)
+ - any "orphan" vertices (belonging only to specified edge(s))
+
+ @type edges: multiple ints or MEdges
+ @param edges: can be
+ - a single MEdge belonging to the mesh
+ - a single integer, specifying an index into the mesh's edge list
+ - a sequence (list or tuple) containing two or more of either of
+ the above.
+ """
+
+ def selected():
+ """
+ Get selected edges.
+ Selected edges are those for which both vertices are selected.
+ @return: a list of the indices for all edges selected in edit mode.
+ @rtype: list of ints
+ """
class MFace:
- """
- The MFace object
- ================
- This object holds mesh face data.
-
- Example::
- import Blender
- from Blender import Mesh, Window
-
- in_emode = Window.EditMode()
- if in_emode: Window.EditMode(0)
-
- me = Mesh.Get("Mesh")
- faces = me.faces
-
- ## Example for editmode faces selection:
- selected_faces = []
- for f in faces:
- if f.sel:
- selected_faces.append(f)
- # ... unselect selected and select all the others:
- for f in faces:
- f.sel = 1 - f.sel # 1 becomes 0, 0 becomes 1
-
- ## Example for UV textured faces selection:
- selected_faces = []
- SEL = Mesh.FaceFlags['SELECT']
- # get selected faces:
- for f in faces:
- if f.flag & SEL:
- selected_faces.append(f)
- # ... unselect selected and select all the others:
- for f in faces:
- if f.flag & SEL:
- f.flag &= ~SEL # unselect these
- else:
- f.flag |= SEL # and select these
-
- if in_emode: Window.EditMode(1)
- Blender.Redraw()
-
- @ivar verts: The face's vertices. Each face has 3 or 4 vertices.
- @type verts: list of MVerts
- @ivar v: Same as L{verts}. This attribute is only for compatibility with
- NMesh scripts and will probably be deprecated in the future.
- @ivar sel: The face's B{edit mode} selection state (selected=1).
- This is not the same as the selection state of the textured faces
- (see L{flag}). B{Note}: changing the select state of a face changes
- the select state of the face's vertices.
- @type sel: int
- @ivar hide: The face's B{edit mode} visibility state (hidden=1).
- This is not the same as the visibility state of
- the textured faces (see L{flag}).
- @type hide: int
- @ivar smooth: If set, the vertex normals are averaged to make this
- face look smooth. (This is the same as choosing "Set Smooth" in the
- Editing Panel (F9) under "Link and Material" properties).
- @type smooth: int
- @ivar col: The face's vertex colors, if defined. Each vertex has its own
- color.
- Will throw an exception if the mesh does not have UV faces or vertex
- colors; use L{Mesh.faceUV} and L{Mesh.vertexColors} to test. B{Note}:
- if a mesh has i{both} UV faces and vertex colors, the colors stored in
- the UV faces will be used here.
-
- Example::
- # This example uses vertex normals to apply normal colors to each face.
- from Blender import Scene, Mesh, Window
- scn= Scene.GetCurrent() # Current scene, important to be scene aware
- ob= scn.getActiveObject() # last selected object
- me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh
- me.faceUV=1 # Enable face, vertex colors
- for f in me.faces:
- for i, v in enumerate(f.v):
- no= v.no
- col= f.col[i]
- col.r= int((no.x+1)*128)
- col.g= int((no.y+1)*128)
- col.b= int((no.z+1)*128)
- Window.RedrawAll()
- @type col: sequence of MCols
- @ivar mat: The face's index into the mesh's materials
- list. It is in the range [0,15].
- @type mat: int
- @ivar image: The Image used as a texture for this face.
- Setting this attribute will create UV faces if they do not exist.
- Getting this attribute throw an exception if the mesh does not have
- UV faces; use L{Mesh.faceUV} to test.
- Assigning an image will automatically set the TEX attribute of the
- L{mode} bitfield. Use "del f.image" or "f.image = None" to clear the
- image assigned to the face.
- @type image: Image
- @ivar mode: The texture mode bitfield (see L{FaceModes}).
- Will throw an exception if the mesh does not have UV faces; use
- L{Mesh.faceUV} to test.
- @type mode: int
- @ivar index: The face's index within the mesh. Read-only.
- @type index: int
-
- @ivar flag: The face's B{texture mode} flags; indicates the selection,
- active , and visibility states of a textured face (see
- L{FaceFlags} for values).
- This is not the same as the selection or visibility states of
- the faces in edit mode (see L{sel} and L{hide}).
- To set the active face, use
- the L{Mesh.activeFace} attribute instead.
- Will throw an exception if the mesh does not have UV faces; use
- L{Mesh.faceUV} to test.
-
- @ivar transp: Transparency mode. It is one of the values in
- L{FaceTranspModes}).
- Will throw an exception if the mesh does not have UV faces; use
- L{Mesh.faceUV} to test.
- @type transp: int
-
- @ivar uv: The face's UV coordinates. Each vertex has its own UV coordinate.
- Setting this attribute will create UV faces if they do not exist.
- Getting this attribute throw an exception if the mesh does not have
- UV faces; use L{Mesh.faceUV} to test.
- @type uv: tuple of vectors (WRAPPED DATA)
- @ivar uvSel: The face's UV coordinates selection state; a 1 indicates the
- vertex is selected. Each vertex has its own UV coordinate select state
- (this is not the same as the vertex's edit mode selection state).
- Setting this attribute will create UV faces if they do not exist.
- Getting this attribute throw an exception if the mesh does not have
- UV faces; use L{Mesh.faceUV} to test.
- @type uvSel: tuple of ints
- @ivar no: The face's normal vector (x, y, z). Read-only.
- @type no: vector
- @ivar cent: The center of the face. Read-only.
- @type cent: vector
- @ivar area: The area of the face. Read-only.
- @type area: float
- @ivar edge_keys: A tuple, each item a key that can reference an edge by its
- ordered indices. Read-only. This is useful for building connectivity data.
- Example::
- from Blender import Mesh
- me = Mesh.Get('Cube')
- # a dictionary where the edge is the key, and a list of faces that use it are the value
- edge_faces = dict([(ed.key, []) for ed in me.edges])
-
- # Add the faces to the dict
- for f in me.faces:
- for key in f.edge_keys:
- edge_faces[key].append(f) # add this face to the edge as a user
-
- # Print the edges and the number of face users
- for key, face_users in edge_faces.iteritems():
- print 'Edge:', key, 'uses:', len(face_users),'faces'
-
- @type edge_keys: tuple
- @note: there are regular faces and textured faces in Blender, both currently
- with their own selection and visibility states, due to a mix of old and new
- code. To (un)select or (un)hide regular faces (visible in EditMode), use
- L{MFace.sel} and L{MFace.hide} attributes. For textured faces (UV Face
- Select and Paint modes in Blender) use the L{MFace.flag} attribute.
- Check the example above and note L{Window.EditMode}.
- @note: Assigning UV textures to mesh faces in Blender works like this:
- 1. Select your mesh.
- 2. Enter face select mode (press f) and select at least some face(s).
- 3. In the UV/Image Editor window, load / select an image.
- 4. Play in both windows (better split the screen to see both at the same
- time) until the UV coordinates are where you want them. Hint: in the
- 3D window, the 'u' key opens a menu of default UV choices and the 'r'
- key lets you rotate the UV coords.
- 5. Leave face select mode (press f).
- """
-
- def __iter__():
- """
- Iterator for MVert. It iterates over the MVerts of the face, returning
- v1, v2, v3 (and optionally v4);
- @return: one of the face's vertices
- @rtype: MVert
- """
-
- def __len__():
- """
- len for MVert. It returns the number of vertices in the face.
- @rtype: int
- """
+ """
+ The MFace object
+ ================
+ This object holds mesh face data.
+
+ Example::
+ import Blender
+ from Blender import Mesh, Window
+
+ in_emode = Window.EditMode()
+ if in_emode: Window.EditMode(0)
+
+ me = Mesh.Get("Mesh")
+ faces = me.faces
+
+ ## Example for editmode faces selection:
+ selected_faces = []
+ for f in faces:
+ if f.sel:
+ selected_faces.append(f)
+ # ... unselect selected and select all the others:
+ for f in faces:
+ f.sel = not f.sel # 1 becomes 0, 0 becomes 1
+
+ ## Example for UV textured faces selection:
+ selected_faces = []
+ SEL = Mesh.FaceFlags['SELECT']
+ # get selected faces:
+ for f in faces:
+ if f.flag & SEL:
+ selected_faces.append(f)
+ # ... unselect selected and select all the others:
+ for f in faces:
+ if f.flag & SEL:
+ f.flag &= ~SEL # unselect these
+ else:
+ f.flag |= SEL # and select these
+
+ if in_emode: Window.EditMode(1)
+ Blender.Redraw()
+
+ @ivar verts: The face's vertices. Each face has 3 or 4 vertices.
+ @type verts: list of MVerts
+ @ivar v: Same as L{verts}. This attribute is only for compatibility with
+ NMesh scripts and will probably be deprecated in the future.
+ @ivar sel: The face's B{edit mode} selection state (selected=1).
+ This is not the same as the selection state of the textured faces
+ (see L{flag}). B{Note}: changing the select state of a face changes
+ the select state of the face's vertices.
+ @type sel: int
+ @ivar hide: The face's B{edit mode} visibility state (hidden=1).
+ This is not the same as the visibility state of
+ the textured faces (see L{flag}).
+ @type hide: int
+ @ivar smooth: If set, the vertex normals are averaged to make this
+ face look smooth. (This is the same as choosing "Set Smooth" in the
+ Editing Panel (F9) under "Link and Material" properties).
+ @type smooth: int
+ @ivar col: The face's vertex colors, if defined. Each vertex has its own
+ color.
+ Will throw an exception if the mesh does not have UV faces or vertex
+ colors; use L{Mesh.faceUV} and L{Mesh.vertexColors} to test. B{Note}:
+ if a mesh has i{both} UV faces and vertex colors, the colors stored in
+ the UV faces will be used here.
+
+ Example::
+ # This example uses vertex normals to apply normal colors to each face.
+ from Blender import Scene, Mesh, Window
+ scn= Scene.GetCurrent() # Current scene, important to be scene aware
+ ob= scn.getActiveObject() # last selected object
+ me= ob.getData(mesh=1) # thin wrapper doesn't copy mesh data like nmesh
+ me.faceUV=1 # Enable face, vertex colors
+ for f in me.faces:
+ for i, v in enumerate(f.v):
+ no= v.no
+ col= f.col[i]
+ col.r= int((no.x+1)*128)
+ col.g= int((no.y+1)*128)
+ col.b= int((no.z+1)*128)
+ Window.RedrawAll()
+ @type col: sequence of MCols
+ @ivar mat: The face's index into the mesh's materials
+ list. It is in the range [0,15].
+ @type mat: int
+ @ivar image: The Image used as a texture for this face.
+ Setting this attribute will create UV faces if they do not exist.
+ Getting this attribute throw an exception if the mesh does not have
+ UV faces; use L{Mesh.faceUV} to test.
+ Assigning an image will automatically set the TEX attribute of the
+ L{mode} bitfield. Use "del f.image" or "f.image = None" to clear the
+ image assigned to the face.
+ @type image: Image
+ @ivar mode: The texture mode bitfield (see L{FaceModes}).
+ Will throw an exception if the mesh does not have UV faces; use
+ L{Mesh.faceUV} to test.
+ @type mode: int
+ @ivar index: The face's index within the mesh. Read-only.
+ @type index: int
+
+ @ivar flag: The face's B{texture mode} flags; indicates the selection,
+ active , and visibility states of a textured face (see
+ L{FaceFlags} for values).
+ This is not the same as the selection or visibility states of
+ the faces in edit mode (see L{sel} and L{hide}).
+ To set the active face, use
+ the L{Mesh.activeFace} attribute instead.
+ Will throw an exception if the mesh does not have UV faces; use
+ L{Mesh.faceUV} to test.
+
+ @ivar transp: Transparency mode. It is one of the values in
+ L{FaceTranspModes}).
+ Will throw an exception if the mesh does not have UV faces; use
+ L{Mesh.faceUV} to test.
+ @type transp: int
+
+ @ivar uv: The face's UV coordinates. Each vertex has its own UV coordinate.
+ Setting this attribute will create UV faces if they do not exist.
+ Getting this attribute throw an exception if the mesh does not have
+ UV faces; use L{Mesh.faceUV} to test.
+ @type uv: tuple of vectors (WRAPPED DATA)
+ @ivar uvSel: The face's UV coordinates selection state; a 1 indicates the
+ vertex is selected. Each vertex has its own UV coordinate select state
+ (this is not the same as the vertex's edit mode selection state).
+ Setting this attribute will create UV faces if they do not exist.
+ Getting this attribute throw an exception if the mesh does not have
+ UV faces; use L{Mesh.faceUV} to test.
+ @type uvSel: tuple of ints
+ @ivar no: The face's normal vector (x, y, z). Read-only.
+ @type no: vector
+ @ivar cent: The center of the face. Read-only.
+ @type cent: vector
+ @ivar area: The area of the face. Read-only.
+ @type area: float
+ @ivar edge_keys: A tuple, each item a key that can reference an edge by its
+ ordered indices. Read-only. This is useful for building connectivity data.
+ Example::
+ from Blender import Mesh
+ me = Mesh.Get('Cube')
+ # a dictionary where the edge is the key, and a list of faces that use it are the value
+ edge_faces = dict([(ed.key, []) for ed in me.edges])
+
+ # Add the faces to the dict
+ for f in me.faces:
+ for key in f.edge_keys:
+ edge_faces[key].append(f) # add this face to the edge as a user
+
+ # Print the edges and the number of face users
+ for key, face_users in edge_faces.iteritems():
+ print 'Edge:', key, 'uses:', len(face_users),'faces'
+
+ @type edge_keys: tuple
+ @note: there are regular faces and textured faces in Blender, both currently
+ with their own selection and visibility states, due to a mix of old and new
+ code. To (un)select or (un)hide regular faces (visible in EditMode), use
+ L{MFace.sel} and L{MFace.hide} attributes. For textured faces (UV Face
+ Select and Paint modes in Blender) use the L{MFace.flag} attribute.
+ Check the example above and note L{Window.EditMode}.
+ @note: Assigning UV textures to mesh faces in Blender works like this:
+ 1. Select your mesh.
+ 2. Enter face select mode (press f) and select at least some face(s).
+ 3. In the UV/Image Editor window, load / select an image.
+ 4. Play in both windows (better split the screen to see both at the same
+ time) until the UV coordinates are where you want them. Hint: in the
+ 3D window, the 'u' key opens a menu of default UV choices and the 'r'
+ key lets you rotate the UV coords.
+ 5. Leave face select mode (press f).
+ """
+
+ def __iter__():
+ """
+ Iterator for MVert. It iterates over the MVerts of the face, returning
+ v1, v2, v3 (and optionally v4);
+ @return: one of the face's vertices
+ @rtype: MVert
+ """
+
+ def __len__():
+ """
+ len for MVert. It returns the number of vertices in the face.
+ @rtype: int
+ """
class MFaceSeq:
- """
- The MFaceSeq object
- ===================
- This object provides sequence and iterator access to the mesh's faces.
- """
-
- def extend(vertseq,ignoreDups=True,indexList=True):
- """
- Add zero or more faces and edges to the mesh. Faces which already exist
- in the mesh, or faces which contain the same vertex multiple times are
- ignored. Sequences of two vertices are accepted, but no face will be
- created.
-
- Example::
- import Blender
- from Blender import Mesh
-
- me = Mesh.Get("Plane") # get the mesh data called "Plane"
- v = me.verts # get vertices
- if len(v) >= 6: # if there are enough vertices...
- me.faces.extend(v[1],v[2],v[3]) # add a single edge
- l=[(v[0],v[1]),[0,2,4,5]]
- me.faces.extend(l) # add another face
-
- @type vertseq: sequence(s) of MVerts
- @param vertseq: either two to four ints or MVerts, or sequence (list or
- tuple) of sequences each containing two to four ints or MVerts.
- @type ignoreDups: boolean
- @param ignoreDups: keyword parameter (default is False). If supplied and
- True, do not check the input list or mesh for duplicate faces. This can
- speed up scripts but can prossibly produce undesirable effects. Only
- use if you know what you're doing.
- @type indexList: boolean
- @param indexList: keyword parameter (default is False). If supplied and
- True, the method will return a list representing the new index for each
- face in the input list. If faces are removed as duplicates, None is
- inserted in place of the index.
- @warning: Faces using the first vertex at the 3rd or 4th location in the
- face's vertex list will have their order rotated so that the zero index
- on in the first or second location in the face. When creating face data
- with UVs or vertex colors, you may need to work around this, either by
- checking for zero indices yourself or by adding a dummy first vertex to
- the mesh that can be removed when your script has finished.
- """
-
- def delete(deledges, faces):
- """
- Deletes one or more faces (and optionally the edges associated with
- the face(s)) from the mesh.
-
- @type deledges: int
- @param deledges: controls whether just the faces (deledges=0)
- or the faces and edges (deledges=1) are deleted. These correspond to the
- "Only Faces" and "Edges & Faces" options in the Edit Mode pop-up menu
- @type faces: multiple ints or MFaces
- @param faces: a sequence (list or tuple) containing one or more of:
- - an MEdge belonging to the mesh
- - a integer, specifying an index into the mesh's face list
- """
-
- def selected():
- """
- Get selected faces.
- @return: a list of the indices for all faces selected in edit mode.
- @rtype: list of ints
- """
+ """
+ The MFaceSeq object
+ ===================
+ This object provides sequence and iterator access to the mesh's faces.
+ """
+
+ def extend(vertseq,ignoreDups=True,indexList=True):
+ """
+ Add zero or more faces and edges to the mesh. Faces which already exist
+ in the mesh, or faces which contain the same vertex multiple times are
+ ignored. Sequences of two vertices are accepted, but no face will be
+ created.
+
+ Example::
+ import Blender
+ from Blender import Mesh
+
+ me = Mesh.Get("Plane") # get the mesh data called "Plane"
+ v = me.verts # get vertices
+ if len(v) >= 6: # if there are enough vertices...
+ me.faces.extend(v[1],v[2],v[3]) # add a single edge
+ l=[(v[0],v[1]),[0,2,4,5]]
+ me.faces.extend(l) # add another face
+
+ @type vertseq: sequence(s) of MVerts
+ @param vertseq: either two to four ints or MVerts, or sequence (list or
+ tuple) of sequences each containing two to four ints or MVerts.
+ @type ignoreDups: boolean
+ @param ignoreDups: keyword parameter (default is False). If supplied and
+ True, do not check the input list or mesh for duplicate faces. This can
+ speed up scripts but can prossibly produce undesirable effects. Only
+ use if you know what you're doing.
+ @type indexList: boolean
+ @param indexList: keyword parameter (default is False). If supplied and
+ True, the method will return a list representing the new index for each
+ face in the input list. If faces are removed as duplicates, None is
+ inserted in place of the index.
+ @warning: Faces using the first vertex at the 3rd or 4th location in the
+ face's vertex list will have their order rotated so that the zero index
+ on in the first or second location in the face. When creating face data
+ with UVs or vertex colors, you may need to work around this, either by
+ checking for zero indices yourself or by adding a dummy first vertex to
+ the mesh that can be removed when your script has finished.
+ """
+
+ def delete(deledges, faces):
+ """
+ Deletes one or more faces (and optionally the edges associated with
+ the face(s)) from the mesh.
+
+ @type deledges: int
+ @param deledges: controls whether just the faces (deledges=0)
+ or the faces and edges (deledges=1) are deleted. These correspond to the
+ "Only Faces" and "Edges & Faces" options in the Edit Mode pop-up menu
+ @type faces: multiple ints or MFaces
+ @param faces: a sequence (list or tuple) containing one or more of:
+ - an MEdge belonging to the mesh
+ - a integer, specifying an index into the mesh's face list
+ """
+
+ def selected():
+ """
+ Get selected faces.
+ @return: a list of the indices for all faces selected in edit mode.
+ @rtype: list of ints
+ """
from IDProp import IDGroup, IDArray
class Mesh:
- """
- The Mesh Data object
- ====================
- This object gives access to mesh data in Blender.
-
- @note: the verts, edges and faces attributes are implemented as sequences.
- The operator[] and len() are defined for these sequences. You cannot
- assign to an item in the sequence, but you can assign to most of the
- attributes of individual items.
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- mesh's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
- @ivar edges: The mesh's edges.
- @type edges: sequence of MEdges
- @ivar faces: The mesh's faces.
- @type faces: sequence of MFaces
- @ivar verts: The mesh's vertices.
- @type verts: sequence of MVerts
-
- @ivar materials: The mesh's materials. Each mesh can reference up to
- 16 materials. Empty slots in the mesh's list are represented by B{None}.
- B{Note}: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
- for each object in order for these materials to be used instead of
- the object's materials.
- B{Note}: Making the material list shorter does not change the face's material indices.
- Take care when using the face's material indices to reference a material in this list.
- B{Note}: The list that's returned is I{not} linked to the original mesh.
- mesh.materials.append(material) won't do anything.
- Use mesh.materials += [material] instead.
- @type materials: list of L{Material}s
- @ivar degr: The max angle for auto smoothing in [1,80].
- @type degr: int
- @ivar maxSmoothAngle: Same as L{degr}. This attribute is only for
- compatibility with NMesh scripts and will probably be deprecated in
- the future.
- @ivar mode: The mesh's mode bitfield. See L{Modes}.
- @type mode: int
- @ivar sel: Sets selection status for all vertices, edges and faces in the
- mesh (write only).
- @type sel: boolean
- @ivar hide: Sets hidden status for all vertices, edges and faces in the
- mesh (write only).
- @type hide: boolean
- @ivar name: The Mesh name. It's common to use this field to store extra
- data about the mesh (to be exported to another program, for example).
- @type name: str
- @ivar subDivLevels: The [display, rendering] subdivision levels in [1, 6].
- @type subDivLevels: list of 2 ints
- @ivar users: The number of Objects using (linked to) this mesh. (read only)
- @type users: int
- @ivar fakeUser: The fake user status.
- enabling this will keep it in the blend even if there are no users.
- @type fakeUser: bool
-
- @ivar faceUV: The mesh contains UV-mapped textured faces. Enabling faceUV
- does not initialize the face colors like the Blender UI does; this must
- be done in the script. B{Note}: if faceUV is set, L{vertexColors} cannot
- be set. Furthermore, if vertexColors is already set when faceUV is set,
- vertexColors is cleared. This is because the vertex color information
- is stored with UV faces, so enabling faceUV implies enabling vertexColors.
- In addition, faceUV cannot be set when the mesh has no faces defined
- (this is the same behavior as the UI). Attempting to do so will throw
- a RuntimeError exception.
- @type faceUV: bool
- @ivar vertexColors: The mesh contains vertex colors. See L{faceUV} for the
- use of vertex colors when UV-mapped texture faces are enabled.
- @type vertexColors: bool
- @ivar vertexUV: The mesh contains "sticky" per-vertex UV coordinates.
- @type vertexUV: bool
- @ivar activeFace: Index of the mesh's active face in UV Face Select and
- Paint modes. Only one face can be active at a time. Note that this is
- independent of the selected faces in Face Select and Edit modes.
- Will throw an exception if the mesh does not have UV faces; use
- L{faceUV} to test.
- @type activeFace: int
- @ivar activeGroup: The mesh's active vertex group. The mesh must be
- linked to an object (read the comment in L{addVertGroup} for more info).
- @type activeGroup: string or None
- @ivar texMesh: The mesh's texMesh setting, used so coordinates from another
- mesh can be used for rendering textures.
- @type texMesh: Mesh or None
- @ivar key: The L{Key<Key.Key>} object containing the keyframes for this mesh, if any.
- @type key: Key or None
-
- @ivar activeUVLayer: The mesh's active UV/Image layer. None if there is no UV/Image layers.
- @type activeUVLayer: string
- @ivar activeColorLayer: The mesh's active Vertex Color layer. None if there is no UV/Image layers.
- @type activeColorLayer: string
-
- @ivar multires: The mesh has multires data, set True to add multires data.
- Will throw an exception if the mesh has shape keys; use L{key} to test.
- @type multires: bool
- @ivar multiresLevelCount: The mesh has multires data. (read only)
- @type multiresLevelCount: int
- @ivar multiresDrawLevel: The multires level to display in the 3dview in [1 - multiresLevelCount].
- @type multiresDrawLevel: int
- @ivar multiresEdgeLevel: The multires level edge display in the 3dview [1 - multiresLevelCount].
- @type multiresEdgeLevel: int
- @ivar multiresPinLevel: The multires pin level, used for applying modifiers [1 - multiresLevelCount].
- @type multiresPinLevel: int
- @ivar multiresRenderLevel: The multires level to render [1 - multiresLevelCount].
- @type multiresRenderLevel: int
-
-
- """
-
- def getFromObject(object, cage=0, render=0):
- """
- Replace the mesh's existing data with the raw mesh data from a Blender
- Object. This method supports all the geometry based objects (mesh, text,
- curve, surface, and meta). If the object has modifiers, they will be
- applied before to the object before extracting the vertex data unless
- the B{cage} parameter is 1.
- @note: The mesh coordinates are in I{local space}, not the world space of
- its object. For world space vertex coordinates, each vertex location must
- be multiplied by the object's 4x4 transform matrix (see L{transform}).
- @note: The objects materials will not be copied into the existing mesh,
- however the face material indices will match the material list of the original data.
- @type object: blender object or string
- @param object: The Blender object or its name, which contains the geometry data.
- @type cage: int
- @param cage: determines whether the original vertices or derived vertices
- @type render: int
- @param render: determines whether the render setting for modifiers will be used or not.
- (for objects with modifiers) are used. The default is derived vertices.
- """
-
- def calcNormals():
- """
- Recalculates the vertex normals using face data.
- """
-
- def transform(matrix, recalc_normals = False):
- """
- Transforms the mesh by the specified 4x4 matrix (such as returned by
- L{Object.Object.getMatrix}). The matrix should be invertible.
- Ideal usage for this is exporting to an external file where
- global vertex locations are required for each object.
- Sometimes external renderers or file formats do not use vertex normals.
- In this case, you can skip transforming the vertex normals by leaving
- the optional parameter recalc_normals as False or 0 (the default value).
-
- Example::
- # This script outputs deformed meshes worldspace vertex locations
- # for a selected object without changing the object
- import Blender
- from Blender import Mesh, Object
-
- ob = Object.GetSelected()[0] # Get the first selected object
- me = Mesh.New() # Create a new mesh
- me.getFromObject(ob.name) # Get the object's mesh data
- verts = me.verts[:] # Save a copy of the vertices
- me.transform(ob.matrix) # Convert verts to world space
- for v in me.verts:
- print 'worldspace vert', v.co
- me.verts = verts # Restore the original verts
-
- @type matrix: Py_Matrix
- @param matrix: 4x4 Matrix which can contain location, scale and rotation.
- @type recalc_normals: int
- @param recalc_normals: if True or 1, also transform vertex normals.
- @warn: unlike L{NMesh.transform()<NMesh.NMesh.transform>}, this method
- I{will immediately modify the mesh data} when it is used. If you
- transform the mesh using the object's matrix to get the vertices'
- world positions, the result will be a "double transform". To avoid
- this you either need to set the object's matrix to the identity
- matrix, perform the inverse transform after outputting the transformed
- vertices, or make a copy of the vertices prior to using this method
- and restore them after outputting the transformed vertices (as shown
- in the example).
- """
-
- def vertexShade(object):
- """
- Colors vertices based on the current lighting setup, like when there
- are no vertex colors and no textured faces and a user enters Vertex Paint
- Mode in Blender (only lamps in visible layers account). An exception is
- thrown if called while in EditMode.
- @type object: Object
- @param object: The Blender Object linked to the mesh.
- """
-
- def update():
- """
- Update display lists after changes to mesh. B{Note}: with changes taking
- place for using a directed acyclic graph (DAG) for scene and object
- updating, this method may be only temporary and may be removed in future
- releases.
- @warn: Since Blender 2.42 this function has changed; now it won't recalculate
- vertex normals (seen when faces are smooth). See L{Mesh.calcNormals()}.
- """
-
- def findEdges(edges):
- """
- Quickly search for the location of an edges.
- @type edges: sequence(s) of ints or MVerts
- @param edges: can be tuples of MVerts or integer indexes (B{note:} will
- not work with PVerts) or a sequence (list or tuple) containing two or
- more sequences.
- @rtype: int, None or list
- @return: if an edge is found, its index is returned; otherwise None is
- returned. If a sequence of edges is passed, a list is returned.
- """
-
- def addVertGroup(group):
- """
- Add a named and empty vertex (deform) group to the object this mesh is
- linked to. The mesh must first be linked to an object (with object.link()
- or object.getData() ) so the method knows which object to update.
- This is because vertex groups in Blender are stored in I{the object} --
- not in the mesh, which may be linked to more than one object.
- @type group: string
- @param group: the name for the new group.
- """
-
- def removeVertGroup(group):
- """
- Remove a named vertex (deform) group from the object linked to this mesh.
- All vertices assigned to the group will be removed (just from the group,
- not deleted from the mesh), if any. If this mesh was newly created, it
- must first be linked to an object (read the comment in L{addVertGroup} for
- more info).
- @type group: string
- @param group: the name of a vertex group.
- """
-
- def assignVertsToGroup(group, vertList, weight, assignmode = AssignModes['REPLACE']):
- """
- Adds an array (a Python list) of vertex points to a named vertex group
- associated with a mesh. The vertex list is a list of vertex indices from
- the mesh. You should assign vertex points to groups only when the mesh has
- all its vertex points added to it and is already linked to an object.
-
- I{B{Example:}}
- The example here adds a new set of vertex indices to a sphere primitive::
- import Blender
- sphere = Blender.Object.Get('Sphere')
- replace = Blender.Mesh.AssignModes.REPLACE
- mesh = sphere.getData(mesh=True)
- mesh.addVertGroup('firstGroup')
- vertList = []
- for x in range(300):
- if x % 3 == 0:
- vertList.append(x)
- mesh.assignVertsToGroup('firstGroup', vertList, 0.5, replace)
-
- @type group: string
- @param group: the name of the group.
- @type vertList: list of ints
- @param vertList: a list of vertex indices.
- @type weight: float
- @param weight: the deform weight for (which means: the amount of influence
- the group has over) the given vertices. It should be in the range
- [0.0, 1.0]. If weight <= 0, the given vertices are removed from the
- group. If weight > 1, it is clamped.
- @type assignmode: module constant
- @param assignmode: Three choices: REPLACE, ADD or SUBTRACT.
- See L{AssignModes} for a complete description.
- """
-
- def removeVertsFromGroup(group, vertList = None):
- """
- Remove a list of vertices from the given group. If this mesh was newly
- created, it must first be linked to an object (check L{addVertGroup}).
- @type group: string
- @param group: the name of a vertex group
- @type vertList: list of ints
- @param vertList: a list of vertex indices to be removed from I{group}.
- If None, all vertices are removed -- the group is emptied.
- """
-
- def getVertsFromGroup(group, weightsFlag = 0, vertList = None):
- """
- Return a list of vertex indices associated with the passed group. This
- method can be used to test whether a vertex index is part of a group and
- if so, what its weight is.
-
- I{B{Example:}}
- Append this to the example from L{assignVertsToGroup}::
- # ...
- print "Vertex indices from group %s :" % groupName
- print mesh.getVertsFromGroup('firstGroup')
- print "Again, with weights:"
- print mesh.getVertsFromGroup('firstGroup',1)
- print "Again, with weights and restricted to the given indices:"
- print mesh.getVertsFromGroup('firstGroup',1,[1,2,3,4,5,6])
-
- @type group: string
- @param group: the group name.
- @type weightsFlag: bool
- @param weightsFlag: if 1, the weight is returned along with the index.
- @type vertList: list of ints
- @param vertList: if given, only those vertex points that are both in the
- list and group passed in are returned.
- """
-
- def renameVertGroup(groupName, newName):
- """
- Renames a vertex group.
- @type groupName: string
- @param groupName: the vertex group name to be renamed.
- @type newName: string
- @param newName: the name to replace the old name.
- """
-
- def getVertGroupNames():
- """
- Return a list of all vertex group names.
- @rtype: list of strings
- @return: returns a list of strings representing all vertex group
- associated with the mesh's object
- """
-
- def getUVLayerNames():
- """
- Return a list of all UV layer names
- @rtype: list of strings
- @return: returns a list of strings representing all UV layers
- associated with the mesh's object
- """
-
- def getColorLayerNames():
- """
- Return a list of all color layer names
- @rtype: list of strings
- @return: returns a list of strings representing all color layers
- associated with the mesh's object
- """
-
- def getVertexInfluences(index):
- """
- Get the bone influences for a specific vertex.
- @type index: int
- @param index: The index of a vertex.
- @rtype: list of lists
- @return: List of pairs [name, weight], where name is the bone name (string)
- and weight is a float value.
- """
-
- def removeAllKeys():
- """
- Remove all mesh keys stored in this mesh.
- @rtype: bool
- @return: True if successful or False if the Mesh has no keys.
- """
-
- def insertKey(frame = None, type = 'relative'):
- """
- Insert a mesh key at the given frame.
- @type frame: int
- @type type: string
- @param frame: The Scene frame where the mesh key should be inserted. If
- None or the arg is not given, the current frame is used.
- @param type: The mesh key type: 'relative' or 'absolute'. This is only
- relevant on meshes with no keys.
- @warn: This and L{removeAllKeys} were included in this release only to
- make accessing vertex keys possible, but may not be a proper solution
- and may be substituted by something better later. For example, it
- seems that 'frame' should be kept in the range [1, 100]
- (the curves can be manually tweaked in the Ipo Curve Editor window in
- Blender itself later).
- @warn: Will throw an error if the mesh has multires. use L{multires} to check.
- """
-
- def addUVLayer(name):
- """
- Adds a new UV/Image layer to this mesh, it will always be the last layer but not made active.
- @type name: string
- @param name: The name of the new UV layer, 31 characters max.
- """
-
- def addColorLayer(name):
- """
- Adds a new Vertex Color layer to this mesh, it will always be the last layer but not made active.
- @type name: string
- @param name: The name of the new Color layer, 31 characters max.
- """
-
- def removeUVLayer(name):
- """
- Removes the active UV/Image layer.
- @type name: string
- @param name: The name of the UV layer to remove.
- """
-
- def removeColorLayer(name):
- """
- Removes the active Vertex Color layer.
- @type name: string
- @param name: The name of the Color layer to remove.
- """
-
- def renameUVLayer(name, newname):
- """
- Removes the active UV/Image layer.
- @type name: string
- @param name: The UV layer to rename.
- @type newname: string
- @param newname: The new name of the UV layer, will be made unique.
- """
-
- def renameColorLayer(name, newname):
- """
- Removes the active Vertex Color layer.
- @type name: string
- @param name: The Color layer to rename.
- @type newname: string
- @param newname: The new name of the Color layer, will be made unique.
- """
-
- def smooth():
- """
- Flattens angle of selected faces. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def flipNormals():
- """
- Toggles the direction of selected face's normals. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def toSphere():
- """
- Moves selected vertices outward in a spherical shape. Experimental mesh
- tool.
- An exception is thrown if called while in EditMode.
- """
-
- def fill():
- """
- Scan fill a closed selected edge loop. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def triangleToQuad():
- """
- Convert selected triangles to quads. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- """
-
- def quadToTriangle(mode=0):
- """
- Convert selected quads to triangles. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- @type mode: int
- @param mode: specifies whether a to add the new edge between the
- closest (=0) or farthest(=1) vertices.
- """
-
- def subdivide(beauty=0):
- """
- Subdivide selected edges in a mesh. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- @type beauty: int
- @param beauty: specifies whether a "beauty" subdivide should be
- enabled (disabled is default). Value must be in the range [0,1].
- """
-
- def remDoubles(limit):
- """
- Removes duplicates from selected vertices. Experimental mesh tool.
- An exception is thrown if called while in EditMode.
- @type limit: float
- @param limit: specifies the maximum distance considered for vertices
- to be "doubles". Value is clamped to the range [0.0,1.0].
- @rtype: int
- @return: the number of vertices deleted
- """
-
- def recalcNormals(direction=0):
- """
- Recalculates inside or outside normals for selected faces. Experimental
- mesh tool.
- An exception is thrown if called while in EditMode.
- @type direction: int
- @param direction: specifies outward (0) or inward (1) normals. Outward
- is the default. Value must be in the range [0,1].
- """
-
- def __copy__ ():
- """
- Make a copy of this mesh
- @rtype: Mesh
- @return: a copy of this mesh
- """
+ """
+ The Mesh Data object
+ ====================
+ This object gives access to mesh data in Blender.
+
+ @note: the verts, edges and faces attributes are implemented as sequences.
+ The operator[] and len() are defined for these sequences. You cannot
+ assign to an item in the sequence, but you can assign to most of the
+ attributes of individual items.
+ @ivar edges: The mesh's edges.
+ @type edges: sequence of MEdges
+ @ivar faces: The mesh's faces.
+ @type faces: sequence of MFaces
+ @ivar verts: The mesh's vertices.
+ @type verts: sequence of MVerts
+
+ @ivar materials: The mesh's materials. Each mesh can reference up to
+ 16 materials. Empty slots in the mesh's list are represented by B{None}.
+ B{Note}: L{Object.colbits<Object.Object.colbits>} needs to be set correctly
+ for each object in order for these materials to be used instead of
+ the object's materials.
+ B{Note}: Making the material list shorter does not change the face's material indices.
+ Take care when using the face's material indices to reference a material in this list.
+ B{Note}: The list that's returned is I{not} linked to the original mesh.
+ mesh.materials.append(material) won't do anything.
+ Use mesh.materials += [material] instead.
+ @type materials: list of L{Material}s
+ @ivar degr: The max angle for auto smoothing in [1,80].
+ @type degr: int
+ @ivar maxSmoothAngle: Same as L{degr}. This attribute is only for
+ compatibility with NMesh scripts and will probably be deprecated in
+ the future.
+ @ivar mode: The mesh's mode bitfield. See L{Modes}.
+ @type mode: int
+ @ivar sel: Sets selection status for all vertices, edges and faces in the
+ mesh (write only).
+ @type sel: boolean
+ @ivar hide: Sets hidden status for all vertices, edges and faces in the
+ mesh (write only).
+ @type hide: boolean
+ @ivar subDivLevels: The [display, rendering] subdivision levels in [1, 6].
+ @type subDivLevels: list of 2 ints
+
+ @ivar faceUV: The mesh contains UV-mapped textured faces. Enabling faceUV
+ does not initialize the face colors like the Blender UI does; this must
+ be done in the script. B{Note}: if faceUV is set, L{vertexColors} cannot
+ be set. Furthermore, if vertexColors is already set when faceUV is set,
+ vertexColors is cleared. This is because the vertex color information
+ is stored with UV faces, so enabling faceUV implies enabling vertexColors.
+ In addition, faceUV cannot be set when the mesh has no faces defined
+ (this is the same behavior as the UI). Attempting to do so will throw
+ a RuntimeError exception.
+ @type faceUV: bool
+ @ivar vertexColors: The mesh contains vertex colors. See L{faceUV} for the
+ use of vertex colors when UV-mapped texture faces are enabled.
+ @type vertexColors: bool
+ @ivar vertexUV: The mesh contains "sticky" per-vertex UV coordinates.
+ @type vertexUV: bool
+ @ivar activeFace: Index of the mesh's active face in UV Face Select and
+ Paint modes. Only one face can be active at a time. Note that this is
+ independent of the selected faces in Face Select and Edit modes.
+ Will throw an exception if the mesh does not have UV faces; use
+ L{faceUV} to test.
+ @type activeFace: int
+ @ivar activeGroup: The mesh's active vertex group. The mesh must be
+ linked to an object (read the comment in L{addVertGroup} for more info).
+ @type activeGroup: string or None
+ @ivar texMesh: The mesh's texMesh setting, used so coordinates from another
+ mesh can be used for rendering textures.
+ @type texMesh: Mesh or None
+ @ivar key: The L{Key<Key.Key>} object containing the keyframes for this mesh, if any.
+ @type key: Key or None
+
+ @ivar activeUVLayer: The mesh's active UV/Image layer. None if there is no UV/Image layers.
+ @type activeUVLayer: string
+ @ivar activeColorLayer: The mesh's active Vertex Color layer. None if there is no UV/Image layers.
+ @type activeColorLayer: string
+
+ @ivar multires: The mesh has multires data, set True to add multires data.
+ Will throw an exception if the mesh has shape keys; use L{key} to test.
+ @type multires: bool
+ @ivar multiresLevelCount: The mesh has multires data. (read only)
+ @type multiresLevelCount: int
+ @ivar multiresDrawLevel: The multires level to display in the 3dview in [1 - multiresLevelCount].
+ @type multiresDrawLevel: int
+ @ivar multiresEdgeLevel: The multires level edge display in the 3dview [1 - multiresLevelCount].
+ @type multiresEdgeLevel: int
+ @ivar multiresPinLevel: The multires pin level, used for applying modifiers [1 - multiresLevelCount].
+ @type multiresPinLevel: int
+ @ivar multiresRenderLevel: The multires level to render [1 - multiresLevelCount].
+ @type multiresRenderLevel: int
+
+
+ """
+
+ def getFromObject(object, cage=0, render=0):
+ """
+ Replace the mesh's existing data with the raw mesh data from a Blender
+ Object. This method supports all the geometry based objects (mesh, text,
+ curve, surface, and meta). If the object has modifiers, they will be
+ applied before to the object before extracting the vertex data unless
+ the B{cage} parameter is 1.
+ @note: The mesh coordinates are in I{local space}, not the world space of
+ its object. For world space vertex coordinates, each vertex location must
+ be multiplied by the object's 4x4 transform matrix (see L{transform}).
+ @note: The objects materials will not be copied into the existing mesh,
+ however the face material indices will match the material list of the original data.
+ @type object: blender object or string
+ @param object: The Blender object or its name, which contains the geometry data.
+ @type cage: int
+ @param cage: determines whether the original vertices or derived vertices
+ @type render: int
+ @param render: determines whether the render setting for modifiers will be used or not.
+ (for objects with modifiers) are used. The default is derived vertices.
+ """
+
+ def calcNormals():
+ """
+ Recalculates the vertex normals using face data.
+ """
+
+ def transform(matrix, recalc_normals = False):
+ """
+ Transforms the mesh by the specified 4x4 matrix (such as returned by
+ L{Object.Object.getMatrix}). The matrix should be invertible.
+ Ideal usage for this is exporting to an external file where
+ global vertex locations are required for each object.
+ Sometimes external renderers or file formats do not use vertex normals.
+ In this case, you can skip transforming the vertex normals by leaving
+ the optional parameter recalc_normals as False or 0 (the default value).
+
+ Example::
+ # This script outputs deformed meshes worldspace vertex locations
+ # for a selected object without changing the object
+ import Blender
+ from Blender import Mesh, Object
+
+ ob = Object.GetSelected()[0] # Get the first selected object
+ me = Mesh.New() # Create a new mesh
+ me.getFromObject(ob.name) # Get the object's mesh data
+ verts = me.verts[:] # Save a copy of the vertices
+ me.transform(ob.matrix) # Convert verts to world space
+ for v in me.verts:
+ print 'worldspace vert', v.co
+ me.verts = verts # Restore the original verts
+
+ @type matrix: Py_Matrix
+ @param matrix: 4x4 Matrix which can contain location, scale and rotation.
+ @type recalc_normals: int
+ @param recalc_normals: if True or 1, also transform vertex normals.
+ @warn: unlike L{NMesh.transform()<NMesh.NMesh.transform>}, this method
+ I{will immediately modify the mesh data} when it is used. If you
+ transform the mesh using the object's matrix to get the vertices'
+ world positions, the result will be a "double transform". To avoid
+ this you either need to set the object's matrix to the identity
+ matrix, perform the inverse transform after outputting the transformed
+ vertices, or make a copy of the vertices prior to using this method
+ and restore them after outputting the transformed vertices (as shown
+ in the example).
+ """
+
+ def vertexShade(object):
+ """
+ Colors vertices based on the current lighting setup, like when there
+ are no vertex colors and no textured faces and a user enters Vertex Paint
+ Mode in Blender (only lamps in visible layers account). An exception is
+ thrown if called while in EditMode.
+ @type object: Object
+ @param object: The Blender Object linked to the mesh.
+ """
+
+ def update():
+ """
+ Update display lists after changes to mesh. B{Note}: with changes taking
+ place for using a directed acyclic graph (DAG) for scene and object
+ updating, this method may be only temporary and may be removed in future
+ releases.
+ @warn: Since Blender 2.42 this function has changed; now it won't recalculate
+ vertex normals (seen when faces are smooth). See L{Mesh.calcNormals()}.
+ """
+
+ def findEdges(edges):
+ """
+ Quickly search for the location of an edges.
+ @type edges: sequence(s) of ints or MVerts
+ @param edges: can be tuples of MVerts or integer indexes (B{note:} will
+ not work with PVerts) or a sequence (list or tuple) containing two or
+ more sequences.
+ @rtype: int, None or list
+ @return: if an edge is found, its index is returned; otherwise None is
+ returned. If a sequence of edges is passed, a list is returned.
+ """
+
+ def addVertGroup(group):
+ """
+ Add a named and empty vertex (deform) group to the object this mesh is
+ linked to. The mesh must first be linked to an object (with object.link()
+ or object.getData() ) so the method knows which object to update.
+ This is because vertex groups in Blender are stored in I{the object} --
+ not in the mesh, which may be linked to more than one object.
+ @type group: string
+ @param group: the name for the new group.
+ """
+
+ def removeVertGroup(group):
+ """
+ Remove a named vertex (deform) group from the object linked to this mesh.
+ All vertices assigned to the group will be removed (just from the group,
+ not deleted from the mesh), if any. If this mesh was newly created, it
+ must first be linked to an object (read the comment in L{addVertGroup} for
+ more info).
+ @type group: string
+ @param group: the name of a vertex group.
+ """
+
+ def assignVertsToGroup(group, vertList, weight, assignmode = AssignModes['REPLACE']):
+ """
+ Adds an array (a Python list) of vertex points to a named vertex group
+ associated with a mesh. The vertex list is a list of vertex indices from
+ the mesh. You should assign vertex points to groups only when the mesh has
+ all its vertex points added to it and is already linked to an object.
+
+ I{B{Example:}}
+ The example here adds a new set of vertex indices to a sphere primitive::
+ import Blender
+ sphere = Blender.Object.Get('Sphere')
+ replace = Blender.Mesh.AssignModes.REPLACE
+ mesh = sphere.getData(mesh=True)
+ mesh.addVertGroup('firstGroup')
+ vertList = []
+ for x in range(300):
+ if x % 3 == 0:
+ vertList.append(x)
+ mesh.assignVertsToGroup('firstGroup', vertList, 0.5, replace)
+
+ @type group: string
+ @param group: the name of the group.
+ @type vertList: list of ints
+ @param vertList: a list of vertex indices.
+ @type weight: float
+ @param weight: the deform weight for (which means: the amount of influence
+ the group has over) the given vertices. It should be in the range
+ [0.0, 1.0]. If weight <= 0, the given vertices are removed from the
+ group. If weight > 1, it is clamped.
+ @type assignmode: module constant
+ @param assignmode: Three choices: REPLACE, ADD or SUBTRACT.
+ See L{AssignModes} for a complete description.
+ """
+
+ def removeVertsFromGroup(group, vertList = None):
+ """
+ Remove a list of vertices from the given group. If this mesh was newly
+ created, it must first be linked to an object (check L{addVertGroup}).
+ @type group: string
+ @param group: the name of a vertex group
+ @type vertList: list of ints
+ @param vertList: a list of vertex indices to be removed from I{group}.
+ If None, all vertices are removed -- the group is emptied.
+ """
+
+ def getVertsFromGroup(group, weightsFlag = 0, vertList = None):
+ """
+ Return a list of vertex indices associated with the passed group. This
+ method can be used to test whether a vertex index is part of a group and
+ if so, what its weight is.
+
+ I{B{Example:}}
+ Append this to the example from L{assignVertsToGroup}::
+ # ...
+ print "Vertex indices from group %s :" % groupName
+ print mesh.getVertsFromGroup('firstGroup')
+ print "Again, with weights:"
+ print mesh.getVertsFromGroup('firstGroup',1)
+ print "Again, with weights and restricted to the given indices:"
+ print mesh.getVertsFromGroup('firstGroup',1,[1,2,3,4,5,6])
+
+ @type group: string
+ @param group: the group name.
+ @type weightsFlag: bool
+ @param weightsFlag: if 1, the weight is returned along with the index.
+ @type vertList: list of ints
+ @param vertList: if given, only those vertex points that are both in the
+ list and group passed in are returned.
+ """
+
+ def renameVertGroup(groupName, newName):
+ """
+ Renames a vertex group.
+ @type groupName: string
+ @param groupName: the vertex group name to be renamed.
+ @type newName: string
+ @param newName: the name to replace the old name.
+ """
+
+ def getVertGroupNames():
+ """
+ Return a list of all vertex group names.
+ @rtype: list of strings
+ @return: returns a list of strings representing all vertex group
+ associated with the mesh's object
+ """
+
+ def getUVLayerNames():
+ """
+ Return a list of all UV layer names
+ @rtype: list of strings
+ @return: returns a list of strings representing all UV layers
+ associated with the mesh's object
+ """
+
+ def getColorLayerNames():
+ """
+ Return a list of all color layer names
+ @rtype: list of strings
+ @return: returns a list of strings representing all color layers
+ associated with the mesh's object
+ """
+
+ def getVertexInfluences(index):
+ """
+ Get the bone influences for a specific vertex.
+ @type index: int
+ @param index: The index of a vertex.
+ @rtype: list of lists
+ @return: List of pairs [name, weight], where name is the bone name (string)
+ and weight is a float value.
+ """
+
+ def removeAllKeys():
+ """
+ Remove all mesh keys stored in this mesh.
+ @rtype: bool
+ @return: True if successful or False if the Mesh has no keys.
+ """
+
+ def insertKey(frame = None, type = 'relative'):
+ """
+ Insert a mesh key at the given frame.
+ @type frame: int
+ @type type: string
+ @param frame: The Scene frame where the mesh key should be inserted. If
+ None or the arg is not given, the current frame is used.
+ @param type: The mesh key type: 'relative' or 'absolute'. This is only
+ relevant on meshes with no keys.
+ @warn: This and L{removeAllKeys} were included in this release only to
+ make accessing vertex keys possible, but may not be a proper solution
+ and may be substituted by something better later. For example, it
+ seems that 'frame' should be kept in the range [1, 100]
+ (the curves can be manually tweaked in the Ipo Curve Editor window in
+ Blender itself later).
+ @warn: Will throw an error if the mesh has multires. use L{multires} to check.
+ """
+
+ def addUVLayer(name):
+ """
+ Adds a new UV/Image layer to this mesh, it will always be the last layer but not made active.
+ @type name: string
+ @param name: The name of the new UV layer, 31 characters max.
+ """
+
+ def addColorLayer(name):
+ """
+ Adds a new Vertex Color layer to this mesh, it will always be the last layer but not made active.
+ @type name: string
+ @param name: The name of the new Color layer, 31 characters max.
+ """
+
+ def removeUVLayer(name):
+ """
+ Removes the active UV/Image layer.
+ @type name: string
+ @param name: The name of the UV layer to remove.
+ """
+
+ def removeColorLayer(name):
+ """
+ Removes the active Vertex Color layer.
+ @type name: string
+ @param name: The name of the Color layer to remove.
+ """
+
+ def renameUVLayer(name, newname):
+ """
+ Removes the active UV/Image layer.
+ @type name: string
+ @param name: The UV layer to rename.
+ @type newname: string
+ @param newname: The new name of the UV layer, will be made unique.
+ """
+
+ def renameColorLayer(name, newname):
+ """
+ Removes the active Vertex Color layer.
+ @type name: string
+ @param name: The Color layer to rename.
+ @type newname: string
+ @param newname: The new name of the Color layer, will be made unique.
+ """
+
+ def smooth():
+ """
+ Flattens angle of selected faces. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ """
+
+ def flipNormals():
+ """
+ Toggles the direction of selected face's normals. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ """
+
+ def toSphere():
+ """
+ Moves selected vertices outward in a spherical shape. Experimental mesh
+ tool.
+ An exception is thrown if called while in EditMode.
+ """
+
+ def fill():
+ """
+ Scan fill a closed selected edge loop. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ """
+
+ def triangleToQuad():
+ """
+ Convert selected triangles to quads. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ """
+
+ def quadToTriangle(mode=0):
+ """
+ Convert selected quads to triangles. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ @type mode: int
+ @param mode: specifies whether a to add the new edge between the
+ closest (=0) or farthest(=1) vertices.
+ """
+
+ def subdivide(beauty=0):
+ """
+ Subdivide selected edges in a mesh. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ @type beauty: int
+ @param beauty: specifies whether a "beauty" subdivide should be
+ enabled (disabled is default). Value must be in the range [0,1].
+ """
+
+ def remDoubles(limit):
+ """
+ Removes duplicates from selected vertices. Experimental mesh tool.
+ An exception is thrown if called while in EditMode.
+ @type limit: float
+ @param limit: specifies the maximum distance considered for vertices
+ to be "doubles". Value is clamped to the range [0.0,1.0].
+ @rtype: int
+ @return: the number of vertices deleted
+ """
+
+ def recalcNormals(direction=0):
+ """
+ Recalculates inside or outside normals for selected faces. Experimental
+ mesh tool.
+ An exception is thrown if called while in EditMode.
+ @type direction: int
+ @param direction: specifies outward (0) or inward (1) normals. Outward
+ is the default. Value must be in the range [0,1].
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this mesh
+ @rtype: Mesh
+ @return: a copy of this mesh
+ """
+
+import id_generics
+Mesh.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Metaball.py b/source/blender/python/api2_2x/doc/Metaball.py
index 1f2ee6b3b5f..704638ea742 100644
--- a/source/blender/python/api2_2x/doc/Metaball.py
+++ b/source/blender/python/api2_2x/doc/Metaball.py
@@ -99,143 +99,138 @@ Example::
def New (name):
- """
- Creates a new Metaball.
- @type name: string
- @param name: The name of the metaball. If this parameter is not given (or not valid) blender will assign a name to the metaball.
- @rtype: Blender Metaball
- @return: The created Metaball.
- """
+ """
+ Creates a new Metaball.
+ @type name: string
+ @param name: The name of the metaball. If this parameter is not given (or not valid) blender will assign a name to the metaball.
+ @rtype: Blender Metaball
+ @return: The created Metaball.
+ """
def Get (name):
- """
- Get the Metaball from Blender.
- @type name: string
- @param name: The name of the requested Metaball.
- @rtype: Blender Metaball or a list of Blender Metaballs
- @return: It depends on the 'name' parameter:
- - (name): The Metaball with the given name;
- - (): A list with all Metaballs in the current scene.
- """
+ """
+ Get the Metaball from Blender.
+ @type name: string
+ @param name: The name of the requested Metaball.
+ @rtype: Blender Metaball or a list of Blender Metaballs
+ @return: It depends on the 'name' parameter:
+ - (name): The Metaball with the given name;
+ - (): A list with all Metaballs in the current scene.
+ """
class Metaball:
- """
- The Metaball object
- ===================
- This metaball gives access to generic data from all metaballs in Blender.
- @ivar name: The unique name of the metaball.
- @type name: string
- @ivar users: The user count (read only)
- @type users: int
- @ivar fakeUser: The fake user status.
- Enabling this will keep it in the blend even if there are no users.
- @type fakeUser: bool
- @ivar elements: Element iterator of MetaElemSeq type.
- @type elements: MetaElemSeq
- @ivar wiresize: display resolution.
- Value clamped between 0.05 and 1.0.
-
- A lower value results in more polygons.
- @type wiresize: float
- @ivar rendersize: render resolution.
- Value clamped between 0.05 and 1.0.
-
- A lower value results in more polygons.
- @type rendersize: float
- @ivar thresh: Threshold setting for this metaball.
- Value clamped between 0.0 and 5.0.
- @type thresh: float
- @ivar materials: List of up to 16 Materials or None types
- Only the first material of the mother-ball used at the moment.
- @type materials: list
- """
-
- def __copy__():
- """
- Return a copy of this metaball object data.
- @rtype: Metaball
- @return: Metaball
- """
+ """
+ The Metaball object
+ ===================
+ This metaball gives access to generic data from all metaballs in Blender.
+ @ivar elements: Element iterator of MetaElemSeq type.
+ @type elements: MetaElemSeq
+ @ivar wiresize: display resolution.
+ Value clamped between 0.05 and 1.0.
+
+ A lower value results in more polygons.
+ @type wiresize: float
+ @ivar rendersize: render resolution.
+ Value clamped between 0.05 and 1.0.
+
+ A lower value results in more polygons.
+ @type rendersize: float
+ @ivar thresh: Threshold setting for this metaball.
+ Value clamped between 0.0 and 5.0.
+ @type thresh: float
+ @ivar materials: List of up to 16 Materials or None types
+ Only the first material of the mother-ball used at the moment.
+ @type materials: list
+ """
+
+ def __copy__():
+ """
+ Return a copy of this metaball object data.
+ @rtype: Metaball
+ @return: Metaball
+ """
+
+import id_generics
+Metaball.__doc__ += id_generics.attributes
+
class MetaElemSeq:
- """
- The MetaElemSeq object
- ======================
- This object provides sequence and iterator access to the metaballs elements.
- The elements accessed within this iterator "wraps" the actual metaball elements; changing any
- of the elements's attributes will immediately change the data in the metaball.
-
- This iterator is most like pythons 'set' type.
- """
-
- def add():
- """
- Append a new element to the metaball.
- no arguments are taken, instead a new metaelement is
- added to the metaball data and returned.
- This new element can then be modified.
-
- @return: a new meta element.
- @rtype: Metaelement
- """
-
- def remove(element):
- """
- remove an element from the metaball data.
-
- if the element is not a part of the metaball data, an error will be raised.
-
- @return: None
- @rtype: None
- """
-
- def __iter__():
- """
- Iterate over elements in this metaball.
-
- @return: One of the metaelem in this metaball.
- @rtype: Metaelem
- """
-
- def __len__():
- """
- Iterate over elements in this metaball.
-
- @return: The number of elements in this metaball
- @rtype: int
- """
+ """
+ The MetaElemSeq object
+ ======================
+ This object provides sequence and iterator access to the metaballs elements.
+ The elements accessed within this iterator "wraps" the actual metaball elements; changing any
+ of the elements's attributes will immediately change the data in the metaball.
+
+ This iterator is most like pythons 'set' type.
+ """
+
+ def add():
+ """
+ Append a new element to the metaball.
+ no arguments are taken, instead a new metaelement is
+ added to the metaball data and returned.
+ This new element can then be modified.
+
+ @return: a new meta element.
+ @rtype: Metaelement
+ """
+
+ def remove(element):
+ """
+ remove an element from the metaball data.
+
+ if the element is not a part of the metaball data, an error will be raised.
+
+ @return: None
+ @rtype: None
+ """
+
+ def __iter__():
+ """
+ Iterate over elements in this metaball.
+
+ @return: One of the metaelem in this metaball.
+ @rtype: Metaelem
+ """
+
+ def __len__():
+ """
+ Iterate over elements in this metaball.
+
+ @return: The number of elements in this metaball
+ @rtype: int
+ """
class Metaelem:
- """
- The Metaelem object
- ===================
- This gives direct access to meta element data within a metaball.
- @ivar type: The type of the metaball.
- Values must be from L{Types}
-
- Example::
- from Blender import Metaball
- mb= Metaball.Get('mb')
- for el in mb.elements:
- el.type= Metaball.Types.CUBE
- @type type: int
- @ivar co: The location of this element.
- @type co: Vector
- @ivar dims: Element dimensions.
- Values clamped between 0 and 20 on all axies.
- @type dims: Vector
- @ivar quat: Element rotation.
- @type quat: Quaternion
- @ivar stiffness: Element stiffness.
- Value clamped between 0 and 10.
- @type stiffness: float
- @ivar radius: Element radius.
- Value clamped between 0 and 5000.
- @type radius: float
- @ivar negative: Element negative volume status.
- @type negative: bool
- @ivar hide: Element hidden status.
- @type hide: bool
- """
-
-
+ """
+ The Metaelem object
+ ===================
+ This gives direct access to meta element data within a metaball.
+ @ivar type: The type of the metaball.
+ Values must be from L{Types}
+
+ Example::
+ from Blender import Metaball
+ mb= Metaball.Get('mb')
+ for el in mb.elements:
+ el.type= Metaball.Types.CUBE
+ @type type: int
+ @ivar co: The location of this element.
+ @type co: Vector
+ @ivar dims: Element dimensions.
+ Values clamped between 0 and 20 on all axies.
+ @type dims: Vector
+ @ivar quat: Element rotation.
+ @type quat: Quaternion
+ @ivar stiffness: Element stiffness.
+ Value clamped between 0 and 10.
+ @type stiffness: float
+ @ivar radius: Element radius.
+ Value clamped between 0 and 5000.
+ @type radius: float
+ @ivar negative: Element negative volume status.
+ @type negative: bool
+ @ivar hide: Element hidden status.
+ @type hide: bool
+ """
diff --git a/source/blender/python/api2_2x/doc/NLA.py b/source/blender/python/api2_2x/doc/NLA.py
index e99dece80c8..e088b277103 100644
--- a/source/blender/python/api2_2x/doc/NLA.py
+++ b/source/blender/python/api2_2x/doc/NLA.py
@@ -13,11 +13,11 @@ Actions are linked to objects of type armature.
@type Flags: readonly dictionary
@var Flags: Constant dict used by the L{ActionStrip.flag} attribute.
It is a bitmask and settings are ORed together.
- - SELECT: action strip is selected in NLA window
- - STRIDE_PATH: play action based on path position and stride.
- - HOLD: continue displaying the last frame past the end of the strip
- - ACTIVE: action strip is active in NLA window
- - LOCK_ACTION: action start/end are automatically mapped to strip duration
+ - SELECT: action strip is selected in NLA window
+ - STRIDE_PATH: play action based on path position and stride.
+ - HOLD: continue displaying the last frame past the end of the strip
+ - ACTIVE: action strip is active in NLA window
+ - LOCK_ACTION: action start/end are automatically mapped to strip duration
@type StrideAxes: readonly dictionary
@var StrideAxes: Constant dict used by the L{ActionStrip.strideAxis} attribute.
@@ -29,199 +29,202 @@ Currently the only value is MODE_ADD.
"""
def NewAction (name = 'DefaultAction'):
- """
- Create a new Action object.
- @type name: string
- @param name: The Action name.
- @rtype: PyAction
- """
-
+ """
+ Create a new Action object.
+ @type name: string
+ @param name: The Action name.
+ @rtype: PyAction
+ """
+
def CopyAction (action):
- """
- Copy an action and it's keyframes
- @type action: PyAction
- @param action: The action to be copied.
- @rtype: PyAction
- @return: A copied action
- """
+ """
+ Copy an action and it's keyframes
+ @type action: PyAction
+ @param action: The action to be copied.
+ @rtype: PyAction
+ @return: A copied action
+ """
def GetActions ():
- """
- Get all actions and return them as a Key : Value Dictionary.
- @rtype: Dictionary of PyActions
- @return: All the actions in blender
- """
-
+ """
+ Get all actions and return them as a Key : Value Dictionary.
+ @rtype: Dictionary of PyActions
+ @return: All the actions in blender
+ """
+
class Action:
- """
- The Action object
- =================
- This object gives access to Action-specific data in Blender.
- """
-
- def getName():
- """
- Get the name of this Action.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Action.
- @type name: string
- @param name: The new name
- """
-
- def setActive(object):
- """
- Set this action as the current action for an object.
- @type object: PyObject
- @param object: The object whose action is to be set
- """
-
- def getChannelIpo(channel):
- """
- Get the Ipo for the named channel in this action
- @type channel: string
- @param channel: The name of a channel in this action
- @rtype: PyIpo or None
- @return: the Ipo for the channel
- """
-
- def getFrameNumbers():
- """
- Gets the frame numbers at which a key was inserted into this action
- @rtype: PyList
- @return: a list of ints
- """
-
- def removeChannel(channel):
- """
- Remove a named channel from this action
- @type channel: string
- @param channel: The name of a channel in this action to be removed
- """
-
- def getAllChannelIpos():
- """
- Get the all the Ipos for this action
- @rtype: Dictionary [channel : PyIpo or None]
- @return: the Ipos for all the channels in the action
- """
+ """
+ The Action object
+ =================
+ This object gives access to Action-specific data in Blender.
+ """
+
+ def getName():
+ """
+ Get the name of this Action.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Action.
+ @type name: string
+ @param name: The new name
+ """
+
+ def setActive(object):
+ """
+ Set this action as the current action for an object.
+ @type object: PyObject
+ @param object: The object whose action is to be set
+ """
+
+ def getChannelIpo(channel):
+ """
+ Get the Ipo for the named channel in this action
+ @type channel: string
+ @param channel: The name of a channel in this action
+ @rtype: PyIpo or None
+ @return: the Ipo for the channel
+ """
+
+ def getFrameNumbers():
+ """
+ Gets the frame numbers at which a key was inserted into this action
+ @rtype: PyList
+ @return: a list of ints
+ """
+
+ def removeChannel(channel):
+ """
+ Remove a named channel from this action
+ @type channel: string
+ @param channel: The name of a channel in this action to be removed
+ """
+
+ def getAllChannelIpos():
+ """
+ Get the all the Ipos for this action
+ @rtype: Dictionary [channel : PyIpo or None]
+ @return: the Ipos for all the channels in the action
+ """
+
+import id_generics
+Action.__doc__ += id_generics.attributes
class ActionStrips:
- """
- The ActionStrips object
- =======================
- This object gives access to sequence of L{ActionStrip} objects for
- a particular Object.
- """
-
- def __getitem__(index):
- """
- This operator returns one of the action strips in the stack.
- @type index: int
- @return: an action strip object
- @rtype: ActionStrip
- @raise KeyError: index was out of range
- """
-
- def __len__():
- """
- Returns the number of action strips for the object.
- @return: number of action strips
- @rtype: int
- """
-
- def append(action):
- """
- Appends a new action to the end of the action strip sequence.
- @type action: L{Action<NLA.Action>}
- @param action: the action to use in the action strip
- @rtype: ActionStrip
- @return: the new action strip
- """
-
- def remove(actionstrip):
- """
- Remove an action strip from this object's actionstrip sequence.
- @type actionstrip: an action strip from this sequence to remove.
- @note: Accessing attributes of the action strip after it is removed will
- throw an exception.
- """
-
- def moveDown(actionstrip):
- """
- Move the action strip down in the object's actionstrip sequence.
- @type actionstrip: an action strip from this sequence.
- """
+ """
+ The ActionStrips object
+ =======================
+ This object gives access to sequence of L{ActionStrip} objects for
+ a particular Object.
+ """
+
+ def __getitem__(index):
+ """
+ This operator returns one of the action strips in the stack.
+ @type index: int
+ @return: an action strip object
+ @rtype: ActionStrip
+ @raise KeyError: index was out of range
+ """
+
+ def __len__():
+ """
+ Returns the number of action strips for the object.
+ @return: number of action strips
+ @rtype: int
+ """
+
+ def append(action):
+ """
+ Appends a new action to the end of the action strip sequence.
+ @type action: L{Action<NLA.Action>}
+ @param action: the action to use in the action strip
+ @rtype: ActionStrip
+ @return: the new action strip
+ """
+
+ def remove(actionstrip):
+ """
+ Remove an action strip from this object's actionstrip sequence.
+ @type actionstrip: an action strip from this sequence to remove.
+ @note: Accessing attributes of the action strip after it is removed will
+ throw an exception.
+ """
+
+ def moveDown(actionstrip):
+ """
+ Move the action strip down in the object's actionstrip sequence.
+ @type actionstrip: an action strip from this sequence.
+ """
- def moveUp(actionstrip):
- """
- Move the action strip up in the object's actionstrip sequence.
- @type actionstrip: an action strip from this sequence.
- """
+ def moveUp(actionstrip):
+ """
+ Move the action strip up in the object's actionstrip sequence.
+ @type actionstrip: an action strip from this sequence.
+ """
class ActionStrip:
- """
- The ActionStrip object
- ======================
- This object gives access to a particular action strip.
- @ivar action: Action associated with the strip.
- @type action: BPy Action object
- @ivar stripStart: Starting frame of the strip.
- @type stripStart: float
- @ivar stripEnd: Ending frame of the strip.
- @type stripEnd: float
- @ivar actionStart: Starting frame of the action.
- @type actionStart: float
- @ivar actionEnd: Ending frame of the action.
- @type actionEnd: float
- @ivar repeat: The number of times to repeat the action range.
- @type repeat: float
- @ivar mode: Controls the ActionStrip mode. See L{Modes} for
- valid values.
- @type mode: int
- @ivar flag: Controls various ActionStrip attributes. Values can be ORed.
- See L{Flags} for valid values.
- @type flag: int
- @ivar strideAxis: Dominant axis for stride bone. See L{StrideAxes} for
- valid values.
- @type strideAxis: int
- @ivar strideLength: Distance covered by one complete cycle of the action
- specified in the Action Range.
- @type strideLength: float
- @ivar strideBone: Name of Bone used for stride
- @type strideBone: string
- @ivar groupTarget: Armature object within DupliGroup for local animation
- @type groupTarget: object
- @ivar blendIn: Number of frames of motion blending.
- @type blendIn: float
- @ivar blendOut: Number of frames of ease-out.
- @type blendOut: float
- """
-
- def resetActionLimits():
- """
- Activates the functionality found in NLA Strip menu under "Reset Action
- Start/End". This method restores the values of ActionStart and
- ActionEnd to their defaults, usually the first and last frames within
- an action that contain keys.
- @rtype: None
- """
-
- def resetStripSize():
- """
- Activates the functionality found in NLA Strip menu under "Reset Strip
- Size". This method resets the action strip size to its creation values.
- @rtype: None
- """
-
- def snapToFrame():
- """
- Activates the functionality found in NLA Strip menu under "Snap to Frame".
- This function snaps the ends of the action strip to the nearest whole
- numbered frame.
- @rtype: None
- """
+ """
+ The ActionStrip object
+ ======================
+ This object gives access to a particular action strip.
+ @ivar action: Action associated with the strip.
+ @type action: BPy Action object
+ @ivar stripStart: Starting frame of the strip.
+ @type stripStart: float
+ @ivar stripEnd: Ending frame of the strip.
+ @type stripEnd: float
+ @ivar actionStart: Starting frame of the action.
+ @type actionStart: float
+ @ivar actionEnd: Ending frame of the action.
+ @type actionEnd: float
+ @ivar repeat: The number of times to repeat the action range.
+ @type repeat: float
+ @ivar mode: Controls the ActionStrip mode. See L{Modes} for
+ valid values.
+ @type mode: int
+ @ivar flag: Controls various ActionStrip attributes. Values can be ORed.
+ See L{Flags} for valid values.
+ @type flag: int
+ @ivar strideAxis: Dominant axis for stride bone. See L{StrideAxes} for
+ valid values.
+ @type strideAxis: int
+ @ivar strideLength: Distance covered by one complete cycle of the action
+ specified in the Action Range.
+ @type strideLength: float
+ @ivar strideBone: Name of Bone used for stride
+ @type strideBone: string
+ @ivar groupTarget: Armature object within DupliGroup for local animation
+ @type groupTarget: object
+ @ivar blendIn: Number of frames of motion blending.
+ @type blendIn: float
+ @ivar blendOut: Number of frames of ease-out.
+ @type blendOut: float
+ """
+
+ def resetActionLimits():
+ """
+ Activates the functionality found in NLA Strip menu under "Reset Action
+ Start/End". This method restores the values of ActionStart and
+ ActionEnd to their defaults, usually the first and last frames within
+ an action that contain keys.
+ @rtype: None
+ """
+
+ def resetStripSize():
+ """
+ Activates the functionality found in NLA Strip menu under "Reset Strip
+ Size". This method resets the action strip size to its creation values.
+ @rtype: None
+ """
+
+ def snapToFrame():
+ """
+ Activates the functionality found in NLA Strip menu under "Snap to Frame".
+ This function snaps the ends of the action strip to the nearest whole
+ numbered frame.
+ @rtype: None
+ """
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index 1ba6f429d85..c757f23456c 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -4,18 +4,18 @@
The Blender.Object submodule
B{New}:
- - Addition of attributes for particle deflection, softbodies, and
- rigidbodies.
- - Objects now increment the Blender user count when they are created and
- decremented it when they are destroyed. This means Python scripts can
- keep the object "alive" if it is deleted in the Blender GUI.
- - L{Object.getData} now accepts two optional bool keyword argument to
- define (1) if the user wants the data object or just its name
- and (2) if a mesh object should use NMesh or Mesh.
- - L{Object.clearScriptLinks} accepts a parameter now.
- - Object attributes: renamed Layer to L{Layers<Object.Object.Layers>} and
- added the easier L{layers<Object.Object.layers>}. The old form "Layer"
- will continue to work.
+ - Addition of attributes for particle deflection, softbodies, and
+ rigidbodies.
+ - Objects now increment the Blender user count when they are created and
+ decremented it when they are destroyed. This means Python scripts can
+ keep the object "alive" if it is deleted in the Blender GUI.
+ - L{Object.getData} now accepts two optional bool keyword argument to
+ define (1) if the user wants the data object or just its name
+ and (2) if a mesh object should use NMesh or Mesh.
+ - L{Object.clearScriptLinks} accepts a parameter now.
+ - Object attributes: renamed Layer to L{Layers<Object.Object.Layers>} and
+ added the easier L{layers<Object.Object.layers>}. The old form "Layer"
+ will continue to work.
Object
@@ -25,1721 +25,1713 @@ This module provides access to the B{Objects} in Blender.
Example::
- import Blender
- scn = Blender.Scene.GetCurrent() # get the current scene
- cam = Blender.Camera.New('ortho') # make ortho camera data object
- ob = scn.objects.new(cam) # make a new object in this scene using the camera data
- ob.setLocation (0.0, -5.0, 1.0) # position the object in the scene
+ import Blender
+ scn = Blender.Scene.GetCurrent() # get the current scene
+ cam = Blender.Camera.New('ortho') # make ortho camera data object
+ ob = scn.objects.new(cam) # make a new object in this scene using the camera data
+ ob.setLocation (0.0, -5.0, 1.0) # position the object in the scene
- Blender.Redraw() # redraw the scene to show the updates.
+ Blender.Redraw() # redraw the scene to show the updates.
@type DrawModes: readonly dictionary
@var DrawModes: Constant dict used for with L{Object.drawMode} bitfield
- attribute. Values can be ORed together. Individual bits can also
- be set/cleared with boolean attributes.
- - AXIS: Enable display of active object's center and axis.
- - TEXSPACE: Enable display of active object's texture space.
- - NAME: Enable display of active object's name.
- - WIRE: Enable the active object's wireframe over solid drawing.
- - XRAY: Enable drawing the active object in front of others.
- - TRANSP: Enable transparent materials for the active object (mesh only).
+ attribute. Values can be ORed together. Individual bits can also
+ be set/cleared with boolean attributes.
+ - AXIS: Enable display of active object's center and axis.
+ - TEXSPACE: Enable display of active object's texture space.
+ - NAME: Enable display of active object's name.
+ - WIRE: Enable the active object's wireframe over solid drawing.
+ - XRAY: Enable drawing the active object in front of others.
+ - TRANSP: Enable transparent materials for the active object (mesh only).
@type DrawTypes: readonly dictionary
@var DrawTypes: Constant dict used for with L{Object.drawType} attribute.
- Only one type can be selected at a time.
- - BOUNDBOX: Only draw object with bounding box
- - WIRE: Draw object in wireframe
- - SOLID: Draw object in solid
- - SHADED: Draw object with shaded or textured
+ Only one type can be selected at a time.
+ - BOUNDBOX: Only draw object with bounding box
+ - WIRE: Draw object in wireframe
+ - SOLID: Draw object in solid
+ - SHADED: Draw object with shaded or textured
@type ParentTypes: readonly dictionary
@var ParentTypes: Constant dict used for with L{Object.parentType} attribute.
- - OBJECT: Object parent type.
- - CURVE: Curve deform parent type.
- - LATTICE: Lattice deform parent type. Note: This is the same as ARMATURE, 2.43 was released with LATTICE as an invalid value.
- - ARMATURE: Armature deform parent type.
- - VERT1: 1 mesh vert parent type.
- - VERT3: 1 mesh verts parent type.
- - BONE: Armature bone parent type.
-
+ - OBJECT: Object parent type.
+ - CURVE: Curve deform parent type.
+ - LATTICE: Lattice deform parent type. Note: This is the same as ARMATURE, 2.43 was released with LATTICE as an invalid value.
+ - ARMATURE: Armature deform parent type.
+ - VERT1: 1 mesh vert parent type.
+ - VERT3: 1 mesh verts parent type.
+ - BONE: Armature bone parent type.
+
@type ProtectFlags: readonly dictionary
@var ProtectFlags: Constant dict used for with L{Object.protectFlags} attribute.
- Values can be ORed together.
- - LOCX, LOCY, LOCZ: lock x, y or z location individually
- - ROTX, ROTY, ROTZ: lock x, y or z rotation individually
- - SCALEX, SCALEY, SCALEZ: lock x, y or z scale individually
- - LOC, ROT, SCALE: lock all 3 attributes for location, rotation or scale
+ Values can be ORed together.
+ - LOCX, LOCY, LOCZ: lock x, y or z location individually
+ - ROTX, ROTY, ROTZ: lock x, y or z rotation individually
+ - SCALEX, SCALEY, SCALEZ: lock x, y or z scale individually
+ - LOC, ROT, SCALE: lock all 3 attributes for location, rotation or scale
@type PITypes: readonly dictionary
@var PITypes: Constant dict used for with L{Object.piType} attribute.
- Only one type can be selected at a time.
- - NONE: No force influence on particles
- - FORCE: Object center attracts or repels particles ("Spherical")
- - VORTEX: Particles swirl around Z-axis of the object
- - WIND: Constant force applied in direction of object Z axis
- - GUIDE: Use a Curve Path to guide particles
+ Only one type can be selected at a time.
+ - NONE: No force influence on particles
+ - FORCE: Object center attracts or repels particles ("Spherical")
+ - VORTEX: Particles swirl around Z-axis of the object
+ - WIND: Constant force applied in direction of object Z axis
+ - GUIDE: Use a Curve Path to guide particles
@type RBFlags: readonly dictionary
@var RBFlags: Constant dict used for with L{Object.rbFlags} attribute.
- Values can be ORed together.
- - SECTOR: All game elements should be in the Sector boundbox
- - PROP: An Object fixed within a sector
- - BOUNDS: Specify a bounds object for physics
- - ACTOR: Enables objects that are evaluated by the engine
- - DYNAMIC: Enables motion defined by laws of physics (requires ACTOR)
- - GHOST: Enable objects that don't restitute collisions (requires ACTOR)
- - MAINACTOR: Enables MainActor (requires ACTOR)
- - RIGIDBODY: Enable rolling physics (requires ACTOR, DYNAMIC)
- - COLLISION_RESPONSE: Disable auto (de)activation (requires ACTOR, DYNAMIC)
- - USEFH: Use Fh settings in Materials (requires ACTOR, DYNAMIC)
- - ROTFH: Use face normal to rotate Object (requires ACTOR, DYNAMIC)
- - ANISOTROPIC: Enable anisotropic friction (requires ACTOR, DYNAMIC)
- - CHILD: reserved
+ Values can be ORed together.
+ - SECTOR: All game elements should be in the Sector boundbox
+ - PROP: An Object fixed within a sector
+ - BOUNDS: Specify a bounds object for physics
+ - ACTOR: Enables objects that are evaluated by the engine
+ - DYNAMIC: Enables motion defined by laws of physics (requires ACTOR)
+ - GHOST: Enable objects that don't restitute collisions (requires ACTOR)
+ - MAINACTOR: Enables MainActor (requires ACTOR)
+ - RIGIDBODY: Enable rolling physics (requires ACTOR, DYNAMIC)
+ - COLLISION_RESPONSE: Disable auto (de)activation (requires ACTOR, DYNAMIC)
+ - USEFH: Use Fh settings in Materials (requires ACTOR, DYNAMIC)
+ - ROTFH: Use face normal to rotate Object (requires ACTOR, DYNAMIC)
+ - ANISOTROPIC: Enable anisotropic friction (requires ACTOR, DYNAMIC)
+ - CHILD: reserved
@type RBShapes: readonly dictionary
@var RBShapes: Constant dict used for with L{Object.rbShapeBoundType}
- attribute. Only one type can be selected at a time. Values are
- BOX, SPHERE, CYLINDER, CONE, and POLYHEDERON
+ attribute. Only one type can be selected at a time. Values are
+ BOX, SPHERE, CYLINDER, CONE, and POLYHEDERON
"""
def New (type, name='type'):
- """
- Creates a new Object. Deprecated; instead use Scene.objects.new().
- @type type: string
- @param type: The Object type: 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
- 'Mball', 'Mesh', 'Surf' or 'Empty'.
- @type name: string
- @param name: The name of the object. By default, the name will be the same
- as the object type.
- If the name is already in use, this new object will have a number at the end of the name.
- @return: The created Object.
-
- I{B{Example:}}
-
- The example below creates a new Lamp object and puts it at the default
- location (0, 0, 0) in the current scene::
- import Blender
-
- object = Blender.Object.New('Lamp')
- lamp = Blender.Lamp.New('Spot')
- object.link(lamp)
- scene = Blender.Scene.GetCurrent()
- scene.link(object)
-
- Blender.Redraw()
- @Note: if an object is created but is not linked to object data, and the
- object is not linked to a scene, it will be deleted when the Python
- object is deallocated. This is because Blender does not allow objects
- to exist without object data unless they are Empty objects. Scene.link()
- will automatically create object data for an object if it has none.
- """
+ """
+ Creates a new Object. Deprecated; instead use Scene.objects.new().
+ @type type: string
+ @param type: The Object type: 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
+ 'Mball', 'Mesh', 'Surf' or 'Empty'.
+ @type name: string
+ @param name: The name of the object. By default, the name will be the same
+ as the object type.
+ If the name is already in use, this new object will have a number at the end of the name.
+ @return: The created Object.
+
+ I{B{Example:}}
+
+ The example below creates a new Lamp object and puts it at the default
+ location (0, 0, 0) in the current scene::
+ import Blender
+
+ object = Blender.Object.New('Lamp')
+ lamp = Blender.Lamp.New('Spot')
+ object.link(lamp)
+ scene = Blender.Scene.GetCurrent()
+ scene.link(object)
+
+ Blender.Redraw()
+ @Note: if an object is created but is not linked to object data, and the
+ object is not linked to a scene, it will be deleted when the Python
+ object is deallocated. This is because Blender does not allow objects
+ to exist without object data unless they are Empty objects. Scene.link()
+ will automatically create object data for an object if it has none.
+ """
def Get (name = None):
- """
- Get the Object from Blender.
- @type name: string
- @param name: The name of the requested Object.
- @return: It depends on the 'name' parameter:
- - (name): The Object with the given name;
- - (): A list with all Objects in the current scene.
+ """
+ Get the Object from Blender.
+ @type name: string
+ @param name: The name of the requested Object.
+ @return: It depends on the 'name' parameter:
+ - (name): The Object with the given name;
+ - (): A list with all Objects in the current scene.
- I{B{Example 1:}}
+ I{B{Example 1:}}
- The example below works on the default scene. The script returns the plane object and prints the location of the plane::
- import Blender
+ The example below works on the default scene. The script returns the plane object and prints the location of the plane::
+ import Blender
- object = Blender.Object.Get ('plane')
- print object.getLocation()
+ object = Blender.Object.Get ('plane')
+ print object.getLocation()
- I{B{Example 2:}}
+ I{B{Example 2:}}
- The example below works on the default scene. The script returns all objects
- in the scene and prints the list of object names::
- import Blender
+ The example below works on the default scene. The script returns all objects
+ in the scene and prints the list of object names::
+ import Blender
- objects = Blender.Object.Get ()
- print objects
- @note: Get will return objects from all scenes.
- Most user tools should only operate on objects from the current scene - Blender.Scene.GetCurrent().getChildren()
- """
+ objects = Blender.Object.Get ()
+ print objects
+ @note: Get will return objects from all scenes.
+ Most user tools should only operate on objects from the current scene - Blender.Scene.GetCurrent().getChildren()
+ """
def GetSelected ():
- """
- Get the user selection. If no objects are selected, an empty list will be returned.
-
- @return: A list of all selected Objects in the current scene.
+ """
+ Get the user selection. If no objects are selected, an empty list will be returned.
+
+ @return: A list of all selected Objects in the current scene.
- I{B{Example:}}
+ I{B{Example:}}
- The example below works on the default scene. Select one or more objects and
- the script will print the selected objects::
- import Blender
+ The example below works on the default scene. Select one or more objects and
+ the script will print the selected objects::
+ import Blender
- objects = Blender.Object.GetSelected()
- print objects
- @note: The active object will always be the first object in the list (if selected).
- @note: The user selection is made up of selected objects from Blender's current scene only.
- @note: The user selection is limited to objects on visible layers;
- if the user's last active 3d view is in localview then the selection will be limited to the objects in that localview.
- """
+ objects = Blender.Object.GetSelected()
+ print objects
+ @note: The active object will always be the first object in the list (if selected).
+ @note: The user selection is made up of selected objects from Blender's current scene only.
+ @note: The user selection is limited to objects on visible layers;
+ if the user's last active 3d view is in localview then the selection will be limited to the objects in that localview.
+ """
def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=0, material=0, texture=0, ipo=0):
- """
- Duplicate selected objects on visible layers from Blenders current scene,
- de-selecting the currently visible, selected objects and making a copy where all new objects are selected.
- By default no data linked to the object is duplicated; use the keyword arguments to change this.
- L{Object.GetSelected()<GetSelected>} will return the list of objects resulting from duplication.
-
- @type mesh: bool
- @param mesh: When non-zero, mesh object data will be duplicated with the objects.
- @type surface: bool
- @param surface: When non-zero, surface object data will be duplicated with the objects.
- @type curve: bool
- @param curve: When non-zero, curve object data will be duplicated with the objects.
- @type text: bool
- @param text: When non-zero, text object data will be duplicated with the objects.
- @type metaball: bool
- @param metaball: When non-zero, metaball object data will be duplicated with the objects.
- @type armature: bool
- @param armature: When non-zero, armature object data will be duplicated with the objects.
- @type lamp: bool
- @param lamp: When non-zero, lamp object data will be duplicated with the objects.
- @type material: bool
- @param material: When non-zero, materials used by the object or its object data will be duplicated with the objects.
- @type texture: bool
- @param texture: When non-zero, texture data used by the object's materials will be duplicated with the objects.
- @type ipo: bool
- @param ipo: When non-zero, Ipo data linked to the object will be duplicated with the objects.
-
- I{B{Example:}}
-
- The example below creates duplicates the active object 10 times
- and moves each object 1.0 on the X axis::
- import Blender
-
- scn = Scene.GetCurrent()
- ob_act = scn.objects.active
-
- # Unselect all
- scn.objects.selected = []
- ob_act.sel = 1
-
- for x in xrange(10):
- Blender.Object.Duplicate() # Duplicate linked
- ob_act = scn.objects.active
- ob_act.LocX += 1
- Blender.Redraw()
- """
+ """
+ Duplicate selected objects on visible layers from Blenders current scene,
+ de-selecting the currently visible, selected objects and making a copy where all new objects are selected.
+ By default no data linked to the object is duplicated; use the keyword arguments to change this.
+ L{Object.GetSelected()<GetSelected>} will return the list of objects resulting from duplication.
+
+ @type mesh: bool
+ @param mesh: When non-zero, mesh object data will be duplicated with the objects.
+ @type surface: bool
+ @param surface: When non-zero, surface object data will be duplicated with the objects.
+ @type curve: bool
+ @param curve: When non-zero, curve object data will be duplicated with the objects.
+ @type text: bool
+ @param text: When non-zero, text object data will be duplicated with the objects.
+ @type metaball: bool
+ @param metaball: When non-zero, metaball object data will be duplicated with the objects.
+ @type armature: bool
+ @param armature: When non-zero, armature object data will be duplicated with the objects.
+ @type lamp: bool
+ @param lamp: When non-zero, lamp object data will be duplicated with the objects.
+ @type material: bool
+ @param material: When non-zero, materials used by the object or its object data will be duplicated with the objects.
+ @type texture: bool
+ @param texture: When non-zero, texture data used by the object's materials will be duplicated with the objects.
+ @type ipo: bool
+ @param ipo: When non-zero, Ipo data linked to the object will be duplicated with the objects.
+
+ I{B{Example:}}
+
+ The example below creates duplicates the active object 10 times
+ and moves each object 1.0 on the X axis::
+ import Blender
+
+ scn = Scene.GetCurrent()
+ ob_act = scn.objects.active
+
+ # Unselect all
+ scn.objects.selected = []
+ ob_act.sel = 1
+
+ for x in xrange(10):
+ Blender.Object.Duplicate() # Duplicate linked
+ ob_act = scn.objects.active
+ ob_act.LocX += 1
+ Blender.Redraw()
+ """
from IDProp import IDGroup, IDArray
class Object:
- """
- The Object object
- =================
- This object gives access to generic data from all objects in Blender.
-
- B{Note}:
- When dealing with properties and functions such as LocX/RotY/getLocation(), getSize() and getEuler(),
- keep in mind that these transformation properties are relative to the object's parent (if any).
-
- To get these values in worldspace (taking into account vertex parents, constraints, etc.)
- pass the argument 'worldspace' to these functions.
-
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- object's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
- @ivar restrictDisplay: Don't display this object in the 3D view: disabled by default, use the outliner to toggle.
- @type restrictDisplay: bool
- @ivar restrictSelect: Don't select this object in the 3D view: disabled by default, use the outliner to toggle.
- @type restrictSelect: bool
- @ivar restrictRender: Don't render this object: disabled by default, use the outliner to toggle.
- @type restrictRender: bool
- @ivar LocX: The X location coordinate of the object.
- @type LocX: float
- @ivar LocY: The Y location coordinate of the object.
- @type LocY: float
- @ivar LocZ: The Z location coordinate of the object.
- @type LocZ: float
- @ivar loc: The (X,Y,Z) location coordinates of the object.
- @type loc: tuple of 3 floats
- @ivar dLocX: The delta X location coordinate of the object.
- This variable applies to IPO Objects only.
- @type dLocX: float
- @ivar dLocY: The delta Y location coordinate of the object.
- This variable applies to IPO Objects only.
- @type dLocY: float
- @ivar dLocZ: The delta Z location coordinate of the object.
- This variable applies to IPO Objects only.
- @type dLocZ: float
- @ivar dloc: The delta (X,Y,Z) location coordinates of the object (vector).
- This variable applies to IPO Objects only.
- @type dloc: tuple of 3 floats
- @ivar RotX: The X rotation angle (in radians) of the object.
- @type RotX: float
- @ivar RotY: The Y rotation angle (in radians) of the object.
- @type RotY: float
- @ivar RotZ: The Z rotation angle (in radians) of the object.
- @type RotZ: float
- @ivar rot: The (X,Y,Z) rotation angles (in radians) of the object.
- @type rot: euler (Py_WRAPPED)
- @ivar dRotX: The delta X rotation angle (in radians) of the object.
- This variable applies to IPO Objects only.
- @type dRotX: float
- @ivar dRotY: The delta Y rotation angle (in radians) of the object.
- This variable applies to IPO Objects only.
- @type dRotY: float
- @ivar dRotZ: The delta Z rotation angle (in radians) of the object.
- This variable applies to IPO Objects only.
- @type dRotZ: float
- @ivar drot: The delta (X,Y,Z) rotation angles (in radians) of the object.
- This variable applies to IPO Objects only.
- @type drot: tuple of 3 floats
- @ivar SizeX: The X size of the object.
- @type SizeX: float
- @ivar SizeY: The Y size of the object.
- @type SizeY: float
- @ivar SizeZ: The Z size of the object.
- @type SizeZ: float
- @ivar size: The (X,Y,Z) size of the object.
- @type size: tuple of 3 floats
- @ivar dSizeX: The delta X size of the object.
- @type dSizeX: float
- @ivar dSizeY: The delta Y size of the object.
- @type dSizeY: float
- @ivar dSizeZ: The delta Z size of the object.
- @type dSizeZ: float
- @ivar dsize: The delta (X,Y,Z) size of the object.
- @type dsize: tuple of 3 floats
- @ivar Layers: The object layers (also check the newer attribute
- L{layers<layers>}). This value is a bitmask with at
- least one position set for the 20 possible layers starting from the low
- order bit. The easiest way to deal with these values in in hexadecimal
- notation.
- Example::
- ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
- After setting the Layer value, call Blender.Redraw( -1 ) to update
- the interface.
- @type Layers: integer (bitmask)
- @type layers: list of integers
- @ivar layers: The layers this object is visible in (also check the older
- attribute L{Layers<Layers>}). This returns a list of
- integers in the range [1, 20], each number representing the respective
- layer. Setting is done by passing a list of ints or an empty list for
- no layers.
- Example::
- ob.layers = [] # object won't be visible
- ob.layers = [1, 4] # object visible only in layers 1 and 4
- ls = o.layers
- ls.append([10])
- o.layers = ls
- print ob.layers # will print: [1, 4, 10]
- B{Note}: changes will only be visible after the screen (at least
- the 3d View and Buttons windows) is redrawn.
- @ivar parent: The parent object of the object (if defined). Read-only.
- @type parent: Object or None
- @ivar data: The Datablock object linked to this object. Read-only.
- @type data: varies
- @ivar ipo: Contains the Ipo if one is assigned to the object, B{None}
- otherwise. Setting to B{None} clears the current Ipo.
- @type ipo: Ipo
- @ivar mat: The matrix of the object in world space (absolute, takes vertex parents, tracking
- and Ipos into account). Read-only.
- @type mat: Matrix
- @ivar matrix: Same as L{mat}. Read-only.
- @type matrix: Matrix
- @ivar matrixLocal: The matrix of the object relative to its parent; if there is no parent,
- returns the world matrix (L{matrixWorld<Object.Object.matrixWorld>}).
- @type matrixLocal: Matrix
- @ivar matrixOldWorld: Old-type worldspace matrix (prior to Blender 2.34).
- Read-only.
- @type matrixOldWorld: Matrix
- @ivar matrixWorld: Same as L{mat}. Read-only.
- @type matrixWorld: Matrix
- @ivar colbits: The Material usage mask. A set bit #n means: the Material
- #n in the Object's material list is used. Otherwise, the Material #n
- of the Objects Data material list is displayed.
- Example::
- object.colbits = (1<<0) + (1<<5) # use mesh materials 0 (1<<0) and 5 (1<<5)
- # use object materials for all others
- @ivar sel: The selection state of the object in the current scene.
- True is selected, False is unselected. Setting makes the object active.
- @type sel: boolean
- @ivar effects: The list of particle effects associated with the object.
- Read-only.
- @type effects: list of Effect objects
- @ivar parentbonename: The string name of the parent bone (if defined).
- This can be set to another bone in the armature if the object already has a bone parent.
- @type parentbonename: string or None
- @ivar protectFlags: The "transform locking" bitfield flags for the object.
- See L{ProtectFlags} const dict for values.
- @type protectFlags: int
- @ivar DupGroup: The DupliGroup Animation Property. Assign a group to
- DupGroup to make this object an instance of that group.
- This does not enable or disable the DupliGroup option, for that use
- L{enableDupGroup}.
- The attribute returns None when this object does not have a dupliGroup,
- and setting the attrbute to None deletes the object from the group.
- @type DupGroup: Group or None
- @ivar DupObjects: The Dupli object instances. Read-only.
- Returns of list of tuples for object duplicated
- by dupliframe, dupliverts dupligroups and other animation properties.
- The first tuple item is the original object that is duplicated,
- the second is the 4x4 worldspace dupli-matrix.
- Example::
- import Blender
- from Blender import Object, Scene, Mathutils
-
- ob= Object.Get('Cube')
- dupe_obs= ob.DupObjects
- scn= Scene.GetCurrent()
- for dupe_ob, dupe_matrix in dupe_obs:
- print dupe_ob.name
- empty_ob = scn.objects.new('Empty')
- empty_ob.setMatrix(dupe_matrix)
- Blender.Redraw()
- @type DupObjects: list of tuples containing (object, matrix)
- @ivar enableNLAOverride: Whether the object uses NLA or active Action for animation.
- @type enableNLAOverride: boolean
- @ivar enableDupVerts: The DupliVerts status of the object.
- Does not indicate that this object has any dupliVerts,
- (as returned by L{DupObjects}) just that dupliVerts are enabled.
- @type enableDupVerts: boolean
- @ivar enableDupFaces: The DupliFaces status of the object.
- Does not indicate that this object has any dupliFaces,
- (as returned by L{DupObjects}) just that dupliFaces are enabled.
- @type enableDupFaces: boolean
- @ivar enableDupFacesScale: The DupliFacesScale status of the object.
- @type enableDupFacesScale: boolean
- @ivar enableDupFrames: The DupliFrames status of the object.
- Does not indicate that this object has any dupliFrames,
- (as returned by L{DupObjects}) just that dupliFrames are enabled.
- @type enableDupFrames: boolean
- @ivar enableDupGroup: The DupliGroup status of the object.
- Set True to make this object an instance of the object's L{DupGroup},
- and set L{DupGroup} to a group for this to take effect,
- Use L{DupObjects} to get the object data from this instance.
- @type enableDupGroup: boolean
- @ivar enableDupRot: The DupliRot status of the object.
- Use with L{enableDupVerts} to rotate each instance
- by the vertex normal.
- @type enableDupRot: boolean
- @ivar enableDupNoSpeed: The DupliNoSpeed status of the object.
- Use with L{enableDupFrames} to ignore dupliFrame speed.
- @type enableDupNoSpeed: boolean
- @ivar DupSta: The DupliFrame starting frame. Use with L{enableDupFrames}.
- Value clamped to [1,32767].
- @type DupSta: int
- @ivar DupEnd: The DupliFrame end frame. Use with L{enableDupFrames}.
- Value clamped to [1,32767].
- @type DupEnd: int
- @ivar DupOn: The DupliFrames in succession between DupOff frames.
- Value is clamped to [1,1500].
- Use with L{enableDupFrames} and L{DupOff} > 0.
- @type DupOn: int
- @ivar DupOff: The DupliFrame removal of every Nth frame for this object.
- Use with L{enableDupFrames}. Value is clamped to [0,1500].
- @type DupOff: int
- @ivar passIndex: Index # for the IndexOB render pass.
- Value is clamped to [0,1000].
- @type passIndex: int
- @ivar activeMaterial: The active material index for this object.
-
- The active index is used to select the material to edit in the material buttons,
- new data created will also use the active material.
-
- Value is clamped to [1,len(ob.materials)]. - [0,0] when there is no materials applied to the object.
- @type activeMaterial: int
- @ivar drawSize: The size to display the Empty.
- Value clamped to [0.01,10.0].
- @type drawSize: float
- @ivar modifiers: The modifiers associated with the object.
- Example::
- # copy the active objects modifiers to all other visible selected objects
- from Blender import *
- scn = Scene.GetCurrent()
- ob_act = scn.objects.active
- for ob in scn.objects.context:
- # Cannot copy modifiers to an object of a different type
- if ob.type == ob_act.type:
- ob.modifiers = ob_act.modifiers
- @type modifiers: L{Modifier Sequence<Modifier.ModSeq>}
- @ivar constraints: a L{sequence<Constraint.Constraints>} of
- L{constraints<Constraint.Constraint>} for the object. Read-only.
- @type constraints: Constraint Sequence
- @ivar actionStrips: a L{sequence<NLA.ActionStrips>} of
- L{action strips<NLA.ActionStrip>} for the object. Read-only.
- @type actionStrips: BPy_ActionStrips
- @ivar action: The action associated with this object (if defined).
- Read-only.
- @type action: L{Action<NLA.Action>} or None
- @ivar name: Object data name. Maximum length 20 characters.
- @type name: string
- @ivar oopsLoc: Object's (X,Y) OOPs location. Returns None if object
- is not found in list.
- @type oopsLoc: tuple of 2 floats
- @ivar oopsSel: Object OOPs selection flag.
- @type oopsSel: boolean
- @ivar game_properties: The object's properties. Read-only.
- @type game_properties: list of Properties.
- @ivar timeOffset: The time offset of the object's animation.
- Value clamped to [-300000.0,300000.0].
- @type timeOffset: float
- @ivar track: The object's tracked object. B{None} is returned if no
- object is tracked. Also, assigning B{None} clear the tracked object.
- @type track: Object or None
- @ivar type: The object's type. Read-only.
- @type type: string
- @ivar users: The number of users of the object. Read-only.
- @type users: int
- @ivar fakeUser: The fake user status.
- Enabling this will keep it in the blend even if there are no users.
- @type fakeUser: bool
- @ivar boundingBox: The bounding box of this object. Read-only.
- @type boundingBox: list of 8 3D vectors
- @ivar drawType: The object's drawing type.
- See L{DrawTypes} constant dict for values.
- @type drawType: int
- @ivar parentType: The object's parent type. Read-only.
- See L{ParentTypes} constant dict for values.
- @type parentType: int
- @ivar axis: Enable display of active object's center and axis.
- Also see B{AXIS} bit in L{drawMode} attribute.
- @type axis: boolean
- @ivar texSpace: Enable display of active object's texture space.
- Also see B{TEXSPACE} bit in L{drawMode} attribute.
- @type texSpace: boolean
- @ivar nameMode: Enable display of active object's name.
- Also see B{NAME} bit in L{drawMode} attribute.
- @type nameMode: boolean
- @ivar wireMode: Enable the active object's wireframe over solid drawing.
- Also see B{WIRE} bit in L{drawMode} attribute.
- @type wireMode: boolean
- @ivar xRay: Enable drawing the active object in front of others.
- Also see B{XRAY} bit in L{drawMode} attribute.
- @type xRay: boolean
- @ivar transp: Enable transparent materials for the active object
- (mesh only). Also see B{TRANSP} bit in L{drawMode} attribute.
- @type transp: boolean
- @ivar drawMode: The object's drawing mode bitfield.
- See L{DrawModes} constant dict for values.
- @type drawMode: int
-
- @ivar piType: Type of particle interaction.
- See L{PITypes} constant dict for values.
- @type piType: int
- @ivar piFalloff: The particle interaction falloff power.
- Value clamped to [0.0,10.0].
- @type piFalloff: float
- @ivar piMaxDist: Max distance for the particle interaction field to work.
- Value clamped to [0.0,1000.0].
- @type piMaxDist: float
- @ivar piPermeability: Probability that a particle will pass through the
- mesh. Value clamped to [0.0,1.0].
- @type piPermeability: float
- @ivar piRandomDamp: Random variation of particle interaction damping.
- Value clamped to [0.0,1.0].
- @type piRandomDamp: float
- @ivar piSoftbodyDamp: Damping factor for softbody deflection.
- Value clamped to [0.0,1.0].
- @type piSoftbodyDamp: float
- @ivar piSoftbodyIThick: Inner face thickness for softbody deflection.
- Value clamped to [0.001,1.0].
- @type piSoftbodyIThick: float
- @ivar piSoftbodyOThick: Outer face thickness for softbody deflection.
- Value clamped to [0.001,1.0].
- @type piSoftbodyOThick: float
- @ivar piStrength: Particle interaction force field strength.
- Value clamped to [0.0,1000.0].
- @type piStrength: float
- @ivar piSurfaceDamp: Amount of damping during particle collision.
- Value clamped to [0.0,1.0].
- @type piSurfaceDamp: float
- @ivar piUseMaxDist: Use a maximum distance for the field to work.
- @type piUseMaxDist: boolean
-
- @ivar isSoftBody: True if object is a soft body. Read-only.
- @type isSoftBody: boolean
- @ivar SBDefaultGoal: Default softbody goal value, when no vertex group used.
- Value clamped to [0.0,1.0].
- @type SBDefaultGoal: float
- @ivar SBErrorLimit: Softbody Runge-Kutta ODE solver error limit (low values give more precision).
- Value clamped to [0.01,1.0].
- @type SBErrorLimit: float
- @ivar SBFriction: General media friction for softbody point movements.
- Value clamped to [0.0,10.0].
- @type SBFriction: float
- @ivar SBGoalFriction: Softbody goal (vertex target position) friction.
- Value clamped to [0.0,10.0].
- @type SBGoalFriction: float
- @ivar SBGoalSpring: Softbody goal (vertex target position) spring stiffness.
- Value clamped to [0.0,0.999].
- @type SBGoalSpring: float
- @ivar SBGrav: Apply gravitation to softbody point movement.
- Value clamped to [0.0,10.0].
- @type SBGrav: float
- @ivar SBInnerSpring: Softbody edge spring stiffness.
- Value clamped to [0.0,0.999].
- @type SBInnerSpring: float
- @ivar SBInnerSpringFrict: Softbody edge spring friction.
- Value clamped to [0.0,10.0].
- @type SBInnerSpringFrict: float
- @ivar SBMass: Softbody point mass (heavier is slower).
- Value clamped to [0.001,50.0].
- @type SBMass: float
- @ivar SBMaxGoal: Softbody goal maximum (vertex group weights scaled to
- match this range). Value clamped to [0.0,1.0].
- @type SBMaxGoal: float
- @ivar SBMinGoal: Softbody goal minimum (vertex group weights scaled to
- match this range). Value clamped to [0.0,1.0].
- @type SBMinGoal: float
- @ivar SBSpeed: Tweak timing for physics to control softbody frequency and
- speed. Value clamped to [0.0,10.0].
- @type SBSpeed: float
- @ivar SBStiffQuads: Softbody adds diagonal springs on 4-gons enabled.
- @type SBStiffQuads: boolean
- @ivar SBUseEdges: Softbody use edges as springs enabled.
- @type SBUseEdges: boolean
- @ivar SBUseGoal: Softbody forces for vertices to stick to animated position enabled.
- @type SBUseGoal: boolean
-
- @ivar rbFlags: Rigid body bitfield. See L{RBFlags} for valid values.
- @type rbFlags: int
- @ivar rbMass: Rigid body mass. Must be a positive value.
- @type rbMass: float
- @ivar rbRadius: Rigid body bounding sphere size. Must be a positive
- value.
- @type rbRadius: float
- @ivar rbShapeBoundType: Rigid body shape bound type. See L{RBShapes}
- const dict for values.
- @type rbShapeBoundType: int
- """
-
- def buildParts():
- """
- Recomputes the particle system. This method only applies to an Object of
- the type Effect.
- """
-
- def insertShapeKey():
- """
- Insert a Shape Key in the current object. It applies to Objects of
- the type Mesh, Lattice, or Curve.
- """
-
- def getPose():
- """
- Gets the current Pose of the object.
- @rtype: Pose object
- @return: the current pose object
- """
-
- def evaluatePose(framenumber):
- """
- Evaluates the Pose based on its currently bound action at a certain frame.
- @type framenumber: Int
- @param framenumber: The frame number to evaluate to.
- """
-
- def clearIpo():
- """
- Unlinks the ipo from this object.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def clrParent(mode = 0, fast = 0):
- """
- Clears parent object.
- @type mode: Integer
- @type fast: Integer
- @param mode: A mode flag. If mode flag is 2, then the object transform will
- be kept. Any other value, or no value at all will update the object
- transform.
- @param fast: If the value is 0, the scene hierarchy will not be updated. Any
- other value, or no value at all will update the scene hierarchy.
- """
-
- def getData(name_only=False, mesh=False):
- """
- Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this
- Object. If the keyword parameter B{name_only} is True, only the Datablock
- name is returned as a string. It the object is of type Mesh, then the
- B{mesh} keyword can also be used; the data return is a Mesh object if
- True, otherwise it is an NMesh object (the default).
- The B{mesh} keyword is ignored for non-mesh objects.
- @type name_only: bool
- @param name_only: This is a keyword parameter. If True (or nonzero),
- only the name of the data object is returned.
- @type mesh: bool
- @param mesh: This is a keyword parameter. If True (or nonzero),
- a Mesh data object is returned.
- @rtype: specific Object type or string
- @return: Depends on the type of Datablock linked to the Object. If
- B{name_only} is True, it returns a string.
- @note: Mesh is faster than NMesh because Mesh is a thin wrapper.
- @note: This function is different from L{NMesh.GetRaw} and L{Mesh.Get}
- because it keeps a link to the original mesh, which is needed if you are
- dealing with Mesh weight groups.
- @note: Make sure the object you are getting the data from isn't in
- EditMode before calling this function; otherwise you'll get the data
- before entering EditMode. See L{Window.EditMode}.
- """
-
- def getParentBoneName():
- """
- Returns None, or the 'sub-name' of the parent (eg. Bone name)
- @return: string
- """
-
- def getDeltaLocation():
- """
- Returns the object's delta location in a list (x, y, z)
- @rtype: A vector triple
- @return: (x, y, z)
- """
-
- def getDrawMode():
- """
- Returns the object draw mode.
- @rtype: Integer
- @return: a sum of the following:
- - 2 - axis
- - 4 - texspace
- - 8 - drawname
- - 16 - drawimage
- - 32 - drawwire
- - 64 - xray
- """
-
- def getDrawType():
- """
- Returns the object draw type
- @rtype: Integer
- @return: One of the following:
- - 1 - Bounding box
- - 2 - Wire
- - 3 - Solid
- - 4 - Shaded
- - 5 - Textured
- """
-
- def getEuler(space):
- """
- @type space: string
- @param space: The desired space for the size:
- - localspace: (default) relative to the object's parent;
- - worldspace: absolute, taking vertex parents, tracking and
- Ipo's into account;
- Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ). Angles are in radians.
- @rtype: Py_Euler
- @return: A python Euler. Data is wrapped when euler is present.
- """
-
- def getInverseMatrix():
- """
- Returns the object's inverse matrix.
- @rtype: Py_Matrix
- @return: A python matrix 4x4
- """
-
- def getIpo():
- """
- Returns the Ipo associated to this object or None if there's no linked ipo.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
- def isSelected():
- """
- Returns the objects selection state in the current scene as a boolean value True or False.
- @rtype: Boolean
- @return: Selection state as True or False
- """
-
- def getLocation(space):
- """
- @type space: string
- @param space: The desired space for the location:
- - localspace: (default) relative to the object's parent;
- - worldspace: absolute, taking vertex parents, tracking and
- Ipo's into account;
- Returns the object's location (x, y, z).
- @return: (x, y, z)
-
- I{B{Example:}}
-
- The example below works on the default scene. It retrieves all objects in
- the scene and prints the name and location of each object::
- import Blender
-
- objects = Blender.Object.Get()
-
- for obj in objects:
- print obj.getName()
- print obj.getLocation()
- @note: the worldspace location is the same as ob.matrixWorld[3][0:3]
- """
-
- def getAction():
- """
- Returns an action if one is associated with this object (only useful for armature types).
- @rtype: Py_Action
- @return: a python action.
- """
-
- def getMaterials(what = 0):
- """
- Returns a list of materials assigned to the object.
- @type what: int
- @param what: if nonzero, empty slots will be returned as None's instead
- of being ignored (default way). See L{NMesh.NMesh.getMaterials}.
- @rtype: list of Material Objects
- @return: list of Material Objects assigned to the object.
- """
-
- def getMatrix(space = 'worldspace'):
- """
- Returns the object matrix.
- @type space: string
- @param space: The desired matrix:
- - worldspace (default): absolute, taking vertex parents, tracking and
- Ipo's into account;
- - localspace: relative to the object's parent (returns worldspace
- matrix if the object doesn't have a parent);
- - old_worldspace: old behavior, prior to Blender 2.34, where eventual
- changes made by the script itself were not taken into account until
- a redraw happened, either called by the script or upon its exit.
- Returns the object matrix.
- @rtype: Py_Matrix (WRAPPED DATA)
- @return: a python 4x4 matrix object. Data is wrapped for 'worldspace'
- """
-
- def getName():
- """
- Returns the name of the object
- @return: The name of the object
-
- I{B{Example:}}
-
- The example below works on the default scene. It retrieves all objects in
- the scene and prints the name of each object::
- import Blender
-
- scn= Blender.Scene.GetCurrent()
- objects = scn.getChildren()
-
- for obj in objects:
- print obj.getName()
- """
-
- def getParent():
- """
- Returns the object's parent object.
- @rtype: Object
- @return: The parent object of the object. If not available, None will be
- returned.
- """
-
- def getSize(space):
- """
- @type space: string
- @param space: The desired space for the size:
- - localspace: (default) relative to the object's parent;
- - worldspace: absolute, taking vertex parents, tracking and
- Ipo's into account;
- Returns the object's size.
- @return: (SizeX, SizeY, SizeZ)
- @note: the worldspace size will not return negative (flipped) scale values.
- """
-
- def getParentBoneName():
- """
- Returns the object's parent object's sub name, or None.
- For objects parented to bones, this is the name of the bone.
- @rtype: String
- @return: The parent object sub-name of the object.
- If not available, None will be returned.
- """
-
- def getTimeOffset():
- """
- Returns the time offset of the object's animation.
- @return: TimeOffset
- """
-
- def getTracked():
- """
- Returns the object's tracked object.
- @rtype: Object
- @return: The tracked object of the object. If not available, None will be
- returned.
- """
-
- def getType():
- """
- Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
- 'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases.
-
- I{B{Example:}}
-
- The example below works on the default scene. It retrieves all objects in
- the scene and updates the location and rotation of the camera. When run,
- the camera will rotate 180 degrees and moved to the opposite side of the X
- axis. Note that the number 'pi' in the example is an approximation of the
- true number 'pi'. A better, less error-prone value of pi is math.pi from the python math module.::
- import Blender
-
- objects = Blender.Object.Get()
-
- for obj in objects:
- if obj.getType() == 'Camera':
- obj.LocY = -obj.LocY
- obj.RotZ = 3.141592 - obj.RotZ
-
- Blender.Redraw()
-
- @return: The type of object.
- @rtype: String
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in object ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -LOC
- -ROT
- -SIZE
- -LOCROT
- -LOCROTSIZE
- -PI_STRENGTH
- -PI_FALLOFF
- -PI_PERM
- -PI_SURFACEDAMP
- -PI_RANDOMDAMP
- @return: None
- """
-
- def link(datablock):
- """
- Links Object with ObData datablock provided in the argument. The data must match the
- Object's type, so you cannot link a Lamp to a Mesh type object.
- @type datablock: Blender ObData datablock
- @param datablock: A Blender datablock matching the objects type.
- """
-
- def makeParent(objects, noninverse = 0, fast = 0):
- """
- Makes the object the parent of the objects provided in the argument which
- must be a list of valid Objects.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type noninverse: Integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: Integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitely update the Scene hierarchy.
- @warn: objects must first be linked to a scene before they can become
- parents of other objects. Calling this makeParent method for an
- unlinked object will result in an error.
- """
-
- def join(objects):
- """
- Uses the object as a base for all of the objects in the provided list to join into.
-
- @type objects: Sequence of Blender Object
- @param objects: A list of objects matching the object's type.
- @note: Objects in the list will not be removed from the scene.
- To avoid overlapping data you may want to remove them manually after joining.
- @note: Join modifies the base object's data in place so that
- other objects are joined into it. No new object or data is created.
- @note: Join will only work for object types Mesh, Armature, Curve and Surface;
- an excption will be raised if the object is not of these types.
- @note: Objects in the list will be ignored if they to not match the base object.
- @note: The base object must be in the current scene to be joined.
- @note: This function will not work in background mode (no user interface).
- @note: An error in the function input will raise a TypeError or AttributeError,
- otherwise an error in the data input will raise a RuntimeError.
- For situations where you don't have tight control on the data that is being joined,
- you should handle the RuntimeError error, letting the user know the data can't be joined.
- """
-
- def makeParentDeform(objects, noninverse = 0, fast = 0):
- """
- Makes the object the deformation parent of the objects provided in the argument
- which must be a list of valid Objects.
- The parent object must be a Curve or Armature.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type noninverse: Integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: Integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitely update the Scene hierarchy.
- @warn: objects must first be linked to a scene before they can become
- parents of other objects. Calling this makeParent method for an
- unlinked object will result in an error.
- @warn: child objects must be of mesh type to deform correctly. Other object
- types will fall back to normal parenting silently.
- """
-
- def makeParentVertex(objects, indices, noninverse = 0, fast = 0):
- """
- Makes the object the vertex parent of the objects provided in the argument
- which must be a list of valid Objects.
- The parent object must be a Mesh, Curve or Surface.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type indices: Tuple of Integers
- @param indices: The indices of the vertices you want to parent to (1 or 3 values)
- @type noninverse: Integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: Integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitely update the Scene hierarchy.
- @warn: objects must first be linked to a scene before they can become
- parents of other objects. Calling this makeParent method for an
- unlinked object will result in an error.
- """
- def makeParentBone(objects, bonename, noninverse = 0, fast = 0):
- """
- Makes one of the object's bones the parent of the objects provided in the argument
- which must be a list of valid objects. The parent object must be an Armature.
- @type objects: Sequence of Blender Object
- @param objects: The children of the parent
- @type bonename: string
- @param bonename: a valid bone name from the armature
- @type noninverse: integer
- @param noninverse:
- 0 - make parent with inverse
- 1 - make parent without inverse
- @type fast: integer
- @param fast:
- 0 - update scene hierarchy automatically
- 1 - don't update scene hierarchy (faster). In this case, you must
- explicitly update the Scene hierarchy.
- @warn: Objects must first be linked to a scene before they can become
- parents of other objects. Calling this method for an
- unlinked object will result in an exception.
- """
-
- def setDeltaLocation(delta_location):
- """
- Sets the object's delta location which must be a vector triple.
- @type delta_location: A vector triple
- @param delta_location: A vector triple (x, y, z) specifying the new
- location.
- """
-
- def setDrawMode(drawmode):
- """
- Sets the object's drawing mode. The drawing mode can be a mix of modes. To
- enable these, add up the values.
- @type drawmode: Integer
- @param drawmode: A sum of the following:
- - 2 - axis
- - 4 - texspace
- - 8 - drawname
- - 16 - drawimage
- - 32 - drawwire
- - 64 - xray
- """
-
- def setDrawType(drawtype):
- """
- Sets the object's drawing type.
- @type drawtype: Integer
- @param drawtype: One of the following:
- - 1 - Bounding box
- - 2 - Wire
- - 3 - Solid
- - 4 - Shaded
- - 5 - Textured
- """
-
- def setEuler(euler):
- """
- Sets the object's localspace rotation according to the specified Euler angles.
- @type euler: Py_Euler or a list of floats
- @param euler: a python Euler or x,y,z rotations as floats
- """
-
- def setIpo(ipo):
- """
- Links an ipo to this object.
- @type ipo: Blender Ipo
- @param ipo: an object type ipo.
- """
-
- def setLocation(x, y, z):
- """
- Sets the object's location relative to the parent object (if any).
- @type x: float
- @param x: The X coordinate of the new location.
- @type y: float
- @param y: The Y coordinate of the new location.
- @type z: float
- @param z: The Z coordinate of the new location.
- """
-
- def setMaterials(materials):
- """
- Sets the materials. The argument must be a list 16 items or less. Each
- list element is either a Material or None. Also see L{colbits}.
- @type materials: Materials list
- @param materials: A list of Blender material objects.
- @note: Materials are assigned to the object's data by default. Unless
- you know the material is applied to the object or are changing the
- object's L{colbits}, you need to look at the object data's materials.
- """
-
- def setMatrix(matrix):
- """
- Sets the object's matrix and updates its transformation. If the object
- has a parent, the matrix transform is relative to the parent.
- @type matrix: Py_Matrix 3x3 or 4x4
- @param matrix: a 3x3 or 4x4 Python matrix. If a 3x3 matrix is given,
- it is extended to a 4x4 matrix.
- @Note: This method is "bad": when called it changes the location,
- rotation and size attributes of the object (since Blender uses these
- values to calculate the object's transformation matrix). Ton is
- not happy having a method which "pretends" to do a matrix operation.
- In the future, this method may be replaced with other methods which
- make it easier for the user to determine the correct loc/rot/size values
- for necessary for the object.
- """
-
- def setName(name):
- """
- Sets the name of the object. A string longer than 20 characters will be shortened.
- @type name: String
- @param name: The new name for the object.
- """
-
- def setSize(x, y, z):
- """
- Sets the object's size, relative to the parent object (if any), clamped
- @type x: float
- @param x: The X size multiplier.
- @type y: float
- @param y: The Y size multiplier.
- @type z: float
- @param z: The Z size multiplier.
- """
-
- def setTimeOffset(timeOffset):
- """
- Sets the time offset of the object's animation.
- @type timeOffset: float
- @param timeOffset: The new time offset for the object's animation.
- """
-
- def shareFrom(object):
- """
- Link data of a specified argument with this object. This works only
- if both objects are of the same type.
- @type object: Blender Object
- @param object: A Blender Object of the same type.
- @note: This function is faster than using L{getData()} and setData()
- because it skips making a Python object from the object's data.
- """
-
- def select(boolean):
- """
- Sets the object's selection state in the current scene.
- setting the selection will make this object the active object of this scene.
- @type boolean: Integer
- @param boolean:
- - 0 - unselected
- - 1 - selected
- """
-
- def getBoundBox():
- """
- Returns the worldspace bounding box of this object. This works for meshes (out of
- edit mode) and curves.
- @rtype: list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA)
- @return: The coordinates of the 8 corners of the bounding box. Data is wrapped when
- bounding box is present.
- """
-
- def makeDisplayList():
- """
- Updates this object's display list. Blender uses display lists to store
- already transformed data (like a mesh with its vertices already modified
- by coordinate transformations and armature deformation). If the object
- isn't modified, there's no need to recalculate this data. This method is
- here for the *few cases* where a script may need it, like when toggling
- the "SubSurf" mode for a mesh:
-
- Example::
- import Blender
-
- scn = Blender.Scene.GetCurrent()
- object = scn.objects.active
- object.modifiers.append(Blender.Modifier.Type.SUBSURF)
- object.makeDisplayList()
- Blender.Window.RedrawAll()
-
- If you try this example without the line to update the display list, the
- object will disappear from the screen until you press "SubSurf".
- @warn: If after running your script objects disappear from the screen or
- are not displayed correctly, try this method function. But if the script
- works properly without it, there's no reason to use it.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Object's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Object. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Object.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def makeTrack (tracked, fast = 0):
- """
- Make this Object track another.
- @type tracked: Blender Object
- @param tracked: the object to be tracked.
- @type fast: int (bool)
- @param fast: if zero, the scene hierarchy is updated automatically. If
- you set 'fast' to a nonzero value, don't forget to update the scene
- yourself (see L{Scene.Scene.update}).
- @note: you also need to clear the rotation (L{setEuler}) of this object
- if it was not (0,0,0) already.
- """
-
- def clearTrack (mode = 0, fast = 0):
- """
- Make this Object not track another anymore.
- @type mode: int (bool)
- @param mode: if nonzero the matrix transformation used for tracking is kept.
- @type fast: int (bool)
- @param fast: if zero, the scene hierarchy is updated automatically. If
- you set 'fast' to a nonzero value, don't forget to update the scene
- yourself (see L{Scene.Scene.update}).
- """
-
- def getAllProperties ():
- """
- Return a list of all game properties from this object.
- @rtype: PyList
- @return: List of Property objects.
- """
-
- def getProperty (name):
- """
- Return a game property from this object matching the name argument.
- @type name: string
- @param name: the name of the property to get.
- @rtype: Property object
- @return: The first property that matches name.
- """
-
- def addProperty (name_or_property, data, type):
- """
- Add or create a game property for an object. If called with only a
- property object, the property is assigned to the object. If called
- with a property name string and data object, a new property is
- created and added to the object.
- @type name_or_property: string or Property object
- @param name_or_property: the property name, or a property object.
- @type data: string, int or float
- @param data: Only valid when I{name_or_property} is a string.
- Value depends on what is passed in:
- - string: string type property
- - int: integer type property
- - float: float type property
- @type type: string (optional)
- @param type: Only valid when I{name_or_property} is a string.
- Can be the following:
- - 'BOOL'
- - 'INT'
- - 'FLOAT'
- - 'TIME'
- - 'STRING'
- @warn: If a type is not declared string data will
- become string type, int data will become int type
- and float data will become float type. Override type
- to declare bool type, and time type.
- @warn: A property object can be added only once to an object;
- you must remove the property from an object to add it elsewhere.
- """
-
- def removeProperty (property):
- """
- Remove a game property from an object.
- @type property: Property object or string
- @param property: Property object or property name to be removed.
- """
-
- def removeAllProperties():
- """
- Removes all game properties from an object.
- """
-
- def copyAllPropertiesTo (object):
- """
- Copies all game properties from one object to another.
- @type object: Object object
- @param object: Object that will receive the properties.
- """
-
- def getPIStregth():
- """
- Get the Object's Particle Interaction Strength.
- @rtype: float
- """
-
- def setPIStrength(strength):
- """
- Set the Object's Particle Interaction Strength.
- Values between -1000.0 to 1000.0
- @rtype: None
- @type strength: float
- @param strength: the Object's Particle Interaction New Strength.
- """
-
- def getPIFalloff():
- """
- Get the Object's Particle Interaction falloff.
- @rtype: float
- """
-
- def setPIFalloff(falloff):
- """
- Set the Object's Particle Interaction falloff.
- Values between 0 to 10.0
- @rtype: None
- @type falloff: float
- @param falloff: the Object's Particle Interaction New falloff.
- """
-
- def getPIMaxDist():
- """
- Get the Object's Particle Interaction MaxDist.
- @rtype: float
- """
-
- def setPIMaxDist(MaxDist):
- """
- Set the Object's Particle Interaction MaxDist.
- Values between 0 to 1000.0
- @rtype: None
- @type MaxDist: float
- @param MaxDist: the Object's Particle Interaction New MaxDist.
- """
-
- def getPIType():
- """
- Get the Object's Particle Interaction Type.
- @rtype: int
- """
-
- def setPIType(type):
- """
- Set the Object's Particle Interaction type.
- Use Module Constants
- - NONE
- - WIND
- - FORCE
- - VORTEX
- - MAGNET
- @rtype: None
- @type type: int
- @param type: the Object's Particle Interaction Type.
- """
-
- def getPIUseMaxDist():
- """
- Get the Object's Particle Interaction if using MaxDist.
- @rtype: int
- """
-
- def setPIUseMaxDist(status):
- """
- Set the Object's Particle Interaction MaxDist.
- 0 = Off, 1 = on
- @rtype: None
- @type status: int
- @param status: the new status
- """
-
- def getPIDeflection():
- """
- Get the Object's Particle Interaction Deflection Setting.
- @rtype: int
- """
-
- def setPIDeflection(status):
- """
- Set the Object's Particle Interaction Deflection Setting.
- 0 = Off, 1 = on
- @rtype: None
- @type status: int
- @param status: the new status
- """
-
- def getPIPermf():
- """
- Get the Object's Particle Interaction Permeability.
- @rtype: float
- """
-
- def setPIPerm(perm):
- """
- Set the Object's Particle Interaction Permeability.
- Values between 0 to 10.0
- @rtype: None
- @type perm: float
- @param perm: the Object's Particle Interaction New Permeability.
- """
-
- def getPIRandomDamp():
- """
- Get the Object's Particle Interaction RandomDamp.
- @rtype: float
- """
-
- def setPIRandomDamp(damp):
- """
- Set the Object's Particle Interaction RandomDamp.
- Values between 0 to 10.0
- @rtype: None
- @type damp: float
- @param damp: the Object's Particle Interaction New RandomDamp.
- """
-
- def getPISurfaceDamp():
- """
- Get the Object's Particle Interaction SurfaceDamp.
- @rtype: float
- """
-
- def setPISurfaceDamp(damp):
- """
- Set the Object's Particle Interaction SurfaceDamp.
- Values between 0 to 10.0
- @rtype: None
- @type damp: float
- @param damp: the Object's Particle Interaction New SurfaceDamp.
- """
-
- def getSBMass():
- """
- Get the Object's SoftBody Mass.
- @rtype: float
- """
-
- def setSBMass(mass):
- """
- Set the Object's SoftBody Mass.
- Values between 0 to 50.0
- @rtype: None
- @type mass: float
- @param mass: the Object's SoftBody New mass.
- """
-
- def getSBGravity():
- """
- Get the Object's SoftBody Gravity.
- @rtype: float
- """
-
- def setSBGravity(grav):
- """
- Set the Object's SoftBody Gravity.
- Values between 0 to 10.0
- @rtype: None
- @type grav: float
- @param grav: the Object's SoftBody New Gravity.
- """
-
- def getSBFriction():
- """
- Get the Object's SoftBody Friction.
- @rtype: float
- """
-
- def setSBFriction(frict):
- """
- Set the Object's SoftBody Friction.
- Values between 0 to 10.0
- @rtype: None
- @type frict: float
- @param frict: the Object's SoftBody New Friction.
- """
-
- def getSBErrorLimit():
- """
- Get the Object's SoftBody ErrorLimit.
- @rtype: float
- """
-
- def setSBErrorLimit(err):
- """
- Set the Object's SoftBody ErrorLimit.
- Values between 0 to 1.0
- @rtype: None
- @type err: float
- @param err: the Object's SoftBody New ErrorLimit.
- """
-
- def getSBGoalSpring():
- """
- Get the Object's SoftBody GoalSpring.
- @rtype: float
- """
-
- def setSBGoalSpring(gs):
- """
- Set the Object's SoftBody GoalSpring.
- Values between 0 to 0.999
- @rtype: None
- @type gs: float
- @param gs: the Object's SoftBody New GoalSpring.
- """
-
- def getSBGoalFriction():
- """
- Get the Object's SoftBody GoalFriction.
- @rtype: float
- """
-
- def setSBGoalFriction(gf):
- """
- Set the Object's SoftBody GoalFriction.
- Values between 0 to 10.0
- @rtype: None
- @type gf: float
- @param gf: the Object's SoftBody New GoalFriction.
- """
-
- def getSBMinGoal():
- """
- Get the Object's SoftBody MinGoal.
- @rtype: float
- """
-
- def setSBMinGoal(mg):
- """
- Set the Object's SoftBody MinGoal.
- Values between 0 to 1.0
- @rtype: None
- @type mg: float
- @param mg: the Object's SoftBody New MinGoal.
- """
-
- def getSBMaxGoal():
- """
- Get the Object's SoftBody MaxGoal.
- @rtype: float
- """
-
- def setSBMaxGoal(mg):
- """
- Set the Object's SoftBody MaxGoal.
- Values between 0 to 1.0
- @rtype: None
- @type mg: float
- @param mg: the Object's SoftBody New MaxGoal.
- """
-
- def getSBInnerSpring():
- """
- Get the Object's SoftBody InnerSpring.
- @rtype: float
- """
-
- def setSBInnerSpring(sprr):
- """
- Set the Object's SoftBody InnerSpring.
- Values between 0 to 0.999
- @rtype: None
- @type sprr: float
- @param sprr: the Object's SoftBody New InnerSpring.
- """
-
- def getSBInnerSpringFriction():
- """
- Get the Object's SoftBody InnerSpringFriction.
- @rtype: float
- """
-
- def setSBInnerSpringFriction(sprf):
- """
- Set the Object's SoftBody InnerSpringFriction.
- Values between 0 to 10.0
- @rtype: None
- @type sprf: float
- @param sprf: the Object's SoftBody New InnerSpringFriction.
- """
-
- def getSBDefaultGoal():
- """
- Get the Object's SoftBody DefaultGoal.
- @rtype: float
- """
-
- def setSBDefaultGoal(goal):
- """
- Set the Object's SoftBody DefaultGoal.
- Values between 0 to 1.0
- @rtype: None
- @type goal: float
- @param goal: the Object's SoftBody New DefaultGoal.
- """
-
- def isSB():
- """
- Returns the Object's SoftBody enabled state.
- @rtype: boolean
- """
-
- def getSBPostDef():
- """
- get SoftBodies PostDef option
- @rtype: int
- """
-
- def setSBPostDef(switch):
- """
- Enable / Disable SoftBodies PostDef option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New PostDef Value.
- """
-
- def getSBUseGoal():
- """
- get SoftBodies UseGoal option
- @rtype: int
- """
-
- def setSBUseGoal(switch):
- """
- Enable / Disable SoftBodies UseGoal option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New UseGoal Value.
- """
- def getSBUseEdges():
- """
- get SoftBodies UseEdges option
- @rtype: int
- """
-
- def setSBUseEdges(switch):
- """
- Enable / Disable SoftBodies UseEdges option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New UseEdges Value.
- """
-
- def getSBStiffQuads():
- """
- get SoftBodies StiffQuads option
- @rtype: int
- """
-
- def setSBStiffQuads(switch):
- """
- Enable / Disable SoftBodies StiffQuads option
- 1: on
- 0: off
- @rtype: None
- @type switch: int
- @param switch: the Object's SoftBody New StiffQuads Value.
- """
+ """
+ The Object object
+ =================
+ This object gives access to generic data from all objects in Blender.
+
+ B{Note}:
+ When dealing with properties and functions such as LocX/RotY/getLocation(), getSize() and getEuler(),
+ keep in mind that these transformation properties are relative to the object's parent (if any).
+
+ To get these values in worldspace (taking into account vertex parents, constraints, etc.)
+ pass the argument 'worldspace' to these functions.
+
+ @ivar restrictDisplay: Don't display this object in the 3D view: disabled by default, use the outliner to toggle.
+ @type restrictDisplay: bool
+ @ivar restrictSelect: Don't select this object in the 3D view: disabled by default, use the outliner to toggle.
+ @type restrictSelect: bool
+ @ivar restrictRender: Don't render this object: disabled by default, use the outliner to toggle.
+ @type restrictRender: bool
+ @ivar LocX: The X location coordinate of the object.
+ @type LocX: float
+ @ivar LocY: The Y location coordinate of the object.
+ @type LocY: float
+ @ivar LocZ: The Z location coordinate of the object.
+ @type LocZ: float
+ @ivar loc: The (X,Y,Z) location coordinates of the object.
+ @type loc: tuple of 3 floats
+ @ivar dLocX: The delta X location coordinate of the object.
+ This variable applies to IPO Objects only.
+ @type dLocX: float
+ @ivar dLocY: The delta Y location coordinate of the object.
+ This variable applies to IPO Objects only.
+ @type dLocY: float
+ @ivar dLocZ: The delta Z location coordinate of the object.
+ This variable applies to IPO Objects only.
+ @type dLocZ: float
+ @ivar dloc: The delta (X,Y,Z) location coordinates of the object (vector).
+ This variable applies to IPO Objects only.
+ @type dloc: tuple of 3 floats
+ @ivar RotX: The X rotation angle (in radians) of the object.
+ @type RotX: float
+ @ivar RotY: The Y rotation angle (in radians) of the object.
+ @type RotY: float
+ @ivar RotZ: The Z rotation angle (in radians) of the object.
+ @type RotZ: float
+ @ivar rot: The (X,Y,Z) rotation angles (in radians) of the object.
+ @type rot: euler (Py_WRAPPED)
+ @ivar dRotX: The delta X rotation angle (in radians) of the object.
+ This variable applies to IPO Objects only.
+ @type dRotX: float
+ @ivar dRotY: The delta Y rotation angle (in radians) of the object.
+ This variable applies to IPO Objects only.
+ @type dRotY: float
+ @ivar dRotZ: The delta Z rotation angle (in radians) of the object.
+ This variable applies to IPO Objects only.
+ @type dRotZ: float
+ @ivar drot: The delta (X,Y,Z) rotation angles (in radians) of the object.
+ This variable applies to IPO Objects only.
+ @type drot: tuple of 3 floats
+ @ivar SizeX: The X size of the object.
+ @type SizeX: float
+ @ivar SizeY: The Y size of the object.
+ @type SizeY: float
+ @ivar SizeZ: The Z size of the object.
+ @type SizeZ: float
+ @ivar size: The (X,Y,Z) size of the object.
+ @type size: tuple of 3 floats
+ @ivar dSizeX: The delta X size of the object.
+ @type dSizeX: float
+ @ivar dSizeY: The delta Y size of the object.
+ @type dSizeY: float
+ @ivar dSizeZ: The delta Z size of the object.
+ @type dSizeZ: float
+ @ivar dsize: The delta (X,Y,Z) size of the object.
+ @type dsize: tuple of 3 floats
+ @ivar Layers: The object layers (also check the newer attribute
+ L{layers<layers>}). This value is a bitmask with at
+ least one position set for the 20 possible layers starting from the low
+ order bit. The easiest way to deal with these values in in hexadecimal
+ notation.
+ Example::
+ ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
+ After setting the Layer value, call Blender.Redraw( -1 ) to update
+ the interface.
+ @type Layers: integer (bitmask)
+ @type layers: list of integers
+ @ivar layers: The layers this object is visible in (also check the older
+ attribute L{Layers<Layers>}). This returns a list of
+ integers in the range [1, 20], each number representing the respective
+ layer. Setting is done by passing a list of ints or an empty list for
+ no layers.
+ Example::
+ ob.layers = [] # object won't be visible
+ ob.layers = [1, 4] # object visible only in layers 1 and 4
+ ls = o.layers
+ ls.append([10])
+ o.layers = ls
+ print ob.layers # will print: [1, 4, 10]
+ B{Note}: changes will only be visible after the screen (at least
+ the 3d View and Buttons windows) is redrawn.
+ @ivar parent: The parent object of the object (if defined). Read-only.
+ @type parent: Object or None
+ @ivar data: The Datablock object linked to this object. Read-only.
+ @type data: varies
+ @ivar ipo: Contains the Ipo if one is assigned to the object, B{None}
+ otherwise. Setting to B{None} clears the current Ipo.
+ @type ipo: Ipo
+ @ivar mat: The matrix of the object in world space (absolute, takes vertex parents, tracking
+ and Ipos into account). Read-only.
+ @type mat: Matrix
+ @ivar matrix: Same as L{mat}. Read-only.
+ @type matrix: Matrix
+ @ivar matrixLocal: The matrix of the object relative to its parent; if there is no parent,
+ returns the world matrix (L{matrixWorld<Object.Object.matrixWorld>}).
+ @type matrixLocal: Matrix
+ @ivar matrixOldWorld: Old-type worldspace matrix (prior to Blender 2.34).
+ Read-only.
+ @type matrixOldWorld: Matrix
+ @ivar matrixWorld: Same as L{mat}. Read-only.
+ @type matrixWorld: Matrix
+ @ivar colbits: The Material usage mask. A set bit #n means: the Material
+ #n in the Object's material list is used. Otherwise, the Material #n
+ of the Objects Data material list is displayed.
+ Example::
+ object.colbits = (1<<0) + (1<<5) # use mesh materials 0 (1<<0) and 5 (1<<5)
+ # use object materials for all others
+ @ivar sel: The selection state of the object in the current scene.
+ True is selected, False is unselected. Setting makes the object active.
+ @type sel: boolean
+ @ivar effects: The list of particle effects associated with the object.
+ Read-only.
+ @type effects: list of Effect objects
+ @ivar parentbonename: The string name of the parent bone (if defined).
+ This can be set to another bone in the armature if the object already has a bone parent.
+ @type parentbonename: string or None
+ @ivar protectFlags: The "transform locking" bitfield flags for the object.
+ See L{ProtectFlags} const dict for values.
+ @type protectFlags: int
+ @ivar DupGroup: The DupliGroup Animation Property. Assign a group to
+ DupGroup to make this object an instance of that group.
+ This does not enable or disable the DupliGroup option, for that use
+ L{enableDupGroup}.
+ The attribute returns None when this object does not have a dupliGroup,
+ and setting the attrbute to None deletes the object from the group.
+ @type DupGroup: Group or None
+ @ivar DupObjects: The Dupli object instances. Read-only.
+ Returns of list of tuples for object duplicated
+ by dupliframe, dupliverts dupligroups and other animation properties.
+ The first tuple item is the original object that is duplicated,
+ the second is the 4x4 worldspace dupli-matrix.
+ Example::
+ import Blender
+ from Blender import Object, Scene, Mathutils
+
+ ob= Object.Get('Cube')
+ dupe_obs= ob.DupObjects
+ scn= Scene.GetCurrent()
+ for dupe_ob, dupe_matrix in dupe_obs:
+ print dupe_ob.name
+ empty_ob = scn.objects.new('Empty')
+ empty_ob.setMatrix(dupe_matrix)
+ Blender.Redraw()
+ @type DupObjects: list of tuples containing (object, matrix)
+ @ivar enableNLAOverride: Whether the object uses NLA or active Action for animation.
+ @type enableNLAOverride: boolean
+ @ivar enableDupVerts: The DupliVerts status of the object.
+ Does not indicate that this object has any dupliVerts,
+ (as returned by L{DupObjects}) just that dupliVerts are enabled.
+ @type enableDupVerts: boolean
+ @ivar enableDupFaces: The DupliFaces status of the object.
+ Does not indicate that this object has any dupliFaces,
+ (as returned by L{DupObjects}) just that dupliFaces are enabled.
+ @type enableDupFaces: boolean
+ @ivar enableDupFacesScale: The DupliFacesScale status of the object.
+ @type enableDupFacesScale: boolean
+ @ivar enableDupFrames: The DupliFrames status of the object.
+ Does not indicate that this object has any dupliFrames,
+ (as returned by L{DupObjects}) just that dupliFrames are enabled.
+ @type enableDupFrames: boolean
+ @ivar enableDupGroup: The DupliGroup status of the object.
+ Set True to make this object an instance of the object's L{DupGroup},
+ and set L{DupGroup} to a group for this to take effect,
+ Use L{DupObjects} to get the object data from this instance.
+ @type enableDupGroup: boolean
+ @ivar enableDupRot: The DupliRot status of the object.
+ Use with L{enableDupVerts} to rotate each instance
+ by the vertex normal.
+ @type enableDupRot: boolean
+ @ivar enableDupNoSpeed: The DupliNoSpeed status of the object.
+ Use with L{enableDupFrames} to ignore dupliFrame speed.
+ @type enableDupNoSpeed: boolean
+ @ivar DupSta: The DupliFrame starting frame. Use with L{enableDupFrames}.
+ Value clamped to [1,32767].
+ @type DupSta: int
+ @ivar DupEnd: The DupliFrame end frame. Use with L{enableDupFrames}.
+ Value clamped to [1,32767].
+ @type DupEnd: int
+ @ivar DupOn: The DupliFrames in succession between DupOff frames.
+ Value is clamped to [1,1500].
+ Use with L{enableDupFrames} and L{DupOff} > 0.
+ @type DupOn: int
+ @ivar DupOff: The DupliFrame removal of every Nth frame for this object.
+ Use with L{enableDupFrames}. Value is clamped to [0,1500].
+ @type DupOff: int
+ @ivar passIndex: Index # for the IndexOB render pass.
+ Value is clamped to [0,1000].
+ @type passIndex: int
+ @ivar activeMaterial: The active material index for this object.
+
+ The active index is used to select the material to edit in the material buttons,
+ new data created will also use the active material.
+
+ Value is clamped to [1,len(ob.materials)]. - [0,0] when there is no materials applied to the object.
+ @type activeMaterial: int
+ @ivar drawSize: The size to display the Empty.
+ Value clamped to [0.01,10.0].
+ @type drawSize: float
+ @ivar modifiers: The modifiers associated with the object.
+ Example::
+ # copy the active objects modifiers to all other visible selected objects
+ from Blender import *
+ scn = Scene.GetCurrent()
+ ob_act = scn.objects.active
+ for ob in scn.objects.context:
+ # Cannot copy modifiers to an object of a different type
+ if ob.type == ob_act.type:
+ ob.modifiers = ob_act.modifiers
+ @type modifiers: L{Modifier Sequence<Modifier.ModSeq>}
+ @ivar constraints: a L{sequence<Constraint.Constraints>} of
+ L{constraints<Constraint.Constraint>} for the object. Read-only.
+ @type constraints: Constraint Sequence
+ @ivar actionStrips: a L{sequence<NLA.ActionStrips>} of
+ L{action strips<NLA.ActionStrip>} for the object. Read-only.
+ @type actionStrips: BPy_ActionStrips
+ @ivar action: The action associated with this object (if defined).
+ Read-only.
+ @type action: L{Action<NLA.Action>} or None
+ @ivar oopsLoc: Object's (X,Y) OOPs location. Returns None if object
+ is not found in list.
+ @type oopsLoc: tuple of 2 floats
+ @ivar oopsSel: Object OOPs selection flag.
+ @type oopsSel: boolean
+ @ivar game_properties: The object's properties. Read-only.
+ @type game_properties: list of Properties.
+ @ivar timeOffset: The time offset of the object's animation.
+ Value clamped to [-300000.0,300000.0].
+ @type timeOffset: float
+ @ivar track: The object's tracked object. B{None} is returned if no
+ object is tracked. Also, assigning B{None} clear the tracked object.
+ @type track: Object or None
+ @ivar type: The object's type. Read-only.
+ @type type: string
+ @ivar boundingBox: The bounding box of this object. Read-only.
+ @type boundingBox: list of 8 3D vectors
+ @ivar drawType: The object's drawing type.
+ See L{DrawTypes} constant dict for values.
+ @type drawType: int
+ @ivar parentType: The object's parent type. Read-only.
+ See L{ParentTypes} constant dict for values.
+ @type parentType: int
+ @ivar axis: Enable display of active object's center and axis.
+ Also see B{AXIS} bit in L{drawMode} attribute.
+ @type axis: boolean
+ @ivar texSpace: Enable display of active object's texture space.
+ Also see B{TEXSPACE} bit in L{drawMode} attribute.
+ @type texSpace: boolean
+ @ivar nameMode: Enable display of active object's name.
+ Also see B{NAME} bit in L{drawMode} attribute.
+ @type nameMode: boolean
+ @ivar wireMode: Enable the active object's wireframe over solid drawing.
+ Also see B{WIRE} bit in L{drawMode} attribute.
+ @type wireMode: boolean
+ @ivar xRay: Enable drawing the active object in front of others.
+ Also see B{XRAY} bit in L{drawMode} attribute.
+ @type xRay: boolean
+ @ivar transp: Enable transparent materials for the active object
+ (mesh only). Also see B{TRANSP} bit in L{drawMode} attribute.
+ @type transp: boolean
+ @ivar drawMode: The object's drawing mode bitfield.
+ See L{DrawModes} constant dict for values.
+ @type drawMode: int
+
+ @ivar piType: Type of particle interaction.
+ See L{PITypes} constant dict for values.
+ @type piType: int
+ @ivar piFalloff: The particle interaction falloff power.
+ Value clamped to [0.0,10.0].
+ @type piFalloff: float
+ @ivar piMaxDist: Max distance for the particle interaction field to work.
+ Value clamped to [0.0,1000.0].
+ @type piMaxDist: float
+ @ivar piPermeability: Probability that a particle will pass through the
+ mesh. Value clamped to [0.0,1.0].
+ @type piPermeability: float
+ @ivar piRandomDamp: Random variation of particle interaction damping.
+ Value clamped to [0.0,1.0].
+ @type piRandomDamp: float
+ @ivar piSoftbodyDamp: Damping factor for softbody deflection.
+ Value clamped to [0.0,1.0].
+ @type piSoftbodyDamp: float
+ @ivar piSoftbodyIThick: Inner face thickness for softbody deflection.
+ Value clamped to [0.001,1.0].
+ @type piSoftbodyIThick: float
+ @ivar piSoftbodyOThick: Outer face thickness for softbody deflection.
+ Value clamped to [0.001,1.0].
+ @type piSoftbodyOThick: float
+ @ivar piStrength: Particle interaction force field strength.
+ Value clamped to [0.0,1000.0].
+ @type piStrength: float
+ @ivar piSurfaceDamp: Amount of damping during particle collision.
+ Value clamped to [0.0,1.0].
+ @type piSurfaceDamp: float
+ @ivar piUseMaxDist: Use a maximum distance for the field to work.
+ @type piUseMaxDist: boolean
+
+ @ivar isSoftBody: True if object is a soft body. Read-only.
+ @type isSoftBody: boolean
+ @ivar SBDefaultGoal: Default softbody goal value, when no vertex group used.
+ Value clamped to [0.0,1.0].
+ @type SBDefaultGoal: float
+ @ivar SBErrorLimit: Softbody Runge-Kutta ODE solver error limit (low values give more precision).
+ Value clamped to [0.01,1.0].
+ @type SBErrorLimit: float
+ @ivar SBFriction: General media friction for softbody point movements.
+ Value clamped to [0.0,10.0].
+ @type SBFriction: float
+ @ivar SBGoalFriction: Softbody goal (vertex target position) friction.
+ Value clamped to [0.0,10.0].
+ @type SBGoalFriction: float
+ @ivar SBGoalSpring: Softbody goal (vertex target position) spring stiffness.
+ Value clamped to [0.0,0.999].
+ @type SBGoalSpring: float
+ @ivar SBGrav: Apply gravitation to softbody point movement.
+ Value clamped to [0.0,10.0].
+ @type SBGrav: float
+ @ivar SBInnerSpring: Softbody edge spring stiffness.
+ Value clamped to [0.0,0.999].
+ @type SBInnerSpring: float
+ @ivar SBInnerSpringFrict: Softbody edge spring friction.
+ Value clamped to [0.0,10.0].
+ @type SBInnerSpringFrict: float
+ @ivar SBMass: Softbody point mass (heavier is slower).
+ Value clamped to [0.001,50.0].
+ @type SBMass: float
+ @ivar SBMaxGoal: Softbody goal maximum (vertex group weights scaled to
+ match this range). Value clamped to [0.0,1.0].
+ @type SBMaxGoal: float
+ @ivar SBMinGoal: Softbody goal minimum (vertex group weights scaled to
+ match this range). Value clamped to [0.0,1.0].
+ @type SBMinGoal: float
+ @ivar SBSpeed: Tweak timing for physics to control softbody frequency and
+ speed. Value clamped to [0.0,10.0].
+ @type SBSpeed: float
+ @ivar SBStiffQuads: Softbody adds diagonal springs on 4-gons enabled.
+ @type SBStiffQuads: boolean
+ @ivar SBUseEdges: Softbody use edges as springs enabled.
+ @type SBUseEdges: boolean
+ @ivar SBUseGoal: Softbody forces for vertices to stick to animated position enabled.
+ @type SBUseGoal: boolean
+
+ @ivar rbFlags: Rigid body bitfield. See L{RBFlags} for valid values.
+ @type rbFlags: int
+ @ivar rbMass: Rigid body mass. Must be a positive value.
+ @type rbMass: float
+ @ivar rbRadius: Rigid body bounding sphere size. Must be a positive
+ value.
+ @type rbRadius: float
+ @ivar rbShapeBoundType: Rigid body shape bound type. See L{RBShapes}
+ const dict for values.
+ @type rbShapeBoundType: int
+ """
+
+ def buildParts():
+ """
+ Recomputes the particle system. This method only applies to an Object of
+ the type Effect.
+ """
+
+ def insertShapeKey():
+ """
+ Insert a Shape Key in the current object. It applies to Objects of
+ the type Mesh, Lattice, or Curve.
+ """
+
+ def getPose():
+ """
+ Gets the current Pose of the object.
+ @rtype: Pose object
+ @return: the current pose object
+ """
+
+ def evaluatePose(framenumber):
+ """
+ Evaluates the Pose based on its currently bound action at a certain frame.
+ @type framenumber: Int
+ @param framenumber: The frame number to evaluate to.
+ """
+
+ def clearIpo():
+ """
+ Unlinks the ipo from this object.
+ @return: True if there was an ipo linked or False otherwise.
+ """
+
+ def clrParent(mode = 0, fast = 0):
+ """
+ Clears parent object.
+ @type mode: Integer
+ @type fast: Integer
+ @param mode: A mode flag. If mode flag is 2, then the object transform will
+ be kept. Any other value, or no value at all will update the object
+ transform.
+ @param fast: If the value is 0, the scene hierarchy will not be updated. Any
+ other value, or no value at all will update the scene hierarchy.
+ """
+
+ def getData(name_only=False, mesh=False):
+ """
+ Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this
+ Object. If the keyword parameter B{name_only} is True, only the Datablock
+ name is returned as a string. It the object is of type Mesh, then the
+ B{mesh} keyword can also be used; the data return is a Mesh object if
+ True, otherwise it is an NMesh object (the default).
+ The B{mesh} keyword is ignored for non-mesh objects.
+ @type name_only: bool
+ @param name_only: This is a keyword parameter. If True (or nonzero),
+ only the name of the data object is returned.
+ @type mesh: bool
+ @param mesh: This is a keyword parameter. If True (or nonzero),
+ a Mesh data object is returned.
+ @rtype: specific Object type or string
+ @return: Depends on the type of Datablock linked to the Object. If
+ B{name_only} is True, it returns a string.
+ @note: Mesh is faster than NMesh because Mesh is a thin wrapper.
+ @note: This function is different from L{NMesh.GetRaw} and L{Mesh.Get}
+ because it keeps a link to the original mesh, which is needed if you are
+ dealing with Mesh weight groups.
+ @note: Make sure the object you are getting the data from isn't in
+ EditMode before calling this function; otherwise you'll get the data
+ before entering EditMode. See L{Window.EditMode}.
+ """
+
+ def getParentBoneName():
+ """
+ Returns None, or the 'sub-name' of the parent (eg. Bone name)
+ @return: string
+ """
+
+ def getDeltaLocation():
+ """
+ Returns the object's delta location in a list (x, y, z)
+ @rtype: A vector triple
+ @return: (x, y, z)
+ """
+
+ def getDrawMode():
+ """
+ Returns the object draw mode.
+ @rtype: Integer
+ @return: a sum of the following:
+ - 2 - axis
+ - 4 - texspace
+ - 8 - drawname
+ - 16 - drawimage
+ - 32 - drawwire
+ - 64 - xray
+ """
+
+ def getDrawType():
+ """
+ Returns the object draw type
+ @rtype: Integer
+ @return: One of the following:
+ - 1 - Bounding box
+ - 2 - Wire
+ - 3 - Solid
+ - 4 - Shaded
+ - 5 - Textured
+ """
+
+ def getEuler(space):
+ """
+ @type space: string
+ @param space: The desired space for the size:
+ - localspace: (default) relative to the object's parent;
+ - worldspace: absolute, taking vertex parents, tracking and
+ Ipo's into account;
+ Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ). Angles are in radians.
+ @rtype: Py_Euler
+ @return: A python Euler. Data is wrapped when euler is present.
+ """
+
+ def getInverseMatrix():
+ """
+ Returns the object's inverse matrix.
+ @rtype: Py_Matrix
+ @return: A python matrix 4x4
+ """
+
+ def getIpo():
+ """
+ Returns the Ipo associated to this object or None if there's no linked ipo.
+ @rtype: Ipo
+ @return: the wrapped ipo or None.
+ """
+ def isSelected():
+ """
+ Returns the objects selection state in the current scene as a boolean value True or False.
+ @rtype: Boolean
+ @return: Selection state as True or False
+ """
+
+ def getLocation(space):
+ """
+ @type space: string
+ @param space: The desired space for the location:
+ - localspace: (default) relative to the object's parent;
+ - worldspace: absolute, taking vertex parents, tracking and
+ Ipo's into account;
+ Returns the object's location (x, y, z).
+ @return: (x, y, z)
+
+ I{B{Example:}}
+
+ The example below works on the default scene. It retrieves all objects in
+ the scene and prints the name and location of each object::
+ import Blender
+
+ objects = Blender.Object.Get()
+
+ for obj in objects:
+ print obj.getName()
+ print obj.getLocation()
+ @note: the worldspace location is the same as ob.matrixWorld[3][0:3]
+ """
+
+ def getAction():
+ """
+ Returns an action if one is associated with this object (only useful for armature types).
+ @rtype: Py_Action
+ @return: a python action.
+ """
+
+ def getMaterials(what = 0):
+ """
+ Returns a list of materials assigned to the object.
+ @type what: int
+ @param what: if nonzero, empty slots will be returned as None's instead
+ of being ignored (default way). See L{NMesh.NMesh.getMaterials}.
+ @rtype: list of Material Objects
+ @return: list of Material Objects assigned to the object.
+ """
+
+ def getMatrix(space = 'worldspace'):
+ """
+ Returns the object matrix.
+ @type space: string
+ @param space: The desired matrix:
+ - worldspace (default): absolute, taking vertex parents, tracking and
+ Ipo's into account;
+ - localspace: relative to the object's parent (returns worldspace
+ matrix if the object doesn't have a parent);
+ - old_worldspace: old behavior, prior to Blender 2.34, where eventual
+ changes made by the script itself were not taken into account until
+ a redraw happened, either called by the script or upon its exit.
+ Returns the object matrix.
+ @rtype: Py_Matrix (WRAPPED DATA)
+ @return: a python 4x4 matrix object. Data is wrapped for 'worldspace'
+ """
+
+ def getName():
+ """
+ Returns the name of the object
+ @return: The name of the object
+
+ I{B{Example:}}
+
+ The example below works on the default scene. It retrieves all objects in
+ the scene and prints the name of each object::
+ import Blender
+
+ scn= Blender.Scene.GetCurrent()
+ objects = scn.getChildren()
+
+ for obj in objects:
+ print obj.getName()
+ """
+
+ def getParent():
+ """
+ Returns the object's parent object.
+ @rtype: Object
+ @return: The parent object of the object. If not available, None will be
+ returned.
+ """
+
+ def getSize(space):
+ """
+ @type space: string
+ @param space: The desired space for the size:
+ - localspace: (default) relative to the object's parent;
+ - worldspace: absolute, taking vertex parents, tracking and
+ Ipo's into account;
+ Returns the object's size.
+ @return: (SizeX, SizeY, SizeZ)
+ @note: the worldspace size will not return negative (flipped) scale values.
+ """
+
+ def getParentBoneName():
+ """
+ Returns the object's parent object's sub name, or None.
+ For objects parented to bones, this is the name of the bone.
+ @rtype: String
+ @return: The parent object sub-name of the object.
+ If not available, None will be returned.
+ """
+
+ def getTimeOffset():
+ """
+ Returns the time offset of the object's animation.
+ @return: TimeOffset
+ """
+
+ def getTracked():
+ """
+ Returns the object's tracked object.
+ @rtype: Object
+ @return: The tracked object of the object. If not available, None will be
+ returned.
+ """
+
+ def getType():
+ """
+ Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
+ 'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases.
+
+ I{B{Example:}}
+
+ The example below works on the default scene. It retrieves all objects in
+ the scene and updates the location and rotation of the camera. When run,
+ the camera will rotate 180 degrees and moved to the opposite side of the X
+ axis. Note that the number 'pi' in the example is an approximation of the
+ true number 'pi'. A better, less error-prone value of pi is math.pi from the python math module.::
+ import Blender
+
+ objects = Blender.Object.Get()
+
+ for obj in objects:
+ if obj.getType() == 'Camera':
+ obj.LocY = -obj.LocY
+ obj.RotZ = 3.141592 - obj.RotZ
+
+ Blender.Redraw()
+
+ @return: The type of object.
+ @rtype: String
+ """
+
+ def insertIpoKey(keytype):
+ """
+ Inserts keytype values in object ipo at curframe. Uses module constants.
+ @type keytype: Integer
+ @param keytype:
+ -LOC
+ -ROT
+ -SIZE
+ -LOCROT
+ -LOCROTSIZE
+ -PI_STRENGTH
+ -PI_FALLOFF
+ -PI_PERM
+ -PI_SURFACEDAMP
+ -PI_RANDOMDAMP
+ @return: None
+ """
+
+ def link(datablock):
+ """
+ Links Object with ObData datablock provided in the argument. The data must match the
+ Object's type, so you cannot link a Lamp to a Mesh type object.
+ @type datablock: Blender ObData datablock
+ @param datablock: A Blender datablock matching the objects type.
+ """
+
+ def makeParent(objects, noninverse = 0, fast = 0):
+ """
+ Makes the object the parent of the objects provided in the argument which
+ must be a list of valid Objects.
+ @type objects: Sequence of Blender Object
+ @param objects: The children of the parent
+ @type noninverse: Integer
+ @param noninverse:
+ 0 - make parent with inverse
+ 1 - make parent without inverse
+ @type fast: Integer
+ @param fast:
+ 0 - update scene hierarchy automatically
+ 1 - don't update scene hierarchy (faster). In this case, you must
+ explicitely update the Scene hierarchy.
+ @warn: objects must first be linked to a scene before they can become
+ parents of other objects. Calling this makeParent method for an
+ unlinked object will result in an error.
+ """
+
+ def join(objects):
+ """
+ Uses the object as a base for all of the objects in the provided list to join into.
+
+ @type objects: Sequence of Blender Object
+ @param objects: A list of objects matching the object's type.
+ @note: Objects in the list will not be removed from the scene.
+ To avoid overlapping data you may want to remove them manually after joining.
+ @note: Join modifies the base object's data in place so that
+ other objects are joined into it. No new object or data is created.
+ @note: Join will only work for object types Mesh, Armature, Curve and Surface;
+ an excption will be raised if the object is not of these types.
+ @note: Objects in the list will be ignored if they to not match the base object.
+ @note: The base object must be in the current scene to be joined.
+ @note: This function will not work in background mode (no user interface).
+ @note: An error in the function input will raise a TypeError or AttributeError,
+ otherwise an error in the data input will raise a RuntimeError.
+ For situations where you don't have tight control on the data that is being joined,
+ you should handle the RuntimeError error, letting the user know the data can't be joined.
+ """
+
+ def makeParentDeform(objects, noninverse = 0, fast = 0):
+ """
+ Makes the object the deformation parent of the objects provided in the argument
+ which must be a list of valid Objects.
+ The parent object must be a Curve or Armature.
+ @type objects: Sequence of Blender Object
+ @param objects: The children of the parent
+ @type noninverse: Integer
+ @param noninverse:
+ 0 - make parent with inverse
+ 1 - make parent without inverse
+ @type fast: Integer
+ @param fast:
+ 0 - update scene hierarchy automatically
+ 1 - don't update scene hierarchy (faster). In this case, you must
+ explicitely update the Scene hierarchy.
+ @warn: objects must first be linked to a scene before they can become
+ parents of other objects. Calling this makeParent method for an
+ unlinked object will result in an error.
+ @warn: child objects must be of mesh type to deform correctly. Other object
+ types will fall back to normal parenting silently.
+ """
+
+ def makeParentVertex(objects, indices, noninverse = 0, fast = 0):
+ """
+ Makes the object the vertex parent of the objects provided in the argument
+ which must be a list of valid Objects.
+ The parent object must be a Mesh, Curve or Surface.
+ @type objects: Sequence of Blender Object
+ @param objects: The children of the parent
+ @type indices: Tuple of Integers
+ @param indices: The indices of the vertices you want to parent to (1 or 3 values)
+ @type noninverse: Integer
+ @param noninverse:
+ 0 - make parent with inverse
+ 1 - make parent without inverse
+ @type fast: Integer
+ @param fast:
+ 0 - update scene hierarchy automatically
+ 1 - don't update scene hierarchy (faster). In this case, you must
+ explicitely update the Scene hierarchy.
+ @warn: objects must first be linked to a scene before they can become
+ parents of other objects. Calling this makeParent method for an
+ unlinked object will result in an error.
+ """
+ def makeParentBone(objects, bonename, noninverse = 0, fast = 0):
+ """
+ Makes one of the object's bones the parent of the objects provided in the argument
+ which must be a list of valid objects. The parent object must be an Armature.
+ @type objects: Sequence of Blender Object
+ @param objects: The children of the parent
+ @type bonename: string
+ @param bonename: a valid bone name from the armature
+ @type noninverse: integer
+ @param noninverse:
+ 0 - make parent with inverse
+ 1 - make parent without inverse
+ @type fast: integer
+ @param fast:
+ 0 - update scene hierarchy automatically
+ 1 - don't update scene hierarchy (faster). In this case, you must
+ explicitly update the Scene hierarchy.
+ @warn: Objects must first be linked to a scene before they can become
+ parents of other objects. Calling this method for an
+ unlinked object will result in an exception.
+ """
+
+ def setDeltaLocation(delta_location):
+ """
+ Sets the object's delta location which must be a vector triple.
+ @type delta_location: A vector triple
+ @param delta_location: A vector triple (x, y, z) specifying the new
+ location.
+ """
+
+ def setDrawMode(drawmode):
+ """
+ Sets the object's drawing mode. The drawing mode can be a mix of modes. To
+ enable these, add up the values.
+ @type drawmode: Integer
+ @param drawmode: A sum of the following:
+ - 2 - axis
+ - 4 - texspace
+ - 8 - drawname
+ - 16 - drawimage
+ - 32 - drawwire
+ - 64 - xray
+ """
+
+ def setDrawType(drawtype):
+ """
+ Sets the object's drawing type.
+ @type drawtype: Integer
+ @param drawtype: One of the following:
+ - 1 - Bounding box
+ - 2 - Wire
+ - 3 - Solid
+ - 4 - Shaded
+ - 5 - Textured
+ """
+
+ def setEuler(euler):
+ """
+ Sets the object's localspace rotation according to the specified Euler angles.
+ @type euler: Py_Euler or a list of floats
+ @param euler: a python Euler or x,y,z rotations as floats
+ """
+
+ def setIpo(ipo):
+ """
+ Links an ipo to this object.
+ @type ipo: Blender Ipo
+ @param ipo: an object type ipo.
+ """
+
+ def setLocation(x, y, z):
+ """
+ Sets the object's location relative to the parent object (if any).
+ @type x: float
+ @param x: The X coordinate of the new location.
+ @type y: float
+ @param y: The Y coordinate of the new location.
+ @type z: float
+ @param z: The Z coordinate of the new location.
+ """
+
+ def setMaterials(materials):
+ """
+ Sets the materials. The argument must be a list 16 items or less. Each
+ list element is either a Material or None. Also see L{colbits}.
+ @type materials: Materials list
+ @param materials: A list of Blender material objects.
+ @note: Materials are assigned to the object's data by default. Unless
+ you know the material is applied to the object or are changing the
+ object's L{colbits}, you need to look at the object data's materials.
+ """
+
+ def setMatrix(matrix):
+ """
+ Sets the object's matrix and updates its transformation. If the object
+ has a parent, the matrix transform is relative to the parent.
+ @type matrix: Py_Matrix 3x3 or 4x4
+ @param matrix: a 3x3 or 4x4 Python matrix. If a 3x3 matrix is given,
+ it is extended to a 4x4 matrix.
+ @Note: This method is "bad": when called it changes the location,
+ rotation and size attributes of the object (since Blender uses these
+ values to calculate the object's transformation matrix). Ton is
+ not happy having a method which "pretends" to do a matrix operation.
+ In the future, this method may be replaced with other methods which
+ make it easier for the user to determine the correct loc/rot/size values
+ for necessary for the object.
+ """
+
+ def setName(name):
+ """
+ Sets the name of the object. A string longer than 20 characters will be shortened.
+ @type name: String
+ @param name: The new name for the object.
+ """
+
+ def setSize(x, y, z):
+ """
+ Sets the object's size, relative to the parent object (if any), clamped
+ @type x: float
+ @param x: The X size multiplier.
+ @type y: float
+ @param y: The Y size multiplier.
+ @type z: float
+ @param z: The Z size multiplier.
+ """
+
+ def setTimeOffset(timeOffset):
+ """
+ Sets the time offset of the object's animation.
+ @type timeOffset: float
+ @param timeOffset: The new time offset for the object's animation.
+ """
+
+ def shareFrom(object):
+ """
+ Link data of a specified argument with this object. This works only
+ if both objects are of the same type.
+ @type object: Blender Object
+ @param object: A Blender Object of the same type.
+ @note: This function is faster than using L{getData()} and setData()
+ because it skips making a Python object from the object's data.
+ """
+
+ def select(boolean):
+ """
+ Sets the object's selection state in the current scene.
+ setting the selection will make this object the active object of this scene.
+ @type boolean: Integer
+ @param boolean:
+ - 0 - unselected
+ - 1 - selected
+ """
+
+ def getBoundBox():
+ """
+ Returns the worldspace bounding box of this object. This works for meshes (out of
+ edit mode) and curves.
+ @rtype: list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA)
+ @return: The coordinates of the 8 corners of the bounding box. Data is wrapped when
+ bounding box is present.
+ """
+
+ def makeDisplayList():
+ """
+ Updates this object's display list. Blender uses display lists to store
+ already transformed data (like a mesh with its vertices already modified
+ by coordinate transformations and armature deformation). If the object
+ isn't modified, there's no need to recalculate this data. This method is
+ here for the *few cases* where a script may need it, like when toggling
+ the "SubSurf" mode for a mesh:
+
+ Example::
+ import Blender
+
+ scn = Blender.Scene.GetCurrent()
+ object = scn.objects.active
+ object.modifiers.append(Blender.Modifier.Type.SUBSURF)
+ object.makeDisplayList()
+ Blender.Window.RedrawAll()
+
+ If you try this example without the line to update the display list, the
+ object will disappear from the screen until you press "SubSurf".
+ @warn: If after running your script objects disappear from the screen or
+ are not displayed correctly, try this method function. But if the script
+ works properly without it, there's no reason to use it.
+ """
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Object's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks (links = None):
+ """
+ Delete script links from this Object. If no list is specified, all
+ script links are deleted.
+ @type links: list of strings
+ @param links: None (default) or a list of Blender L{Text} names.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Object.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ """
+
+ def makeTrack (tracked, fast = 0):
+ """
+ Make this Object track another.
+ @type tracked: Blender Object
+ @param tracked: the object to be tracked.
+ @type fast: int (bool)
+ @param fast: if zero, the scene hierarchy is updated automatically. If
+ you set 'fast' to a nonzero value, don't forget to update the scene
+ yourself (see L{Scene.Scene.update}).
+ @note: you also need to clear the rotation (L{setEuler}) of this object
+ if it was not (0,0,0) already.
+ """
+
+ def clearTrack (mode = 0, fast = 0):
+ """
+ Make this Object not track another anymore.
+ @type mode: int (bool)
+ @param mode: if nonzero the matrix transformation used for tracking is kept.
+ @type fast: int (bool)
+ @param fast: if zero, the scene hierarchy is updated automatically. If
+ you set 'fast' to a nonzero value, don't forget to update the scene
+ yourself (see L{Scene.Scene.update}).
+ """
+
+ def getAllProperties ():
+ """
+ Return a list of all game properties from this object.
+ @rtype: PyList
+ @return: List of Property objects.
+ """
+
+ def getProperty (name):
+ """
+ Return a game property from this object matching the name argument.
+ @type name: string
+ @param name: the name of the property to get.
+ @rtype: Property object
+ @return: The first property that matches name.
+ """
+
+ def addProperty (name_or_property, data, type):
+ """
+ Add or create a game property for an object. If called with only a
+ property object, the property is assigned to the object. If called
+ with a property name string and data object, a new property is
+ created and added to the object.
+ @type name_or_property: string or Property object
+ @param name_or_property: the property name, or a property object.
+ @type data: string, int or float
+ @param data: Only valid when I{name_or_property} is a string.
+ Value depends on what is passed in:
+ - string: string type property
+ - int: integer type property
+ - float: float type property
+ @type type: string (optional)
+ @param type: Only valid when I{name_or_property} is a string.
+ Can be the following:
+ - 'BOOL'
+ - 'INT'
+ - 'FLOAT'
+ - 'TIME'
+ - 'STRING'
+ @warn: If a type is not declared string data will
+ become string type, int data will become int type
+ and float data will become float type. Override type
+ to declare bool type, and time type.
+ @warn: A property object can be added only once to an object;
+ you must remove the property from an object to add it elsewhere.
+ """
+
+ def removeProperty (property):
+ """
+ Remove a game property from an object.
+ @type property: Property object or string
+ @param property: Property object or property name to be removed.
+ """
+
+ def removeAllProperties():
+ """
+ Removes all game properties from an object.
+ """
+
+ def copyAllPropertiesTo (object):
+ """
+ Copies all game properties from one object to another.
+ @type object: Object object
+ @param object: Object that will receive the properties.
+ """
+
+ def getPIStregth():
+ """
+ Get the Object's Particle Interaction Strength.
+ @rtype: float
+ """
+
+ def setPIStrength(strength):
+ """
+ Set the Object's Particle Interaction Strength.
+ Values between -1000.0 to 1000.0
+ @rtype: None
+ @type strength: float
+ @param strength: the Object's Particle Interaction New Strength.
+ """
+
+ def getPIFalloff():
+ """
+ Get the Object's Particle Interaction falloff.
+ @rtype: float
+ """
+
+ def setPIFalloff(falloff):
+ """
+ Set the Object's Particle Interaction falloff.
+ Values between 0 to 10.0
+ @rtype: None
+ @type falloff: float
+ @param falloff: the Object's Particle Interaction New falloff.
+ """
+
+ def getPIMaxDist():
+ """
+ Get the Object's Particle Interaction MaxDist.
+ @rtype: float
+ """
+
+ def setPIMaxDist(MaxDist):
+ """
+ Set the Object's Particle Interaction MaxDist.
+ Values between 0 to 1000.0
+ @rtype: None
+ @type MaxDist: float
+ @param MaxDist: the Object's Particle Interaction New MaxDist.
+ """
+
+ def getPIType():
+ """
+ Get the Object's Particle Interaction Type.
+ @rtype: int
+ """
+
+ def setPIType(type):
+ """
+ Set the Object's Particle Interaction type.
+ Use Module Constants
+ - NONE
+ - WIND
+ - FORCE
+ - VORTEX
+ - MAGNET
+ @rtype: None
+ @type type: int
+ @param type: the Object's Particle Interaction Type.
+ """
+
+ def getPIUseMaxDist():
+ """
+ Get the Object's Particle Interaction if using MaxDist.
+ @rtype: int
+ """
+
+ def setPIUseMaxDist(status):
+ """
+ Set the Object's Particle Interaction MaxDist.
+ 0 = Off, 1 = on
+ @rtype: None
+ @type status: int
+ @param status: the new status
+ """
+
+ def getPIDeflection():
+ """
+ Get the Object's Particle Interaction Deflection Setting.
+ @rtype: int
+ """
+
+ def setPIDeflection(status):
+ """
+ Set the Object's Particle Interaction Deflection Setting.
+ 0 = Off, 1 = on
+ @rtype: None
+ @type status: int
+ @param status: the new status
+ """
+
+ def getPIPermf():
+ """
+ Get the Object's Particle Interaction Permeability.
+ @rtype: float
+ """
+
+ def setPIPerm(perm):
+ """
+ Set the Object's Particle Interaction Permeability.
+ Values between 0 to 10.0
+ @rtype: None
+ @type perm: float
+ @param perm: the Object's Particle Interaction New Permeability.
+ """
+
+ def getPIRandomDamp():
+ """
+ Get the Object's Particle Interaction RandomDamp.
+ @rtype: float
+ """
+
+ def setPIRandomDamp(damp):
+ """
+ Set the Object's Particle Interaction RandomDamp.
+ Values between 0 to 10.0
+ @rtype: None
+ @type damp: float
+ @param damp: the Object's Particle Interaction New RandomDamp.
+ """
+
+ def getPISurfaceDamp():
+ """
+ Get the Object's Particle Interaction SurfaceDamp.
+ @rtype: float
+ """
+
+ def setPISurfaceDamp(damp):
+ """
+ Set the Object's Particle Interaction SurfaceDamp.
+ Values between 0 to 10.0
+ @rtype: None
+ @type damp: float
+ @param damp: the Object's Particle Interaction New SurfaceDamp.
+ """
+
+ def getSBMass():
+ """
+ Get the Object's SoftBody Mass.
+ @rtype: float
+ """
+
+ def setSBMass(mass):
+ """
+ Set the Object's SoftBody Mass.
+ Values between 0 to 50.0
+ @rtype: None
+ @type mass: float
+ @param mass: the Object's SoftBody New mass.
+ """
+
+ def getSBGravity():
+ """
+ Get the Object's SoftBody Gravity.
+ @rtype: float
+ """
+
+ def setSBGravity(grav):
+ """
+ Set the Object's SoftBody Gravity.
+ Values between 0 to 10.0
+ @rtype: None
+ @type grav: float
+ @param grav: the Object's SoftBody New Gravity.
+ """
+
+ def getSBFriction():
+ """
+ Get the Object's SoftBody Friction.
+ @rtype: float
+ """
+
+ def setSBFriction(frict):
+ """
+ Set the Object's SoftBody Friction.
+ Values between 0 to 10.0
+ @rtype: None
+ @type frict: float
+ @param frict: the Object's SoftBody New Friction.
+ """
+
+ def getSBErrorLimit():
+ """
+ Get the Object's SoftBody ErrorLimit.
+ @rtype: float
+ """
+
+ def setSBErrorLimit(err):
+ """
+ Set the Object's SoftBody ErrorLimit.
+ Values between 0 to 1.0
+ @rtype: None
+ @type err: float
+ @param err: the Object's SoftBody New ErrorLimit.
+ """
+
+ def getSBGoalSpring():
+ """
+ Get the Object's SoftBody GoalSpring.
+ @rtype: float
+ """
+
+ def setSBGoalSpring(gs):
+ """
+ Set the Object's SoftBody GoalSpring.
+ Values between 0 to 0.999
+ @rtype: None
+ @type gs: float
+ @param gs: the Object's SoftBody New GoalSpring.
+ """
+
+ def getSBGoalFriction():
+ """
+ Get the Object's SoftBody GoalFriction.
+ @rtype: float
+ """
+
+ def setSBGoalFriction(gf):
+ """
+ Set the Object's SoftBody GoalFriction.
+ Values between 0 to 10.0
+ @rtype: None
+ @type gf: float
+ @param gf: the Object's SoftBody New GoalFriction.
+ """
+
+ def getSBMinGoal():
+ """
+ Get the Object's SoftBody MinGoal.
+ @rtype: float
+ """
+
+ def setSBMinGoal(mg):
+ """
+ Set the Object's SoftBody MinGoal.
+ Values between 0 to 1.0
+ @rtype: None
+ @type mg: float
+ @param mg: the Object's SoftBody New MinGoal.
+ """
+
+ def getSBMaxGoal():
+ """
+ Get the Object's SoftBody MaxGoal.
+ @rtype: float
+ """
+
+ def setSBMaxGoal(mg):
+ """
+ Set the Object's SoftBody MaxGoal.
+ Values between 0 to 1.0
+ @rtype: None
+ @type mg: float
+ @param mg: the Object's SoftBody New MaxGoal.
+ """
+
+ def getSBInnerSpring():
+ """
+ Get the Object's SoftBody InnerSpring.
+ @rtype: float
+ """
+
+ def setSBInnerSpring(sprr):
+ """
+ Set the Object's SoftBody InnerSpring.
+ Values between 0 to 0.999
+ @rtype: None
+ @type sprr: float
+ @param sprr: the Object's SoftBody New InnerSpring.
+ """
+
+ def getSBInnerSpringFriction():
+ """
+ Get the Object's SoftBody InnerSpringFriction.
+ @rtype: float
+ """
+
+ def setSBInnerSpringFriction(sprf):
+ """
+ Set the Object's SoftBody InnerSpringFriction.
+ Values between 0 to 10.0
+ @rtype: None
+ @type sprf: float
+ @param sprf: the Object's SoftBody New InnerSpringFriction.
+ """
+
+ def getSBDefaultGoal():
+ """
+ Get the Object's SoftBody DefaultGoal.
+ @rtype: float
+ """
+
+ def setSBDefaultGoal(goal):
+ """
+ Set the Object's SoftBody DefaultGoal.
+ Values between 0 to 1.0
+ @rtype: None
+ @type goal: float
+ @param goal: the Object's SoftBody New DefaultGoal.
+ """
+
+ def isSB():
+ """
+ Returns the Object's SoftBody enabled state.
+ @rtype: boolean
+ """
+
+ def getSBPostDef():
+ """
+ get SoftBodies PostDef option
+ @rtype: int
+ """
+
+ def setSBPostDef(switch):
+ """
+ Enable / Disable SoftBodies PostDef option
+ 1: on
+ 0: off
+ @rtype: None
+ @type switch: int
+ @param switch: the Object's SoftBody New PostDef Value.
+ """
+
+ def getSBUseGoal():
+ """
+ get SoftBodies UseGoal option
+ @rtype: int
+ """
+
+ def setSBUseGoal(switch):
+ """
+ Enable / Disable SoftBodies UseGoal option
+ 1: on
+ 0: off
+ @rtype: None
+ @type switch: int
+ @param switch: the Object's SoftBody New UseGoal Value.
+ """
+ def getSBUseEdges():
+ """
+ get SoftBodies UseEdges option
+ @rtype: int
+ """
+
+ def setSBUseEdges(switch):
+ """
+ Enable / Disable SoftBodies UseEdges option
+ 1: on
+ 0: off
+ @rtype: None
+ @type switch: int
+ @param switch: the Object's SoftBody New UseEdges Value.
+ """
+
+ def getSBStiffQuads():
+ """
+ get SoftBodies StiffQuads option
+ @rtype: int
+ """
+
+ def setSBStiffQuads(switch):
+ """
+ Enable / Disable SoftBodies StiffQuads option
+ 1: on
+ 0: off
+ @rtype: None
+ @type switch: int
+ @param switch: the Object's SoftBody New StiffQuads Value.
+ """
class Property:
- """
- The Property object
- ===================
- This property gives access to object property data in Blender, used by the game engine.
- @ivar name: The property name.
- @ivar data: Data for this property. Depends on property type.
- @ivar type: The property type.
- @warn: Comparisons between properties will only be true when
- both the name and data pairs are the same.
- """
-
- def getName ():
- """
- Get the name of this property.
- @rtype: string
- @return: The property name.
- """
-
- def setName (name):
- """
- Set the name of this property.
- @type name: string
- @param name: The new name of the property
- """
-
- def getData():
- """
- Get the data for this property.
- @rtype: string, int, or float
- """
-
- def setData(data):
- """
- Set the data for this property.
- @type data: string, int, or float
- @param data: The data to set for this property.
- @warn: See object.setProperty(). Changing data
- which is of a different type then the property is
- set to (i.e. setting an int value to a float type'
- property) will change the type of the property
- automatically.
- """
-
- def getType ():
- """
- Get the type for this property.
- @rtype: string
- """
-
+ """
+ The Property object
+ ===================
+ This property gives access to object property data in Blender, used by the game engine.
+ @ivar name: The property name.
+ @ivar data: Data for this property. Depends on property type.
+ @ivar type: The property type.
+ @warn: Comparisons between properties will only be true when
+ both the name and data pairs are the same.
+ """
+
+ def getName ():
+ """
+ Get the name of this property.
+ @rtype: string
+ @return: The property name.
+ """
+
+ def setName (name):
+ """
+ Set the name of this property.
+ @type name: string
+ @param name: The new name of the property
+ """
+
+ def getData():
+ """
+ Get the data for this property.
+ @rtype: string, int, or float
+ """
+
+ def setData(data):
+ """
+ Set the data for this property.
+ @type data: string, int, or float
+ @param data: The data to set for this property.
+ @warn: See object.setProperty(). Changing data
+ which is of a different type then the property is
+ set to (i.e. setting an int value to a float type'
+ property) will change the type of the property
+ automatically.
+ """
+
+ def getType ():
+ """
+ Get the type for this property.
+ @rtype: string
+ """
+
+import id_generics
+Object.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Scene.py b/source/blender/python/api2_2x/doc/Scene.py
index 0ad018b2538..a07194f626a 100644
--- a/source/blender/python/api2_2x/doc/Scene.py
+++ b/source/blender/python/api2_2x/doc/Scene.py
@@ -4,9 +4,9 @@
The Blender.Scene submodule.
B{New}:
- - L{Scene.clearScriptLinks<Scene.Scene.clearScriptLinks>} accepts a parameter now.
- - acess methods L{Scene.getLayers<Scene.Scene.getLayers>}, L{Scene.setLayers<Scene.Scene.setLayers>} via lists to complement the layers and
- Layers Scene attributes which use bitmasks.
+ - L{Scene.clearScriptLinks<Scene.Scene.clearScriptLinks>} accepts a parameter now.
+ - acess methods L{Scene.getLayers<Scene.Scene.getLayers>}, L{Scene.setLayers<Scene.Scene.setLayers>} via lists to complement the layers and
+ Layers Scene attributes which use bitmasks.
Scene
=====
@@ -14,367 +14,365 @@ Scene
This module provides access to B{Scenes} in Blender.
Example::
- import Blender
- from Blender import Scene, Object, Camera
- #
- camdata = Camera.New('persp') # create new camera data
- camdata.name = 'newCam'
- camdata.lens = 16.0
- scene = Scene.New('NewScene') # create a new scene
- scene.objects.new(camdata,'Camera') # add a new object to the scene with newly-created data
- scene.makeCurrent() # make this the current scene
+ import Blender
+ from Blender import Scene, Object, Camera
+ #
+ camdata = Camera.New('persp') # create new camera data
+ camdata.name = 'newCam'
+ camdata.lens = 16.0
+ scene = Scene.New('NewScene') # create a new scene
+ scene.objects.new(camdata,'Camera') # add a new object to the scene with newly-created data
+ scene.makeCurrent() # make this the current scene
@warn: B{scene.objects.new} is the preferred way to add new objects to a scene.
- The older way is to create an object with B{Object.New()}, link the
- data to the new object, then link the object to the scene. This way is
- not recommended since a forgotten step or run-time error in the script can
- cause bad things to be done to Blender's database.
-
- If you use this older method, it's recommended to always perform the
- operations in this order. This is because if
- there is no object data linked to an object B{ob}, B{scene.link(ob)} will
- automatically create the missing data. This is OK on its own, but I{if
- after that} object B{ob} is linked to obdata, the automatically created one
- will be discarded -- as expected -- but will stay in Blender's memory
- space until the program is exited, since Blender doesn't really get rid of
- most kinds of data. So first linking ObData to object, then object to
- scene is a tiny tiny bit faster than the other way around and also saves
- some realtime memory (if many objects are created from scripts, the
- savings become important).
+ The older way is to create an object with B{Object.New()}, link the
+ data to the new object, then link the object to the scene. This way is
+ not recommended since a forgotten step or run-time error in the script can
+ cause bad things to be done to Blender's database.
+
+ If you use this older method, it's recommended to always perform the
+ operations in this order. This is because if
+ there is no object data linked to an object B{ob}, B{scene.link(ob)} will
+ automatically create the missing data. This is OK on its own, but I{if
+ after that} object B{ob} is linked to obdata, the automatically created one
+ will be discarded -- as expected -- but will stay in Blender's memory
+ space until the program is exited, since Blender doesn't really get rid of
+ most kinds of data. So first linking ObData to object, then object to
+ scene is a tiny tiny bit faster than the other way around and also saves
+ some realtime memory (if many objects are created from scripts, the
+ savings become important).
"""
def New (name = 'Scene'):
- """
- Create a new Scene in Blender.
- @type name: string
- @param name: The Scene name.
- @rtype: Blender Scene
- @return: The created Scene.
- """
+ """
+ Create a new Scene in Blender.
+ @type name: string
+ @param name: The Scene name.
+ @rtype: Blender Scene
+ @return: The created Scene.
+ """
def Get (name = None):
- """
- Get the Scene(s) from Blender.
- @type name: string
- @param name: The name of a Scene.
- @rtype: Blender Scene or a list of Blender Scenes
- @return: It depends on the I{name} parameter:
- - (name): The Scene with the given I{name};
- - (): A list with all Scenes currently in Blender.
- """
+ """
+ Get the Scene(s) from Blender.
+ @type name: string
+ @param name: The name of a Scene.
+ @rtype: Blender Scene or a list of Blender Scenes
+ @return: It depends on the I{name} parameter:
+ - (name): The Scene with the given I{name};
+ - (): A list with all Scenes currently in Blender.
+ """
def GetCurrent():
- """
- Get the currently active Scene in Blender.
- @rtype: Blender Scene
- @return: The currently active Scene.
- """
+ """
+ Get the currently active Scene in Blender.
+ @rtype: Blender Scene
+ @return: The currently active Scene.
+ """
def Unlink(scene):
- """
- Unlink (delete) a Scene from Blender.
- @type scene: Blender Scene
- @param scene: The Scene to be unlinked.
- """
-
+ """
+ Unlink (delete) a Scene from Blender.
+ @type scene: Blender Scene
+ @param scene: The Scene to be unlinked.
+ """
+
from IDProp import IDGroup, IDArray
class Scene:
- """
- The Scene object
- ================
- This object gives access to Scene data in Blender.
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
- scene's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
- @type name: string
- @ivar name: The Scene name.
- @type Layers: integer (bitmask)
- @ivar Layers: The Scene layers (check also the easier to use
- L{layers}). This value is a bitmask with at least
- one position set for the 20 possible layers starting from the low order
- bit. The easiest way to deal with these values in in hexadecimal
- notation.
- Example::
- scene.Layers = 0x04 # sets layer 3 ( bit pattern 0100 )
- scene.Layers |= 0x01
- print scene.Layers # will print: 5 ( meaning bit pattern 0101)
- After setting the Layers value, the interface (at least the 3d View and
- the Buttons window) needs to be redrawn to show the changes.
- @type layers: list of integers
- @ivar layers: The Scene layers (check also L{Layers}).
- This attribute accepts and returns a list of integer values in the
- range [1, 20].
- Example::
- scene.layers = [3] # set layer 3
- scene.layers = scene.layers.append(1)
- print scene.layers # will print: [1, 3]
- @type objects: sequence of objects
- @ivar objects: The scene's objects. The sequence supports the methods .link(ob), .unlink(ob), and .new(obdata), and can be iterated over.
- """
-
- def getName():
- """
- Get the name of this Scene.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Scene.
- @type name: string
- @param name: The new name.
- """
-
- def getLayers():
- """
- Get the layers set for this Scene.
- @rtype: list of integers
- @return: a list where each number means the layer with that number is
- set.
- """
-
- def setLayers(layers):
- """
- Set the visible layers for this scene.
- @type layers: list of integers
- @param layers: a list of integers in the range [1, 20], where each available
- index makes the layer with that number visible.
- @note: if this Scene is the current one, the 3D View layers are also
- updated, but the screen needs to be redrawn (at least 3D Views and
- Buttons windows) for the changes to be seen.
- """
-
- def copy(duplicate_objects = 1):
- """
- Make a copy of this Scene.
- @type duplicate_objects: int
- @param duplicate_objects: Defines how the Scene children are duplicated:
- - 0: Link Objects;
- - 1: Link Object Data;
- - 2: Full copy.
- @rtype: Scene
- @return: The copied Blender Scene.
- """
-
- def makeCurrent():
- """
- Make this Scene the currently active one in Blender.
- """
-
- def update(full = 0):
- """
- Update this Scene in Blender.
- @type full: int
- @param full: A bool to control the level of updating:
- - 0: sort the base list of objects.
- - 1: sort and also regroup, do ipos, keys, script links, etc.
- @warn: When in doubt, try with I{full = 0} first, since it is faster.
- The "full" update is a recent addition to this method.
- """
-
- def getRenderingContext():
- """
- Get the rendering context for this scene, see L{Render}.
- @rtype: RenderData
- @return: the render data object for this scene.
- """
-
- def getRadiosityContext():
- """
- Get the radiosity context for this scene, see L{Radio}.
- @rtype: Blender Radiosity
- @return: the radiosity object for this scene.
- @note: only the current scene can return a radiosity context.
- """
-
- def getChildren():
- """
- Get all objects linked to this Scene. (B{deprecated}). B{Note}: new scripts
- should use the L{objects} attribute instead. In cases where a list is
- required use list(scn.objects).
- @rtype: list of Blender Objects
- @return: A list with all Blender Objects linked to this Scene.
- @note: L{Object.Get} will return all objects currently in Blender, which
- means all objects from all available scenes. In most cases (exporter
- scripts, for example), it's probably better to use this
- scene.GetChildren instead, since it will only access objects from this
- particular scene.
- @warn: Depricated! use scene.objects instead.
- """
-
- def getActiveObject():
- """
- Get this scene's active object.
- @note: the active object, if selected, can also be retrieved with
- L{Object.GetSelected} -- it is the first item in the returned
- list. But even when no object is selected in Blender, there can be
- an active one (if the user enters editmode, for example, this is the
- object that should become available for edition). So what makes this
- scene method different from C{Object.GetSelected()[0]} is that it can
- return the active object even when no objects are selected.
- @rtype: Blender Object or None
- @return: the active object or None if not available.
- @warn: Depricated! use scene.objects.active instead.
- """
-
- def getCurrentCamera():
- """
- Get the currently active Camera for this Scene.
- @note: The active camera can be any object type, not just a camera object.
- @rtype: Blender Object
- @return: The currently active Camera object.
- """
-
- def setCurrentCamera(camera):
- """
- Set the currently active Camera in this Scene.
- @type camera: Blender Camera
- @param camera: The new active Camera.
- """
-
- def link(object):
- """
- Link an Object to this Scene.
- @type object: Blender Object
- @param object: A Blender Object.
- """
-
- def unlink(object):
- """
- Unlink an Object from this Scene.
- @type object: Blender Object
- @param object: A Blender Object.
- @rtype: boolean
- @return: true if object was found in the scene.
- """
-
- def getScriptLinks (event):
- """
- Get a list with this Scene's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this Scene. If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this Scene.
-
- Using OpenGL functions within a scene ScriptLink will draw graphics over the 3D view.
- There is an issue with the zoom of the floating panels also scaling graphics drawn by your scriptlink.
- This makes matching OpenGL graphics to mouse location impossible.
- Make sure that you use floating point for operations that you would usually use int functions for: glRasterPos2f rather then glRasterPos2i.
-
- The following example shows how you can use the OpenGL model view matrix to obtain the scale value.
-
- Example::
- from Blender import BGL
- view_matrix = BGL.Buffer(BGL.GL_FLOAT, 16)
- BGL.glGetFloatv(BGL.GL_MODELVIEW_MATRIX, view_matrix)
- gl_scale = 1/viewMatrix[0]
-
- # Now that we have the scale we can draw to the correct scale.
- BGL.glRect2f(10*gl_scale, 10*gl_scale, 110*gl_scale, 110*gl_scale)
-
-
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
- """
-
- def play (mode = 0, win = '<VIEW3D>'):
- """
- Play a realtime animation. This is the "Play Back Animation" function in
- Blender, different from playing a sequence of rendered images (for that
- check L{Render.RenderData.play}).
- @type mode: int
- @param mode: controls playing:
- - 0: keep playing in the biggest 'win' window;
- - 1: keep playing in all 'win', VIEW3D and SEQ windows;
- - 2: play once in the biggest VIEW3D;
- - 3: play once in all 'win', VIEW3D and SEQ windows.
- @type win: int
- @param win: window type, see L{Window.Types}. Only some of them are
- meaningful here: VIEW3D, SEQ, IPO, ACTION, NLA, SOUND. But the others
- are also accepted, since this function can be used simply as an
- interruptible timer. If 'win' is not visible or invalid, VIEW3D is
- tried, then any bigger visible window.
- @rtype: bool
- @return: 0 on normal exit or 1 when play back is canceled by user input.
- """
+ """
+ The Scene object
+ ================
+ This object gives access to Scene data in Blender.
+ @type Layers: integer (bitmask)
+ @ivar Layers: The Scene layers (check also the easier to use
+ L{layers}). This value is a bitmask with at least
+ one position set for the 20 possible layers starting from the low order
+ bit. The easiest way to deal with these values in in hexadecimal
+ notation.
+ Example::
+ scene.Layers = 0x04 # sets layer 3 ( bit pattern 0100 )
+ scene.Layers |= 0x01
+ print scene.Layers # will print: 5 ( meaning bit pattern 0101)
+ After setting the Layers value, the interface (at least the 3d View and
+ the Buttons window) needs to be redrawn to show the changes.
+ @type layers: list of integers
+ @ivar layers: The Scene layers (check also L{Layers}).
+ This attribute accepts and returns a list of integer values in the
+ range [1, 20].
+ Example::
+ scene.layers = [3] # set layer 3
+ scene.layers = scene.layers.append(1)
+ print scene.layers # will print: [1, 3]
+ @type objects: sequence of objects
+ @ivar objects: The scene's objects. The sequence supports the methods .link(ob), .unlink(ob), and .new(obdata), and can be iterated over.
+ """
+
+ def getName():
+ """
+ Get the name of this Scene.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Scene.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getLayers():
+ """
+ Get the layers set for this Scene.
+ @rtype: list of integers
+ @return: a list where each number means the layer with that number is set.
+ """
+
+ def setLayers(layers):
+ """
+ Set the visible layers for this scene.
+ @type layers: list of integers
+ @param layers: a list of integers in the range [1, 20], where each available
+ index makes the layer with that number visible.
+ @note: if this Scene is the current one, the 3D View layers are also
+ updated, but the screen needs to be redrawn (at least 3D Views and
+ Buttons windows) for the changes to be seen.
+ """
+
+ def copy(duplicate_objects = 1):
+ """
+ Make a copy of this Scene.
+ @type duplicate_objects: int
+ @param duplicate_objects: Defines how the Scene children are duplicated:
+ - 0: Link Objects;
+ - 1: Link Object Data;
+ - 2: Full copy.
+ @rtype: Scene
+ @return: The copied Blender Scene.
+ """
+
+ def makeCurrent():
+ """
+ Make this Scene the currently active one in Blender.
+ """
+
+ def update(full = 0):
+ """
+ Update this Scene in Blender.
+ @type full: int
+ @param full: A bool to control the level of updating:
+ - 0: sort the base list of objects.
+ - 1: sort and also regroup, do ipos, keys, script links, etc.
+ @warn: When in doubt, try with I{full = 0} first, since it is faster.
+ The "full" update is a recent addition to this method.
+ """
+
+ def getRenderingContext():
+ """
+ Get the rendering context for this scene, see L{Render}.
+ @rtype: RenderData
+ @return: the render data object for this scene.
+ """
+
+ def getRadiosityContext():
+ """
+ Get the radiosity context for this scene, see L{Radio}.
+ @rtype: Blender Radiosity
+ @return: the radiosity object for this scene.
+ @note: only the current scene can return a radiosity context.
+ """
+
+ def getChildren():
+ """
+ Get all objects linked to this Scene. (B{deprecated}). B{Note}: new scripts
+ should use the L{objects} attribute instead. In cases where a list is
+ required use list(scn.objects).
+ @rtype: list of Blender Objects
+ @return: A list with all Blender Objects linked to this Scene.
+ @note: L{Object.Get} will return all objects currently in Blender, which
+ means all objects from all available scenes. In most cases (exporter
+ scripts, for example), it's probably better to use this
+ scene.GetChildren instead, since it will only access objects from this
+ particular scene.
+ @warn: Depricated! use scene.objects instead.
+ """
+
+ def getActiveObject():
+ """
+ Get this scene's active object.
+ @note: the active object, if selected, can also be retrieved with
+ L{Object.GetSelected} -- it is the first item in the returned
+ list. But even when no object is selected in Blender, there can be
+ an active one (if the user enters editmode, for example, this is the
+ object that should become available for edition). So what makes this
+ scene method different from C{Object.GetSelected()[0]} is that it can
+ return the active object even when no objects are selected.
+ @rtype: Blender Object or None
+ @return: the active object or None if not available.
+ @warn: Depricated! use scene.objects.active instead.
+ """
+
+ def getCurrentCamera():
+ """
+ Get the currently active Camera for this Scene.
+ @note: The active camera can be any object type, not just a camera object.
+ @rtype: Blender Object
+ @return: The currently active Camera object.
+ """
+
+ def setCurrentCamera(camera):
+ """
+ Set the currently active Camera in this Scene.
+ @type camera: Blender Camera
+ @param camera: The new active Camera.
+ """
+
+ def link(object):
+ """
+ Link an Object to this Scene.
+ @type object: Blender Object
+ @param object: A Blender Object.
+ """
+
+ def unlink(object):
+ """
+ Unlink an Object from this Scene.
+ @type object: Blender Object
+ @param object: A Blender Object.
+ @rtype: boolean
+ @return: true if object was found in the scene.
+ """
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Scene's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks (links = None):
+ """
+ Delete script links from this Scene. If no list is specified, all
+ script links are deleted.
+ @type links: list of strings
+ @param links: None (default) or a list of Blender L{Text} names.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Scene.
+
+ Using OpenGL functions within a scene ScriptLink will draw graphics over the 3D view.
+ There is an issue with the zoom of the floating panels also scaling graphics drawn by your scriptlink.
+ This makes matching OpenGL graphics to mouse location impossible.
+ Make sure that you use floating point for operations that you would usually use int functions for: glRasterPos2f rather then glRasterPos2i.
+
+ The following example shows how you can use the OpenGL model view matrix to obtain the scale value.
+
+ Example::
+ from Blender import BGL
+ view_matrix = BGL.Buffer(BGL.GL_FLOAT, 16)
+ BGL.glGetFloatv(BGL.GL_MODELVIEW_MATRIX, view_matrix)
+ gl_scale = 1/viewMatrix[0]
+
+ # Now that we have the scale we can draw to the correct scale.
+ BGL.glRect2f(10*gl_scale, 10*gl_scale, 110*gl_scale, 110*gl_scale)
+
+
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged", "OnLoad", "OnSave", "Redraw" or "Render".
+ """
+
+ def play (mode = 0, win = '<VIEW3D>'):
+ """
+ Play a realtime animation. This is the "Play Back Animation" function in
+ Blender, different from playing a sequence of rendered images (for that
+ check L{Render.RenderData.play}).
+ @type mode: int
+ @param mode: controls playing:
+ - 0: keep playing in the biggest 'win' window;
+ - 1: keep playing in all 'win', VIEW3D and SEQ windows;
+ - 2: play once in the biggest VIEW3D;
+ - 3: play once in all 'win', VIEW3D and SEQ windows.
+ @type win: int
+ @param win: window type, see L{Window.Types}. Only some of them are
+ meaningful here: VIEW3D, SEQ, IPO, ACTION, NLA, SOUND. But the others
+ are also accepted, since this function can be used simply as an
+ interruptible timer. If 'win' is not visible or invalid, VIEW3D is
+ tried, then any bigger visible window.
+ @rtype: bool
+ @return: 0 on normal exit or 1 when play back is canceled by user input.
+ """
+
+import id_generics
+Scene.__doc__ += id_generics.attributes
+
class SceneObjects:
- """
- The SceneObjects (Scene ObjectSeq) object
- =========================================
- This object gives access to the Objects in a Scene in Blender.
-
- Example::
- from Blender import Scene
- scn = Scene.GetCurrent()
-
- scn.objects.selected = [] # select none
- scn.objects.selected = scn.objects # select all
- scn.objects.context = scn.objects # select all and move into the scenes display layer
-
- # get a list of mesh objects
- obs = [ob for ob in scn.objects if ob.type == 'Mesh']
-
- # Select only these mesh objects
- scn.objects.selected = obs
-
- # print all object names
- for ob in scn.objects: print ob.name
-
- # make a list of objects that you can add and remove to
- # will not affect the current scene
- scene_obs = list(scn.objects)
-
- @ivar selected: an iterator over all the selected objects in a scene.
- @type selected: sequence of L{Object}
- @ivar context: an iterator over all the visible selected objects in a scene.
- @type context: sequence of L{Object}
- @ivar active: the active object in the scene.
- @type active: L{Object}
- """
-
- def new(data):
- """
- Adds a new object to the scene. Data is either object data such as a
- L{Mesh} or L{Curve}, or the string "Empty" for an Empty object. The
- type of the object is determined by the type of the data.
- @type data: string or object data
- @param data: the object data for the new object
- @return: the new object.
- @rtype: L{Object}
- """
-
- def link(object):
- """
- Adds an existing object to the scene. If the object is already linked
- to the scene, no action is taken and no exception is raised.
- @type object: L{Object}
- @param object: the object
- @rtype: None
- """
-
- def unlink(object):
- """
- Removes an object from the scene. If the object is not linked
- to the scene, no action is taken and no exception is raised.
- @type object: L{Object}
- @param object: the object
- @rtype: None
- """
+ """
+ The SceneObjects (Scene ObjectSeq) object
+ =========================================
+ This object gives access to the Objects in a Scene in Blender.
+
+ Example::
+ from Blender import Scene
+ scn = Scene.GetCurrent()
+
+ scn.objects.selected = [] # select none
+ scn.objects.selected = scn.objects # select all
+ scn.objects.context = scn.objects # select all and move into the scenes display layer
+
+ # get a list of mesh objects
+ obs = [ob for ob in scn.objects if ob.type == 'Mesh']
+
+ # Select only these mesh objects
+ scn.objects.selected = obs
+
+ # print all object names
+ for ob in scn.objects: print ob.name
+
+ # make a list of objects that you can add and remove to
+ # will not affect the current scene
+ scene_obs = list(scn.objects)
+
+ @ivar selected: an iterator over all the selected objects in a scene.
+ @type selected: sequence of L{Object}
+ @ivar context: an iterator over all the visible selected objects in a scene.
+ @type context: sequence of L{Object}
+ @ivar active: the active object in the scene.
+ @type active: L{Object}
+ """
+
+ def new(data):
+ """
+ Adds a new object to the scene. Data is either object data such as a
+ L{Mesh} or L{Curve}, or the string "Empty" for an Empty object. The
+ type of the object is determined by the type of the data.
+ @type data: string or object data
+ @param data: the object data for the new object
+ @return: the new object.
+ @rtype: L{Object}
+ """
+
+ def link(object):
+ """
+ Adds an existing object to the scene. If the object is already linked
+ to the scene, no action is taken and no exception is raised.
+ @type object: L{Object}
+ @param object: the object
+ @rtype: None
+ """
+
+ def unlink(object):
+ """
+ Removes an object from the scene. If the object is not linked
+ to the scene, no action is taken and no exception is raised.
+ @type object: L{Object}
+ @param object: the object
+ @rtype: None
+ """
diff --git a/source/blender/python/api2_2x/doc/Sound.py b/source/blender/python/api2_2x/doc/Sound.py
index 91c30f5540e..bc3a929ec15 100644
--- a/source/blender/python/api2_2x/doc/Sound.py
+++ b/source/blender/python/api2_2x/doc/Sound.py
@@ -9,13 +9,13 @@ Sound
This module provides access to B{Sound} objects in Blender.
Example::
- import Blender
- from Blender import Sound
- #
- sound = Sound.Load("/path/to/my/sound.wav") # load a sound file
- print "Sound from", sound.filename,
- print "loaded to obj", sound.name
- print "All Sounds available now:", Sound.Get()
+ import Blender
+ from Blender import Sound
+ #
+ sound = Sound.Load("/path/to/my/sound.wav") # load a sound file
+ print "Sound from", sound.filename,
+ print "loaded to obj", sound.name
+ print "All Sounds available now:", Sound.Get()
No way to get the actual audio data is provided by this library,
but it is included in the Python standard library (module audioop).
@@ -23,125 +23,125 @@ Note that using that module requires a full/normal Python installation.
"""
def Load (filename):
- """
- Load the sound called 'filename' into a Sound object.
- @type filename: string
- @param filename: The full path to the sound file.
- @rtype: Blender Sound
- @return: A Blender Sound object with the data from I{filename}.
- """
+ """
+ Load the sound called 'filename' into a Sound object.
+ @type filename: string
+ @param filename: The full path to the sound file.
+ @rtype: Blender Sound
+ @return: A Blender Sound object with the data from I{filename}.
+ """
def Get (name = None):
- """
- Get the Sound object(s) from Blender.
- @type name: string
- @param name: The name of the Sound object.
- @rtype: Blender Sound or a list of Blender Sounds
- @return: It depends on the I{name} parameter:
- - (name): The Sound object called I{name}, None if not found;
- - (): A list with all Sound objects in the current scene.
- """
+ """
+ Get the Sound object(s) from Blender.
+ @type name: string
+ @param name: The name of the Sound object.
+ @rtype: Blender Sound or a list of Blender Sounds
+ @return: It depends on the I{name} parameter:
+ - (name): The Sound object called I{name}, None if not found;
+ - (): A list with all Sound objects in the current scene.
+ """
class Sound:
- """
- The Sound object
- ================
- This object gives access to Sounds in Blender.
- @ivar name: The name of this Sound object.
- @ivar filename: The filename (path) to the sound file loaded into this Sound
- @ivar packed: Boolean, True when the sample is packed (readonly).
- object.
- """
-
- def getName():
- """
- Get the name of this Sound object.
- @rtype: string
- """
-
- def getFilename():
- """
- Get the filename of the sound file loaded into this Sound object.
- @rtype: string
- """
-
- def setName():
- """
- Set the name of this Sound object.
- @rtype: None
- """
-
- def setFilename():
- """
- Set the filename of the sound file loaded into this Sound object.
- @rtype: None
- """
-
- def setCurrent():
- """
- Make this the active sound in the sound buttons window (also redraws).
- """
-
- def play():
- """
- Play this sound.
- """
-
- def getVolume():
- """
- Get this sound's volume.
- rtype: float
- """
-
- def setVolume(f):
- """
- Set this sound's volume.
- @type f: float
- @param f: the new volume value in the range [0.0, 1.0].
- """
-
- def getAttenuation():
- """
- Get this sound's attenuation value.
- rtype: float
- """
-
- def setAttenuation(f):
- """
- Set this sound's attenuation.
- @type f: float
- @param f: the new attenuation value in the range [0.0, 5.0].
- """
-
- def getPitch():
- """
- Get this sound's pitch value.
- rtype: float
- """
-
- def setPitch(f):
- """
- Set this sound's pitch.
- @type f: float
- @param f: the new pitch value in the range [-12.0, 12.0].
- """
-
- def pack():
- """
- Packs the sound into the current blend file.
- @note: An error will be raised if the sound is already packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- """
-
- def unpack(mode):
- """
- Unpacks the sound to the samples filename.
- @param mode: One of the values in Blender.Unpackmodes dict.
- @note: An error will be raised if the sound is not packed or the filename path does not exist.
- @returns: nothing
- @rtype: none
- @type mode: int
- """
-
+ """
+ The Sound object
+ ================
+ This object gives access to Sounds in Blender.
+ @ivar filename: The filename (path) to the sound file loaded into this Sound
+ @ivar packed: Boolean, True when the sample is packed (readonly).
+ """
+
+ def getName():
+ """
+ Get the name of this Sound object.
+ @rtype: string
+ """
+
+ def getFilename():
+ """
+ Get the filename of the sound file loaded into this Sound object.
+ @rtype: string
+ """
+
+ def setName():
+ """
+ Set the name of this Sound object.
+ @rtype: None
+ """
+
+ def setFilename():
+ """
+ Set the filename of the sound file loaded into this Sound object.
+ @rtype: None
+ """
+
+ def setCurrent():
+ """
+ Make this the active sound in the sound buttons window (also redraws).
+ """
+
+ def play():
+ """
+ Play this sound.
+ """
+
+ def getVolume():
+ """
+ Get this sound's volume.
+ rtype: float
+ """
+
+ def setVolume(f):
+ """
+ Set this sound's volume.
+ @type f: float
+ @param f: the new volume value in the range [0.0, 1.0].
+ """
+
+ def getAttenuation():
+ """
+ Get this sound's attenuation value.
+ rtype: float
+ """
+
+ def setAttenuation(f):
+ """
+ Set this sound's attenuation.
+ @type f: float
+ @param f: the new attenuation value in the range [0.0, 5.0].
+ """
+
+ def getPitch():
+ """
+ Get this sound's pitch value.
+ rtype: float
+ """
+
+ def setPitch(f):
+ """
+ Set this sound's pitch.
+ @type f: float
+ @param f: the new pitch value in the range [-12.0, 12.0].
+ """
+
+ def pack():
+ """
+ Packs the sound into the current blend file.
+ @note: An error will be raised if the sound is already packed or the filename path does not exist.
+ @returns: nothing
+ @rtype: none
+ """
+
+ def unpack(mode):
+ """
+ Unpacks the sound to the samples filename.
+ @param mode: One of the values in Blender.Unpackmodes dict.
+ @note: An error will be raised if the sound is not packed or the filename path does not exist.
+ @returns: nothing
+ @rtype: none
+ @type mode: int
+ """
+
+import id_generics
+Sound.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Text.py b/source/blender/python/api2_2x/doc/Text.py
index ad37de8171c..78fa304043d 100644
--- a/source/blender/python/api2_2x/doc/Text.py
+++ b/source/blender/python/api2_2x/doc/Text.py
@@ -9,126 +9,128 @@ Text Objects
This module provides access to B{Text} objects in Blender.
Example::
- import Blender
- from Blender import Text
- #
- txt = Text.New("MyText") # create a new Text object
- print Text.Get() # current list of Texts in Blender
- txt.write("Appending some ") # appending text
- txt.write("text to my\\n") # '\\n' inserts new-line markers
- txt.write("text buffer.")
- print txt.asLines() # retrieving the buffer as a list of lines
- Text.unlink(txt) # removing a Text object
+ import Blender
+ from Blender import Text
+ #
+ txt = Text.New("MyText") # create a new Text object
+ print Text.Get() # current list of Texts in Blender
+ txt.write("Appending some ") # appending text
+ txt.write("text to my\\n") # '\\n' inserts new-line markers
+ txt.write("text buffer.")
+ print txt.asLines() # retrieving the buffer as a list of lines
+ Text.unlink(txt) # removing a Text object
"""
def New (name = None, follow_cursor = 0):
- """
- Create a new Text object.
- @type name: string
- @param name: The Text name.
- @type follow_cursor: int
- @param follow_cursor: The text follow flag: if 1, the text display always
- follows the cursor.
- @rtype: Blender Text
- @return: The created Text Data object.
- """
+ """
+ Create a new Text object.
+ @type name: string
+ @param name: The Text name.
+ @type follow_cursor: int
+ @param follow_cursor: The text follow flag: if 1, the text display always
+ follows the cursor.
+ @rtype: Blender Text
+ @return: The created Text Data object.
+ """
def Get (name = None):
- """
- Get the Text object(s) from Blender.
- @type name: string
- @param name: The name of the Text object.
- @rtype: Blender Text or a list of Blender Texts
- @return: It depends on the 'name' parameter:
- - (name): The Text object with the given name;
- - (): A list with all Text objects in the current scene.
- """
+ """
+ Get the Text object(s) from Blender.
+ @type name: string
+ @param name: The name of the Text object.
+ @rtype: Blender Text or a list of Blender Texts
+ @return: It depends on the 'name' parameter:
+ - (name): The Text object with the given name;
+ - (): A list with all Text objects in the current scene.
+ """
def Load (filename):
- """
- Load a file into a Blender Text object.
- @type filename: string
- @param filename: The name of the file to load.
- @rtype: Blender Text
- @return: A Text object with the contents of the loaded file.
- """
+ """
+ Load a file into a Blender Text object.
+ @type filename: string
+ @param filename: The name of the file to load.
+ @rtype: Blender Text
+ @return: A Text object with the contents of the loaded file.
+ """
def unlink(textobj):
- """
- Unlink (remove) the given Text object from Blender.
- @type textobj: Blender Text
- @param textobj: The Text object to be deleted.
- """
+ """
+ Unlink (remove) the given Text object from Blender.
+ @type textobj: Blender Text
+ @param textobj: The Text object to be deleted.
+ """
class Text:
- """
- The Text object
- ===============
- This object gives access to Texts in Blender.
- @ivar name: The Text name.
- @ivar filename: The filename of the file loaded into this Text.
- @ivar mode: The follow_mode flag: if 1 it is 'on'; if 0, 'off'.
- @ivar nlines: The number of lines in this Text.
- """
-
- def getName():
- """
- Get the name of this Text object.
- @rtype: string
- """
-
- def setName(name):
- """
- Set the name of this Text object.
- @type name: string
- @param name: The new name.
- """
-
- def getFilename():
- """
- Get the filename of the file loaded into this Text object.
- @rtype: string
- """
-
- def getNLines():
- """
- Get the number of lines in this Text buffer.
- @rtype: int
- """
-
- def clear():
- """
- Clear this Text object: its buffer becomes empty.
- """
-
- def set(attribute, value):
- """
- Set this Text's attributes.
- @type attribute: string
- @param attribute: The attribute to change:
- currently, 'follow_cursor' is the only one available. It can be
- turned 'on' with value = 1 and 'off' with value = 0.
- @type value: int
- @param value: The new attribute value.
- """
-
- def write(data):
- """
- Append a string to this Text buffer.
- @type data: string
- @param data: The string to append to the text buffer.
- """
-
- def asLines():
- """
- Retrieve the contents of this Text buffer as a list of strings.
- @rtype: list of strings
- @return: A list of strings, one for each line in the buffer
- """
-
- def makeCurrent():
- """
- Display this text in the current 3d view if any
- @rtype: None
- @return: None
- """ \ No newline at end of file
+ """
+ The Text object
+ ===============
+ This object gives access to Texts in Blender.
+ @ivar filename: The filename of the file loaded into this Text.
+ @ivar mode: The follow_mode flag: if 1 it is 'on'; if 0, 'off'.
+ @ivar nlines: The number of lines in this Text.
+ """
+
+ def getName():
+ """
+ Get the name of this Text object.
+ @rtype: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Text object.
+ @type name: string
+ @param name: The new name.
+ """
+
+ def getFilename():
+ """
+ Get the filename of the file loaded into this Text object.
+ @rtype: string
+ """
+
+ def getNLines():
+ """
+ Get the number of lines in this Text buffer.
+ @rtype: int
+ """
+
+ def clear():
+ """
+ Clear this Text object: its buffer becomes empty.
+ """
+
+ def set(attribute, value):
+ """
+ Set this Text's attributes.
+ @type attribute: string
+ @param attribute: The attribute to change:
+ currently, 'follow_cursor' is the only one available. It can be
+ turned 'on' with value = 1 and 'off' with value = 0.
+ @type value: int
+ @param value: The new attribute value.
+ """
+
+ def write(data):
+ """
+ Append a string to this Text buffer.
+ @type data: string
+ @param data: The string to append to the text buffer.
+ """
+
+ def asLines():
+ """
+ Retrieve the contents of this Text buffer as a list of strings.
+ @rtype: list of strings
+ @return: A list of strings, one for each line in the buffer
+ """
+
+ def makeCurrent():
+ """
+ Display this text in the current 3d view if any
+ @rtype: None
+ @return: None
+ """
+
+import id_generics
+Text.__doc__ += id_generics.attributes \ No newline at end of file
diff --git a/source/blender/python/api2_2x/doc/Text3d.py b/source/blender/python/api2_2x/doc/Text3d.py
index fc4815ba057..15fda10aeb5 100644
--- a/source/blender/python/api2_2x/doc/Text3d.py
+++ b/source/blender/python/api2_2x/doc/Text3d.py
@@ -9,278 +9,279 @@ Text3d Objects
This module provides access to B{Font} objects in Blender.
Example::
- import Blender
- from Blender import Curve, Object, Scene, Text3d
- txt = Text3d.New("MyText") # create a new Text3d object called MyText
- scn = Scene.GetCurrent() # get current scene
- ob = scn.objects.new(txt) # create an object from the obdata in the current scene
- ob.makeDisplayList() # rebuild the display list for this object
- Window.RedrawAll()
+ import Blender
+ from Blender import Curve, Object, Scene, Text3d
+ txt = Text3d.New("MyText") # create a new Text3d object called MyText
+ scn = Scene.GetCurrent() # get current scene
+ ob = scn.objects.new(txt) # create an object from the obdata in the current scene
+ ob.makeDisplayList() # rebuild the display list for this object
+ Window.RedrawAll()
"""
def New (name = None):
- """
- Create a new Text3d object.
- @type name: string
- @param name: The name for the new object..
- @rtype: Blender Text3d
- @return: The created Text3d Data object.
- """
+ """
+ Create a new Text3d object.
+ @type name: string
+ @param name: The name for the new object..
+ @rtype: Blender Text3d
+ @return: The created Text3d Data object.
+ """
def Get (name = None):
- """
- Get the Text3d object(s) from Blender.
- @type name: string
- @param name: The name of the Text3d object.
- @rtype: Blender Text3d or a list of Blender Text3ds
- @return: It depends on the 'name' parameter:
- - (name): The Text3d object with the given name;
- - (): A list with all Text3d objects in the current scene.
- """
+ """
+ Get the Text3d object(s) from Blender.
+ @type name: string
+ @param name: The name of the Text3d object.
+ @rtype: Blender Text3d or a list of Blender Text3d's
+ @return: It depends on the 'name' parameter:
+ - (name): The Text3d object with the given name;
+ - (): A list with all Text3d objects in the current scene.
+ """
class Text3d:
- """
- The Text3d object
- =================
- This object gives access Blender's B{Font} objects
- @ivar name: The Text3d name.
- @ivar filename: The filename of the file loaded into this Text.
- @ivar mode: The follow_mode flag: if 1 it is 'on'; if 0, 'off'.
- @ivar nlines: The number of lines in this Text.
- """
-
- def getName():
- """
- Get the name of this Text3d object.
- @rtype: string
- """
-
- def setName( name ):
- """
- Set the name of this Text3d object.
- @type name: string
- @param name: The new name.
- @returns: None
- """
-
- def getText():
- """
- Get text string for this object
- @rtype: string
- """
-
- def setText( name ):
- """
- Set the text string in this Text3d object
- @type name: string
- @param name: The new text string for this object.
- @returns: None
- """
-
- def getDrawMode():
- """
- Get the drawing mode (3d, front, and/or back)
- Gets the text3d's drawing modes. Uses module constants
- - DRAW3D : "3D" is set
- - DRAWFRONT : "Front" is set
- - DRAWBACK : "Back" is set
- @rtype: tuple of module constants
- """
-
- def setDrawMode(val):
- """
- Set the text3d's drawing mode. Uses module constants
- - DRAW3D
- - DRAWFRONT
- - DRAWBACK
- @rtype: None
- @type val: single module constant or tuple of module constants
- @param val : The Text3d's modes. See L{getDrawMode} for the meaning of
- the constants.
- """
-
- def getUVordco():
- """
- Return whether UV coords are used for Texture mapping
- """
-
- def setUVordco(val):
- """
- Set the font to use UV coords for Texture mapping
- """
-
- def getBevelAmount():
- """
- Get the Text3d's bevel resolution value.
- @rtype: float
- """
-
- def setBevelAmount(bevelresol):
- """
- Set the Text3d's bevel resolution value.
- @rtype: None
- @type bevelresol: float
- @param bevelresol: The new Curve's bevel resolution value.
- """
-
- def getDefaultResolution():
- """
- Return Default text resolution.
- @rtype: float
- """
-
- def setDefaultResolution(resolu):
- """
- Sets Default text Resolution.
- @rtype: None
- @type resolu: float
- @param resolu: The new Curve's U-resolution value.
- """
-
- def getWidth():
- """
- Get the Text3d's width value.
- @rtype: float
- """
-
- def setWidth(width):
- """
- Set the Text3d's width value.
- @rtype: None
- @type width: float
- @param width: The new text3d's width value.
- """
-
- def getgetExtrudeDepth():
- """
- Get the text3d's ext1 value.
- @rtype: float
- """
-
- def setgetExtrudeDepth(ext1):
- """
- Set the text3d's ext1 value.
- @rtype: None
- @type ext1: float
- @param ext1: The new text3d's ext1 value.
- """
-
- def getExtrudeBevelDepth():
- """
- Get the text3d's ext2 value.
- @rtype: float
- """
-
- def setExtrudeBevelDepth(ext2):
- """
- Set the text3d's ext2 value.
- @rtype: None
- @type ext2: float
- @param ext2: The new text3d's ext2 value.
- """
-
- def getShear():
- """
- Get the text3d's shear value.
- @rtype: float
- """
-
- def setShear(shear):
- """
- Set the text3d's shear value.
- @rtype: None
- @type shear: float
- @param shear: The new text3d's shear value.
- """
-
- def getSize():
- """
- Get the text3d's size value.
- @rtype: float
- """
-
- def setSize(size):
- """
- Set the text3d's size value.
- @rtype: None
- @type size: float
- @param size: The new text3d's size value.
- """
-
- def getLineSeparation():
- """
- Get the text3d's ext2 value.
- @rtype: float
- """
-
- def setLineSeparation(sep):
- """
- Set the text3d's ext2 value.
- @rtype: None
- @type sep: float
- @param sep: The new text3d's separation value.
- """
-
- def getSpacing():
- """
- Get the text3d's spacing value.
- @rtype: float
- """
-
- def setSpacing(spacing):
- """
- Set the text3d's spacing value.
- @rtype: None
- @type spacing: float
- @param spacing: The new text3d's spacing value.
- """
-
- def getXoffset():
- """
- Get the text3d's Xoffset value.
- @rtype: float
- """
-
- def setXoffset(xof):
- """
- Set the text3d's Xoffset value.
- @rtype: None
- @type xof: float
- @param xof: The new text3d's Xoffset value.
- """
-
- def getYoffset():
- """
- Get the text3d's Yoffset value.
- @rtype: float
- """
-
- def setYoffset(yof):
- """
- Set the text3d's Yoffset value.
- @rtype: None
- @type yof: float
- @param yof: The new text3d's Yoffset value.
- """
-
- def getAlignment():
- """
- Get the text3d's alignment value. Uses module constants
- - LEFT
- - RIGHT
- - MIDDLE
- - FLUSH
- @rtype: module constant
- """
-
- def setAlignment(align):
- """
- Set the text3d's Alignment value. Uses module constants
- - LEFT
- - RIGHT
- - MIDDLE
- - FLUSH
- @rtype: None
- @type align: module constant
- @param align: The new text3d's Alignment value.
- """
-
+ """
+ The Text3d object
+ =================
+ This object gives access Blender's B{Font} objects
+ @ivar filename: The filename of the file loaded into this Text.
+ @ivar mode: The follow_mode flag: if 1 it is 'on'; if 0, 'off'.
+ @ivar nlines: The number of lines in this Text.
+ """
+
+ def getName():
+ """
+ Get the name of this Text3d object.
+ @rtype: string
+ """
+
+ def setName( name ):
+ """
+ Set the name of this Text3d object.
+ @type name: string
+ @param name: The new name.
+ @returns: None
+ """
+
+ def getText():
+ """
+ Get text string for this object
+ @rtype: string
+ """
+
+ def setText( name ):
+ """
+ Set the text string in this Text3d object
+ @type name: string
+ @param name: The new text string for this object.
+ @returns: None
+ """
+
+ def getDrawMode():
+ """
+ Get the drawing mode (3d, front, and/or back)
+ Gets the text3d's drawing modes. Uses module constants
+ - DRAW3D : "3D" is set
+ - DRAWFRONT : "Front" is set
+ - DRAWBACK : "Back" is set
+ @rtype: tuple of module constants
+ """
+
+ def setDrawMode(val):
+ """
+ Set the text3d's drawing mode. Uses module constants
+ - DRAW3D
+ - DRAWFRONT
+ - DRAWBACK
+ @rtype: None
+ @type val: single module constant or tuple of module constants
+ @param val : The Text3d's modes. See L{getDrawMode} for the meaning of
+ the constants.
+ """
+
+ def getUVordco():
+ """
+ Return whether UV coords are used for Texture mapping
+ """
+
+ def setUVordco(val):
+ """
+ Set the font to use UV coords for Texture mapping
+ """
+
+ def getBevelAmount():
+ """
+ Get the Text3d's bevel resolution value.
+ @rtype: float
+ """
+
+ def setBevelAmount(bevelresol):
+ """
+ Set the Text3d's bevel resolution value.
+ @rtype: None
+ @type bevelresol: float
+ @param bevelresol: The new Curve's bevel resolution value.
+ """
+
+ def getDefaultResolution():
+ """
+ Return Default text resolution.
+ @rtype: float
+ """
+
+ def setDefaultResolution(resolu):
+ """
+ Sets Default text Resolution.
+ @rtype: None
+ @type resolu: float
+ @param resolu: The new Curve's U-resolution value.
+ """
+
+ def getWidth():
+ """
+ Get the Text3d's width value.
+ @rtype: float
+ """
+
+ def setWidth(width):
+ """
+ Set the Text3d's width value.
+ @rtype: None
+ @type width: float
+ @param width: The new text3d's width value.
+ """
+
+ def getgetExtrudeDepth():
+ """
+ Get the text3d's ext1 value.
+ @rtype: float
+ """
+
+ def setgetExtrudeDepth(ext1):
+ """
+ Set the text3d's ext1 value.
+ @rtype: None
+ @type ext1: float
+ @param ext1: The new text3d's ext1 value.
+ """
+
+ def getExtrudeBevelDepth():
+ """
+ Get the text3d's ext2 value.
+ @rtype: float
+ """
+
+ def setExtrudeBevelDepth(ext2):
+ """
+ Set the text3d's ext2 value.
+ @rtype: None
+ @type ext2: float
+ @param ext2: The new text3d's ext2 value.
+ """
+
+ def getShear():
+ """
+ Get the text3d's shear value.
+ @rtype: float
+ """
+
+ def setShear(shear):
+ """
+ Set the text3d's shear value.
+ @rtype: None
+ @type shear: float
+ @param shear: The new text3d's shear value.
+ """
+
+ def getSize():
+ """
+ Get the text3d's size value.
+ @rtype: float
+ """
+
+ def setSize(size):
+ """
+ Set the text3d's size value.
+ @rtype: None
+ @type size: float
+ @param size: The new text3d's size value.
+ """
+
+ def getLineSeparation():
+ """
+ Get the text3d's ext2 value.
+ @rtype: float
+ """
+
+ def setLineSeparation(sep):
+ """
+ Set the text3d's ext2 value.
+ @rtype: None
+ @type sep: float
+ @param sep: The new text3d's separation value.
+ """
+
+ def getSpacing():
+ """
+ Get the text3d's spacing value.
+ @rtype: float
+ """
+
+ def setSpacing(spacing):
+ """
+ Set the text3d's spacing value.
+ @rtype: None
+ @type spacing: float
+ @param spacing: The new text3d's spacing value.
+ """
+
+ def getXoffset():
+ """
+ Get the text3d's Xoffset value.
+ @rtype: float
+ """
+
+ def setXoffset(xof):
+ """
+ Set the text3d's Xoffset value.
+ @rtype: None
+ @type xof: float
+ @param xof: The new text3d's Xoffset value.
+ """
+
+ def getYoffset():
+ """
+ Get the text3d's Yoffset value.
+ @rtype: float
+ """
+
+ def setYoffset(yof):
+ """
+ Set the text3d's Yoffset value.
+ @rtype: None
+ @type yof: float
+ @param yof: The new text3d's Yoffset value.
+ """
+
+ def getAlignment():
+ """
+ Get the text3d's alignment value. Uses module constants
+ - LEFT
+ - RIGHT
+ - MIDDLE
+ - FLUSH
+ @rtype: module constant
+ """
+
+ def setAlignment(align):
+ """
+ Set the text3d's Alignment value. Uses module constants
+ - LEFT
+ - RIGHT
+ - MIDDLE
+ - FLUSH
+ @rtype: None
+ @type align: module constant
+ @param align: The new text3d's Alignment value.
+ """
+
+import id_generics
+Text3d.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py
index ab10299349f..34093bef6c7 100644
--- a/source/blender/python/api2_2x/doc/Texture.py
+++ b/source/blender/python/api2_2x/doc/Texture.py
@@ -8,8 +8,8 @@
The Blender.Texture submodule.
B{New}:
- - many new attributes in L{MTex} submodule
- - new dictionaries (L{Texture.BlendModes}, L{Texture.Mappings}, L{Texture.Proj}) to use for the values of some of the new L{MTex} attributes.
+ - many new attributes in L{MTex} submodule
+ - new dictionaries (L{Texture.BlendModes}, L{Texture.Mappings}, L{Texture.Proj}) to use for the values of some of the new L{MTex} attributes.
Texture
=======
@@ -17,244 +17,242 @@ Texture
This module provides access to B{Texture} objects in Blender.
Example::
-
- from Blender import Texture,Image,Material
-
- footex = Texture.Get('foo') # get texture named 'foo'
- footex.setType('Image') # make foo be an image texture
- img = Image.Load('test.png') # load an image
- footex.image = img # link the image to the texture
+
+ from Blender import Texture,Image,Material
+
+ footex = Texture.Get('foo') # get texture named 'foo'
+ footex.setType('Image') # make foo be an image texture
+ img = Image.Load('test.png') # load an image
+ footex.image = img # link the image to the texture
- mat = Material.Get('bar') # get a material
- mtextures = mat.getTextures() # get a list of the MTex objects
- for mtex in mtextures:
- if mtex.tex.type == Texture.Types.IMAGE:
- print mtex.tex.image.filename # print the filenames of all the
- # images in textures linked to "bar"
+ mat = Material.Get('bar') # get a material
+ mtextures = mat.getTextures() # get a list of the MTex objects
+ for mtex in mtextures:
+ if mtex.tex.type == Texture.Types.IMAGE:
+ print mtex.tex.image.filename # print the filenames of all the
+ # images in textures linked to "bar"
- mat.setTexture(0, footex) # set the material's first texture
- # to be our texture
+ mat.setTexture(0, footex) # set the material's first texture
+ # to be our texture
@type Types: readonly dictionary
@var Types: The available texture types:
- - NONE - No texture
- - CLOUDS - Clouds texture
- - WOOD - Wood texture
- - MARBLE - Marble texture
- - MAGIC - Magic texture
- - BLEND - Blend texture
- - STUCCI - Stucci texture
- - NOISE - Noise texture
- - IMAGE - Image texture
- - PLUGIN - Plugin texture
- - ENVMAP - EnvMap texture
- - MUSGRAVE - Musgrave procedural texture
- - VORONOI - Voronoi procedural texture
- - DISTNOISE - Distorted noise texture
+ - NONE - No texture
+ - CLOUDS - Clouds texture
+ - WOOD - Wood texture
+ - MARBLE - Marble texture
+ - MAGIC - Magic texture
+ - BLEND - Blend texture
+ - STUCCI - Stucci texture
+ - NOISE - Noise texture
+ - IMAGE - Image texture
+ - PLUGIN - Plugin texture
+ - ENVMAP - EnvMap texture
+ - MUSGRAVE - Musgrave procedural texture
+ - VORONOI - Voronoi procedural texture
+ - DISTNOISE - Distorted noise texture
@type Flags: readonly dictionary
@var Flags: The available Texture flags:
- - FLIPBLEND - Flips the blend texture's X and Y directions
- - NEGALPHA - Reverse the alpha value
- - CHECKER_ODD - Fill the "odd" checkerboard tiles
- - CHECKER_EVEN - Fill the "even" checkerboard tiles
+ - FLIPBLEND - Flips the blend texture's X and Y directions
+ - NEGALPHA - Reverse the alpha value
+ - CHECKER_ODD - Fill the "odd" checkerboard tiles
+ - CHECKER_EVEN - Fill the "even" checkerboard tiles
@type ImageFlags: readonly dictionary
@var ImageFlags: The available image flags for Texture.imageFlags:
- - INTERPOL - Interpolate pixels of the image
- - USEALPHA - Use the alpha layer
- - MIPMAP - Enable mipmapping [cannot be used with FIELDS]
- - FIELDS - Work with field images [cannot be used with MIPMAP]
- - ROT90 - Rotate the image 90 degrees when rendering
- - CALCALPHA - Calculate an alpha from the RGB
- - STFIELD - Denotes this is a standard field
- - MOVIE - Use a movie for an image
- - CYCLIC - Repeat animation image
- - ANTI - Use anti-aliasing
- - NORMALMAP - Use image RGB values for normal mapping
+ - INTERPOL - Interpolate pixels of the image
+ - USEALPHA - Use the alpha layer
+ - MIPMAP - Enable mipmapping [cannot be used with FIELDS]
+ - FIELDS - Work with field images [cannot be used with MIPMAP]
+ - ROT90 - Rotate the image 90 degrees when rendering
+ - CALCALPHA - Calculate an alpha from the RGB
+ - STFIELD - Denotes this is a standard field
+ - MOVIE - Use a movie for an image
+ - CYCLIC - Repeat animation image
+ - ANTI - Use anti-aliasing
+ - NORMALMAP - Use image RGB values for normal mapping
@type ExtendModes: readonly dictionary
@var ExtendModes: Extend, clip, repeat or checker modes for image textures
- - EXTEND - Extends the colour of the edge
- - CLIP - Return alpha 0.0 outside image
- - CLIPCUBE - Return alpha 0.0 around cube-shaped area around image
- - REPEAT - Repeat image vertically and horizontally
- - CHECKER - Repeat image in checkerboard pattern
+ - EXTEND - Extends the colour of the edge
+ - CLIP - Return alpha 0.0 outside image
+ - CLIPCUBE - Return alpha 0.0 around cube-shaped area around image
+ - REPEAT - Repeat image vertically and horizontally
+ - CHECKER - Repeat image in checkerboard pattern
@type Noise: readonly dictionary
@var Noise: Noise types and bases. SINE, SAW and TRI are only used for
- marble and wood textures, while the remainder are used for all textures
- which has a noise basis function (for these textures, the constant should
- be used with the second noise basis setting).
- - SINE - Produce bands using sine wave (marble, wood textures)
- - SAW - Produce bands using saw wave (marble, wood textures)
- - TRI - Produce bands using triangle wave (marble, wood textures)
- - BLENDER - Original Blender algorithm
- - PERLIN - Ken Perlin's original (1985) algorithm
- - IMPROVEDPERLIN - Ken Perlin's newer (2002) algorithm
- - VORONOIF1 - none
- - VORONOIF2 - none
- - VORONOIF3 - none
- - VORONOIF4 - none
- - VORONOIF2F1 - none
- - VORONOICRACKLE - none
- - CELLNOISE - Steven Worley's cellular basis algorithm (1996)
+ marble and wood textures, while the remainder are used for all textures
+ which has a noise basis function (for these textures, the constant should
+ be used with the second noise basis setting).
+ - SINE - Produce bands using sine wave (marble, wood textures)
+ - SAW - Produce bands using saw wave (marble, wood textures)
+ - TRI - Produce bands using triangle wave (marble, wood textures)
+ - BLENDER - Original Blender algorithm
+ - PERLIN - Ken Perlin's original (1985) algorithm
+ - IMPROVEDPERLIN - Ken Perlin's newer (2002) algorithm
+ - VORONOIF1 - none
+ - VORONOIF2 - none
+ - VORONOIF3 - none
+ - VORONOIF4 - none
+ - VORONOIF2F1 - none
+ - VORONOICRACKLE - none
+ - CELLNOISE - Steven Worley's cellular basis algorithm (1996)
@type BlendModes: readonly dictionary
@var BlendModes: The available texture blending modes:
- - MIX - mix texture with value
- - MULTIPLY - multiply texture with value
- - ADD - add texture to value
- - SUBTRACT - subtract texture from value
- - DIVIDE - divide value by texture
- - DARKEN - replace value with texture if texture is darker
- - DIFFERENCE - difference of texture from value
- - LIGHTEN - replace value with texture if texture is lighter
- - SCREEN - 'screen' mode
+ - MIX - mix texture with value
+ - MULTIPLY - multiply texture with value
+ - ADD - add texture to value
+ - SUBTRACT - subtract texture from value
+ - DIVIDE - divide value by texture
+ - DARKEN - replace value with texture if texture is darker
+ - DIFFERENCE - difference of texture from value
+ - LIGHTEN - replace value with texture if texture is lighter
+ - SCREEN - 'screen' mode
@type Mappings: readonly dictionary
@var Mappings: The available 2D texture coordinate mappings for images:
- - FLAT - flat projection
- - CUBE - cube projection
- - TUBE - cylindrical projection
- - SPHERE - spherical projection
+ - FLAT - flat projection
+ - CUBE - cube projection
+ - TUBE - cylindrical projection
+ - SPHERE - spherical projection
@type Proj: readonly dictionary
@var Proj: The available projections per axis:
- - NONE - axis isn't used
- - X - axis is used as final x axis
- - Y - axis is used as final y axis
- - Z - axis is used as final z axis
+ - NONE - axis isn't used
+ - X - axis is used as final x axis
+ - Y - axis is used as final y axis
+ - Z - axis is used as final z axis
@type STypes: readonly dictionary
@var STypes: Texture-type specific data. Depending on the value of
- Texture.type, certain groups will make sense. For instance, when a texture
- is of type CLOUD, the CLD_xxx stypes can be used. Note that the first
- value in each group is the default.
- 1. Clouds type
- - CLD_DEFAULT - Monochromatic noise
- - CLD_COLOR - RGB noise
- 2. Wood type
- - WOD_BANDS - Use standard wood texture
- - WOD_RINGS - Use wood rings
- - WOD_BANDNOISE - Add noise to standard wood
- - WOD_RINGNOISE - Add noise to rings
- 3. Magic type
- - MAG_DEFAULT - Magic has no STypes
- 4. Marble type
- - MBL_SOFT - Use soft marble
- - MBL_SHARP - Use more clearly defined marble
- - MBL_SHARPER - Use very clearly dfefined marble
- 5. Blend type
- - BLN_LIN - Use a linear progression
- - BLN_QUAD - Use a quadratic progression
- - BLN_EASE - Uses a more complicated blend function
- - BLN_DIAG - Use a diagonal progression
- - BLN_SPHERE - Use a progression with the shape of a sphere
- - BLN_HALO - Use a quadratic progression with the shape of a sphere
- 6. Stucci type
- - STC_PLASTIC - Standard stucci
- - STC_WALLIN - Creates dimples
- - STC_WALLOUT - Creates ridges
- 7. Noise type
- - NSE_DEFAULT - Noise has no STypes
- 8. Image type
- - IMG_DEFAULT - Image has no STypes
- 9. Plugin type
- - PLG_DEFAULT - Plugin has no STypes
- 10. Envmap type
- - ENV_STATIC - Calculate map only once
- - ENV_ANIM - Calculate map each rendering
- - ENV_LOAD - Load map from disk
- 11. Musgrave type
- - MUS_MFRACTAL - Hetero Multifractal
- - MUS_RIDGEDMF - Ridged Multifractal
- - MUS_HYBRIDMF - Hybrid Multifractal
- - MUS_FBM - Fractal Brownian Motion
- - MUS_HTERRAIN - Hetero Terrain
- 12. Voronoi type
- - VN_INT - Only calculate intensity
- - VN_COL1 - Color cells by position
- - VN_COL2 - Same as Col1 plus outline based on F2-F1
- - VN_COL3 - Same as Col2 multiplied by intensity
- 13. Distorted noise type
- - DN_BLENDER - Original Blender algorithm
- - DN_PERLIN - Ken Perlin's original (1985) algorithm
- - DN_IMPROVEDPERLIN - Ken Perlin's newer (2002) algorithm
- - DN_VORONOIF1 - none
- - DN_VORONOIF2 - none
- - DN_VORONOIF3 - none
- - DN_VORONOIF4 - none
- - DN_VORONOIF2F1 - none
- - DN_VORONOICRACKLE - none
- - DN_CELLNOISE - Steven Worley's cellular basis algorithm (1996)
+ Texture.type, certain groups will make sense. For instance, when a texture
+ is of type CLOUD, the CLD_xxx stypes can be used. Note that the first
+ value in each group is the default.
+ 1. Clouds type
+ - CLD_DEFAULT - Monochromatic noise
+ - CLD_COLOR - RGB noise
+ 2. Wood type
+ - WOD_BANDS - Use standard wood texture
+ - WOD_RINGS - Use wood rings
+ - WOD_BANDNOISE - Add noise to standard wood
+ - WOD_RINGNOISE - Add noise to rings
+ 3. Magic type
+ - MAG_DEFAULT - Magic has no STypes
+ 4. Marble type
+ - MBL_SOFT - Use soft marble
+ - MBL_SHARP - Use more clearly defined marble
+ - MBL_SHARPER - Use very clearly dfefined marble
+ 5. Blend type
+ - BLN_LIN - Use a linear progression
+ - BLN_QUAD - Use a quadratic progression
+ - BLN_EASE - Uses a more complicated blend function
+ - BLN_DIAG - Use a diagonal progression
+ - BLN_SPHERE - Use a progression with the shape of a sphere
+ - BLN_HALO - Use a quadratic progression with the shape of a sphere
+ 6. Stucci type
+ - STC_PLASTIC - Standard stucci
+ - STC_WALLIN - Creates dimples
+ - STC_WALLOUT - Creates ridges
+ 7. Noise type
+ - NSE_DEFAULT - Noise has no STypes
+ 8. Image type
+ - IMG_DEFAULT - Image has no STypes
+ 9. Plugin type
+ - PLG_DEFAULT - Plugin has no STypes
+ 10. Envmap type
+ - ENV_STATIC - Calculate map only once
+ - ENV_ANIM - Calculate map each rendering
+ - ENV_LOAD - Load map from disk
+ 11. Musgrave type
+ - MUS_MFRACTAL - Hetero Multifractal
+ - MUS_RIDGEDMF - Ridged Multifractal
+ - MUS_HYBRIDMF - Hybrid Multifractal
+ - MUS_FBM - Fractal Brownian Motion
+ - MUS_HTERRAIN - Hetero Terrain
+ 12. Voronoi type
+ - VN_INT - Only calculate intensity
+ - VN_COL1 - Color cells by position
+ - VN_COL2 - Same as Col1 plus outline based on F2-F1
+ - VN_COL3 - Same as Col2 multiplied by intensity
+ 13. Distorted noise type
+ - DN_BLENDER - Original Blender algorithm
+ - DN_PERLIN - Ken Perlin's original (1985) algorithm
+ - DN_IMPROVEDPERLIN - Ken Perlin's newer (2002) algorithm
+ - DN_VORONOIF1 - none
+ - DN_VORONOIF2 - none
+ - DN_VORONOIF3 - none
+ - DN_VORONOIF4 - none
+ - DN_VORONOIF2F1 - none
+ - DN_VORONOICRACKLE - none
+ - DN_CELLNOISE - Steven Worley's cellular basis algorithm (1996)
@var TexCo: Flags for MTex.texco.
- - ORCO - Use the original coordinates of the mesh
- - REFL - Use reflection vector as texture coordinates
- - NOR - Use normal vector as texture coordinates
- - GLOB - Use global coordinates for the texture coordinates
- - UV - Use UV coordinates for texture coordinates
- - OBJECT - Use linked object's coordinates for texture coordinates
- - WIN - Use screen coordinates as texture coordinates
- - VIEW - Pass camera view vector on to the texture (World texture only!)
- - STICK - Use mesh sticky coordinates for the texture coordinates
- - STRESS - Use mesh stress coordinates for the texture coordinates
- - TANGENT - Use mesh tangent coordinates for the texture coordinates
+ - ORCO - Use the original coordinates of the mesh
+ - REFL - Use reflection vector as texture coordinates
+ - NOR - Use normal vector as texture coordinates
+ - GLOB - Use global coordinates for the texture coordinates
+ - UV - Use UV coordinates for texture coordinates
+ - OBJECT - Use linked object's coordinates for texture coordinates
+ - WIN - Use screen coordinates as texture coordinates
+ - VIEW - Pass camera view vector on to the texture (World texture only!)
+ - STICK - Use mesh sticky coordinates for the texture coordinates
+ - STRESS - Use mesh stress coordinates for the texture coordinates
+ - TANGENT - Use mesh tangent coordinates for the texture coordinates
@type TexCo: readonly dictionary
@var MapTo: Flags for MTex.mapto.
- - COL - Make the texture affect the basic colour of the material
- - NOR - Make the texture affect the rendered normal
- - CSP - Make the texture affect the specularity colour
- - CMIR - Make the texture affect the mirror colour
- - REF - Make the texture affect the diffuse reflectivity value
- - SPEC - Make the texture affect the specularity value
- - HARD - Make the texture affect the hardness value
- - ALPHA - Make the texture affect the alpha value
- - EMIT - Make the texture affect the emit value
- - RAYMIR - Make the texture affect the mirror reflectivity value
- - DISP - Make the texture displace the mesh
- - TRANSLU - Make the texture affect the translucency value
- - AMB - Make the texture affect the ambient value
- - WARP - Make the texture affect texture coordinates for the following textures
+ - COL - Make the texture affect the basic colour of the material
+ - NOR - Make the texture affect the rendered normal
+ - CSP - Make the texture affect the specularity colour
+ - CMIR - Make the texture affect the mirror colour
+ - REF - Make the texture affect the diffuse reflectivity value
+ - SPEC - Make the texture affect the specularity value
+ - HARD - Make the texture affect the hardness value
+ - ALPHA - Make the texture affect the alpha value
+ - EMIT - Make the texture affect the emit value
+ - RAYMIR - Make the texture affect the mirror reflectivity value
+ - DISP - Make the texture displace the mesh
+ - TRANSLU - Make the texture affect the translucency value
+ - AMB - Make the texture affect the ambient value
+ - WARP - Make the texture affect texture coordinates for the following textures
@type MapTo: readonly dictionary
"""
def New (name = 'Tex'):
- """
- Create a new Texture object.
- @type name: string
- @param name: The Texture name.
- @rtype: Blender Texture
- @return: The created Texture object.
- """
+ """
+ Create a new Texture object.
+ @type name: string
+ @param name: The Texture name.
+ @rtype: Blender Texture
+ @return: The created Texture object.
+ """
def Get (name = None):
- """
- Get the Texture object(s) from Blender.
- @type name: string
- @param name: The name of the Texture.
- @rtype: Blender Texture or a list of Blender Textures
- @return: It depends on the I{name} parameter:
- - (name): The Texture object with the given I{name};
- - (): A list with all Texture objects in the current scene.
- """
+ """
+ Get the Texture object(s) from Blender.
+ @type name: string
+ @param name: The name of the Texture.
+ @rtype: Blender Texture or a list of Blender Textures
+ @return: It depends on the I{name} parameter:
+ - (name): The Texture object with the given I{name};
+ - (): A list with all Texture objects in the current scene.
+ """
from IDProp import IDGroup, IDArray
class Texture:
- """
- The Texture object
- ==================
- This object gives access to Texture-specific data in Blender.
+ """
+ The Texture object
+ ==================
+ This object gives access to Texture-specific data in Blender.
- Note that many of the attributes of this object are only relevant for
- specific texture types.
+ Note that many of the attributes of this object are only relevant for
+ specific texture types.
- @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this texture's ID Properties.
- @type properties: L{IDGroup<IDProp.IDGroup>}
@ivar animFrames: Number of frames of a movie to use.
Value is clamped to the range [0,30000].
@type animFrames: int
@@ -326,8 +324,6 @@ class Texture:
@type mipmap: int
@ivar movie: Movie frames as images enabled. Also see L{ImageFlags}.
@type movie: int
- @ivar name: Texture data name.
- @type name: string
@ivar noiseBasis: Noise basis type (wood, stucci, marble, clouds,
Musgrave, distorted). See L{Noise} dictionary.
@type noiseBasis: int
@@ -373,8 +369,6 @@ class Texture:
@type type: int
@ivar useAlpha: Use of image's alpha channel enabled. Also see L{ImageFlags}.
@type useAlpha: int
- @ivar users: Number of texture users. Read-only.
- @type users: int
@ivar weight1: Weight 1 (for Voronoi textures).
Value is clamped to the range [-2.0,2.0].
@type weight1: float
@@ -387,160 +381,161 @@ class Texture:
@ivar weight4: Weight 4 (for Voronoi textures).
Value is clamped to the range [-2.0,2.0].
@type weight4: float
- """
-
- def getExtend():
- """
- Get the extend mode of the texture. See L{setExtend}.
- @rtype: string.
- """
-
- def getImage():
- """
- Get the Image associated with this texture (or None).
- @rtype: Blender Image
- """
-
- def getName():
- """
- Get the name of this Texture object.
- @rtype: string
- """
-
- def getType():
- """
- Get this Texture's type. See L{setType}.
- @rtype: string
- """
-
- def setExtend(extendmode):
- """
- Set the extend mode of this texture (only used for IMAGE textures)
- @param extendmode: The new extend mode. One of:
- 'Extend', 'Clip', 'ClipCube' and 'Repeat'
- @type extendmode: string
- """
-
- def setFlags(f1=None, f2=None, f3=None, f4=None):
- """
- Set this object's flags.
- @param f1,f2,f3,f4: Flags to be set (omitted flags are cleared). Can be any of
- 'FlipBlendXY', 'NegAlpha', 'CheckerOdd', and 'CheckerEven'
- @type f1,f2,f3,f4: string
- """
-
- def setImage(image):
- """
- Set the Image of this texture.
- @param image: The new Image.
- @type image: Blender Image
- @warning: This sets the texture's type to 'Image' if it is not already.
- """
-
- def setImageFlags(f1=None, f2=None, f3=None, etc=None):
- """
- Set the Image flags (only makes sense for IMAGE textures). Omitted
- flags are cleared.
- @param f1, f2, f3, etc: Flag to set. See L{ImageFlags} for their meanings. Can be
- any of: 'InterPol', 'UseAlpha', 'MipMap', 'Fields', 'Rot90',
- 'CalcAlpha', 'Cyclic', 'Movie', 'StField', 'Anti' and 'NormalMap'
- @type f1, f2, f3, etc: string
- """
-
- def setName(name):
- """
- Set the name of this Texture object.
- @param name: The new name.
- @type name: string
- """
-
- def setSType(stype):
- """
- Set the SType.
- @param stype: The new stype. This can be any of the values listed in
- L{STypes} or 'Default' which sets the stype to the default value.
- @type stype: string
-
- @note: the set of valid parameters is dependent on the current
- texture type. Be sure to always set the texture type B{before}
- setting the texture's stype; otherwise an exception might occur.
- """
-
- def setType(type):
- """
- Set this Texture's type.
- @param type: The new type. Possible options are:
- 'None', 'Clouds', 'Wood', 'Marble', 'Magic', 'Blend', 'Stucci',
- 'Noise', 'Image', 'Plugin', 'EnvMap', 'Musgrave', 'Voronoi'
- and 'DistNoise'
- @type type: string
- """
-
+ """
+
+ def getExtend():
+ """
+ Get the extend mode of the texture. See L{setExtend}.
+ @rtype: string.
+ """
+
+ def getImage():
+ """
+ Get the Image associated with this texture (or None).
+ @rtype: Blender Image
+ """
+
+ def getName():
+ """
+ Get the name of this Texture object.
+ @rtype: string
+ """
+
+ def getType():
+ """
+ Get this Texture's type. See L{setType}.
+ @rtype: string
+ """
+
+ def setExtend(extendmode):
+ """
+ Set the extend mode of this texture (only used for IMAGE textures)
+ @param extendmode: The new extend mode. One of:
+ 'Extend', 'Clip', 'ClipCube' and 'Repeat'
+ @type extendmode: string
+ """
+
+ def setFlags(f1=None, f2=None, f3=None, f4=None):
+ """
+ Set this object's flags.
+ @param f1,f2,f3,f4: Flags to be set (omitted flags are cleared). Can be any of
+ 'FlipBlendXY', 'NegAlpha', 'CheckerOdd', and 'CheckerEven'
+ @type f1,f2,f3,f4: string
+ """
+
+ def setImage(image):
+ """
+ Set the Image of this texture.
+ @param image: The new Image.
+ @type image: Blender Image
+ @warning: This sets the texture's type to 'Image' if it is not already.
+ """
+
+ def setImageFlags(f1=None, f2=None, f3=None, etc=None):
+ """
+ Set the Image flags (only makes sense for IMAGE textures). Omitted
+ flags are cleared.
+ @param f1, f2, f3, etc: Flag to set. See L{ImageFlags} for their meanings. Can be
+ any of: 'InterPol', 'UseAlpha', 'MipMap', 'Fields', 'Rot90',
+ 'CalcAlpha', 'Cyclic', 'Movie', 'StField', 'Anti' and 'NormalMap'
+ @type f1, f2, f3, etc: string
+ """
+
+ def setName(name):
+ """
+ Set the name of this Texture object.
+ @param name: The new name.
+ @type name: string
+ """
+
+ def setSType(stype):
+ """
+ Set the SType.
+ @param stype: The new stype. This can be any of the values listed in
+ L{STypes} or 'Default' which sets the stype to the default value.
+ @type stype: string
+
+ @note: the set of valid parameters is dependent on the current
+ texture type. Be sure to always set the texture type B{before}
+ setting the texture's stype; otherwise an exception might occur.
+ """
+
+ def setType(type):
+ """
+ Set this Texture's type.
+ @param type: The new type. Possible options are:
+ 'None', 'Clouds', 'Wood', 'Marble', 'Magic', 'Blend', 'Stucci',
+ 'Noise', 'Image', 'Plugin', 'EnvMap', 'Musgrave', 'Voronoi'
+ and 'DistNoise'
+ @type type: string
+ """
+import id_generics
+Texture.__doc__ += id_generics.attributes
class MTex:
- """
- The MTex Object
- ===============
-
- This object links a material to a texture. It allows the same texture to be
- used in several different ways.
-
- @ivar tex: The Texture this is linked to.
- @type tex: Blender Texture
- @ivar texco: Texture coordinates ("Map input"). See L{TexCo}
- @ivar mapto: "Map to" field of texture. OR'd values of L{MapTo}
- @ivar object: Object whose space to use when texco is Object
- @type object: Blender Object
- @ivar col: Color that the texture blends with
- @ivar dvar: Value that the texture blends with when not blending colors
- @ivar blendmode: Texture blending mode. L{BlendModes}
- @ivar colfac: Factor by which texture affects color
- @ivar norfac: Factor by which texture affects normal
- @ivar varfac: Factor by which texture affects most variables
- @ivar dispfac: Factor by which texture affects displacement
- @ivar warpfac: Factor by which texture affects warp
- @ivar ofs: Offset to adjust texture space
- @ivar size: Size to scale texture space
- @ivar mapping: Mapping of texture coordinates (flat, cube, etc.). L{Mappings}
- @ivar stencil: Stencil mode
- @ivar neg: Negate texture values mode
- @ivar noRGB: Convert texture RGB values to intensity values
- @ivar correctNor: Correct normal mapping for Texture space and Object space
- @ivar xproj: Projection of X axis to Texture space. L{Proj}
- @ivar yproj: Projection of Y axis to Texture space. L{Proj}
- @ivar zproj: Projection of Z axis to Texture space. L{Proj}
- @ivar mtCol: How texture maps to color
- @ivar mtNor: How texture maps to normals
- @ivar mtCsp: How texture maps to specularity color
- @ivar mtCmir: How texture maps to mirror color
- @ivar mtRef: How texture maps to reflectivity
- @ivar mtSpec: How texture maps to specularity
- @ivar mtEmit: How texture maps to emit value
- @ivar mtAlpha: How texture maps to alpha value
- @ivar mtHard: How texture maps to hardness
- @ivar mtRayMir: How texture maps to RayMir value
- @ivar mtTranslu: How texture maps to translucency
- @ivar mtAmb: How texture maps to ambient value
- @ivar mtDisp: How texture maps to displacement
- @ivar mtWarp: How texture maps to warp
- """
-
- def getIpo():
- """
- Get the Ipo associated with this texture object, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this texture object.
- @type ipo: Blender Ipo
- @param ipo: a "texture data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this texture object.
- @return: True if there was an ipo linked or False otherwise.
- """
+ """
+ The MTex Object
+ ===============
+
+ This object links a material to a texture. It allows the same texture to be
+ used in several different ways.
+
+ @ivar tex: The Texture this is linked to.
+ @type tex: Blender Texture
+ @ivar texco: Texture coordinates ("Map input"). See L{TexCo}
+ @ivar mapto: "Map to" field of texture. OR'd values of L{MapTo}
+ @ivar object: Object whose space to use when texco is Object
+ @type object: Blender Object
+ @ivar col: Color that the texture blends with
+ @ivar dvar: Value that the texture blends with when not blending colors
+ @ivar blendmode: Texture blending mode. L{BlendModes}
+ @ivar colfac: Factor by which texture affects color
+ @ivar norfac: Factor by which texture affects normal
+ @ivar varfac: Factor by which texture affects most variables
+ @ivar dispfac: Factor by which texture affects displacement
+ @ivar warpfac: Factor by which texture affects warp
+ @ivar ofs: Offset to adjust texture space
+ @ivar size: Size to scale texture space
+ @ivar mapping: Mapping of texture coordinates (flat, cube, etc.). L{Mappings}
+ @ivar stencil: Stencil mode
+ @ivar neg: Negate texture values mode
+ @ivar noRGB: Convert texture RGB values to intensity values
+ @ivar correctNor: Correct normal mapping for Texture space and Object space
+ @ivar xproj: Projection of X axis to Texture space. L{Proj}
+ @ivar yproj: Projection of Y axis to Texture space. L{Proj}
+ @ivar zproj: Projection of Z axis to Texture space. L{Proj}
+ @ivar mtCol: How texture maps to color
+ @ivar mtNor: How texture maps to normals
+ @ivar mtCsp: How texture maps to specularity color
+ @ivar mtCmir: How texture maps to mirror color
+ @ivar mtRef: How texture maps to reflectivity
+ @ivar mtSpec: How texture maps to specularity
+ @ivar mtEmit: How texture maps to emit value
+ @ivar mtAlpha: How texture maps to alpha value
+ @ivar mtHard: How texture maps to hardness
+ @ivar mtRayMir: How texture maps to RayMir value
+ @ivar mtTranslu: How texture maps to translucency
+ @ivar mtAmb: How texture maps to ambient value
+ @ivar mtDisp: How texture maps to displacement
+ @ivar mtWarp: How texture maps to warp
+ """
+
+ def getIpo():
+ """
+ Get the Ipo associated with this texture object, if any.
+ @rtype: Ipo
+ @return: the wrapped ipo or None.
+ """
+
+ def setIpo(ipo):
+ """
+ Link an ipo to this texture object.
+ @type ipo: Blender Ipo
+ @param ipo: a "texture data" ipo.
+ """
+
+ def clearIpo():
+ """
+ Unlink the ipo from this texture object.
+ @return: True if there was an ipo linked or False otherwise.
+ """
diff --git a/source/blender/python/api2_2x/doc/World.py b/source/blender/python/api2_2x/doc/World.py
index e2b73f98c2e..d9e9bae750d 100644
--- a/source/blender/python/api2_2x/doc/World.py
+++ b/source/blender/python/api2_2x/doc/World.py
@@ -11,339 +11,341 @@ World
The module world allows you to access all the data of a Blender World.
Example::
- import Blender
- w = Blender.Get('World') #assume there exists a world named "world"
- print w.getName()
- w.hor = [1,1,.2]
- print w.getHor()
+ import Blender
+ w = Blender.Get('World') #assume there exists a world named "world"
+ print w.getName()
+ w.hor = [1,1,.2]
+ print w.getHor()
Example::
- import Blender
- from Blender import *
+ import Blender
+ from Blender import *
- AllWorlds = Blender.World.Get() # returns a list of created world objects
- AvailWorlds = len(AllWorlds) # returns the number of available world objects
- PropWorld = dir(AllWorlds[0]) # returns the properties of the class world
- NameWorld = AllWorlds[0].getName() # get name of the first world object
+ AllWorlds = Blender.World.Get() # returns a list of created world objects
+ AvailWorlds = len(AllWorlds) # returns the number of available world objects
+ PropWorld = dir(AllWorlds[0]) # returns the properties of the class world
+ NameWorld = AllWorlds[0].getName() # get name of the first world object
- MiType = AllWorlds[0].getMistype() # get kind of mist from the first world object
- MiParam = AllWorlds[0].getMist() # get the parameters intensity, start, end and height of the mist
+ MiType = AllWorlds[0].getMistype() # get kind of mist from the first world object
+ MiParam = AllWorlds[0].getMist() # get the parameters intensity, start, end and height of the mist
- HorColor = AllWorlds[0].getHor() # horizon color of the first world object
- HorColorR = HorColor[0] # get the red channel (RGB) of the horizon color
+ HorColor = AllWorlds[0].getHor() # horizon color of the first world object
+ HorColorR = HorColor[0] # get the red channel (RGB) of the horizon color
- ZenColor = AllWorlds[0].getZen() # zenith color of the first world object
- ZenColorB = ZenColor[2] # get the blue channel (RGB) of the Zenith color
+ ZenColor = AllWorlds[0].getZen() # zenith color of the first world object
+ ZenColorB = ZenColor[2] # get the blue channel (RGB) of the Zenith color
- blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object
+ blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object
"""
def New (name):
- """
- Creates a new World.
- @type name: string
- @param name: World's name (optional).
- @rtype: Blender World
- @return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
- """
+ """
+ Creates a new World.
+ @type name: string
+ @param name: World's name (optional).
+ @rtype: Blender World
+ @return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
+ """
def Get (name):
- """
- Get an World from Blender.
- @type name: string
- @param name: The name of the world to retrieve.
- @rtype: Blender World or a list of Blender Worlds
- @return:
- - (name): The World corresponding to the name
- - (): A list with all Worlds in the current scene.
- """
+ """
+ Get an World from Blender.
+ @type name: string
+ @param name: The name of the world to retrieve.
+ @rtype: Blender World or a list of Blender Worlds
+ @return:
+ - (name): The World corresponding to the name
+ - (): A list with all Worlds in the current scene.
+ """
def GetCurrent ():
- """
- Get the active world of the scene.
- @rtype: Blender World or None
- """
+ """
+ Get the active world of the scene.
+ @rtype: Blender World or None
+ """
class World:
- """
- The World object
- ================
- This object gives access to generic data from all worlds in Blender.
- Its attributes depend upon its type.
-
- @ivar name: the name of the world.
- @ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
- @ivar mode:
- @ivar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
- @ivar hor: the horizon color of a world object.
- @ivar zen: the zenith color of a world object.
- @ivar amb: the ambient color of a world object.
- @ivar star: the star parameters of a world object. See getStar for the semantics of these parameters.
- @ivar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
- @type ipo: Blender Ipo
- @ivar ipo: The world type ipo linked to this world object.
- """
-
- def getRange():
- """
- Retrieves the range parameter of a world object.
- @rtype: float
- @return: the range
- """
-
- def setRange(range):
- """
- Sets the range parameter of a world object.
- @type range: float
- @param range: the new range parameter
- @rtype: None
- @return: None
- """
-
- def getName():
- """
- Retrieves the name of a world object
- @rtype: string
- @return: the name of the world object.
- """
-
- def setName(name):
- """
- Sets the name of a world object.
- @type name: string
- @param name : the new name.
- @rtype: None
- @return: None
- """
-
- def getIpo():
- """
- Get the Ipo associated with this world object, if any.
- @rtype: Ipo
- @return: the wrapped ipo or None.
- """
-
- def setIpo(ipo):
- """
- Link an ipo to this world object.
- @type ipo: Blender Ipo
- @param ipo: a "camera data" ipo.
- """
-
- def clearIpo():
- """
- Unlink the ipo from this world object.
- @return: True if there was an ipo linked or False otherwise.
- """
-
- def getSkytype():
- """
- Retrieves the skytype of a world object.
- The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
- @rtype: int
- @return: the skytype of the world object.
- """
-
- def setSkytype(skytype):
- """
- Sets the skytype of a world object.
- See getSkytype for the semantics of the parameter.
- @type skytype: int
- @param skytype : the new skytype.
- @rtype: None
- @return: None
- """
-
- def getMode():
- """
- Retrieves the mode of a world object.
- The mode is a combination of 5 bits:
- - Bit 0 : mist simulation
- - Bit 1 : starfield simulation
- - Bit 2,3 : reserved
- - Bit 4 : ambient occlusion
- @rtype: int
- @return: the mode of the world object.
- """
-
- def setMode(mode):
- """
- Sets the mode of a world object.
- See getMode for the semantics of the parameter.
- @type mode: int
- @param mode : the new mode.
- @rtype: None
- @return: None
- """
-
- def getMistype():
- """
- Retrieves the mist type of a world object.
- The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
- @rtype: int
- @return: the mistype of the world object.
- """
-
- def setMistype(mistype):
- """
- Sets the mist type of a world object.
- See getMistype for the semantics of the parameter.
- @type mistype: int
- @param mistype : the new mist type.
- @rtype: None
- @return: None
- """
-
- def getHor():
- """
- Retrieves the horizon color of a world object.
- This color is a list of 3 floats.
- @rtype: list of three floats
- @return: the horizon color of the world object.
- """
-
- def setHor(hor):
- """
- Sets the horizon color of a world object.
- @type hor: list of three floats
- @param hor : the new hor.
- @rtype: None
- @return: None
- """
-
- def getZen():
- """
- Retrieves the zenith color of a world object.
- This color is a list of 3 floats.
- @rtype: list of three floats
- @return: the zenith color of the world object.
- """
-
- def setZen(zen):
- """
- Sets the zenith color of a world object.
- @type zen: list of three floats
- @param zen : the new zenith color.
- @rtype: None
- @return: None
- """
-
- def getAmb():
- """
- Retrieves the ambient color of a world object.
- This color is a list of 3 floats.
- @rtype: list of three floats
- @return: the ambient color of the world object.
- """
-
- def setAmb(amb):
- """
- Sets the ambient color of a world object.
- @type amb: list of three floats
- @param amb : the new ambient color.
- @rtype: None
- @return: None
- """
-
- def getStar():
- """
- Retrieves the star parameters of a world object.
- It is a list of nine floats :
- red component of the color
- green component of the color
- blue component of the color
- size of the stars
- minimal distance between the stars
- average distance between the stars
- variations of the stars color
- @rtype: list of nine floats
- @return: the star parameters
- """
-
- def setStar(star):
- """
- Sets the star parameters of a world object.
- See getStar for the semantics of the parameter.
- @type star: list of 9 floats
- @param star : the new star parameters.
- @rtype: None
- @return: None
- """
-
- def getMist():
- """
- Retrieves the mist parameters of a world object.
- It is a list of four floats :
- intensity of the mist
- start of the mist
- end of the mist
- height of the mist
- @rtype: list of four floats
- @return: the mist parameters
- """
-
- def setMist(mist):
- """
- Sets the mist parameters of a world object.
- See getMist for the semantics of the parameter.
- @type mist: list of 4 floats
- @param mist : the new mist parameters.
- @rtype: None
- @return: None
- """
-
- def getScriptLinks (event):
- """
- Get a list with this World's script links of type 'event'.
- @type event: string
- @param event: "FrameChanged", "Redraw", "Render".
- @rtype: list
- @return: a list with Blender L{Text} names (the script links of the given
- 'event' type) or None if there are no script links at all.
- """
-
- def clearScriptLinks (links = None):
- """
- Delete script links from this World :). If no list is specified, all
- script links are deleted.
- @type links: list of strings
- @param links: None (default) or a list of Blender L{Text} names.
- """
-
- def addScriptLink (text, event):
- """
- Add a new script link to this World.
- @type text: string
- @param text: the name of an existing Blender L{Text}.
- @type event: string
- @param event: "FrameChanged", "Redraw" or "Render".
- """
-
- def setCurrent ():
- """
- Make this world active in the current scene.
- @rtype: None
- @return: None
- """
-
- def insertIpoKey(keytype):
- """
- Inserts keytype values in world ipo at curframe. Uses module constants.
- @type keytype: Integer
- @param keytype:
- -ZENTIH
- -HORIZON
- -MIST
- -STARS
- -OFFSET
- -SIZE
- @return: py_none
- """
-
- def __copy__ ():
- """
- Make a copy of this world
- @rtype: World
- @return: a copy of this world
- """
+ """
+ The World object
+ ================
+ This object gives access to generic data from all worlds in Blender.
+ Its attributes depend upon its type.
+
+ @ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
+ @ivar mode:
+ @ivar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
+ @ivar hor: the horizon color of a world object.
+ @ivar zen: the zenith color of a world object.
+ @ivar amb: the ambient color of a world object.
+ @ivar star: the star parameters of a world object. See getStar for the semantics of these parameters.
+ @ivar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
+ @type ipo: Blender Ipo
+ @ivar ipo: The world type ipo linked to this world object.
+ """
+
+ def getRange():
+ """
+ Retrieves the range parameter of a world object.
+ @rtype: float
+ @return: the range
+ """
+
+ def setRange(range):
+ """
+ Sets the range parameter of a world object.
+ @type range: float
+ @param range: the new range parameter
+ @rtype: None
+ @return: None
+ """
+
+ def getName():
+ """
+ Retrieves the name of a world object
+ @rtype: string
+ @return: the name of the world object.
+ """
+
+ def setName(name):
+ """
+ Sets the name of a world object.
+ @type name: string
+ @param name : the new name.
+ @rtype: None
+ @return: None
+ """
+
+ def getIpo():
+ """
+ Get the Ipo associated with this world object, if any.
+ @rtype: Ipo
+ @return: the wrapped ipo or None.
+ """
+
+ def setIpo(ipo):
+ """
+ Link an ipo to this world object.
+ @type ipo: Blender Ipo
+ @param ipo: a "camera data" ipo.
+ """
+
+ def clearIpo():
+ """
+ Unlink the ipo from this world object.
+ @return: True if there was an ipo linked or False otherwise.
+ """
+
+ def getSkytype():
+ """
+ Retrieves the skytype of a world object.
+ The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
+ @rtype: int
+ @return: the skytype of the world object.
+ """
+
+ def setSkytype(skytype):
+ """
+ Sets the skytype of a world object.
+ See getSkytype for the semantics of the parameter.
+ @type skytype: int
+ @param skytype : the new skytype.
+ @rtype: None
+ @return: None
+ """
+
+ def getMode():
+ """
+ Retrieves the mode of a world object.
+ The mode is a combination of 5 bits:
+ - Bit 0 : mist simulation
+ - Bit 1 : starfield simulation
+ - Bit 2,3 : reserved
+ - Bit 4 : ambient occlusion
+ @rtype: int
+ @return: the mode of the world object.
+ """
+
+ def setMode(mode):
+ """
+ Sets the mode of a world object.
+ See getMode for the semantics of the parameter.
+ @type mode: int
+ @param mode : the new mode.
+ @rtype: None
+ @return: None
+ """
+
+ def getMistype():
+ """
+ Retrieves the mist type of a world object.
+ The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
+ @rtype: int
+ @return: the mistype of the world object.
+ """
+
+ def setMistype(mistype):
+ """
+ Sets the mist type of a world object.
+ See getMistype for the semantics of the parameter.
+ @type mistype: int
+ @param mistype : the new mist type.
+ @rtype: None
+ @return: None
+ """
+
+ def getHor():
+ """
+ Retrieves the horizon color of a world object.
+ This color is a list of 3 floats.
+ @rtype: list of three floats
+ @return: the horizon color of the world object.
+ """
+
+ def setHor(hor):
+ """
+ Sets the horizon color of a world object.
+ @type hor: list of three floats
+ @param hor : the new hor.
+ @rtype: None
+ @return: None
+ """
+
+ def getZen():
+ """
+ Retrieves the zenith color of a world object.
+ This color is a list of 3 floats.
+ @rtype: list of three floats
+ @return: the zenith color of the world object.
+ """
+
+ def setZen(zen):
+ """
+ Sets the zenith color of a world object.
+ @type zen: list of three floats
+ @param zen : the new zenith color.
+ @rtype: None
+ @return: None
+ """
+
+ def getAmb():
+ """
+ Retrieves the ambient color of a world object.
+ This color is a list of 3 floats.
+ @rtype: list of three floats
+ @return: the ambient color of the world object.
+ """
+
+ def setAmb(amb):
+ """
+ Sets the ambient color of a world object.
+ @type amb: list of three floats
+ @param amb : the new ambient color.
+ @rtype: None
+ @return: None
+ """
+
+ def getStar():
+ """
+ Retrieves the star parameters of a world object.
+ It is a list of nine floats :
+ red component of the color
+ green component of the color
+ blue component of the color
+ size of the stars
+ minimal distance between the stars
+ average distance between the stars
+ variations of the stars color
+ @rtype: list of nine floats
+ @return: the star parameters
+ """
+
+ def setStar(star):
+ """
+ Sets the star parameters of a world object.
+ See getStar for the semantics of the parameter.
+ @type star: list of 9 floats
+ @param star : the new star parameters.
+ @rtype: None
+ @return: None
+ """
+
+ def getMist():
+ """
+ Retrieves the mist parameters of a world object.
+ It is a list of four floats :
+ intensity of the mist
+ start of the mist
+ end of the mist
+ height of the mist
+ @rtype: list of four floats
+ @return: the mist parameters
+ """
+
+ def setMist(mist):
+ """
+ Sets the mist parameters of a world object.
+ See getMist for the semantics of the parameter.
+ @type mist: list of 4 floats
+ @param mist : the new mist parameters.
+ @rtype: None
+ @return: None
+ """
+
+ def getScriptLinks (event):
+ """
+ Get a list with this World's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged", "Redraw", "Render".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks (links = None):
+ """
+ Delete script links from this World :). If no list is specified, all
+ script links are deleted.
+ @type links: list of strings
+ @param links: None (default) or a list of Blender L{Text} names.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this World.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged", "Redraw" or "Render".
+ """
+
+ def setCurrent ():
+ """
+ Make this world active in the current scene.
+ @rtype: None
+ @return: None
+ """
+
+ def insertIpoKey(keytype):
+ """
+ Inserts keytype values in world ipo at curframe. Uses module constants.
+ @type keytype: Integer
+ @param keytype:
+ -ZENTIH
+ -HORIZON
+ -MIST
+ -STARS
+ -OFFSET
+ -SIZE
+ @return: py_none
+ """
+
+ def __copy__ ():
+ """
+ Make a copy of this world
+ @rtype: World
+ @return: a copy of this world
+ """
+
+import id_generics
+World.__doc__ += id_generics.attributes
diff --git a/source/blender/python/api2_2x/id_attributes.py b/source/blender/python/api2_2x/id_attributes.py
new file mode 100644
index 00000000000..93019db5c63
--- /dev/null
+++ b/source/blender/python/api2_2x/id_attributes.py
@@ -0,0 +1,8 @@
+epytext=\
+''' @ivar name: The name of this Group object.
+ @type name: string
+ @ivar users: Number of users this group has (read only)
+ @type users: int
+ @ivar fakeUser: The fake user status.
+ Enabling this will keep it in the blend even if there are no users.
+ @type fakeUser: bool''' \ No newline at end of file