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
diff options
context:
space:
mode:
-rw-r--r--source/blender/python/api2_2x/doc/IDProp.py114
-rw-r--r--source/blender/python/api2_2x/doc/Image.py9
-rw-r--r--source/blender/python/api2_2x/doc/Material.py8
-rw-r--r--source/blender/python/api2_2x/doc/Mesh.py9
-rw-r--r--source/blender/python/api2_2x/doc/NMesh.py9
-rw-r--r--source/blender/python/api2_2x/doc/Object.py9
-rw-r--r--source/blender/python/api2_2x/doc/Scene.py9
-rw-r--r--source/blender/python/api2_2x/doc/Texture.py8
8 files changed, 101 insertions, 74 deletions
diff --git a/source/blender/python/api2_2x/doc/IDProp.py b/source/blender/python/api2_2x/doc/IDProp.py
index d4cf59a6424..aa5cca9ebb3 100644
--- a/source/blender/python/api2_2x/doc/IDProp.py
+++ b/source/blender/python/api2_2x/doc/IDProp.py
@@ -1,21 +1,3 @@
-class IDProperty:
- """
- The IDProperty Type
- ===================
- @ivar name: The name of the property
- @type name: string
- @ivar type: The property type (is read-only)
- @type type: int
- @ivar data: The property's data. This data can be of several forms, depending on the
- ID property type:
-
- 1. For arrays, data implements the [] and allows editing of the array.
- 2. For groups, data allows iteration through the group, and access using the []
- operator (but note that you can access a group that way through the parent IDProperty too).
- See L{IDGroup<IDGroup>}.
- 3. For strings/ints/floats, data just holds the value and can be freely modified.
- """
-
class IDGroup:
"""
The IDGroup Type
@@ -24,15 +6,15 @@ class IDGroup:
operator to get child ID properties.
You can also add new properties using the [] operator.
- For example:
+ For example::
- group['a float!'] = 0.0
- group['an int!'] = 0
- group['a string!'] = "hi!"
- group['an array!'] = [0, 0, 1.0, 0]
-
- group['a subgroup!] = {"float": 0.0, "an int": 1.0, "an array": [1, 2], \
- "another subgroup": {"a": 0.0, "str": "bleh"}}
+ group['a float!'] = 0.0
+ group['an int!'] = 0
+ group['a string!'] = "hi!"
+ group['an array!'] = [0, 0, 1.0, 0]
+
+ group['a subgroup!] = {"float": 0.0, "an int": 1.0, "an array": [1, 2],
+ "another subgroup": {"a": 0.0, "str": "bleh"}}
Note that for arrays, the array type defaults to int unless a float is found
while scanning the template list; if any floats are found, then the whole
@@ -41,24 +23,80 @@ class IDGroup:
You can also delete properties with the del operator. For example:
del group['property']
+
+ @ivar name: The name of the property
+ @type name: string
"""
- def newProperty(type, name, array_type="Float", val=""):
+ def pop(self, item):
+ """
+ Pop an item from the group property.
+ @type item: string
+ @param item: The item name.
+ @rtype: can be dict, list, int, float or string.
+ @return: The removed property.
+ """
+
+ def update(self, updatedict):
+ """
+ Updates items in the dict, similar to normal python
+ dictionary method .update().
+ @type updatedict: dict
+ @param updatedict: A dict of simple types to derive updated/new IDProperties from.
+ @rtype: None
+ @return: None
+ """
+
+ def keys(self):
+ """
+ Returns a list of the keys in this property group.
+ @rtype: list of strings.
+ @return: a list of the keys in this property group.
+ """
+
+ def values(self):
+ """
+ Returns a list of the values in this property group.
+
+ Note that unless a value is itself a property group or an array, you
+ cannot change it by changing the values in this list, you must change them
+ in the parent property group.
+
+ For example,
+
+ group['some_property'] = new_value
+
+ . . .is correct, while,
+
+ values = group.values()
+ values[0] = new_value
+
+ . . .is wrong.
+
+ @rtype: list of strings.
+ @return: a list of the values in this property group.
+ """
+
+ def iteritems(self):
"""
- This function creates a new child ID property in the group.
- @type type: an int or a string
- @param type: The ID property type. Can be:
- "String" or Blender.IDPropTypes['String']
- "Int" or Blender.IDPropTypes['Int']
- "Float" or Blender.IDPropTypes['Float']
- "Array" or Blender.IDPropTypes['Array']
- "Group" or Blender.IDPropTypes['Group']
+ Implements the python dictionary iteritmes method.
+
+ For example::
+
+ for k, v in group.iteritems():
+ print "Property name: " + k
+ print "Property value: " + str(v)
+
+ @rtype: an iterator that spits out items of the form [key, value]
+ @return: an iterator.
"""
- def deleteProperty(prop):
+ def convert_to_pyobject(self):
"""
- deletes a property, takes either a name or a reference
- as an argument.
+ Converts the entire property group to a purely python form.
+
+ @rtype: dict
+ @return: A python dictionary representing the property group
"""
class IDArray:
diff --git a/source/blender/python/api2_2x/doc/Image.py b/source/blender/python/api2_2x/doc/Image.py
index 4975c588802..f0c76f5e52a 100644
--- a/source/blender/python/api2_2x/doc/Image.py
+++ b/source/blender/python/api2_2x/doc/Image.py
@@ -65,16 +65,15 @@ def GetCurrent ():
@return: The Current Blender Image, If there is no current image it returns None.
"""
-from IDProp import IDProperty, IDGroup, IDArray
+from IDProp import IDGroup, IDArray
class Image:
"""
The Image object
================
This object gives access to Images in Blender.
- @ivar properties: Returns an L{IDProperty<IDProperty>} reference of type L{IDGroup<IDGroup>} to
- this image's ID Properties. Note that dict access is available for groups on the parent
- L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>}
- object from the L{IDProperty<IDProperty>}'s data member.
+ @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.
@ivar filename: The filename (path) to the image file loaded into this Image
object.
diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py
index 140b9ad7528..5a05792d5bc 100644
--- a/source/blender/python/api2_2x/doc/Material.py
+++ b/source/blender/python/api2_2x/doc/Material.py
@@ -106,12 +106,8 @@ class Material:
The Material object
===================
This object gives access to Materials in Blender.
- @ivar properties: Returns an L{IDProperty<IDProp.IDProperty>} reference of
- type L{IDGroup<IDProp.IDGroup>} to this material's ID Properties. Note that
- dict access is available for groups on the parent
- L{IDProperty<IDProp.IDProperty>} object, but for everything else you need
- to get the L{IDGroup<IDProp.IDGroup>}
- object from the L{IDProperty<IDProp.IDProperty>}'s data member.
+ @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
+ materials's ID Properties.
@ivar B: Diffuse color (L{rgbCol}) blue component.
Value is clamped to the range [0.0,1.0].
@type B: float
diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py
index b0bf2c7e321..ab01b619ebf 100644
--- a/source/blender/python/api2_2x/doc/Mesh.py
+++ b/source/blender/python/api2_2x/doc/Mesh.py
@@ -691,7 +691,7 @@ class MFaceSeq:
@rtype: list of ints
"""
-from IDProp import IDProperty, IDGroup, IDArray
+from IDProp import IDGroup, IDArray
class Mesh:
"""
The Mesh Data object
@@ -702,10 +702,9 @@ class Mesh:
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{IDProperty<IDProperty>} reference of type L{IDGroup<IDGroup>} to
- this mesh's ID Properties. Note that dict access is available for groups on the parent
- L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>}
- object from the L{IDProperty<IDProperty>}'s data member.
+ @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.
diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py
index 2fa9c74cb2f..8c4fdad41ef 100644
--- a/source/blender/python/api2_2x/doc/NMesh.py
+++ b/source/blender/python/api2_2x/doc/NMesh.py
@@ -337,17 +337,16 @@ class NMFace:
@param vertex: An NMVert object.
"""
-from IDProp import IDProperty, IDGroup, IDArray
+from IDProp import IDGroup, IDArray
class NMesh:
"""
The NMesh Data object
=====================
This object gives access to mesh data in Blender. We refer to mesh as the
object in Blender and NMesh as its Python counterpart.
- @ivar properties: Returns an L{IDProperty<IDProperty>} reference of type L{IDGroup<IDGroup>} to
- this mesh's ID Properties. Note that dict access is available for groups on the parent
- L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>}
- object from the L{IDProperty<IDProperty>}'s data member.
+ @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
+ objects's ID Properties.
+ @type properties: L{IDGroup<IDProp.IDGroup>}
@ivar name: The NMesh name. It's common to use this field to store extra
data about the mesh (to be exported to another program, for example).
@ivar materials: The list of materials used by this NMesh. See
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index 595f9c7c7c7..abf9b63629d 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -237,7 +237,7 @@ def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=
Blender.Redraw()
"""
-from IDProp import IDProperty, IDGroup, IDArray
+from IDProp import IDGroup, IDArray
class Object:
"""
The Object object
@@ -251,10 +251,9 @@ class Object:
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{IDProperty<IDProperty>} reference of type L{IDGroup<IDGroup>} to
- this object's ID Properties. Note that dict access is available for groups on the parent
- L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>}
- object from the L{IDProperty<IDProperty>}'s data member.
+ @ivar properties: Returns an L{IDGroup<IDProp.IDGroup>} reference to this
+ objects'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.
diff --git a/source/blender/python/api2_2x/doc/Scene.py b/source/blender/python/api2_2x/doc/Scene.py
index 2b841ec972d..d45e38b9893 100644
--- a/source/blender/python/api2_2x/doc/Scene.py
+++ b/source/blender/python/api2_2x/doc/Scene.py
@@ -74,16 +74,15 @@ def Unlink(scene):
@param scene: The Scene to be unlinked.
"""
-from IDProp import IDProperty, IDGroup, IDArray
+from IDProp import IDGroup, IDArray
class Scene:
"""
The Scene object
================
This object gives access to Scene data in Blender.
- @ivar properties: Returns an L{IDProperty<IDProperty>} reference of type L{IDGroup<IDGroup>} to
- this scene's ID Properties. Note that dict access is available for groups on the parent
- L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>}
- object from the L{IDProperty<IDProperty>}'s data member.
+ @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)
diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py
index eda831f9e9b..bd946298567 100644
--- a/source/blender/python/api2_2x/doc/Texture.py
+++ b/source/blender/python/api2_2x/doc/Texture.py
@@ -241,7 +241,7 @@ def Get (name = None):
- (): A list with all Texture objects in the current scene.
"""
-from IDProp import IDProperty, IDGroup, IDArray
+from IDProp import IDGroup, IDArray
class Texture:
"""
The Texture object
@@ -251,10 +251,8 @@ class Texture:
Note that many of the attributes of this object are only relevant for
specific texture types.
- @ivar properties: Returns an L{IDProperty<IDProperty>} reference of type L{IDGroup<IDGroup>} to
- this textures's ID Properties. Note that dict access is available for groups on the parent
- L{IDProperty<IDProperty>} object, but for everything else you need to get the L{IDGroup<IDGroup>}
- object from the L{IDProperty<IDProperty>}'s data member.
+ @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