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


Python WorldEditor.pushTool方法代码示例

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


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

示例1: startDragSelect

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import pushTool [as 别名]
	def startDragSelect( self ):
		# add a drag select tool, which will pop itself and set our
		# selection when done.
		nt = WorldEditor.Tool()
		nt.locator = bd.itemTool.locator.subLocator
		nt.functor = Functor.ScriptedFunctor( DragSelectFunctor(nt, self) )
		WorldEditor.pushTool( nt )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:9,代码来源:WorldEditorDirector.py

示例2: enterMode

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import pushTool [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

示例3: abs

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import pushTool [as 别名]
		return abs( self.clickX ) > self.dragStartDelta or abs( self.clickY ) > self.dragStartDelta

	def onMouseEvent( self, (dx,dy,dz), tool ):
		if dz != 0 \
			and ( WorldEditor.isKeyDown( KEY_LSHIFT ) \
				  or WorldEditor.isKeyDown( KEY_RSHIFT ) \
				  or WorldEditor.getOptionInt( "input/legacyMouseWheel" ) != 0 ) \
			and self.selection.size:
			rotateTool = WorldEditor.Tool()
			rotateTool.functor = Functor.WheelRotator()
			rotateTool.locator = Locator.OriginLocator()

			rotateTool.handleMouseEvent( dx, dy, dz )

			# Add the mousewheel rotate tool, it'll automatically pop itself
			WorldEditor.pushTool( rotateTool )

		if not WorldEditor.isKeyDown( KEY_MOUSE0 ):
			# just to make sure that leftMouseDown has a consistent value
			self.leftMouseDown = 0
		
		if self.dragging:
			self.clickX += dx
			self.clickY += dy
			if self.dragDeltaExceeded():
				self.dragging = 0
				try:
					nt = WorldEditor.Tool()
					nt.locator = bd.itemTool.locator.subLocator
					nt.functor = Functor.MatrixMover()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:32,代码来源:WorldEditorDirector.py


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