World Editor

From C4 Engine Wiki

Jump to: navigation, search

The World Editor tool module is used to create every scene that the C4 Engine displays (however, scene data may be imported from other sources.) All of the data describing a world is stored in a world resource having the .wld extension, and world resources are stored in subfolders of the Data directory.

The World Editor is opened by selecting New World or Open World from the C4 menu, or by typing world [name] in the command console. If the Open World menu item is selected (or name is omitted from the console command), then a dialog appears to let you select a world resource. You can also start the World Editor by using the shortcut Ctrl-O to open a world or the shortcut Ctrl-N to create a new world while any C4 window is open.


Contents

Editor Layout

The World Editor has the layout shown below. Most of the window is occupied by one to four viewports that display the world being edited. Across the top of the World Editor are a number of icon buttons that have various functions. Along the left side of the World Editor are a set of arrangeable “pages” that hold various groups of related tools used for a large variety of tasks such as creating geometries and applying physics. See World Editor Pages for more information about these tools.


Image:editor.png


Tool Buttons

Icon

Shortcut

Function

Image:tool_boxselect.png

0

Box Select Nodes. Selects all nodes that intersect the rectangle that is dragged out.

Image:tool_select.png

1

Select Nodes. Selects the one node that is clicked on. The Shift key can be used to add to or subtract from the current selection. This tool can be used to safely select items without the possibility of accidentally moving them.

Image:tool_move.png

2

Move Nodes. Works just like the Select Nodes tool, except that dragging the cursor moves the selected nodes.

Image:tool_rotate.png

3

Rotate Nodes. Works just like the Select Nodes tool except that handles appear on selected nodes. Dragging a handle rotates the selected nodes. The Shift key can be used while rotating to enable angle snap.

Image:tool_resize.png

4

Resize Nodes. Works just like the Select Nodes tool except that handles appear on selected nodes. Dragging a handle resizes the selected nodes.

Image:tool_connect.png

5

Connect Nodes. Works just like the Select Nodes tool except that connectors appear on selected nodes (if they have any).

Image:tool_surface.png

6

Select Surface. Selects individual surfaces of geometry nodes.

Image:tool_scroll.png

Alt key with any tool

Scroll Viewport. Dragging with this tool pans the viewport.

Image:tool_zoom.png

Mouse Wheel with any tool

Zoom Viewport. Dragging vertically with this tool zooms in and out of a viewport.

Image:tool_boxzoom.png


Box Zoom Viewport. A viewport is zoomed to the rectangle dragged out by this tool.

Image:tool_orbit.png

8 or Control key with any tool

Orbit Camera. (This tool can only be used in perspective viewports.) This tool orbits the camera about the selected node that currently has the gizmo. Hold in the Shift key to restrict the camera motion to a horizontal plane. If there is no selected, then the center of the orbit is the world-space origin.

Image:tool_camera.png

9 or Right Mouse Button with any tool

Free Camera Move. (This tool can only be used in perspective viewports.) When the mouse button is held down with this tool, the WSAD keys can be used to fly the camera around forward, backward, left, and right. The Space and C keys move up and down.


Toggle Buttons

The toggle buttons all have corresponding items in the Layout menu.

Icon

Function

Image:flag_backfaces.png

Toggle Backfaces. Shows or hides backfaces for geometries in wireframe display.

Image:flag_worlds.png

Toggle Referenced Worlds. Shows or hides worlds that are externally referenced by marker nodes.

Image:flag_models.png

Toggle Models. Shows or hides nodes that are part of external model resources.

Image:tool_light.png

Toggle Lighting. When active, full lighting is rendered in perspective viewports.

Image:flag_center.png

Draw from Center. When active, many tools operate in relation to the center of a node instead of the opposite corner.

Image:flag_cap.png

Cap Geometry. When active, new geometries include end caps. When inactive, only lateral surfaces are created (e.g., for a cylinder).


Viewports

The World Editor displays one to four viewports at a time, but manages eight separate viewports internally. The visual configuration of the viewports can be changed using the buttons in the Layout page. The eight viewports are the four quarter-size viewports and the four half-size viewports (two horizontal and two vertical) of which at most four are shown in any multi-viewport configuration. Any viewport can be shown by itself at full size by typing Ctrl-n (or Cmd-n on the Mac), where n is a number between 1 and 8, or by selecting it from the Layout menu. Typing Ctrl-n again when viewport n is shown at full size returns to the previous multi-viewport configuration.

There are three types of viewports: orthographic, perspective, and scene graph. Orthographic viewports can display the scene from one of six directions corresponding to the positive and negative x, y, and z axes. The type of each viewport can be changed by right-clicking in a viewport (or Ctrl-clicking on the Mac) and selecting a new viewport type from the popup menu that appears.

The scene graph viewport is a special viewport that displays the scene hierarchy. All of the nodes in the scene are displayed in a tree that represents the actual structure of the scene. Subtrees can be collapsed or expanded by clicking on the collapse boxes between the various levels of the hierarchy. In a scene graph viewport, the Select and Move tool provides the capability to reparent nodes. The currently selected nodes can be reparented by dragging them to another node that will serve as the new parent. (Nodes cannot be reparented to any of their descendants.)


Current Target Zone

Worlds are divided into sections called zones, and zones are connected by portals. Zones can be hierarchically organized, and the root node of every world is an InfiniteZone node. Zones are displayed in the World Editor with a black and yellow cross-hatched boundary.

