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


Python WorldEditor.addCommentaryMsg方法代码示例

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


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

示例1: handleWheelCameraSpeed

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def handleWheelCameraSpeed( self, mz ):
		# look at the rotator for changing the camera speed
		c = WorldEditor.camera()
		currentValue = WorldEditor.getOptionString( "camera/speed" )
		speeds = ["Slow", "Medium", "Fast", "SuperFast"]

		iSpeed = 0
		if currentValue == speeds[1]:
			iSpeed = 1
		elif currentValue == speeds[2]:
			iSpeed = 2
		elif currentValue == speeds[3]:
			iSpeed = 3

		if mz > 0:
			iSpeed = iSpeed + 1
			if iSpeed > 3:
				iSpeed = 3
		elif mz < 0:
			iSpeed = iSpeed - 1
			if iSpeed < 0:
				iSpeed = 0

		value = speeds[iSpeed]

		handled = 0
		if value != currentValue:
			c = WorldEditor.camera()
			WorldEditor.setOptionString( "camera/speed", value )
			c.speed = WorldEditor.getOptionFloat( "camera/speed/" + value )
			c.turboSpeed = WorldEditor.getOptionFloat( "camera/speed/" + value + "/turbo" )
			handled = 1
			WorldEditor.addCommentaryMsg( "New camera speed %s" % value, 1 )

		return handled
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:37,代码来源:WorldEditorDirector.py

示例2: doRedo

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
def doRedo( item ):
	what = WorldEditor.redo(0)
	if what:
		WorldEditor.addCommentaryMsg( "Redoing: " + what )
	WorldEditor.redo()

	bd.itemTool.functor.script.selUpdate()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:9,代码来源:UIExt.py

示例3: actUndoExecute

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
def actUndoExecute():
	what = WorldEditor.undo(0)
	if what:
		WorldEditor.addCommentaryMsg( "Undoing: " + what )
	WorldEditor.undo()

	bd.itemTool.functor.script.selUpdate()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:9,代码来源:ToolbarUIAdapter.py

示例4: onMiddleMouse

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def onMiddleMouse( self ):
		# ensure that we both have a selection and something under the mouse
		if not self.selection.size or not self.mouseRevealer.size:
			return

		# ensure that we're in shell mode
		if not WorldEditor.isChunkSelected():
			return

		# If v is held down, clone and snap the shell under the cursor
		if WorldEditor.isKeyDown( KEY_V ):
			group = WorldEditor.cloneAndAutoSnap( self.mouseRevealer, self.selection )
			if ( group != None ):
				set_assign( self.selection, group )
				self.selUpdate()
			else:
				WorldEditor.addCommentaryMsg( "No matching portals", 2 )

			return

		# if the selection is different to what's under the mouse,
		if set_difference_new( self.selection, self.mouseRevealer ).size:
			# auto snap the shells together
			if not WorldEditor.autoSnap( self.selection, self.mouseRevealer ):
				WorldEditor.addCommentaryMsg( "No matching portals" )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:27,代码来源:WorldEditorDirector.py

示例5: doUndo

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
def doUndo( item ):
	"""This function performs an undo operation."""
	what = WorldEditor.undo(0)
	if what:
		WorldEditor.addCommentaryMsg( "Undoing: " + what )
	WorldEditor.undo()

	bd.itemTool.functor.script.selUpdate()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:10,代码来源:UIExt.py

示例6: pgcTerrainTabSelect

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
def pgcTerrainTabSelect( value ):
	if value == "tabTerrainTextures":
		bd.enterMode( "TerrainTexture" )
	elif value == "tabTerrainBrushes":
		bd.enterMode( "TerrainHeight" )
	elif value == "tabTerrainFilters":
		bd.enterMode( "TerrainFilter" )
	elif value == "tabTerrainTools":
		bd.enterMode( "TerrainHoleCut" )
	else:
		WorldEditor.addCommentaryMsg( value + " unknown tab", 1 )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:13,代码来源:TerrainUIAdapter.py

示例7: enterItemSnapMode

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def enterItemSnapMode( self ):
		newLoc = None
		newLoc = Locator.ChunkObstacleToolLocator()
		t = self.itemTool
		if self.itemSnapMode == 0:
			newLoc = self.itemToolXZLocator
			t.delView( "stdView" )
			t.size = 1
			#½øÈë±à¼­Ä£Ê½
			if ( WorldEditor.getUserMode() == 0 ): 
				t.addView( self.itemToolPlaneView, "stdView" )
				WorldEditor.addCommentaryMsg( "Entering free snap mode" )
		elif self.itemSnapMode == 1:
			newLoc = Locator.TerrainToolLocator()
			t.delView( "stdView" )
			t.size = 1
			if ( WorldEditor.getUserMode() == 0 ): 
				t.addView( self.itemToolTextureView, "stdView" )
				WorldEditor.addCommentaryMsg( "Entering terrain snap mode" )
		elif self.itemSnapMode == 2:
			newLoc = Locator.ChunkObstacleToolLocator()
			t.delView( "stdView" )
			t.size = 1
			if ( WorldEditor.getUserMode() == 0 ): 
				t.addView( self.itemToolModelView, "stdView" )
				WorldEditor.addCommentaryMsg( "Entering obstacle snap mode" )
		else:
			#WorldEditor.addCommentaryMsg( "Unknown snap mode" )
			WorldEditor.addCommentaryMsg( "" )

		#finally, recreate the functor
		self.itemTool.locator.subLocator = newLoc
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:34,代码来源:WorldEditorDirector.py

