Page Menu
Home
Search
Configure Global Search
Log In
Files
F7599
camswitch.py
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
bassam kurdali (bassamk)
Nov 13 2013, 1:47 PM
Size
1 KB
Subscribers
None
camswitch.py
View Options
# camswitch.py
#
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2004-2005: Bassam Kurdali
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
#onframechange scriptlink
import
Blender
def
get_last
(
markers
,
frame
):
frames
=
sorted
(
markers
.
keys
())
frames
.
reverse
()
for
marked_frame
in
frames
:
if
marked_frame
<
frame
and
markers
[
marked_frame
][
0
][:
3
]
==
'cam'
:
return
markers
[
marked_frame
][
0
][
3
:]
scn
=
Blender
.
Scene
.
GetCurrent
()
frm
=
Blender
.
Get
(
'curframe'
)
timeline
=
scn
.
getTimeLine
()
marker
=
timeline
.
getMarked
(
frm
)
if
marker
:
marker
=
timeline
.
getName
(
frm
)
if
marker
[:
3
]
==
'cam'
:
if
scn
.
objects
.
camera
.
getName
()
!=
marker
[
3
:]
:
scn
.
objects
.
camera
=
Blender
.
Object
.
Get
(
marker
[
3
:])
else
:
last_shot
=
get_last
(
timeline
.
getMarked
(),
frm
)
if
scn
.
objects
.
camera
.
getName
()
!=
last_shot
:
scn
.
objects
.
camera
=
Blender
.
Object
.
Get
(
last_shot
)
File Metadata
Details
Mime Type
text/plain
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
24/10/8bda805fa488a95f26ed3bf94c94
Event Timeline
Log In to Comment