本文整理汇总了Python中MovieCamera类的典型用法代码示例。如果您正苦于以下问题:Python MovieCamera类的具体用法?Python MovieCamera怎么用?Python MovieCamera使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MovieCamera类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doToonVictory
def doToonVictory(localToonActive, toons, rewardDicts, deathList, rpanel):
tracks = []
if localToonActive == 1:
tracks.append(Func(rpanel.show))
tracks.append(Func(NametagGlobals.setOnscreenChatForced, 1))
camTracks = []
endTracks = []
danceSound = globalBattleSoundCache.getSound('ENC_Win.mp3')
for t in toons:
rdict = __findToonReward(rewardDicts, t)
expTrack = rpanel.getExpTrack(t, rdict['origExp'], rdict['earnedExp'], deathList, rdict['items'], rdict['missedItems'], toons)
if expTrack:
tracks.append(expTrack)
camDuration = expTrack.getDuration()
camExpTrack = MovieCamera.chooseRewardShot(t, camDuration)
camTracks.append(MovieCamera.chooseRewardShot(t, camDuration))
if localToonActive == 1:
tracks.append(Func(rpanel.hide))
tracks.append(Func(NametagGlobals.setOnscreenChatForced, 0))
tracks = tracks + endTracks
seq = Sequence(tracks)
seqdur = seq.getDuration()
print 'dance duration: ', seqdur
soundTrack = SoundInterval(danceSound, duration = seqdur, loop = 1)
mtrack = Parallel(Sequence(tracks), soundTrack)
camTrack = Track(camTracks)
return (mtrack, camTrack)
示例2: doToonVictory
def doToonVictory(localToonActive, toons, rewardToonIds, rewardDicts, deathList, rpanel, allowGroupShot = 1, uberList = [], helpfulToonsList = [], noSkip = False):
track = Sequence()
if localToonActive == 1:
track.append(Func(rpanel.show))
track.append(Func(NametagGlobals.setOnscreenChatForced, 1))
camTrack = Sequence()
endTrack = Sequence()
danceSound = globalBattleSoundCache.getSound('ENC_Win.ogg')
toonList = []
countToons = 0
uberListNew = []
for t in toons:
if isinstance(t, types.IntType):
t = base.cr.doId2do.get(t)
if t:
toonList.append(t)
uberListNew.append(uberList[countToons])
countToons += 1
toonId2toon = {}
for toon in toonList:
toonId2toon[toon.doId] = toon
rewardToonList = []
for id in rewardToonIds:
rewardToonList.append(toonId2toon.get(id))
skipper = ToonVictorySkipper(len(toonList), noSkip)
lastListenIndex = 0
track.append(skipper.getSetupFunc(lastListenIndex))
for tIndex in xrange(len(toonList)):
t = toonList[tIndex]
rdict = __findToonReward(rewardDicts, t)
if rdict != None:
expTrack = rpanel.getExpTrack(t, rdict['origExp'], rdict['earnedExp'], deathList, rdict['origQuests'], rdict['items'], rdict['missedItems'], rdict['origMerits'], rdict['merits'], rdict['parts'], rewardToonList, uberListNew[tIndex], helpfulToonsList, noSkip=noSkip)
if expTrack:
skipper.setStartTime(tIndex, track.getDuration())
track.append(skipper.getTeardownFunc(lastListenIndex))
lastListenIndex = tIndex
track.append(skipper.getSetupFunc(lastListenIndex))
track.append(expTrack)
camDuration = expTrack.getDuration()
camExpTrack = MovieCamera.chooseRewardShot(t, camDuration)
camTrack.append(MovieCamera.chooseRewardShot(t, camDuration, allowGroupShot=allowGroupShot))
track.append(skipper.getTeardownFunc(lastListenIndex))
track.append(Func(skipper.destroy))
if localToonActive == 1:
track.append(Func(rpanel.hide))
track.append(Func(NametagGlobals.setOnscreenChatForced, 0))
track.append(endTrack)
trackdur = track.getDuration()
soundTrack = SoundInterval(danceSound, duration=trackdur, loop=1)
mtrack = Parallel(track, soundTrack)
skipper.setIvals((mtrack, camTrack))
return (mtrack, camTrack, skipper)
示例3: doSOSs
def doSOSs(calls):
if len(calls) == 0:
return (None, None)
def callerFunc(toon, handle):
toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
handle.d_battleSOS(handle.doId)
def calleeFunc(toon, handle):
toon.setChatAbsolute(TTLocalizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
def observerFunc(toon):
toon.setChatAbsolute(TTLocalizer.MovieSOSObserverHelp, CFSpeech | CFTimeout)
mtrack = Sequence()
for c in calls:
toon = c['toon']
targetType = c['targetType']
handle = c['target']
mtrack.append(Wait(0.5))
if targetType == 'observer':
ival = Func(observerFunc, toon)
elif targetType == 'caller':
ival = Func(callerFunc, toon, handle)
elif targetType == 'callee':
ival = Func(calleeFunc, toon, handle)
else:
notify.error('invalid target type: %s' % targetType)
mtrack.append(ival)
mtrack.append(Wait(2.0))
notify.debug('toon: %s calls for help' % toon.getName())
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
return (mtrack, camTrack)
示例4: doSounds
def doSounds(sounds):
if len(sounds) == 0:
return (None, None)
npcArrivals, npcDepartures, npcs = MovieNPCSOS.doNPCTeleports(sounds)
mtrack = Parallel()
hitCount = 0
prevLevel = 0
prevSounds = [[],
[],
[],
[],
[],
[],
[]]
for sound in sounds:
level = sound['level']
prevSounds[level].append(sound)
for target in sound['target']:
if target['hp'] > 0:
hitCount += 1
break
delay = 0.0
for soundList in prevSounds:
if len(soundList) > 0:
mtrack.append(__doSoundsLevel(soundList, delay, hitCount, npcs))
delay += TOON_SOUND_DELAY
soundTrack = Sequence(npcArrivals, mtrack, npcDepartures)
targets = sounds[0]['target']
camDuration = mtrack.getDuration()
enterDuration = npcArrivals.getDuration()
exitDuration = npcDepartures.getDuration()
camTrack = MovieCamera.chooseSoundShot(sounds, targets, camDuration, enterDuration, exitDuration)
return (soundTrack, camTrack)
示例5: doFires
def doFires(fires):
if len(fires) == 0:
return (None, None)
suitFiresDict = { }
for fire in fires:
suitId = fire['target']['suit'].doId
if suitFiresDict.has_key(suitId):
suitFiresDict[suitId].append(fire)
continue
suitFiresDict[suitId] = [
fire]
suitFires = suitFiresDict.values()
def compFunc(a, b):
if len(a) > len(b):
return 1
elif len(a) < len(b):
return -1
return 0
suitFires.sort(compFunc)
totalHitDict = { }
singleHitDict = { }
groupHitDict = { }
for fire in fires:
suitId = fire['target']['suit'].doId
if fire['target']['hp'] > 0:
addHit(singleHitDict, suitId, 1)
addHit(totalHitDict, suitId, 1)
else:
addHit(singleHitDict, suitId, 0)
addHit(totalHitDict, suitId, 0)
fire['target']['hp'] > 0
notify.debug('singleHitDict = %s' % singleHitDict)
notify.debug('groupHitDict = %s' % groupHitDict)
notify.debug('totalHitDict = %s' % totalHitDict)
delay = 0.0
mtrack = Parallel()
firedTargets = []
for sf in suitFires:
if len(sf) > 0:
ival = __doSuitFires(sf)
if ival:
mtrack.append(Sequence(Wait(delay), ival))
delay = delay + TOON_FIRE_SUIT_DELAY
continue
retTrack = Sequence()
retTrack.append(mtrack)
camDuration = retTrack.getDuration()
camTrack = MovieCamera.chooseFireShot(fires, suitFiresDict, camDuration)
return (retTrack, camTrack)
示例6: doHeals
def doHeals(heals, hasInteractivePropHealBonus):
if len(heals) == 0:
return (None, None)
track = Sequence()
for h in heals:
ival = __doHealLevel(h, hasInteractivePropHealBonus)
if ival:
track.append(ival)
camDuration = track.getDuration()
camTrack = MovieCamera.chooseHealShot(heals, camDuration)
return (track, camTrack)
示例7: doSquirts
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)
示例8: doPetSOSs
def doPetSOSs(PetSOSs):
if len(PetSOSs) == 0:
return (None, None)
track = Sequence()
textTrack = Sequence()
for p in PetSOSs:
ival = __doPetSOS(p)
if ival:
track.append(ival)
camDuration = track.getDuration()
camTrack = MovieCamera.chooseHealShot(PetSOSs, camDuration)
return (track, camTrack)
示例9: doHeals
def doHeals(heals):
if len(heals) == 0:
return (None, None)
ivals = []
for h in heals:
ival = __doHealLevel(h)
if ival:
ivals.append(ival)
mtrack = Track(ivals)
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseHealShot(heals, camDuration)
return (mtrack, camTrack)
示例10: doLures
def doLures(lures):
if len(lures) == 0:
return (None, None)
npcArrivals, npcDepartures, npcs = MovieNPCSOS.doNPCTeleports(lures)
mtrack = Parallel()
for l in lures:
ival = __doLureLevel(l, npcs)
if ival:
mtrack.append(ival)
lureTrack = Sequence(npcArrivals, mtrack, npcDepartures)
camDuration = mtrack.getDuration()
enterDuration = npcArrivals.getDuration()
exitDuration = npcDepartures.getDuration()
camTrack = MovieCamera.chooseLureShot(lures, camDuration, enterDuration, exitDuration)
return (lureTrack, camTrack)
示例11: doLures
def doLures(lures):
if len(lures) == 0:
return (None, None)
ivals = []
for l in lures:
ival = __doLureLevel(l)
if ival:
ivals.append(Track([
ival]))
mtrack = MultiTrack(ivals)
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseLureShot(lures, camDuration)
return (mtrack, camTrack)
示例12: doNPCSOSs
def doNPCSOSs(NPCSOSs):
if len(NPCSOSs) == 0:
return (None, None)
track = Sequence()
textTrack = Sequence()
for n in NPCSOSs:
ival, textIval = __doNPCSOS(n)
if ival:
track.append(ival)
textTrack.append(textIval)
camDuration = track.getDuration()
if camDuration > 0.0:
camTrack = MovieCamera.chooseHealShot(NPCSOSs, camDuration)
else:
camTrack = Sequence()
return (track, Parallel(camTrack, textTrack))
示例13: doSOSs
def doSOSs(calls):
if len(calls) == 0:
return (None, None)
def callerFunc(toon, handle):
toon.setChatAbsolute(Localizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
handle.d_battleSOS(toonbase.localToon.doId)
def calleeFunc(toon, handle):
toon.setChatAbsolute(Localizer.MovieSOSCallHelp % handle.getName(), CFSpeech | CFTimeout)
def observerFunc(toon):
toon.setChatAbsolute(Localizer.MovieSOSObserverHelp, CFSpeech | CFTimeout)
ivals = []
for c in calls:
toon = c['toon']
targetType = c['targetType']
handle = c['target']
ivals.append(WaitInterval(0.5))
if targetType == 'observer':
ival = FunctionInterval(observerFunc, extraArgs = [
toon])
elif targetType == 'caller':
ival = FunctionInterval(callerFunc, extraArgs = [
toon,
handle])
elif targetType == 'callee':
ival = FunctionInterval(calleeFunc, extraArgs = [
toon,
handle])
else:
notify.error('ivalid target type: %s' % targetType)
ivals.append(ival)
ivals.append(WaitInterval(2.0))
notify.debug('toon: %s calls for help' % toon.getName())
mtrack = Track(ivals)
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
return (mtrack, camTrack)
示例14: doSOSs
def doSOSs(calls):
if len(calls) == 0:
return None, None
def callerFunc(toon, handle):
toon.setChatAbsolute(
TTLocalizer.MovieSOSCallHelp %
handle.getName(), CFSpeech | CFTimeout)
base.cr.ttrFriendsManager.sendUpdate('sendTalkWhisper', [handle.doId, 'I Need Help In A Battle!!!'])
def calleeFunc(toon, handle):
toon.setChatAbsolute(
TTLocalizer.MovieSOSCallHelp %
handle.getName(), CFSpeech | CFTimeout)
def observerFunc(toon):
toon.setChatAbsolute(
TTLocalizer.MovieSOSObserverHelp,
CFSpeech | CFTimeout)
mtrack = Sequence()
for c in calls:
toon = c['toon']
targetType = c['targetType']
handle = c['target']
mtrack.append(Wait(0.5))
if targetType == 'observer':
ival = Func(observerFunc, toon)
elif targetType == 'caller':
ival = Func(callerFunc, toon, handle)
elif targetType == 'callee':
ival = Func(calleeFunc, toon, handle)
else:
notify.error('invalid target type: %s' % targetType)
mtrack.append(ival)
mtrack.append(Wait(2.0))
notify.debug('toon: %s calls for help' % toon.getName())
camDuration = mtrack.getDuration()
camTrack = MovieCamera.chooseSOSShot(toon, camDuration)
return mtrack, camTrack
示例15: doDrops
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)