本文整理汇总了Python中direct.interval.MetaInterval.Parallel.append方法的典型用法代码示例。如果您正苦于以下问题:Python Parallel.append方法的具体用法?Python Parallel.append怎么用?Python Parallel.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.interval.MetaInterval.Parallel
的用法示例。
在下文中一共展示了Parallel.append方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: throwTeamInWater
# 需要导入模块: from direct.interval.MetaInterval import Parallel [as 别名]
# 或者: from direct.interval.MetaInterval.Parallel import append [as 别名]
def throwTeamInWater(self, losingTeam):
self.notify.debug('throwTeamInWater( %s )' % PartyGlobals.TeamActivityTeams.getString(losingTeam))
splashSet = False
for toonId in self.toonIds[losingTeam]:
self.fallenToons.append(toonId)
toon = self.getAvatar(toonId)
fallenPosIndex = self.toonIds[losingTeam].index(toonId)
if fallenPosIndex < 0 or fallenPosIndex >= 4:
fallenPosIndex = 0
newPos = self.fallenPositions[fallenPosIndex]
if self.toonIdsToAnimIntervals.has_key(toonId) and self.toonIdsToAnimIntervals[toonId] is not None:
if self.toonIdsToAnimIntervals[toonId].isPlaying():
self.toonIdsToAnimIntervals[toonId].finish()
if toon:
parallel = Parallel(ActorInterval(actor=toon, animName='slip-forward', duration=2.0), LerpPosInterval(toon, duration=2.0, pos=newPos, other=self.root))
else:
self.notify.warning('toon %d is none, skipping slip-forward' % toonId)
parallel = Parallel()
if not splashSet:
splashSet = True
parallel.append(self.splashInterval)
if toon:
self.toonIdsToAnimIntervals[toonId] = Sequence(parallel, Func(toon.loop, 'neutral'))
else:
self.notify.warning('toon %d is none, skipping toon.loop(neutral)' % toonId)
self.toonIdsToAnimIntervals[toonId] = parallel
self.toonIdsToAnimIntervals[toonId].start()
return
示例2: getIntroTrack
# 需要导入模块: from direct.interval.MetaInterval import Parallel [as 别名]
# 或者: from direct.interval.MetaInterval.Parallel import append [as 别名]
def getIntroTrack(self):
self.__cameraTask(None)
origCamParent = camera.getParent()
origCamPos = camera.getPos()
origCamHpr = camera.getHpr()
iCamParent = base.localAvatar.attachNewNode('iCamParent')
iCamParent.setH(180)
camera.reparentTo(iCamParent)
toonHeight = base.localAvatar.getHeight()
camera.setPos(0, -15, toonHeight * 3)
camera.lookAt(0, 0, toonHeight / 2.0)
iCamParent.wrtReparentTo(origCamParent)
waitDur = 5.0
lerpDur = 4.5
lerpTrack = Parallel()
startHpr = iCamParent.getHpr()
startHpr.setX(PythonUtil.reduceAngle(startHpr[0]))
lerpTrack.append(LerpPosHprInterval(iCamParent, lerpDur, pos=Point3(0, 0, 0), hpr=Point3(0, 0, 0), startHpr=startHpr, name=self.uniqueName('introLerpParent')))
lerpTrack.append(LerpPosHprInterval(camera, lerpDur, pos=origCamPos, hpr=origCamHpr, blendType='easeInOut', name=self.uniqueName('introLerpCameraPos')))
base.localAvatar.startLookAround()
def cleanup(origCamParent = origCamParent, origCamPos = origCamPos, origCamHpr = origCamHpr, iCamParent = iCamParent):
camera.reparentTo(origCamParent)
camera.setPos(origCamPos)
camera.setHpr(origCamHpr)
iCamParent.removeNode()
del iCamParent
base.localAvatar.stopLookAround()
return Sequence(Wait(waitDur),
lerpTrack,
Func(cleanup))
示例3: enterShowScores
# 需要导入模块: from direct.interval.MetaInterval import Parallel [as 别名]
# 或者: from direct.interval.MetaInterval.Parallel import append [as 别名]
def enterShowScores(self):
self.notify.debug('enterShowScores')
lerpTrack = Parallel()
lerpDur = 0.5
lerpTrack.append(Parallel(LerpPosInterval(self.goalBar, lerpDur, Point3(0, 0, -.6), blendType='easeInOut'), LerpScaleInterval(self.goalBar, lerpDur, Vec3(self.goalBar.getScale()) * 2.0, blendType='easeInOut')))
tY = 0.6
bY = -.05
lX = -.5
cX = 0
rX = 0.5
scorePanelLocs = (((cX, bY),),
((lX, bY), (rX, bY)),
((cX, tY), (lX, bY), (rX, bY)),
((lX, tY),
(rX, tY),
(lX, bY),
(rX, bY)))
scorePanelLocs = scorePanelLocs[self.numPlayers - 1]
for i in xrange(self.numPlayers):
panel = self.scorePanels[i]
pos = scorePanelLocs[i]
panel.wrtReparentTo(aspect2d)
lerpTrack.append(Parallel(LerpPosInterval(panel, lerpDur, Point3(pos[0], 0, pos[1]), blendType='easeInOut'), LerpScaleInterval(panel, lerpDur, Vec3(panel.getScale()) * 2.0, blendType='easeInOut')))
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))
self.showScoreTrack.start()
#For the Alpha Blueprint ARG
if config.GetBool('want-blueprint4-ARG', False):
MinigameGlobals.generateDebugARGPhrase()
示例4: enterShowScores
# 需要导入模块: from direct.interval.MetaInterval import Parallel [as 别名]
# 或者: from direct.interval.MetaInterval.Parallel import append [as 别名]
def enterShowScores(self):
self.notify.debug('enterShowScores')
lerpTrack = Parallel()
lerpDur = 0.5
lerpTrack.append(Parallel(LerpPosInterval(self.goalBar, lerpDur, Point3(0, 0, -.6), blendType='easeInOut'), LerpScaleInterval(self.goalBar, lerpDur, Vec3(self.goalBar.getScale()) * 2.0, blendType='easeInOut')))
tY = 0.6
bY = -.05
lX = -.5
cX = 0
rX = 0.5
scorePanelLocs = (((cX, bY),),
((lX, bY), (rX, bY)),
((cX, tY), (lX, bY), (rX, bY)),
((lX, tY),
(rX, tY),
(lX, bY),
(rX, bY)))
scorePanelLocs = scorePanelLocs[self.numPlayers - 1]
for i in xrange(self.numPlayers):
panel = self.scorePanels[i]
pos = scorePanelLocs[i]
lerpTrack.append(Parallel(LerpPosInterval(panel, lerpDur, Point3(pos[0], 0, pos[1]), blendType='easeInOut'), LerpScaleInterval(panel, lerpDur, Vec3(panel.getScale()) * 2.0, blendType='easeInOut')))
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))
self.showScoreTrack.start()
示例5: makeBlendIntervalForBlendingToThisAnimation
# 需要导入模块: from direct.interval.MetaInterval import Parallel [as 别名]
# 或者: from direct.interval.MetaInterval.Parallel import append [as 别名]
def makeBlendIntervalForBlendingToThisAnimation(self, newTransitionAnimation, transitionDuration):
currentlyPlayingAnimationsAndEffectsAndDesiredEffects = []
for animationName in self.skeletonAnimationNames:
if animationName == newTransitionAnimation:
continue
controlEffect = self.getControlEffect(animationName)
if controlEffect > 0.0:
currentlyPlayingAnimationsAndEffectsAndDesiredEffects.append((animationName, controlEffect, 0.0))
continue
currentlyPlayingAnimationsAndEffectsAndDesiredEffects.append((newTransitionAnimation, 0.0, 1.0))
if self.blendInterval:
self.blendInterval.pause()
self.blendInterval.clearToInitial()
self.blendInterval = Sequence(name = '%s_%d.blendInterval' % (self.getName(), self.uniqueCounter))
par = Parallel()
for (animationName, fromData, toData) in currentlyPlayingAnimationsAndEffectsAndDesiredEffects:
par.append(LerpFunctionInterval(self.adjustEffect, duration = transitionDuration, fromData = fromData, toData = toData, extraArgs = [
animationName]))
self.blendInterval.append(par)
示例6: DistributedPartyTugOfWarActivity
# 需要导入模块: from direct.interval.MetaInterval import Parallel [as 别名]
# 或者: from direct.interval.MetaInterval.Parallel import append [as 别名]
#.........这里部分代码省略.........
self.toonIdsToAnimIntervals[toonId].start()
return
def handleToonDisabled(self, toonId):
if self.toonIdsToAnimIntervals.has_key(toonId):
if self.toonIdsToAnimIntervals[toonId]:
if self.toonIdsToAnimIntervals[toonId].isPlaying():
self.toonIdsToAnimIntervals[toonId].finish()
else:
self.notify.debug('self.toonIdsToAnimIntervals[%d] is none' % toonId)
def setToonsPlaying(self, leftTeamToonIds, rightTeamToonIds):
DistributedPartyTeamActivity.setToonsPlaying(self, leftTeamToonIds, rightTeamToonIds)
self.toonIdsToRightHands.clear()
for toonId in self.getToonIdsAsList():
toon = self.getAvatar(toonId)
if toon:
self.toonIdsToRightHands[toonId] = toon.getRightHands()[0]
def load(self):
DistributedPartyTeamActivity.load(self)
self.loadModels()
self.loadGuiElements()
self.loadSounds()
self.loadIntervals()
self.arrowKeys = ArrowKeys()
def loadModels(self):
self.playArea = loader.loadModel('phase_13/models/parties/partyTugOfWar')
self.playArea.reparentTo(self.root)
self.sign.reparentTo(self.playArea.find('**/TugOfWar_sign_locator'))
self.dockPositions = [[], []]
for i in xrange(4):
self.dockPositions[0].append(Point3(-PartyGlobals.TugOfWarInitialToonPositionsXOffset - PartyGlobals.TugOfWarToonPositionXSeparation * i, 0.0, PartyGlobals.TugOfWarToonPositionZ))
for i in xrange(4):
self.dockPositions[1].append(Point3(PartyGlobals.TugOfWarInitialToonPositionsXOffset + PartyGlobals.TugOfWarToonPositionXSeparation * i, 0.0, PartyGlobals.TugOfWarToonPositionZ))
self.hopOffPositions = [[], []]
for i in xrange(1, 5):
self.hopOffPositions[PartyGlobals.TeamActivityTeams.LeftTeam].append(self.playArea.find('**/leftTeamHopOff%d_locator' % i).getPos())
self.hopOffPositions[PartyGlobals.TeamActivityTeams.RightTeam].append(self.playArea.find('**/rightTeamHopOff%d_locator' % i).getPos())
for i in xrange(1, 5):
pos = self.playArea.find('**/fallenToon%d_locator' % i).getPos()
self.fallenPositions.append(pos)
self.joinCollision = []
self.joinCollisionNodePaths = []
for i in xrange(len(PartyGlobals.TeamActivityTeams)):
collShape = CollisionTube(PartyGlobals.TugOfWarJoinCollisionEndPoints[0], PartyGlobals.TugOfWarJoinCollisionEndPoints[1], PartyGlobals.TugOfWarJoinCollisionRadius)
collShape.setTangible(True)
self.joinCollision.append(CollisionNode('TugOfWarJoinCollision%d' % i))
self.joinCollision[i].addSolid(collShape)
tubeNp = self.playArea.attachNewNode(self.joinCollision[i])
tubeNp.node().setCollideMask(ToontownGlobals.WallBitmask)
self.joinCollisionNodePaths.append(tubeNp)
self.joinCollisionNodePaths[i].setPos(PartyGlobals.TugOfWarJoinCollisionPositions[i])
self.__enableCollisions()
ropeModel = loader.loadModel('phase_4/models/minigames/tug_of_war_rope')
self.ropeTexture = ropeModel.findTexture('*')
ropeModel.removeNode()
for i in xrange(PartyGlobals.TugOfWarMaximumPlayersPerTeam * 2 - 1):
rope = Rope(self.uniqueName('TugRope%d' % i))
if rope.showRope: