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


Python WorldEditor.pop方法代码示例

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


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

示例1: enterMode

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import pop [as 别名]
	def enterMode( self, modeName, forceUpdate = 0 ):
	
		#print "enterMode - current %s, new %s, terrainMode %s" % (self.modeName, modeName, self.terrainModeName )
	
		if (self.modeName == modeName) and (not forceUpdate):
			return
			
		t = WorldEditor.tool()
		oldTool = t
		
		if t != None and modeName != "Object":
			if self.itemTool.functor.script.selection.size:
				self.itemTool.functor.script.selection.rem( self.itemTool.functor.script.selection )
				self.itemTool.functor.script.selUpdate()

			WorldEditor.popTool()

		# Remove the project or height module if we're coming out of project or height mode
		if self.modeName in ("Project", "Height"):
			self.modeStack.pop()
			self.modeName = self.modeStack[ len( self.modeStack ) - 1 ]
			WorldEditor.pop()

		if ( modeName == "TerrainTexture" ):
			WorldEditor.pushTool( self.alphaTool )
			self.terrainModeName = modeName

		elif ( modeName == "TerrainHeight" ):
			WorldEditor.pushTool( self.heightTool )
			self.terrainModeName = modeName

		elif ( modeName == "TerrainFilter" ):
			WorldEditor.pushTool( self.filterTool )
			self.terrainModeName = modeName

		elif ( modeName == "TerrainHoleCut" ):
			WorldEditor.pushTool( self.holeTool )
			self.terrainModeName = modeName

		elif ( modeName == "Terrain" ):
			self.modeName = modeName
			self.enterMode( self.terrainModeName )
			self.modeStack.append( modeName )
			return

		elif ( modeName == "Object" ):
			WorldEditor.pushTool( self.itemTool )
			self.modeStack.append( modeName )

		elif ( modeName == "Project" ):
			WorldEditor.push( "ProjectModule" )
			self.modeStack.append( modeName )
			
		elif ( modeName == "Height" ):
			WorldEditor.push( "HeightModule" )
			self.modeStack.append( modeName )

		else:
			WorldEditor.addCommentaryMsg( "%s mode not yet implemented" % modeName, 1 )

		self.enterChunkVizMode()

		WorldEditor.addCommentaryMsg( "entered " + modeName + " mode" )
		self.modeName = modeName
		
		newTool = WorldEditor.tool()
		if oldTool != None and oldTool != newTool:
			oldTool.endUsing()
		if newTool != None:
			newTool.beginUsing()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:72,代码来源:WorldEditorDirector.py


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