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
75d6f21d
Commit
75d6f21d
authored
14 years ago
by
Daniel Salazar
Browse files
Options
Downloads
Patches
Plain Diff
Simple addon for animating spline curves or "RotoBeziers" for
rotoscoping
parent
e5858426
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
animation_rotobezier.py
+152
-0
152 additions, 0 deletions
animation_rotobezier.py
with
152 additions
and
0 deletions
animation_rotobezier.py
0 → 100644
+
152
−
0
View file @
75d6f21d
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
#-------------------------------------------------------------------------
# WARNING: Currently adding new CVs to an already animated curve isn't safe
# Thanks to Campbell Barton for hes API additions and fixes
# Daniel Salazar - ZanQdo
#-------------------------------------------------------------------------
bl_addon_info
=
{
'
name
'
:
'
RotoBezier
'
,
'
author
'
:
'
Daniel Salazar <zanqdo@gmail.com>
'
,
'
version
'
:
(
0
,
1
),
'
blender
'
:
(
2
,
5
,
5
),
'
api
'
:
33198
,
'
location
'
:
'
Select a Curve > Properties > Curve > RotoBezier
'
,
'
description
'
:
'
Allows animation of bezier curves for rotoscoping
'
,
'
warning
'
:
''
,
'
wiki_url
'
:
''
,
'
tracker_url
'
:
''
,
'
category
'
:
'
Animation
'
}
import
bpy
#
# GUI (Panel)
#
class
OBJECT_PT_rotobezier
(
bpy
.
types
.
Panel
):
bl_label
=
"
RotoBezier
"
bl_space_type
=
"
PROPERTIES
"
bl_region_type
=
"
WINDOW
"
bl_context
=
"
data
"
# show this add-on only in the Camera-Data-Panel
@classmethod
def
poll
(
self
,
context
):
return
context
.
active_object
.
type
==
'
CURVE
'
# draw the gui
def
draw
(
self
,
context
):
layout
=
self
.
layout
row
=
layout
.
row
()
row
.
operator
(
'
curve.insert_keyframe_rotobezier
'
)
row
.
operator
(
'
curve.delete_keyframe_rotobezier
'
)
class
CURVE_OT_insert_keyframe_rotobezier
(
bpy
.
types
.
Operator
):
bl_label
=
'
Insert Keyframe
'
bl_idname
=
'
curve.insert_keyframe_rotobezier
'
bl_description
=
'
Insert a RotoBezier Keyframe
'
bl_options
=
{
'
REGISTER
'
,
'
UNDO
'
}
# on mouse up:
def
invoke
(
self
,
context
,
event
):
self
.
insert_keyframe
(
context
)
return
{
'
FINISHED
'
}
def
insert_keyframe
(
op
,
context
):
import
bpy
Obj
=
bpy
.
context
.
active_object
if
Obj
.
type
==
'
CURVE
'
:
Mode
=
False
if
bpy
.
context
.
mode
!=
'
OBJECT
'
:
Mode
=
not
Mode
bpy
.
ops
.
object
.
editmode_toggle
()
Data
=
Obj
.
data
for
Splines
in
Data
.
splines
:
for
CVs
in
Splines
.
bezier_points
:
CVs
.
keyframe_insert
(
'
co
'
)
CVs
.
keyframe_insert
(
'
handle_left
'
)
CVs
.
keyframe_insert
(
'
handle_right
'
)
if
Mode
:
bpy
.
ops
.
object
.
editmode_toggle
()
return
{
'
FINISHED
'
}
class
CURVE_OT_delete_keyframe_rotobezier
(
bpy
.
types
.
Operator
):
bl_label
=
'
Delete Keyframe
'
bl_idname
=
'
curve.delete_keyframe_rotobezier
'
bl_description
=
'
Delete a RotoBezier Keyframe
'
# on mouse up:
def
invoke
(
self
,
context
,
event
):
self
.
delete_keyframe
(
context
)
return
{
'
FINISHED
'
}
def
delete_keyframe
(
op
,
context
):
import
bpy
Obj
=
bpy
.
context
.
active_object
if
Obj
.
type
==
'
CURVE
'
:
Mode
=
False
if
bpy
.
context
.
mode
!=
'
OBJECT
'
:
Mode
=
not
Mode
bpy
.
ops
.
object
.
editmode_toggle
()
Data
=
Obj
.
data
for
Splines
in
Data
.
splines
:
for
CVs
in
Splines
.
bezier_points
:
CVs
.
keyframe_delete
(
'
co
'
)
CVs
.
keyframe_delete
(
'
handle_left
'
)
CVs
.
keyframe_delete
(
'
handle_right
'
)
if
Mode
:
bpy
.
ops
.
object
.
editmode_toggle
()
return
{
'
FINISHED
'
}
def
register
():
pass
def
unregister
():
pass
if
__name__
==
"
__main__
"
:
register
()
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