# mcedit2.worldview package — mceditlib 0.1 documentation

### Navigation

- index
- modules |
- previous |
- mceditlib 0.1 documentation »
- mcedit2 package »

# mcedit2.worldview package

## Submodules

## mcedit2.worldview.camera module

camera.py

class `mcedit2.worldview.camera.``CameraWorldViewFrame`(dimension, geometryCache, resourceLoader, shareGLWidget, *args, **kwargs)

  Bases: `PySide.QtGui.QWidget`

  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458EF48>

class `mcedit2.worldview.camera.``CameraKeyControls`(worldView)

  Bases: `object`

  `tickCamera`()
  class `CameraAction`(controls)

    Bases: `mcedit2.worldview.viewaction.ViewAction`

    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458E988>
  class `CameraKeyControls.``Forward`(controls)

    Bases: `mcedit2.worldview.camera.CameraAction`

    `key` = PySide.QtCore.Qt.Key.Key_W
    `labelText` = u'Move Forward'
    `settingsKey` = u'worldview/camera/move/forward'
    `keyPressEvent`(event)
    `keyReleaseEvent`(event)
    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458EA88>
  class `CameraKeyControls.``Backward`(controls)

    Bases: `mcedit2.worldview.camera.CameraAction`

    `key` = PySide.QtCore.Qt.Key.Key_S
    `labelText` = u'Move Backward'
    `settingsKey` = u'worldview/camera/move/backward'
    `keyPressEvent`(event)
    `keyReleaseEvent`(event)
    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458EB88>
  class `CameraKeyControls.``Left`(controls)

    Bases: `mcedit2.worldview.camera.CameraAction`

    `key` = PySide.QtCore.Qt.Key.Key_A
    `labelText` = u'Move Left'
    `settingsKey` = u'worldview/camera/move/left'
    `keyPressEvent`(event)
    `keyReleaseEvent`(event)
    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458ED88>
  class `CameraKeyControls.``Right`(controls)

    Bases: `mcedit2.worldview.camera.CameraAction`

    `key` = PySide.QtCore.Qt.Key.Key_D
    `labelText` = u'Move Right'
    `settingsKey` = u'worldview/camera/move/right'
    `keyPressEvent`(event)
    `keyReleaseEvent`(event)
    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458EF88>
  class `CameraKeyControls.``Up`(controls)

    Bases: `mcedit2.worldview.camera.CameraAction`

    `key` = PySide.QtCore.Qt.Key.Key_Space
    `labelText` = u'Move Up'
    `settingsKey` = u'worldview/camera/move/up'
    `keyPressEvent`(event)
    `keyReleaseEvent`(event)
    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458E788>
  class `CameraKeyControls.``Down`(controls)

    Bases: `mcedit2.worldview.camera.CameraAction`

    `key` = PySide.QtCore.Qt.Key.Key_C
    `labelText` = u'Move Down'
    `settingsKey` = u'worldview/camera/move/down'
    `keyPressEvent`(event)
    `keyReleaseEvent`(event)
    `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458E9C8>

class `mcedit2.worldview.camera.``CameraWorldView`(*a, **kw)

  Bases: `mcedit2.worldview.worldview.WorldView`

  `setViewDistance`(val)
  `centerOnPoint`(pos, distance=20)
  `perspective` = True
  `setPerspective`(val)
  `updateMatrices`()
  `updateOrthoMatrices`()
  `updatePerspectiveMatrices`()
  `cameraVector`
  `makeChunkIter`()
  `yawPitch`
  `discardChunksOutsideViewDistance`(*a, **kw)
  `recieveChunk`(chunk)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458E4C8>

class `mcedit2.worldview.camera.``CameraPanMouseAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `button` = PySide.QtCore.Qt.MouseButton.RightButton
  `mouseDragStart` = None
  `modifiers` = PySide.QtCore.Qt.KeyboardModifier.NoModifier
  `labelText` = u'Turn Camera'
  `settingsKey` = u'worldview/camera/holdToTurn'
  `buttonPressEvent`(event)
  `sensitivity` = 0.15
  `mouseMoveEvent`(event)
  `buttonReleaseEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458E508>

class `mcedit2.worldview.camera.``CameraMoveMouseAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `button` = PySide.QtCore.Qt.MouseButton.MiddleButton
  `mouseDragStart` = None
  `labelText` = u'Move Camera'
  `settingsKey` = u'worldview/camera/holdToMove'
  `buttonPressEvent`(event)
  `sensitivity` = 0.15
  `mouseMoveEvent`(event)
  `buttonReleaseEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458E688>

## mcedit2.worldview.cutaway module

cutaway.py

`mcedit2.worldview.cutaway.``RecenterButton`(view)

`mcedit2.worldview.cutaway.``CutawayWorldViewFrame`(dimension, textureAtlas, geometryCache, sharedGLWidget)

class `mcedit2.worldview.cutaway.``SlicedWorldScene`(dimension, textureAtlas)

  Bases: `mcedit2.rendering.scenegraph.Node`

  `depthLimit` = 0
  `advancedDepthLimit` = 4
  `loadRadius` = 320
  `pos`
  `discardAllChunks`()
  `invalidateChunk`(cx, cz)
  `clear`()
  `updateMeshes`()
  `visibleBounds`(depth=None)
  `wantsChunk`(c)
  `workOnChunk`(*a, **kw)
  `chunkInvalid`(c)

class `mcedit2.worldview.cutaway.``CutawayWorldView`(*a, **kw)

  Bases: `mcedit2.worldview.worldview.WorldView`

  `createWorldScene`()
  `sizeInBlocks`()
  `updateMatrices`()
  `slicedPoint`(x, y)
  `viewCenter`()

    Return the world position at the center of the view.

  `axis`
  `dim`
  `updateMeshPos`()
  `resizeEvent`(event)
  `augmentMouseEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000459FA08>