示例8: selUpdate

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def selUpdate( self ):
		try:
			# tell big bang what the current selection is
			WorldEditor.revealSelection( self.selection )

			if self.selection.size:

				self.selEditor = WorldEditor.ChunkItemEditor( self.selection )

				WorldEditor.setCurrentEditors( self.selEditor )
				#if hasattr(self.selEditor, "description"):
				#	print "Selected a", str(self.selEditor.description)
				#else:
				#	print "Selected a group"

				# inform the user of stats about the selection
				#if ( self.objInfo.shellMode == 1 and self.selection.size > 1):
				#	WorldEditor.showChunkReport( self.selection )
			else:
				self.selEditor = None
				WorldEditor.setCurrentEditors()
		except EnvironmentError, e:
			WorldEditor.addCommentaryMsg( e.args[0], 1 )			
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:25,代码来源:WorldEditorDirector.py

示例9: addChunkShell

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def addChunkShell( self ):

		try:
			(pChunkSection,chunkName) = WorldEditor.createInsideChunkDataSection()

			if ( pChunkSection == None ):
				WorldEditor.addCommentaryMsg( "Could not create data section", 1 )
			else:
				# fill in the model information
				pChunkSection.writeString( "shell/resource", \
					self.objInfo.getBrowsePath() )

				# open the model data section
				pModelSection = ResMgr.openSection( self.objInfo.getBrowsePath() )
				if ( not pModelSection ):
					WorldEditor.addCommentaryMsg( \
							"Could not open model file. Shell not added", 1 )
				else:
					# check to see whether the model is nodefull, if so, warn the user
					testSection = pModelSection["nodefullVisual"]
					if testSection != None:
						WorldEditor.addCommentaryMsg( \
							"warning: model is nodefull, shell not statically lit", 1 )

					# create initial data
					WorldEditor.chunkFromModel( pChunkSection, pModelSection )

					# copy from the template
					pTemplateSection = ResMgr.openSection( self.objInfo.getBrowsePath() + ".template" )
					if pTemplateSection:
						deepCopyTemplate( pChunkSection, pTemplateSection )

					group = WorldEditor.createChunk( pChunkSection, \
						chunkName, \
						self.mouseLocator.subLocator )

					if ( group != None ):
						self.chunkItemAdded( self.objInfo.getBrowsePath() );

		except Exception, e:
			WorldEditor.addCommentaryMsg( e.args[0], 1 )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:43,代码来源:WorldEditorDirector.py

示例10: actSaveCameraPositionExecute

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
def actSaveCameraPositionExecute():
	dir = WorldEditor.getOptionString( "space/mru0" )
	dirDS = ResMgr.openSection( dir )
	if not dirDS:
		WorldEditor.addCommentaryMsg( "Unable to open local directory " + dir )
		return

	ds = dirDS["space.localsettings"]
	if ds == None:
		ds = dirDS.createSection( "space.localsettings" )

	if ds == None:
		WorldEditor.addCommentaryMsg( "Unable to create space.localsettings" )
		return


	m = WorldEditor.camera(0).view
	m.invert()
	ds.writeVector3( "startPosition", m.translation )
	ds.writeVector3( "startDirection", (m.roll, m.pitch, m.yaw) )
	ds.save()

	WorldEditor.addCommentaryMsg( "Camera position saved" )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:25,代码来源:UIAdapter.py

