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:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2011-05-29 20:17:43 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2011-05-29 20:17:43 +0400
commitcdb4eaf2a390469c2dc74ccbffeb620f94c1cb2a (patch)
treee11a097318a648e82e518e742c63cea11c42715b /release/scripts/modules/bpy_extras/object_utils.py
parent820f3b2e507a5efb18091bd12bea4c2008be2ed9 (diff)
parent11014aa34b26337023f53e75ebdc3432e7e116c2 (diff)
Merged with trunk: 36951-37000
Never say good-bye, you'll be back :)
Diffstat (limited to 'release/scripts/modules/bpy_extras/object_utils.py')
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 1cf7fc2f4d5..51a8d4b5e23 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -18,11 +18,27 @@
# <pep8 compliant>
+__all__ = (
+ "add_object_align_init",
+ "object_data_add",
+)
+
+
import bpy
import mathutils
def add_object_align_init(context, operator):
+ """
+ Return a matrix using the operator settings and view context.
+
+ :arg context: The context to use.
+ :type context: :class:`Context`
+ :arg operator: The operator, checked for location and rotation properties.
+ :type operator: :class:`Operator`
+ :return: the matrix from the context and settings.
+ :rtype: :class:`Matrix`
+ """
space_data = context.space_data
if space_data.type != 'VIEW_3D':
space_data = None
@@ -64,7 +80,19 @@ def add_object_align_init(context, operator):
def object_data_add(context, obdata, operator=None):
-
+ """
+ Add an object using the view context and preference to to initialize the
+ location, rotation and layer.
+
+ :arg context: The context to use.
+ :type context: :class:`Context`
+ :arg obdata: the data used for the new object.
+ :type obdata: valid object data type or None.
+ :arg operator: The operator, checked for location and rotation properties.
+ :type operator: :class:`Operator`
+ :return: the newly created object in the scene.
+ :rtype: :class:`ObjectBase`
+ """
scene = context.scene
# ugh, could be made nicer