本文整理汇总了Python中WorldEditor.autoSnap方法的典型用法代码示例。如果您正苦于以下问题:Python WorldEditor.autoSnap方法的具体用法?Python WorldEditor.autoSnap怎么用?Python WorldEditor.autoSnap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldEditor
的用法示例。
在下文中一共展示了WorldEditor.autoSnap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onMiddleMouse
# 需要导入模块: import WorldEditor [as 别名]
# 或者: from WorldEditor import autoSnap [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" )