示例11: ownKeyEvent

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def ownKeyEvent( self, key, modifiers ):
		
		if key == KEY_B:
			if (modifiers & MODIFIER_CTRL) == 0:
				curr = WorldEditor.getOptionInt( "drawBSP" )
				curr = ( curr + 1 ) % 2
				WorldEditor.setOptionInt( "drawBSP", curr )
				self.showBSPMsg( curr )
		
		elif key == KEY_M:
			curr = WorldEditor.getOptionInt( "dragOnSelect" )
			curr = ( curr + 1 ) % 2
			WorldEditor.setOptionInt( "dragOnSelect", curr )
			self.dragOnSelectMsg( curr )
	
		elif key == KEY_F8:
			curr = WorldEditor.getOptionString( "tools/coordFilter" )
			if curr == "World":
				curr = "Local"	
			elif curr == "Local":
				curr = "View"
			elif curr == "View":
				curr = "World"
			WorldEditor.setOptionString( "tools/coordFilter", curr )	
			WorldEditor.addCommentaryMsg( "Reference Coordinate System: %s" % curr )
		
		elif key == KEY_L:
			if modifiers & MODIFIER_CTRL:
				curr = WorldEditor.getOptionInt( "render/lighting" )
				curr = ( curr + 1 ) % 3
				WorldEditor.setOptionInt( "render/lighting", curr )
				self.lightingModeMsg( curr )
				
		elif key == KEY_G:
			curr = WorldEditor.getOptionInt( "snaps/xyzEnabled" )
			curr = ( curr + 1 )% 2
			WorldEditor.setOptionInt( "snaps/xyzEnabled", curr )
			self.objectSnapMsg( curr )

		elif key == KEY_1 and not modifiers:
			WorldEditor.setToolMode( "Objects" )
			
		elif key == KEY_2 and not modifiers:
			WorldEditor.setToolMode( "TerrainTexture" )
			
		elif key == KEY_3 and not modifiers:
			WorldEditor.setToolMode( "TerrainHeight" )
			
		elif key == KEY_4 and not modifiers:
			WorldEditor.setToolMode( "TerrainFilter" )
			
		elif key == KEY_5 and not modifiers:
			WorldEditor.setToolMode( "TerrainMesh" )
			
		elif key == KEY_6 and not modifiers:
			WorldEditor.setToolMode( "TerrainImpExp" )
			
		elif key == KEY_7 and not modifiers:
			WorldEditor.setToolMode( "Project" )
		
		t = WorldEditor.tool()

		sizeSection = ''
		strengthSection = ''
		minSizeSection = ''
		maxSizeSection = ''
		minStrengthSection = ''
		maxStrengthSection = ''
		if t == self.alphaTool:
			sizeSection = 'terrain/texture/size'
			minSizeSection = 'terrain/texture/minsizelimit'
			maxSizeSection = 'terrain/texture/maxsizelimit'
			strengthSection = 'terrain/texture/strength'
			minStrengthSection = 'terrain/texture/minstrengthlimit'
			maxStrengthSection = 'terrain/texture/maxstrengthlimit'
		elif t == self.heightTool:
			sizeSection = 'terrain/height/size'
			minSizeSection = 'terrain/height/minsizelimit'
			maxSizeSection = 'terrain/height/maxsizelimit'
			strengthSection = 'terrain/height/strength'
			minStrengthSection = 'terrain/height/minstrengthlimit'
			maxStrengthSection = 'terrain/height/maxstrengthlimit'
		elif t == self.filterTool:
			sizeSection = 'terrain/filter/size'
			minSizeSection = 'terrain/filter/minsizelimit'
			maxSizeSection = 'terrain/filter/maxsizelimit'
		elif t == self.holeTool:
			sizeSection = 'terrain/cutRepair/size'
			minSizeSection = 'terrain/cutRepair/minsizelimit'
			maxSizeSection = 'terrain/cutRepair/maxsizelimit'

		if sizeSection:
			size = WorldEditor.getOptionFloat( sizeSection )
			minSize = WorldEditor.getOptionFloat( minSizeSection )
			maxSize = WorldEditor.getOptionFloat( maxSizeSection )
			if key == KEY_RBRACKET:
				if not ( modifiers & MODIFIER_SHIFT ):
					size = size * 1.25 + 1
					if size > maxSize:
						size = maxSize
#.........这里部分代码省略.........
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:103,代码来源:WorldEditorDirector.py

示例12: showBSPMsg

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def showBSPMsg( self, state ):
		if state == 1:
			WorldEditor.addCommentaryMsg( "Drawing custom BSPs" )
		else:
			WorldEditor.addCommentaryMsg( "Normal draw mode")
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:7,代码来源:WorldEditorDirector.py

示例13: objectSnapMsg

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def objectSnapMsg( self, state ):
		if state == 1:
			WorldEditor.addCommentaryMsg( "Enabling Object Snap Grid" )
		else:
			WorldEditor.addCommentaryMsg( "Disabling Object Snap Grid" )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:7,代码来源:WorldEditorDirector.py

示例14: lightingModeMsg

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def lightingModeMsg( self, state ):
		WorldEditor.addCommentaryMsg( "Lighting Mode: %s" % self.lightNames[state] )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:4,代码来源:WorldEditorDirector.py

示例15: itemSnapModeMsg

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import addCommentaryMsg [as 别名]
	def itemSnapModeMsg( self, state ):
		WorldEditor.addCommentaryMsg( "Entering %s snap mode" % self.lockNames[state] )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:4,代码来源:WorldEditorDirector.py


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