It's important to understand that whenever a new node is placed in the world, it gets added to the current target zone. The target zone is set by selecting a zone and choosing Set Target from the Node menu (or using the shortcut Ctrl-T). The current target zone is displayed with a green boundary instead of yellow. At any time, nodes can be moved into the current target zone by selecting them and choosing Move to Target Zone from the Node menu (or using the shortcut Ctrl-Shift-Z) or by dragging them to the target zone in the scene graph viewport.


Gizmo

The gizmo is a control that appears for one of the selected nodes. It shows the orientation of the node's local axes in red, green, and blue for the x, y, and z directions, respectively.

When the Select and Move tool is in use, the arrowheads on the axes can be dragged in any viewport to move the node along the corresponding direction.

The gizmo assignment can be iterated through the nodes in the current selection by pressing the Tab key.


Menu Commands

(For shortcuts on the Mac, replace the Ctrl key with the Cmd key.)

World Menu

Command

Shortcut

Description

Close

Ctrl-W

Closes the current editor window.

Save World

Ctrl-S

Saves the current world.

Save World As...

Ctrl-Shift-S

Saves the current world after prompting for a file name.

Save and Play World

Ctrl-P

Saves the current world, closes the World Editor, and loads the world in the game. You can return to the world you were editing by hitting escape (to bring up the main menu) or tilde (to open the command console) and then pressing Ctrl-Shift-P.

Import Scene...


Imports a scene from an external format such as Collada. In the stock engine, only the Collada importer is available.

Export Scene...


Exports the current world to an external format using an export plugin. There are no exporters in the stock engine, so this item is disabled by default.

Load from Model Resource...


Loads a model from C4's MDL format and places it in the world. This should be used to import nodes from an MDL file so that they can be edited. To place models in a world as game objects, use the Models page.

Save to Model Resource...


Saves the current world in the MDL format.


Edit Menu

Command

Shortcut

Description

Undo

Ctrl-Z

Undoes the last action. (Supports multiple undo.)

Cut

Ctrl-X

Cuts the current selection to the clipboard.

Copy

Ctrl-C

Copies the current selection to the clipboard.

Paste

Ctrl-V

Pastes the contents of the clipboard to the world. Note that the clipboard is erased whenever all worlds are closed, so to copy from one world and paste into another, leave the source world open until you've pasted in the destination world.

Clear

Delete

Deletes the current selection.

Select All

Ctrl-A

Selects every node in the current world.

Select All by Mask

Ctrl-Shift-A

Selects every node in the current world that isn't masked off in the Selection Mask page.

Select All with Material


Selects every geometry node having the current material.

Select Supernode

Ctrl-Up arrow

Selects the parents of the currently selected nodes.

Select Subtree

Ctrl-Down arrow

Selects all of the descendants for the currently selected nodes.

Lock Selection

Ctrl-K

Locks the current selection so that it cannot be changed. When the selection is locked, a small lock icon appears next to the cursor.

Unlock Selection

Ctrl-Shift-K

Unlocks the current selection.

Duplicate

Ctrl-D

Duplicates the current selection.

Clone

Ctrl-Shift-D

Duplicates the current selection, but creates references to their object data instead of duplicating it.

Copy Transform


Copies the node transform of the node for which the gizmo is currently shown.

Paste Transform


Pastes the node transform of the node for which the gizmo is currently shown.


Node Menu

Command

Shortcut

Description

Get Info...

Ctrl-I

Opens the Get Info dialog for the selected nodes.

Group Nodes

Ctrl-G

Creates a group node and makes it the parent of the current selection.

Reset Transform to Identity


Resets the transform for each of the selected nodes to the identity matrix.

Align Position to Grid


Moves each of the selected nodes so that it is aligned to the grid.

Set Target Zone

Ctrl-T

Makes the currently selected zone the target zone. (Only available if one zone is selected.)

Move to Target Zone

Ctrl-Shift-Z

Moves (reparents) the currently selected nodes into the target zone.

Set Infinite Target Zone

Ctrl-Y

Makes the infinite root zone the target zone.

Connect Node

Ctrl-L

Connects the currently selected connector to the currently selected node.

Unconnect Node

Ctrl-U

Unconnects the currently selected connector.

Auto-connect Portal

Ctrl-Shift-L

Connects each of the selected portals to the most likely destination zone.

Connect to Root Zone


Connects the current selected portals to the infinite root zone.

Select Connected Node


If any connectors are selected, this selects the nodes that they are connected to.

Resize Terrain Block


Change the dimensions of the number of geometry chunks in a terrain block.


Geometry Menu

Command

Shortcut

Description

Rebuild Primitive

Ctrl-R

Rebuilds each selected primitive geometry.

Recalculate Normals


Recalculates normals and tangents for each selected geometry.

Set Material

Ctrl-M

Changes the material for each of the selected nodes to the current material.

Remove Material


Removes the material from each of the selected nodes.

Combine Detail Levels


Combines multiple geometries into a single geometry with multiple detail levels.

Separate Detail Levels


Separates a geometry with multiple levels of detail into multiple geometries with a single level of detail.

Convert to Generic Mesh

Ctrl-Shift-C

Converts each of the selected geometries to generic mesh geometries.

Merge Geometry

Ctrl-Shift-M

Merges all of the selected geometries into a single mesh geometry.

Invert Geometry

Ctrl-Shift-I

Inverts the faces of each of the selected geometries.

Intersect Geometry

Ctrl-Shift-J

Performs a boolean intersection of the selected geometries and produces a new mesh geometry. (Only available when exactly two geometries are selected.)

Union Geometry

Ctrl-Shift-U

Performs a boolean union of the selected geometries and produces a new mesh geometry. (Only available when exactly two geometries are selected.)


See Also