本文整理汇总了Python中MovieCamera.chooseSOSShot方法的典型用法代码示例。如果您正苦于以下问题:Python MovieCamera.chooseSOSShot方法的具体用法?Python MovieCamera.chooseSOSShot怎么用?Python MovieCamera.chooseSOSShot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieCamera
的用法示例。
在下文中一共展示了MovieCamera.chooseSOSShot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doSOSs
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSOSShot [as 别名]
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)
示例2: doSOSs
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSOSShot [as 别名]
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)
示例3: doSOSs
# 需要导入模块: import MovieCamera [as 别名]
# 或者: from MovieCamera import chooseSOSShot [as 别名]
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