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


Python WorldEditor.setOptionString方法代码示例

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


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

示例1: handleWheelCameraSpeed

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

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
	def setObjectTab( self, tabName ):
		if self.tabName != "":
			# store the current selection
			currentFilter = WorldEditor.getOptionString( "tools/selectFilter" )
			prevSectionName = "object/" + self.tabName + "/selectFilter"
			WorldEditor.setOptionString( prevSectionName, currentFilter )
		self.tabName = tabName
		currSectionName = "object/" + self.tabName + "/selectFilter"
		return WorldEditor.getOptionString( currSectionName )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:11,代码来源:WorldEditorDirector.py

示例3: setBrowsePath

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
	def setBrowsePath( self, name ):
		print "setBrowsePath", name
		WorldEditor.setOptionString( "itemEditor/browsePath", name )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:WorldEditorDirector.py

示例4: ownKeyEvent

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

示例5: ualSelectFilterChange

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
def ualSelectFilterChange( value ):
	if(	WorldEditor.getOptionString( "tools/selectFilter" ) != value ):
		WorldEditor.addCommentaryMsg( "Selection Filter: %s" % value )
		WorldEditor.setOptionString( "tools/selectFilter", value )
	setSelectionFilter( value )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:7,代码来源:UIAdapter.py

示例6: cmbCoordFilterChange

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
def cmbCoordFilterChange( value ):
	WorldEditor.addCommentaryMsg( "Reference Coordinate System: %s" % value )
	WorldEditor.setOptionString( "tools/coordFilter", value )
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:UIAdapter.py

示例7: doSuperFastCamera

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
def doSuperFastCamera( item ):
	WorldEditor.setOptionString( "camera/speed", "SuperFast" );
	updateCamera()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:UIExt.py

示例8: doMediumCamera

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
def doMediumCamera( item ):
	WorldEditor.setOptionString( "camera/speed", "Medium" );
	updateCamera()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:UIExt.py

示例9: doSlowCamera

# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionString [as 别名]
def doSlowCamera( item ):
	WorldEditor.setOptionString( "camera/speed", "Slow" );
	updateCamera()
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:5,代码来源:UIExt.py


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