BrushTool.updateCursor handles missing cursors/boxes
This commit is contained in:
parent
18578b574f
commit
45d50daca9
@ -242,17 +242,20 @@ class BrushTool(EditorTool):
|
|||||||
self.cursorNode.removeChild(self.cursorBoxNode)
|
self.cursorNode.removeChild(self.cursorBoxNode)
|
||||||
|
|
||||||
cursorLevel = self.brushMode.createCursorLevel(self)
|
cursorLevel = self.brushMode.createCursorLevel(self)
|
||||||
cursorBox = self.brushMode.brushBoxForPoint((0, 0, 0), self.options)
|
if cursorLevel is not None:
|
||||||
|
|
||||||
self.cursorBoxNode = SelectionBoxNode()
|
|
||||||
self.cursorBoxNode.selectionBox = cursorBox
|
|
||||||
self.cursorBoxNode.filled = False
|
|
||||||
|
|
||||||
self.cursorWorldScene = worldscene.WorldScene(cursorLevel, self.editorSession.textureAtlas)
|
self.cursorWorldScene = worldscene.WorldScene(cursorLevel, self.editorSession.textureAtlas)
|
||||||
self.cursorWorldScene.depthOffset.depthOffset = DepthOffsets.PreviewRenderer
|
self.cursorWorldScene.depthOffset.depthOffset = DepthOffsets.PreviewRenderer
|
||||||
self.cursorNode.addChild(self.cursorWorldScene)
|
self.cursorNode.addChild(self.cursorWorldScene)
|
||||||
self.cursorNode.addChild(self.cursorBoxNode)
|
|
||||||
|
|
||||||
self.brushLoader = WorldLoader(self.cursorWorldScene)
|
self.brushLoader = WorldLoader(self.cursorWorldScene)
|
||||||
self.brushLoader.startLoader()
|
self.brushLoader.startLoader()
|
||||||
|
|
||||||
|
cursorBox = self.brushMode.brushBoxForPoint((0, 0, 0), self.options)
|
||||||
|
if cursorBox is not None:
|
||||||
|
self.cursorBoxNode = SelectionBoxNode()
|
||||||
|
self.cursorBoxNode.selectionBox = cursorBox
|
||||||
|
self.cursorBoxNode.filled = False
|
||||||
|
|
||||||
|
self.cursorNode.addChild(self.cursorBoxNode)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user