本文整理汇总了Python中WorldEditor.setOptionFloat方法的典型用法代码示例。如果您正苦于以下问题:Python WorldEditor.setOptionFloat方法的具体用法?Python WorldEditor.setOptionFloat怎么用?Python WorldEditor.setOptionFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldEditor
的用法示例。
在下文中一共展示了WorldEditor.setOptionFloat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: actFreeSnapsExecute
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionFloat [as 别名]
def actFreeSnapsExecute():
newSnaps = ( 0.1, 0.1, 0.1 )
WorldEditor.setOptionVector3( "snaps/movement", newSnaps )
WorldEditor.setOptionFloat( "snaps/angle", 1 )
WorldEditor.addCommentaryMsg( "Movement snaps are %f,%f,%f" % (newSnaps[0],newSnaps[1],newSnaps[2]) )
WorldEditor.addCommentaryMsg( "Rotation snaps are %f" % WorldEditor.getOptionFloat( "snaps/angle" ) )
示例2: ownKeyEvent
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionFloat [as 别名]
#.........这里部分代码省略.........
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
t.size = size
WorldEditor.setOptionFloat( sizeSection, size )
WorldEditor.addCommentaryMsg( "Tool size %0.1f" % size )
elif key == KEY_LBRACKET:
if not ( modifiers & MODIFIER_SHIFT ):
size = size * 0.8 - 1
if size < minSize:
size = minSize
t.size = size
WorldEditor.setOptionFloat( sizeSection, size )
WorldEditor.addCommentaryMsg( "Tool size %0.1f" % size )
if strengthSection:
strength = WorldEditor.getOptionFloat( strengthSection )
minStrength = WorldEditor.getOptionFloat( minStrengthSection )
maxStrength = WorldEditor.getOptionFloat( maxStrengthSection )
if key == KEY_RBRACKET and strength >= 0 or key == KEY_LBRACKET and strength < 0:
if modifiers & MODIFIER_SHIFT:
if strength >= 0:
strength = strength * 1.25 + 1
else:
strength = strength * 1.25 - 1
if strength > maxStrength:
strength = maxStrength
t.strength = strength
WorldEditor.setOptionFloat( strengthSection, strength )
WorldEditor.addCommentaryMsg( "Tool strength %0.1f" % strength )
elif key == KEY_LBRACKET and strength >= 0 or key == KEY_RBRACKET and strength < 0:
if modifiers & MODIFIER_SHIFT:
if strength >= 0:
strength = strength * 0.8 - 1
else:
strength = strength * 0.8 + 1
if strength < minStrength:
strength = minStrength
t.strength = strength
WorldEditor.setOptionFloat( strengthSection, strength )
WorldEditor.addCommentaryMsg( "Tool strength %0.1f" % strength )
示例3: actShellSnapsExecute
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import setOptionFloat [as 别名]
def actShellSnapsExecute():
WorldEditor.setOptionVector3( "snaps/movement", WorldEditor.getOptionVector3( "shellSnaps/movement" ) )
WorldEditor.setOptionFloat( "snaps/angle", WorldEditor.getOptionFloat( "shellSnaps/angle" ) )
newSnaps = WorldEditor.getOptionVector3( "snaps/movement" )
WorldEditor.addCommentaryMsg( "Movement snaps are %f,%f,%f" % (newSnaps[0],newSnaps[1],newSnaps[2]) )
WorldEditor.addCommentaryMsg( "Rotation snaps are %f" % WorldEditor.getOptionFloat( "snaps/angle" ) )