本文整理汇总了Python中MovieCamera.chooseSquirtShot方法的典型用法代码示例。如果您正苦于以下问题:Python MovieCamera.chooseSquirtShot方法的具体用法?Python MovieCamera.chooseSquirtShot怎么用?Python MovieCamera.chooseSquirtShot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieCamera
的用法示例。
在下文中一共展示了MovieCamera.chooseSquirtShot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doSquirts
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSquirtShot [as 别名]
def doSquirts(squirts):
if len(squirts) == 0:
return (None, None)
suitSquirtsDict = { }
doneUber = 0
skip = 0
for squirt in squirts:
skip = 0
if skip:
continue
if type(squirt['target']) == type([]):
target = squirt['target'][0]
suitId = target['suit'].doId
if suitSquirtsDict.has_key(suitId):
suitSquirtsDict[suitId].append(squirt)
else:
suitSquirtsDict[suitId] = [
squirt]
type(squirt['target']) == type([])
suitId = squirt['target']['suit'].doId
if suitSquirtsDict.has_key(suitId):
suitSquirtsDict[suitId].append(squirt)
continue
suitSquirtsDict[suitId] = [
squirt]
suitSquirts = suitSquirtsDict.values()
def compFunc(a, b):
if len(a) > len(b):
return 1
elif len(a) < len(b):
return -1
return 0
suitSquirts.sort(compFunc)
delay = 0.0
mtrack = Parallel()
for st in suitSquirts:
if len(st) > 0:
ival = __doSuitSquirts(st)
if ival:
mtrack.append(Sequence(Wait(delay), ival))
delay = delay + TOON_SQUIRT_SUIT_DELAY
continue
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseSquirtShot(squirts, suitSquirtsDict, camDuration)
return (mtrack, camTrack)
示例2: doSquirts
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSquirtShot [as 别名]
def doSquirts(squirts):
if len(squirts) == 0:
return (None, None)
suitSquirtsDict = {}
for squirt in squirts:
suitId = squirt["target"]["suit"].doId
if suitSquirtsDict.has_key(suitId):
suitSquirtsDict[suitId].append(squirt)
else:
suitSquirtsDict[suitId] = [squirt]
suitSquirts = suitSquirtsDict.values()
def compFunc(a, b):
if len(a) > len(b):
return 1
elif len(a) < len(b):
return -1
return 0
suitSquirts.sort(compFunc)
delay = 0.0
tracks = []
for st in suitSquirts:
if len(st) > 0:
ival = __doSuitSquirts(st)
if ival:
tracks.append(Track([(delay, ival)]))
delay = delay + TOON_SQUIRT_SUIT_DELAY
mtrack = MultiTrack(tracks)
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseSquirtShot(squirts, suitSquirtsDict, camDuration)
return (mtrack, camTrack)