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:
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