class `mcedit2.worldview.cutaway.``CutawaySliceUpAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `settingsKey` = u'worldview.cutaway.slice_up'
  `button` = 256
  `labelText` = u'Slice Up'
  `acceptsMouseWheel` = True
  `buttonPressEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000459F9C8>

class `mcedit2.worldview.cutaway.``CutawaySliceDownAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `settingsKey` = u'worldview.cutaway.slice_down'
  `button` = 512
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000459FDC8>
  `labelText` = u'Slice Down'
  `acceptsMouseWheel` = True
  `buttonPressEvent`(event)

## mcedit2.worldview.fourup module

fourup.py

`mcedit2.worldview.fourup.``FourUpWorldViewFrame`(dimension, geometryCache, resourceLoader, sharedGLWidget)

class `mcedit2.worldview.fourup.``FourUpWorldView`(*args, **kwargs)

  Bases: `PySide.QtGui.QWidget`

  `requestChunk`()
  `wantsChunk`(c)
  `recieveChunk`(chunk)
  `invalidateChunk`((cx, cz))
  `mouseBlockPos` = (x=0, y=0, z=0)
  `mouseRay` = Ray((x=0, y=1, z=0), (x=0, y=-1, z=0))
  `mouseBlockFace` = Face(Up)
  `viewportMoved` = <PySide.QtCore.Signal object at 0x0000000009066928>
  `centerPoint`
  `subViewMoved`(view)
  `viewCenter`()
  `centerOnPoint`(point)
  `centerOnView`(centerView)
  `cursorMoved` = <PySide.QtCore.Signal object at 0x0000000009066650>
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000A797488>

## mcedit2.worldview.iso module

iso.py

`mcedit2.worldview.iso.``IsoWorldViewFrame`(world, geometryCache, resourceLoader, sharedGLWidget)

class `mcedit2.worldview.iso.``IsoWorldView`(*a, **kw)

  Bases: `mcedit2.worldview.worldview.WorldView`

  `cameraVector`()
  `centerOnPoint`(pos)
  `makeChunkIter`()
  `rotateView`(yrot, xrot)
  `updateMatrices`()
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6B08>

class `mcedit2.worldview.iso.``RotateMouseAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `button` = PySide.QtCore.Qt.MouseButton.MiddleButton
  `startx` = None
  `starty` = None
  `mousePressEvent`(event)
  `mouseMoveEvent`(event)
  `mouseReleaseEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6B48>

## mcedit2.worldview.minimap module

minimap.py

class `mcedit2.worldview.minimap.``ViewCornersRenderNode`(sceneNode)

  Bases: `mcedit2.rendering.rendergraph.RenderNode`

  `drawSelf`()

class `mcedit2.worldview.minimap.``ViewCornersNode`

  Bases: `mcedit2.rendering.scenegraph.Node`

  `RenderNodeClass`

    alias of `ViewCornersRenderNode`

  `corners`
  `dimension`

class `mcedit2.worldview.minimap.``MinimapWorldView`(*a, **kw)

  Bases: `mcedit2.worldview.worldview.WorldView`

  `minScale` = 1.0
  `createCompass`()
  `updateMatrices`()
  `currentViewMatrixChanged`(currentView)
  `zoom`(scale, (mx, my))
  `sizeHint`()
  `mousePressEvent`(event)
  `mouseMoveEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000459F0C8>
  `mouseReleaseEvent`(event)

