예제 #1
0
파일: __init__.py 프로젝트: wcpe/mcedit2
    def updateCursor(self):
        log.info("Updating brush cursor")
        if self.cursorWorldScene:
            self.brushLoader.timer.stop()
            self.cursorNode.removeChild(self.cursorWorldScene)
            self.cursorWorldScene = None

        if self.cursorBoxNode:
            self.cursorNode.removeChild(self.cursorBoxNode)
            self.cursorBoxNode = None

        cursorLevel = self.brushMode.createCursorLevel(self)
        if cursorLevel is not None:
            self.cursorWorldScene = worldscene.WorldScene(cursorLevel, self.editorSession.textureAtlas)
            self.cursorWorldScene.depthOffset.depthOffset = DepthOffsets.PreviewRenderer
            self.cursorNode.addChild(self.cursorWorldScene)

            self.brushLoader = WorldLoader(self.cursorWorldScene)
            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)
예제 #2
0
    def updateCursor(self):
        log.info("Updating brush cursor")
        if self.cursorWorldScene:
            self.brushLoader.timer.stop()
            self.cursorNode.removeChild(self.cursorWorldScene)

        cursorLevel = self.brushMode.createCursorLevel(self)

        self.cursorWorldScene = worldscene.WorldScene(cursorLevel, self.editorSession.textureAtlas)
        self.cursorWorldScene.depthOffsetNode.depthOffset = DepthOffset.PreviewRenderer
        self.cursorNode.addChild(self.cursorWorldScene)

        self.brushLoader = WorldLoader(self.cursorWorldScene)
        self.brushLoader.timer.start()
예제 #3
0
    def updateCursor(self):
        log.info("Updating brush cursor: %s %s", self.brushStyle, self.brushSelectionForCursor())
        if self.cursorWorldScene:
            self.brushLoader.timer.stop()
            self.cursorNode.removeChild(self.cursorWorldScene)

        cursorLevel = MaskLevel(self.brushSelectionForCursor(),
                                self.fillBlock,
                                self.editorSession.worldEditor.blocktypes)

        self.cursorWorldScene = worldscene.WorldScene(cursorLevel, self.editorSession.textureAtlas)
        self.cursorWorldScene.depthOffsetNode.depthOffset = DepthOffset.PreviewRenderer
        self.cursorNode.addChild(self.cursorWorldScene)

        self.brushLoader = WorldLoader(self.cursorWorldScene)
        self.brushLoader.timer.start()
예제 #4
0
 def updateMeshes(self):
     v = self.pos
     for depth in range(v - self.depthLimit - self.advancedDepthLimit,
                        v + self.depthLimit + self.advancedDepthLimit + 1):
         if depth not in self.sliceScenes:
             scene = self.sliceScenes[depth] = worldscene.WorldScene(self.dimension, self.textureAtlas,
                                                                     bounds=self.visibleBounds(depth))
             scene.sliceDepth = depth
             scene.visible = depth == v
             i = 0
             for i, child in enumerate(self.children):
                 if child.sliceDepth > depth:
                     break
             self.insertChild(i, scene)
     for old in self.sliceScenes.keys():
         if old < v - self.depthLimit - self.advancedDepthLimit or old > v + self.depthLimit + self.advancedDepthLimit:
             scene = self.sliceScenes.pop(old)
             scene.discardAllChunks()
             self.removeChild(scene)
예제 #5
0
 def createWorldScene(self):
     return worldscene.WorldScene(self.dimension, self.textureAtlas, self.geometryCache)