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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-01-08 04:21:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-08 04:22:31 +0300
commit07f4730af48bdf493de5b200eb30899dc78181a0 (patch)
tree84a447e304473e1bdfa05c5d8520d2ad52762521 /camera_turnaround.py
parent4bac8438df999fdcfcbfff6574ffbf38024dd62e (diff)
Cleanup: redundant lookups
Diffstat (limited to 'camera_turnaround.py')
-rw-r--r--camera_turnaround.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/camera_turnaround.py b/camera_turnaround.py
index d1a27e98..6a6e710f 100644
--- a/camera_turnaround.py
+++ b/camera_turnaround.py
@@ -21,7 +21,7 @@ bl_info = {
"author": "Antonio Vazquez (antonioya)",
"version": (0, 2, 5),
"blender": (2, 68, 0),
- "location": "View3D > Toolshelf > Turnaround camera",
+ "location": "View3D > Toolshelf > Animation Tab > Turnaround Camera",
"description": "Add a camera rotation around selected object",
"wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
"Scripts/Animation/TurnaroundCamera",
@@ -58,7 +58,7 @@ class RunAction(Operator):
scene = context.scene
turn_camera = scene.turn_camera
selectobject = context.active_object
- camera = bpy.data.objects[bpy.context.scene.camera.name]
+ camera = context.scene.camera
savedcursor = bpy.context.scene.cursor_location.copy() # cursor position
savedframe = scene.frame_current
if turn_camera.use_cursor is False:
@@ -68,7 +68,7 @@ class RunAction(Operator):
# Create empty and parent
# -------------------------
bpy.ops.object.empty_add(type='PLAIN_AXES')
- myempty = bpy.data.objects[bpy.context.active_object.name]
+ myempty = context.active_object
myempty.location = selectobject.location
savedstate = myempty.matrix_world
@@ -89,7 +89,7 @@ class RunAction(Operator):
# -------------------------
bpy.ops.object.select_all(False)
myempty.select = True
- bpy.context.scene.objects.active = myempty
+ context.scene.objects.active = myempty
# save current configuration
savedinterpolation = context.user_preferences.edit.keyframe_new_interpolation_type
# change interpolation mode
@@ -97,7 +97,7 @@ class RunAction(Operator):
# create first frame
myempty.rotation_euler = (0, 0, 0)
myempty.empty_draw_size = 0.1
- bpy.context.scene.frame_set(scene.frame_start)
+ context.scene.frame_set(scene.frame_start)
myempty.keyframe_insert(data_path='rotation_euler', frame=scene.frame_start)
# Clear the Camera Animations if the option is checked