Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
8b93448f
Commit
8b93448f
authored
6 years ago
by
Antonioya
Browse files
Options
Downloads
Patches
Plain Diff
CameraTurn: Convert to 2.80
Fix the script to run in 2.80 version
parent
28957b32
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
camera_turnaround.py
+24
-17
24 additions, 17 deletions
camera_turnaround.py
with
24 additions
and
17 deletions
camera_turnaround.py
+
24
−
17
View file @
8b93448f
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
bl_info
=
{
bl_info
=
{
"
name
"
:
"
Turnaround Camera
"
,
"
name
"
:
"
Turnaround Camera
"
,
"
author
"
:
"
Antonio Vazquez (antonioya)
"
,
"
author
"
:
"
Antonio Vazquez (antonioya)
"
,
"
version
"
:
(
0
,
2
,
5
),
"
version
"
:
(
0
,
3
,
0
),
"
blender
"
:
(
2
,
6
8
,
0
),
"
blender
"
:
(
2
,
8
0
,
0
),
"
location
"
:
"
View3D > Toolshelf > Animation Tab > Turnaround Camera
"
,
"
location
"
:
"
View3D > Toolshelf > Animation Tab > Turnaround Camera
"
,
"
description
"
:
"
Add a camera rotation around selected object
"
,
"
description
"
:
"
Add a camera rotation around selected object
"
,
"
wiki_url
"
:
"
https://wiki.blender.org/index.php/Extensions:2.6/Py/
"
"
wiki_url
"
:
"
https://wiki.blender.org/index.php/Extensions:2.6/Py/
"
...
@@ -46,7 +46,7 @@ from bpy.types import (
...
@@ -46,7 +46,7 @@ from bpy.types import (
# ------------------------------------------------------
# ------------------------------------------------------
# Action class
# Action class
# ------------------------------------------------------
# ------------------------------------------------------
class
RunAction
(
Operator
):
class
CAMERATURN_OT_
RunAction
(
Operator
):
bl_idname
=
"
object.rotate_around
"
bl_idname
=
"
object.rotate_around
"
bl_label
=
"
Turnaround
"
bl_label
=
"
Turnaround
"
bl_description
=
"
Create camera rotation around selected object
"
bl_description
=
"
Create camera rotation around selected object
"
...
@@ -182,7 +182,7 @@ class RunAction(Operator):
...
@@ -182,7 +182,7 @@ class RunAction(Operator):
# ------------------------------------------------------
# ------------------------------------------------------
# Define Properties
# Define Properties
# ------------------------------------------------------
# ------------------------------------------------------
class
C
ameraTurn
Props
(
PropertyGroup
):
class
C
AMERATURN_
Props
(
PropertyGroup
):
camera_revol_x
:
FloatProperty
(
camera_revol_x
:
FloatProperty
(
name
=
'
X
'
,
min
=
0
,
max
=
25
,
name
=
'
X
'
,
min
=
0
,
max
=
25
,
...
@@ -261,12 +261,12 @@ class CameraTurnProps(PropertyGroup):
...
@@ -261,12 +261,12 @@ class CameraTurnProps(PropertyGroup):
# ------------------------------------------------------
# ------------------------------------------------------
# UI Class
# UI Class
# ------------------------------------------------------
# ------------------------------------------------------
class
PanelUI
(
Panel
):
class
CAMERATURN_PT_ui
(
Panel
):
bl_idname
=
"
CAMERA_TURN_PT_main
"
bl_idname
=
"
CAMERA_TURN_PT_main
"
bl_label
=
"
Turnaround Camera
"
bl_label
=
"
Turnaround Camera
"
bl_space_type
=
"
VIEW_3D
"
bl_space_type
=
"
VIEW_3D
"
bl_region_type
=
"
TOOLS
"
bl_region_type
=
"
UI
"
bl_category
=
"
Animation
"
bl_category
=
"
View
"
def
draw
(
self
,
context
):
def
draw
(
self
,
context
):
layout
=
self
.
layout
layout
=
self
.
layout
...
@@ -297,13 +297,13 @@ class PanelUI(Panel):
...
@@ -297,13 +297,13 @@ class PanelUI(Panel):
row
.
prop
(
scene
,
"
frame_end
"
)
row
.
prop
(
scene
,
"
frame_end
"
)
col
=
layout
.
column
(
align
=
True
)
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
,
"
camera_revol_x
"
)
split
.
prop
(
turn_camera
,
"
inverse_x
"
,
toggle
=
True
)
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
,
"
camera_revol_y
"
)
split
.
prop
(
turn_camera
,
"
inverse_y
"
,
toggle
=
True
)
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
,
"
camera_revol_z
"
)
split
.
prop
(
turn_camera
,
"
inverse_z
"
,
toggle
=
True
)
split
.
prop
(
turn_camera
,
"
inverse_z
"
,
toggle
=
True
)
...
@@ -330,17 +330,24 @@ class PanelUI(Panel):
...
@@ -330,17 +330,24 @@ class PanelUI(Panel):
# ------------------------------------------------------
# ------------------------------------------------------
# Registration
# Registration
# ------------------------------------------------------
# ------------------------------------------------------
classes
=
(
CAMERATURN_OT_RunAction
,
CAMERATURN_PT_ui
,
CAMERATURN_Props
)
def
register
():
def
register
():
bpy
.
utils
.
register_class
(
RunAction
)
from
bpy.utils
import
register_class
bpy
.
utils
.
register_class
(
PanelUI
)
for
cls
in
classes
:
bpy
.
utils
.
register_class
(
CameraTurnProps
)
register_class
(
cls
)
bpy
.
types
.
Scene
.
turn_camera
=
PointerProperty
(
type
=
CameraTurnProps
)
bpy
.
types
.
Scene
.
turn_camera
=
PointerProperty
(
type
=
CAMERATURN_Props
)
def
unregister
():
def
unregister
():
bpy
.
utils
.
unregister_class
(
RunAction
)
from
bpy.utils
import
unregister_class
bpy
.
utils
.
unregister_class
(
PanelUI
)
for
cls
in
reversed
(
classes
):
bpy
.
utils
.
unregister_class
(
CameraTurnProps
)
unregister_class
(
cls
)
del
bpy
.
types
.
Scene
.
turn_camera
del
bpy
.
types
.
Scene
.
turn_camera
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment