当前位置: 首页>>代码示例>>Python>>正文


Python MovieCamera.chooseSquirtShot方法代码示例

本文整理汇总了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)
开发者ID:OldToontown,项目名称:OldToontown,代码行数:55,代码来源:MovieSquirt.py

示例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)
开发者ID:Toonerz,项目名称:Toontown-2003,代码行数:39,代码来源:MovieSquirt.py


注:本文中的MovieCamera.chooseSquirtShot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。