HiFi Entities Editor

edit.js
An alternative entities editor for use in High Fidelity Interface, targeted at the desktop use case. Current under development in an alpha release state.
http://ctrlaltstudio.com/downloads/hifi/scripts/edit.js

To ensure you always use the latest version of the script, use it via this URL rather than downloading it.

Usage: See below for instructions.

Posts:

Change Log
License


Open/Close the Editor

Edit > Edit… menu item or Ctrl-E shortcut to open the editor window start editing. To close the editor window, click the window’s “x”, or use the menu item or shortcut again.

Editing functions only work when the editor window is displayed.

Dialog Window

Tabs across the top: “Entities” is the entities list plus editing controls; other tabs are groups of properties for the selected entity.

Entities tab:

  • Model+Zone+: Click to select an entity type to add then click in-world to add the entity. Click the button again to cancel adding.
    When adding an entity a grid is displayed at the level of the surface your avatar is standing on. If your avatar is flying, the grid is displayed at the approximate level of your feet. Click on the grid to add an entity at that position (the entity is positioned to sit on the grid at the clicked position); alternatively, click in the air above the grid to add an entity 10m away in that direction.
  • Delete: Deletes the currently selected entity. Alternatively, press the “Del” key (not the backspace key).
  • Filter: Searches the entity list.
    Search is conducted over the entity type, name, and model filename. Multiple terms are ANDed together, i.e., if you search for “tree fbx” only entities that have both “tree” and “fbx” somewhere within their type, name, and filename strings are displayed.
    Search is case-insensitive.
  • Distance field and Refresh: Controls which entities are listed.
  • Entities list:

    Entities are highlighted according to your selection:
    • Dark blue background: Selected entities.
    • Light blue background with dashed border: Unselected parents of selected entities.
    • Light blue background with solid border: Unselected descendants (children, and children’s children, etc.) of selected entities.

    To add and remove entities from your selection:
    • Click an entity to select it.
    • Ctrl-click to add/remove an entity from your selection.
    • Alt-click to select an entity plus its descendants.
    • Ctrl-Alt-click to add/remove an entity plus its descendants.
    • Shift-click to extend your selection to include all between the previous entity selected and the entity clicked.

  • Clear Selection: Unselects current entity so that you have none selected.
  • Selected: A count of the number of entities selected.

Object, Model, Physics, and Behavior properties tabs:

  • C & P buttons: These copy and paste vector values — e.g., red, green, and blue values all at once — so that you can easily copy vector values from one entity to another.
    A C button is also provided to copy the entity’s ID, with a corresponding P button to paste the value into the parent ID field.
  • Ctrl-A, Ctrl-X, Ctrl-C, & Ctrl-V: These work within fields as you would expect (select all, cut, copy, & paste).

Status Bar

At the bottom of the dialog is a status bar with the following fields:

  • Messages area: Error and information messages are displayed in the left portion of the status bar.
  • Stretch: Single: When stretching an object with the GUI controls, stretch only the selected face or corner. Click to toggle to Stretch: Both, which makes opposite sides or corners stretch.
  • Axes: World: Moving or rotating an object with the GUI controls is done relative to the world axes. Click to toggle to Axes: Local, and have translations and rotations happen relative to the entity’s local coordinates.

GUI Manipulators

When an entity is selected, axes are drawn through the entity’s registration point if a single entity is selected, or the average of the registration points of multiple entities are selected. The axes will be in world or local coordinates according to the “Axes” setting in the status bar. If multiple entities are selected the local coordinates are that of the first entity selected.

Entities are highlighted according to your selection:

  • Yellow: Selected entities.
  • Cyan dashed: Unselected parents of selected entities.
  • Cyan solid: Unselected descendants (children, and children’s children, etc.) of selected entities.

To add and remove entities from your selection:

  • Click an entity to select it, or click in space to deselect all entities.
  • Ctrl-click to add/remove an entity from your selection.
  • Alt-click to select an entity plus its descendants.
  • Ctrl-Alt-click to add/remove an entity plus its descendants.
  • Shift-click to extend your selection to include all entities with positions inside the bounding box formed by the previous and clicked entities.

The following GUI controls are available to manipulate your selection:

  • Translate: Hover, click, and drag the balls on the axes to move the selected entities along that axis.
  • Rotate: Press and hold the Ctrl key to change the manipulators to circles about the axes.
    Hover, click, and drag on the circle to rotate the selected entities. Any descendant entities that aren’t selected will also be rotated as they’re still linked to their parents.
  • Scale: Press and hold the Ctrl and Shift keys to change the manipulators to cubes on the faces and corners of the selected entity’s bounding box (always in local coordinates). If multiple entities are selected, face manipulators are not provided.
    Hover, click, and drag a cube to stretch the entity in that direction. The single side/corner is stretched if “Stretch: Single” is set in the status bar; the opposite side/corner is also stretched if “Stretch: Both” is set.
  • Duplicate: Press the Shift key while translating to duplicate the selected entities. Shift-duplicating a child creates a new child linked to a new parent if the parent is also being shift-duplicated, otherwise the child is linked to the original entity’s parent.

Parent/Child Linking

To link and unlink selected entities (in dialog or GUI):

  • Ctrl-N links selected entities into a parent child relationship with the parent being the first entity selected.
  • Ctrl-Shift-N unlinks all entities selected from their parents.

Cut, Copy, Paste

Ctrl-X, Ctrl-C, and Ctrl-V cut, copy, and paste entities. Or you can use the menu items in the “Edit” menu. When pasting entities, the “add” grid is displayed at the level of your avatar’s feet, the same as for adding a new entity.

Undo, Redo

Ctrl-Z and Ctrl-Y undo and redo multiple levels of edits (i.e., press Ctrl-Z twice to undo your last two edits, then press Ctrl-Y twice to redo them again).

Note: Undoing the deletion of an entity with children assumes that all the parent entity’s children were in the local copy of the domain model in Interface on your computer when you deleted the entity, i.e., they are or have been in your view so that they’ve been “downloaded”. There’s currently no way in High Fidelity of guaranteeing a complete list of all an entity’s children and their properties.

Export, Import

“Edit” menu items with shortcuts are provided to export entities, and import entities from a JSON file or URL. When importing, the “add” grid is displayed at the level of your avatar’s feet, the same as for adding a new entity.

Marketplace

When adding an item from the Marketplace, the “add” grid is displayed at the level of your avatar’s feet, the same as for adding a new entity.

Camera Control

The Entities Editor does not control your camera. Instead, for camera control, use the inspect.js script:

The inspect.js script leaves your camera where it is after you’ve moved it, so you can position your camera wherever you like to best suit what you’re editing.

Issues

  • Del key doesn’t work if Interface has focus and you also have High Fidelity’s entities editor running and its script is loaded first.
    Work-around: Reload High Fidelity’s edit.js script or defaultScripts.js.

Not Implemented

A number of features have not been implemented but could be, including:

  • Simultaneously editing multiple entities’ properties in the editor dialog.