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:
authorAntonioya <blendergit@gmail.com>2019-01-29 12:21:23 +0300
committerAntonioya <blendergit@gmail.com>2019-01-29 12:21:49 +0300
commit8b93448f56ecdf9c91ad1b6297580eedf1f6e18f (patch)
treebe89967981fc33242db1a828945fee520d3bac76 /camera_turnaround.py
parent28957b32a63ac7a75d59339106d4b3fdee0b2058 (diff)
CameraTurn: Convert to 2.80
Fix the script to run in 2.80 version
Diffstat (limited to 'camera_turnaround.py')
-rw-r--r--camera_turnaround.py41
1 files changed, 24 insertions, 17 deletions
diff --git a/camera_turnaround.py b/camera_turnaround.py
index 8ea44e6d..0a30d922 100644
--- a/camera_turnaround.py
+++ b/camera_turnaround.py
@@ -19,8 +19,8 @@
bl_info = {
"name": "Turnaround Camera",
"author": "Antonio Vazquez (antonioya)",
- "version": (0, 2, 5),
- "blender": (2, 68, 0),
+ "version": (0, 3, 0),
+ "blender": (2, 80, 0),
"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/"
@@ -46,7 +46,7 @@ from bpy.types import (
# ------------------------------------------------------
# Action class
# ------------------------------------------------------
-class RunAction(Operator):
+class CAMERATURN_OT_RunAction(Operator):
bl_idname = "object.rotate_around"
bl_label = "Turnaround"
bl_description = "Create camera rotation around selected object"
@@ -182,7 +182,7 @@ class RunAction(Operator):
# ------------------------------------------------------
# Define Properties
# ------------------------------------------------------
-class CameraTurnProps(PropertyGroup):
+class CAMERATURN_Props(PropertyGroup):
camera_revol_x: FloatProperty(
name='X', min=0, max=25,
@@ -261,12 +261,12 @@ class CameraTurnProps(PropertyGroup):
# ------------------------------------------------------
# UI Class
# ------------------------------------------------------
-class PanelUI(Panel):
+class CAMERATURN_PT_ui(Panel):
bl_idname = "CAMERA_TURN_PT_main"
bl_label = "Turnaround Camera"
bl_space_type = "VIEW_3D"
- bl_region_type = "TOOLS"
- bl_category = "Animation"
+ bl_region_type = "UI"
+ bl_category = "View"
def draw(self, context):
layout = self.layout
@@ -297,13 +297,13 @@ class PanelUI(Panel):
row.prop(scene, "frame_end")
col = layout.column(align=True)
- split = col.split(percentage=0.85, align=True)
+ split = col.split(factor=0.85, align=True)
split.prop(turn_camera, "camera_revol_x")
split.prop(turn_camera, "inverse_x", toggle=True)
- split = col.split(percentage=0.85, align=True)
+ split = col.split(factor=0.85, align=True)
split.prop(turn_camera, "camera_revol_y")
split.prop(turn_camera, "inverse_y", toggle=True)
- split = col.split(percentage=0.85, align=True)
+ split = col.split(factor=0.85, align=True)
split.prop(turn_camera, "camera_revol_z")
split.prop(turn_camera, "inverse_z", toggle=True)
@@ -330,17 +330,24 @@ class PanelUI(Panel):
# ------------------------------------------------------
# Registration
# ------------------------------------------------------
+classes = (
+ CAMERATURN_OT_RunAction,
+ CAMERATURN_PT_ui,
+ CAMERATURN_Props
+)
+
def register():
- bpy.utils.register_class(RunAction)
- bpy.utils.register_class(PanelUI)
- bpy.utils.register_class(CameraTurnProps)
- bpy.types.Scene.turn_camera = PointerProperty(type=CameraTurnProps)
+ from bpy.utils import register_class
+ for cls in classes:
+ register_class(cls)
+ bpy.types.Scene.turn_camera = PointerProperty(type=CAMERATURN_Props)
def unregister():
- bpy.utils.unregister_class(RunAction)
- bpy.utils.unregister_class(PanelUI)
- bpy.utils.unregister_class(CameraTurnProps)
+ from bpy.utils import unregister_class
+ for cls in reversed(classes):
+ unregister_class(cls)
+
del bpy.types.Scene.turn_camera