本文整理汇总了Python中DNAUtil.getBuildingClassFromName方法的典型用法代码示例。如果您正苦于以下问题:Python DNAUtil.getBuildingClassFromName方法的具体用法?Python DNAUtil.getBuildingClassFromName怎么用?Python DNAUtil.getBuildingClassFromName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DNAUtil
的用法示例。
在下文中一共展示了DNAUtil.getBuildingClassFromName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _postGenerate
# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBuildingClassFromName [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()
示例2: setupSuitBuildingOrigin
# 需要导入模块: import DNAUtil [as 别名]
# 或者: from DNAUtil import getBuildingClassFromName [as 别名]
def setupSuitBuildingOrigin(self, nodePath):
building = DNAUtil.getBuildingClassFromName(self.id)
if building != 'tb':
return
name = 'sb' + self.id[2:]
node = nodePath.find('**/*suit_building_origin')
if node.isEmpty():
#TODO: dna logging
#print 'DNALandmarkBuilding ' + name + ' did not find **/*suit_building_origin'
node = nodePath.attachNewNode(ModelNode(self.name))
else:
node.wrtReparentTo(nodePath)
node.setName(name)
node.node().setPreserveTransform(ModelNode.PTNet)
node.hide()