Page MenuHome

add_shot.py

add_shot.py

# add_shot.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 *****
# --------------------------------------------------------------------------
import Blender
from Blender import *
suffixbut = Draw.Create("")
def create( shot ):
scn = Blender.Scene.GetCurrent()
frm = Blender.Get('curframe')
timeline = scn.getTimeLine()
try:
baz = Blender.Object.Get(shot)
except:
if timeline.getMarked(frm) != [] :
cam = Blender.Camera.New('persp',shot)
ob = scn.objects.new(cam)
ob.setName(shot)
scn.setCurrentCamera(ob)
timeline.add (frm)
timeline.setName(frm,'cam'+shot)
else:
print "Marker at current frame"
else:
print " camera "+ shot+" exists."
def event(evt, val):
if evt == Draw.ESCKEY:
Draw.Exit()
return
def choice_evt(evt,val):
global suffixbut
if evt == 1006:
suffixbut.val = val
create( val )
#Draw.Redraw()
return
def button(evt):
Draw.Redraw()
#Redraw()
def gui():
global suffixbut
suffixbut = Draw.String('Shot: ', 1006, 20, 20, 200, 20, suffixbut.val, 32, 'Shot_number',choice_evt)
Draw.Register(gui, event, button)

File Metadata

Mime Type
text/x-python
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1a/96/41ecca7279ff8fc8123c3bf4b4b2

Event Timeline