本文整理汇总了Python中MovieCamera.chooseDropShot方法的典型用法代码示例。如果您正苦于以下问题:Python MovieCamera.chooseDropShot方法的具体用法?Python MovieCamera.chooseDropShot怎么用?Python MovieCamera.chooseDropShot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieCamera
的用法示例。
在下文中一共展示了MovieCamera.chooseDropShot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doDrops
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseDropShot [as 别名]
def doDrops(drops):
if len(drops) == 0:
return (None, None)
suitDropsDict = { }
for drop in drops:
suitId = drop['target']['suit'].doId
if suitDropsDict.has_key(suitId):
suitDropsDict[suitId].append(drop)
else:
suitDropsDict[suitId] = [
drop]
suitDrops = suitDropsDict.values()
def compFunc(a, b):
if len(a) > len(b):
return 1
elif len(a) < len(b):
return -1
return 0
suitDrops.sort(compFunc)
delay = 0.0
tracks = []
for st in suitDrops:
if len(st) > 0:
ival = __doSuitDrops(st)
if ival:
tracks.append(Track([
(delay, ival)]))
delay = delay + TOON_DROP_SUIT_DELAY
mtrack = MultiTrack(tracks, name = 'toplevel-drop')
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseDropShot(drops, suitDropsDict, camDuration)
return (mtrack, camTrack)
示例2: doDrops
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseDropShot [as 别名]
def doDrops(drops):
if len(drops) == 0:
return (None, None)
npcArrivals, npcDepartures, npcs = MovieNPCSOS.doNPCTeleports(drops)
suitDropsDict = {}
groupDrops = []
for drop in drops:
track = drop['track']
level = drop['level']
targets = drop['target']
if len(targets) == 1:
suitId = targets[0]['suit'].doId
if suitId in suitDropsDict:
suitDropsDict[suitId].append((drop, targets[0]))
else:
suitDropsDict[suitId] = [(drop, targets[0])]
elif level <= MAX_LEVEL_INDEX and attackAffectsGroup(track, level):
groupDrops.append(drop)
else:
for target in targets:
suitId = target['suit'].doId
if suitId in suitDropsDict:
otherDrops = suitDropsDict[suitId]
alreadyInList = 0
for oDrop in otherDrops:
if oDrop[0]['toon'] == drop['toon']:
alreadyInList = 1
if alreadyInList == 0:
suitDropsDict[suitId].append((drop, target))
else:
suitDropsDict[suitId] = [(drop, target)]
suitDrops = suitDropsDict.values()
def compFunc(a, b):
if len(a) > len(b):
return 1
elif len(a) < len(b):
return -1
return 0
suitDrops.sort(compFunc)
delay = 0.0
mtrack = Parallel(name='toplevel-drop')
npcDrops = {}
for st in suitDrops:
if len(st) > 0:
ival = __doSuitDrops(st, npcs, npcDrops)
if ival:
mtrack.append(Sequence(Wait(delay), ival))
delay = delay + TOON_DROP_SUIT_DELAY
dropTrack = Sequence(npcArrivals, mtrack, npcDepartures)
camDuration = mtrack.getDuration()
if groupDrops:
ival = __doGroupDrops(groupDrops)
dropTrack.append(ival)
camDuration += ival.getDuration()
enterDuration = npcArrivals.getDuration()
exitDuration = npcDepartures.getDuration()
camTrack = MovieCamera.chooseDropShot(drops, suitDropsDict, camDuration, enterDuration, exitDuration)
return (dropTrack, camTrack)