## mcedit2.worldview.overhead module

overhead.py

`mcedit2.worldview.overhead.``OverheadWorldViewFrame`(dimension, geometryCache, resourceLoader, sharedGLWidget)

class `mcedit2.worldview.overhead.``OverheadWorldView`(*a, **kw)

  Bases: `mcedit2.worldview.worldview.WorldView`

  `cameraVector` = (x=0, y=-1, z=0)
  `updateMatrices`()
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000459F308>

## mcedit2.worldview.viewaction module

viewaction

class `mcedit2.worldview.viewaction.``ViewAction`

  Bases: `PySide.QtCore.QObject`

  `labelText` = 'Unknown Action'
  `hidden` = False
  `settingsKey` = NotImplemented
  `acceptsMouseWheel` = False
  `WHEEL_UP` = 256
  `WHEEL_DOWN` = 512
  `modifiers` = PySide.QtCore.Qt.KeyboardModifier.NoModifier
  `button` = PySide.QtCore.Qt.MouseButton.NoButton
  `key` = 0
  `setBinding`(button, key, modifiers)
  `matchKeyEvent`(event)
  `mouseMoveEvent`(event)

    Called when the mouse moves while the bound keys or buttons are pressed.

  `mousePressEvent`(event)

    Called when the bound mouse button is pressed. By default, calls buttonPressEvent.

  `mouseReleaseEvent`(event)

    Called when the bound mouse button is released. By default, calls buttonReleaseEvent

  `keyPressEvent`(event)

    Called when the bound key is pressed. By default, calls buttonPressEvent.

  `keyReleaseEvent`(event)

    Called when the bound key is released. By default, calls buttonReleaseEvent

  `buttonPressEvent`(event)

    Called by mousePressEvent and keyPressEvent.

    Implement this to handle button-press events if it doesn’t matter whether the action is bound to a key or mouse button.

  `buttonReleaseEvent`(event)

    Called by mouseReleaseEvent and keyReleaseEvent.

    Implement this to handle button-release events if it doesn’t matter whether the action is bound to a key or mouse button.

  `buttonName`(buttons)
  `describeKeys`()
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B69C8>

