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:
authorCampbell Barton <ideasman42@gmail.com>2017-09-10 07:30:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-09-10 07:30:03 +0300
commita4a59d578cc835477c90e9e5920edaead61fb644 (patch)
treedb415bfeafb46df1e58c1dd284646201684653a1 /release/scripts/modules
parent11a9434c2deed4f560f1c7381faf697f77b9de5c (diff)
PyAPI: Add object argument to bake_action
Avoids having to set the scene's active object first.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bpy_extras/anim_utils.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py
index 5e21260e5e4..ee270c6e8c7 100644
--- a/release/scripts/modules/bpy_extras/anim_utils.py
+++ b/release/scripts/modules/bpy_extras/anim_utils.py
@@ -26,23 +26,27 @@ import bpy
# XXX visual keying is actually always considered as True in this code...
-def bake_action(frame_start,
- frame_end,
- frame_step=1,
- only_selected=False,
- do_pose=True,
- do_object=True,
- do_visual_keying=True,
- do_constraint_clear=False,
- do_parents_clear=False,
- do_clean=False,
- action=None,
- ):
+def bake_action(
+ obj,
+ frame_start,
+ frame_end,
+ frame_step=1,
+ only_selected=False,
+ do_pose=True,
+ do_object=True,
+ do_visual_keying=True,
+ do_constraint_clear=False,
+ do_parents_clear=False,
+ do_clean=False,
+ action=None,
+):
"""
Return an image from the file path with options to search multiple paths
and return a placeholder if its not found.
+ :arg obj: Object to bake.
+ :type obj: :class:`bpy.types.Object`
:arg frame_start: First frame to bake.
:type frame_start: int
:arg frame_end: Last frame to bake.
@@ -114,7 +118,6 @@ def bake_action(frame_start,
# TODO, pass data rather then grabbing from the context!
scene = bpy.context.scene
- obj = bpy.context.object
frame_back = scene.frame_current
if obj.pose is None: