本文整理匯總了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()