class `mcedit2.worldview.viewaction.``UseToolMouseAction`(editor)

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `button` = PySide.QtCore.Qt.MouseButton.LeftButton
  `labelText` = "Use Tool (Don't change!)"
  `hidden` = True
  `settingsKey` = None
  `mousePressEvent`(event)
  `mouseMoveEvent`(event)
  `mouseReleaseEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6A08>

class `mcedit2.worldview.viewaction.``TrackingMouseAction`(editor)

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `button` = PySide.QtCore.Qt.MouseButton.NoButton
  `hidden` = True
  `labelText` = "Mouse Tracking (Don't change!)"
  `settingsKey` = None
  `mouseMoveEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6A48>

class `mcedit2.worldview.viewaction.``MoveViewMouseAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `button` = PySide.QtCore.Qt.MouseButton.RightButton
  `labelText` = 'Pan View'
  `settingsKey` = 'worldview/general/holdToMove'
  `buttonPressEvent`(event)
  `mouseMoveEvent`(event)
  `buttonReleaseEvent`(event)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6A88>

class `mcedit2.worldview.viewaction.``ZoomWheelAction`

  Bases: `mcedit2.worldview.viewaction.ViewAction`

  `labelText` = 'Zoom View'
  `maxScale` = 16.0
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6AC8>
  `minScale` = 0.015625
  `settingsKey` = None
  `zooms`
  `wheelEvent`(event)
  `zoom`(view, scale, (mx, my))

## mcedit2.worldview.viewcontrols module

viewcontrols

class `mcedit2.worldview.viewcontrols.``ModifierInputWidget`(inputButton, *a, **kw)

  Bases: `PySide.QtGui.QWidget`

  `mousePressEvent`(mouseEvent)

  `keyPressEvent`(keyEvent)

    Parameters: | keyEvent (QtGui.QKeyEvent) –
    Returns: |
    Return type: |

  `wheelEvent`(wheelEvent)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458ECC8>

class `mcedit2.worldview.viewcontrols.``ButtonModifierInput`(viewAction, *a, **kw)

  Bases: `PySide.QtGui.QPushButton`

  `buttonClicked`()
  `updateText`()
  `key`
  `modifiers`
  `button`
  `setBinding`(button, key, modifiers)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458ED08>

class `mcedit2.worldview.viewcontrols.``ViewControls`(worldView, *args, **kwargs)

  Bases: `PySide.QtGui.QFrame`

  `toggleUnlockControls`()
  `lockUnlockControls`(unlocked)
  `getShowHideButton`()
  `hideEvent`(*a)
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000458ED48>
  `toggleShowHide`()

## mcedit2.worldview.worldruler module

${NAME}

class `mcedit2.worldview.worldruler.``WorldRuler`(worldView, dimName)

  Bases: `PySide.QtGui.QWidget`

  `paintEvent`(event)
  `offsetChanged`(view)
  `centerPoint`
  `scale`
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x000000000459FB08>
  `setScale`(value)

`mcedit2.worldview.worldruler.``WorldViewRulerGrid`(view, rulerSize=22)

## mcedit2.worldview.worldview module

worldview.py

`mcedit2.worldview.worldview.``worldMeshVertexSize`(worldMesh)

class `mcedit2.worldview.worldview.``WorldView`(dimension, textureAtlas, geometryCache=None, sharedGLWidget=None)

  Bases: `PySide.QtOpenGL.QGLWidget`

  Superclass for the following views:

  IsoWorldView: Display the world using an isometric viewing angle, without perspective. Click and drag to pan the viewing area. Use the mouse wheel or a UI control to zoom.

  CameraWorldView: Display the world using a first-person viewing angle with perspective. Click and drag to pan the camera. Use WASD or click and drag to move the camera.

  CutawayWorldView: Display a single slice of the world. Click and drag to move sideways. Use the mouse wheel or a UI widget to move forward or backward. Use a UI widget to zoom.

  FourUpWorldView: Display up to four other world views at once. Default to three cutaways and one isometric view.

  `viewportMoved` = <PySide.QtCore.Signal object at 0x00000000083B13E8>
  `cursorMoved` = <PySide.QtCore.Signal object at 0x00000000083B1420>
  `mouseBlockPos` = (x=0, y=0, z=0)
  `mouseBlockFace` = Face(Up)
  `destroy`()
  `createCompass`()
  `createWorldScene`()
  `createSceneGraph`()
  `initializeGL`(*args, **kwargs)
  `setToolCursor`(cursorNode)
  `setToolOverlays`(overlayNodes)
  `updateMatrices`()

    Subclasses must implement updateMatrices to set the projection and modelview matrices.

    Should set self.matrixNode.projection and self.matrixNode.modelview

  `updateFrustum`()
  `getViewCorners`()
    Returns corners:
      bottom left, near bottom left, far top left, near top left, far bottom right, near bottom right, far top right, near top right, far

    Returns: |
    Return type: | list[QVector4D]

  `getViewBounds`()

    Get the corners of the viewing area, intersected with the world’s bounds. xxx raycast to intersect with terrain height too

    Returns: |
    Return type: |

  `resizeGL`(width, height)
  `resizeEvent`(event)
  `centerPoint`
  `scaleChanged` = <PySide.QtCore.Signal object at 0x00000000083B1458>
  `scale`
  `centerOnPoint`(pos)

    Center the view on the given position

  `viewCenter`()

    Return the world position at the center of the view.

  `dragStart` = None
  `keyPressEvent`(event)
  `keyReleaseEvent`(event)
  `mousePressEvent`(event)
  `mouseMoveEvent`(event)
  `mouseReleaseEvent`(event)
  `wheelPos` = 0
  `wheelEvent`(event)
  `augmentMouseEvent`(event)
  `augmentKeyEvent`(event)
  `augmentEvent`(*a, **kw)
  `maxFPS` = 30
  `glDraw`(*a, **kw)
  `paintGL`()
  `fps`
  `rayAtPosition`(x, y)

    Given coordinates in screen space, return a ray in 3D space.

    Parameters:
      x and y are coordinates local to this QWidget

    Return type: | Ray

  `rayAtCenter`()
  `pointsAtPositions`(*screenPoints)
  `unprojectAtHeight`(x, y, h)

    Given coordinates in screen space, find the corresponding point in 3D space.

    Like rayAtPosition, but the third parameter is a height value in 3D space.

  `resetLoadOrder`()
  `makeChunkIter`()
  `requestChunk`()
  `wantsChunk`(c)
  `recieveChunk`(chunk)
  `chunkInvalid`((cx, cz))
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B60C8>

`mcedit2.worldview.worldview.``iterateChunks`(x, z, radius)

  Yields a list of chunk positions starting from the center and going outward in a square spiral pattern.

  Parameters:

  - x – center block position
  - z – center block position
  - radius (int) – radius, in chunks

  Returns: |
  Return type: |

class `mcedit2.worldview.worldview.``WorldViewInfo`(**kwargs)

  Bases: `mcedit2.widgets.infopanel.InfoPanel`

  `worldMeshVertexSize`
  `worldMeshChunks`
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6108>

class `mcedit2.worldview.worldview.``WorldCursorInfo`(**kwargs)

  Bases: `mcedit2.widgets.infopanel.InfoPanel`

  `blockPos`
  `describeBlock`
  `staticMetaObject` = <PySide.QtCore.QMetaObject object at 0x00000000083B6148>
  `dirs` = {Face(East): (1, 0, 0), Face(West): (-1, 0, 0), Face(Up): (0, 1, 0), Face(Down): (0, -1, 0), Face(North): (0, 0, 1), Face(South): (0, 0, -1)}
  `describeAdjacent`
  `describe`(pos)

    Returns: |
    Return type: |

## Module contents

### Navigation

- index
- modules |
- previous |
- mceditlib 0.1 documentation »
- mcedit2 package »