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


Python DNAUtil.getBlockFromName方法代码示例

本文整理汇总了Python中DNAUtil.getBlockFromName方法的典型用法代码示例。如果您正苦于以下问题:Python DNAUtil.getBlockFromName方法的具体用法?Python DNAUtil.getBlockFromName怎么用?Python DNAUtil.getBlockFromName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DNAUtil的用法示例。


在下文中一共展示了DNAUtil.getBlockFromName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generateCogdoGeometry

# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBlockFromName [as 别名]
    def generateCogdoGeometry(self, storage, np, height, barrier):
        node = np.getParent().attachNewNode('cb' + self.id[2:])
        node.setTransform(np.getTransform())

        barrier.copyTo(node)

        block = DNAUtil.getBlockFromName(self.id)
        x = int(np.getX())
        y = int(np.getY())
        seed = block*1231 + x*83 + y

        codes = storage.getNumCatalogCodes('cogdo_wall')
        if codes != 0:
            wallCode = storage.getCatalogCode('cogdo_wall', seed%codes)
            wall = storage.findNode(wallCode)
        else:
            wall = None

        if wall:
            wallNode = wall.copyTo(node)
            wallNode.setScale(self.width, 1, height)

            for door in DNAUtil.getChildrenOfType(self, DNAFlatDoor):
                door.generateSuitGeometry(storage, wallNode)

        node.flattenStrong()
        node.stash()
开发者ID:ponyboy837,项目名称:SecretGitLolYoloSweg2015,代码行数:29,代码来源:DNAFlatBuilding.py

示例2: _postGenerate

# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBlockFromName [as 别名]
    def _postGenerate(self, storage, np):
        height = np.getPythonTag('wall_height') or 0.0
        np.clearPythonTag('wall_height')

        # First, set up collisions. We need a (self.width, height)-sized square.
        barrierNode = storage.findNode('wall_camera_barrier')
        if not barrierNode:
            raise DNAError('No wall_camera_barrier in storage.')

        barrier = barrierNode.copyTo(np)
        barrier.setScale(self.width, 1, height)

        type = DNAUtil.getBuildingClassFromName(self.id)
        if type == 'tb':
            self.generateSuitGeometry(storage, np, height, barrier)
            self.generateCogdoGeometry(storage, np, height, barrier)

        # We need to set collisions on all of our knock knock doors:
        block = DNAUtil.getBlockFromName(self.name)
        if block is not None:
            for collisionNP in np.findAllMatches('**/door_*/+CollisionNode'):
                collisionNP.setName('KnockKnockDoorSphere_%d' % block)

        # Finally, flatten down:
        np.flattenStrong()
开发者ID:ponyboy837,项目名称:SecretGitLolYoloSweg2015,代码行数:27,代码来源:DNAFlatBuilding.py

示例3: _makeNode

# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBlockFromName [as 别名]
 def _makeNode(self, storage, parent):
     frontNode = parent.find('**/*building*_front')
     if frontNode.isEmpty():
         frontNode = parent.find('**/*_front')
     if not frontNode.getNode(0).isGeomNode():
         frontNode = frontNode.find('**/+GeomNode')
     frontNode.setEffect(DecalEffect.make())
     node = storage.findNode(self.code)
     if node is None:
         pass
     doorNode = node.copyTo(frontNode, 0)
     origin = parent.find('**/*door_origin')
     origin.node().setPreserveTransform(ModelNode.PTNet)
     self.setupDoor(doorNode, parent, origin, storage, DNAUtil.getBlockFromName(parent.getName()), self.getColor())
     return doorNode
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:17,代码来源:DNADoor.py

示例4: _storeData

# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBlockFromName [as 别名]
 def _storeData(self, data):
     block = data.getBlock(DNAUtil.getBlockFromName(self.id))
     block.title = self.getTitle()
     block.buildingType = self.type
     block.zone = self.getVisGroup().getZone()
     block.node = self
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:8,代码来源:DNALandmarkBuilding.py


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