Page Menu
Home
Search
Configure Global Search
Log In
Files
F20290
sequencer_eco.py
Public
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
carlos padial (carlospadial)
Nov 13 2013, 4:23 PM
Size
4 KB
Subscribers
None
sequencer_eco.py
View Options
#----------------------------------------------------------
# File sequencer_slide_strip.py
#----------------------------------------------------------
# ##### 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 #####
bl_info
=
{
'name'
:
'Eco'
,
'author'
:
'Carlos Padial'
,
'version'
:
(
0
,
1
),
'blender'
:
(
2
,
6
,
2
),
'api'
:
44136
,
'category'
:
'Sequencer'
,
'location'
:
'Sequencer > UI > Eco'
,
'description'
:
'eco operator to repeat and offset strips'
,
'wiki_url'
:
'http://wiki.blender.org/index.php?title=Extensions:2.6/Py/Scripts/Sequencer/Eco'
,
'tracker_url'
:
''
,}
'''
==Installation==
Save this file [] in your addons folder
Enable the Add-On from the Add-Ons tab in the User Preferences window, Sequencer section.
==Usage==
Select a movie or meta strip, set number of echoes and offset (in frames), and press Eco button.
The opacity of all strips is updated to 1/number of echoes to mantain luminance. The blending is set to add for all clips except first one.
All clips are grouped inside a meta. Press home after running the script to see the meta.
==TODO==
Add other blending options.
'''
import
bpy
from
bpy.props
import
IntProperty
def
act_strip
(
context
):
try
:
return
context
.
scene
.
sequence_editor
.
active_strip
except
AttributeError
:
return
None
def
initSceneProperties
(
scn
):
bpy
.
types
.
Scene
.
eco_x
=
IntProperty
(
name
=
'Eco X'
,
default
=
1
,
min
=
1
,
max
=
25
)
scn
[
'eco_x'
]
=
5
bpy
.
types
.
Scene
.
offset_eco_x
=
IntProperty
(
name
=
'Offset Eco X'
,
default
=
1
,
min
=
-
250
,
max
=
250
)
scn
[
'offset_eco_x'
]
=
1
return
initSceneProperties
(
bpy
.
context
.
scene
)
class
EcoPanel
(
bpy
.
types
.
Panel
):
bl_label
=
"Eco Panel"
bl_idname
=
"OBJECT_PT_eco"
bl_space_type
=
"SEQUENCE_EDITOR"
bl_region_type
=
"UI"
@classmethod
def
poll
(
self
,
context
):
scn
=
context
.
scene
if
scn
and
scn
.
sequence_editor
:
return
scn
.
sequence_editor
.
sequences
else
:
return
False
def
draw_header
(
self
,
context
):
layout
=
self
.
layout
layout
.
label
(
text
=
""
,
icon
=
"NLA"
)
def
draw
(
self
,
context
):
scn
=
bpy
.
context
.
scene
strip
=
act_strip
(
context
)
seq_type
=
strip
.
type
if
seq_type
==
'MOVIE'
or
seq_type
==
'META'
or
seq_type
==
'SCENE'
:
active_strip
=
act_strip
(
context
)
layout
=
self
.
layout
row
=
layout
.
row
()
row
.
prop
(
scn
,
'eco_x'
,
text
=
"Ecos"
)
row
=
layout
.
row
()
row
.
prop
(
scn
,
'offset_eco_x'
,
text
=
"Offset eco"
)
row
=
layout
.
row
()
row
.
operator
(
'sequencer.eco'
)
class
OBJECT_OT_EcoOperator
(
bpy
.
types
.
Operator
):
bl_idname
=
"sequencer.eco"
bl_label
=
"Eco operator"
bl_description
=
'eco eco eco'
bl_options
=
{
'REGISTER'
,
'UNDO'
}
def
execute
(
self
,
context
):
active_strip
=
act_strip
(
context
)
if
not
act_strip
:
self
.
report
({
'ERROR_INVALID_INPUT'
},
'No active strip'
)
return
{
'CANCELLED'
}
scn
=
bpy
.
context
.
scene
sel_strips
=
bpy
.
context
.
selected_sequences
cur_camera
=
scn
.
camera
eco
=
scn
[
'eco_x'
]
offset
=
scn
[
'offset_eco_x'
]
active_strip
.
blend_type
=
'REPLACE'
active_strip
.
blend_alpha
=
1
for
i
in
range
(
eco
):
bpy
.
ops
.
sequencer
.
duplicate
(
mode
=
'TRANSLATION'
)
bpy
.
ops
.
transform
.
seq_slide
(
value
=
(
offset
,
1
),
snap
=
False
,
snap_target
=
'CLOSEST'
,
snap_point
=
(
0
,
0
,
0
),
snap_align
=
False
,
snap_normal
=
(
0
,
0
,
0
),
release_confirm
=
False
)
active_strip
=
act_strip
(
context
)
active_strip
.
blend_type
=
'ALPHA_OVER'
active_strip
.
blend_alpha
=
1
/
eco
bpy
.
ops
.
sequencer
.
select_all
(
action
=
'TOGGLE'
)
bpy
.
ops
.
sequencer
.
select_all
(
action
=
'TOGGLE'
)
bpy
.
ops
.
sequencer
.
meta_make
()
return
{
'FINISHED'
}
def
register
():
bpy
.
utils
.
register_class
(
EcoPanel
)
bpy
.
utils
.
register_class
(
OBJECT_OT_EcoOperator
)
def
unregister
():
bpy
.
utils
.
unregister_class
(
EcoPanel
)
bpy
.
utils
.
unregister_class
(
OBJECT_OT_EcoOperator
)
if
__name__
==
"__main__"
:
register
()
File Metadata
Details
Mime Type
text/x-python
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7f/c8/8f934ea07c7d20e9bb84ff36bd77
Event Timeline
Log In to Comment