Difference between revisions of "HPL2/Tools/Model Editor"

From Frictional Wiki
< HPL2‎ | Tools
Jump to navigation Jump to search
(Upload from wiki)
 
(Major clean up, image fixes, some link fixes)
Line 1: Line 1:
 
= Model Editor =
 
= Model Editor =
The Model Editor is our own application to create entities. An entity (saved in a .ent file) is composed of a mesh and a set of physical properties, bodies, and optionally joints and sub-entities. It can also contain animations for an animated entity, such as NPC's. Also worth noting is that an entity must be set up with a user defined type.
+
The Model Editor is our own application to create entities. An entity (saved in a .ent file) is composed of a mesh and a set of physical properties, bodies, and optionally joints and sub-entities. It can also contain animations for an animated entity, such as NPCs. Also worth noting is that an entity must be set up with a user defined type.
  
 
== Overview ==
 
== Overview ==
 
When run, the first screen we get to see is like this:
 
When run, the first screen we get to see is like this:
  
[[modeleditoroverview.jpg]]
+
[[File: modeleditoroverview.jpg]]
  
 
Each part of the screen has a specific function, as follows:
 
Each part of the screen has a specific function, as follows:
# [[Model Editor#Main Menu|Main menu bar]]: this is where every non-editor command lies, as well as some edition ones.  
+
#Main menu bar: this is where every non-editor command lies, as well as some edition ones.  
# [[Model Editor#EditMode selection bar|EditMode sidebar]]: here you will find a set of buttons used to switch the current behaviour of the editor. More on this later.
+
#EditMode sidebar: here you will find a set of buttons used to switch the current behaviour of the editor. More on this later.
# EditMode window area: any helper input the current EditMode needs will appear here.
+
#EditMode window area: any helper input the current EditMode needs will appear here.
# Viewport area: this area of the screen is reserved for the viewports, which are used to actually see what you are doing to the map. Every viewport has its own menu bar, to control some parameters of the visualization.
+
#Viewport area: this area of the screen is reserved for the viewports, which are used to actually see what you are doing to the map. Every viewport has its own menu bar, to control some parameters of the visualization.
# Lower toolbar: some tools that are either viewport-dependent or global are located here.
+
#Lower toolbar: some tools that are either viewport-dependent or global are located here.
  
== Main Menu ==
+
These will be explained in the following sections.
 +
 
 +
== Main Menu bar==
 
This is a menu bar, just like in any other windowed application. Available options for this particular editor are as follows:
 
This is a menu bar, just like in any other windowed application. Available options for this particular editor are as follows:
  
* '''File'''
+
*'''File'''
''' '''New''': This command will reset the map to an empty one, and the editor to a default state as well.
+
**'''New''': This command will reset the map to an empty one, and the editor to a default state as well.
''' '''Open''': This will load an entity file in the editor.
+
**'''Open''': This will load an entity file in the editor.
''' '''Save''': Use this to save your work to a file in disk. Will ask for a file name when no file has been created.
+
**'''Save''': Use this to save your work to a file in disk. Will ask for a file name when no file has been created.
''' '''Save As''': This will also save your work, but will ask for a file name everytime it is called.
+
**'''Save As''': This will also save your work, but will ask for a file name everytime it is called.
''' '''Import Mesh''': This option will open a dialog for importing a mesh file into the entity.
+
**'''Import Mesh''': This option will open a dialog for importing a mesh file into the entity.
''' '''Open Recent''': This will show a list of up to 10 files that have been recently loaded or saved.
+
**'''Open Recent''': This will show a list of up to 10 files that have been recently loaded or saved.
''' '''Quit''': This will exit the program.
+
**'''Quit''': This will exit the program.
* '''Edit'''
+
*'''Edit'''
''' '''Undo''': Use this to undo the last action. Note that not everything you can do in the editor is undo-able.
+
**'''Undo''': Use this to undo the last action. Note that not everything you can do in the editor is undo-able.
''' '''Redo''': Use this to redo the last undone action.  
+
**'''Redo''': Use this to redo the last undone action.  
''' '''Delete''': This will delete the current selected objects. Note that not all objects can be deleted.
+
**'''Delete''': This will delete the current selected objects. Note that not all objects can be deleted.
''' '''Clone''': This will create copy objects out of the currently selected ones. Note that not all objects can be cloned.
+
**'''Clone''': This will create copy objects out of the currently selected ones. Note that not all objects can be cloned.
* '''View'''
+
*'''View'''
''' '''Outline''': This will bring up the [[:hpl2:tools:editors:model_editor:outline|Outline Window]]. It can be used to edit attachments with ease.
+
**'''Outline''': This will bring up the [[:hpl2:tools:editors:model_editor:outline|Outline Window]]. It can be used to edit attachments with ease.
* '''Settings'''
+
*'''Settings'''
''' '''User defined variables''': This will bring up the [[:hpl2:tools:editors:model_editor:uservars|User Defined Variables window]]. Use this to set up a defined type to your created entity.
+
**'''User defined variables''': This will bring up the [[:hpl2:tools:editors:model_editor:uservars|User Defined Variables window]]. Use this to set up a defined type to your created entity.
''' '''Animations''': This will bring up the [[:hpl2:tools:editors:model_editor:anims|Animations window]]. Animations are added and its parameters set here.
+
**'''Animations''': This will bring up the [[:hpl2:tools:editors:model_editor:anims|Animations window]]. Animations are added and its parameters set here.
  
 
== EditMode selection bar ==
 
== EditMode selection bar ==
Here you will be able to switch between the different EditModes available in this editor. An EditMode describes the state the editor is going to work in when selected. These five EditModes can be found in this editor and the Model Editor.
+
Here you will be able to switch between the different EditModes available in this editor. An EditMode describes the state the editor is going to work in when selected. These five EditModes can be found in this editor and the Level Editor:
 
+
* [[Hpl2:Tools:editors:select editmode | Select EditMode]]: this mode is used to select and edit objects.
* [[Select EditMode]]: this mode is used to select and edit objects.
+
* [[Hpl2:Tools:editors:light editmode | Light EditMode]]: with this mode you will be able to place lights.
* [[Light EditMode]]: with this mode you will be able to place lights around.
+
* [[Hpl2:Tools:editors:billboard editmode | Billboard EditMode]]: use this to create billboards; light halos, light shafts, etc.
* [[Billboard EditMode]]: use this to create Billboards. Light halos, light shafts, and some other
+
* [[Hpl2:Tools:editors:particle system editmode | Particle System EditMode]]: one can add Particle systems to the entity with this mode.  
* [[Particle System EditMode]]: one can add Particle systems to the map with this mode.  
+
* [[Hpl2:Tools:editors:sound editmode | Sound EditMode]]: used to place sound entities in the entity.
* [[Sound EditMode]]: used to place sound entities in the map.
 
 
 
The following EditModes are exclusive to the Model Editor
 
  
* [[.:model_editor:Shape EditMode]]: physical bodies are created over shapes. Create shapes with this EditMode.
+
The following EditModes are exclusive to the Model Editor:
* [[.:model_editor:Joint EditMode]]: using this mode you will be able to create joints. Joints are used to add contraints to body movements.  
+
* [[Hpl2:Tools:editors:model editor:shape editmode | Shape EditMode]]: physical bodies are created over shapes. Create shapes with this EditMode.
 +
* [[Hpl2:Tools:editors:model editor:joint editmode | Joint EditMode]]: using this mode you will be able to create joints. Joints are used to add contraints to body movements.  
  
 
== Viewport area ==
 
== Viewport area ==
 
This area is meant to actually show what the map contains. There are four viewports in this editor, and their initial setup is shown in this picture:
 
This area is meant to actually show what the map contains. There are four viewports in this editor, and their initial setup is shown in this picture:
  
[[model_viewports.jpg]]
+
[[File: model_viewports.jpg]]
  
 
=== Viewport in focus ===
 
=== Viewport in focus ===
Line 64: Line 64:
 
Each viewport has a "View" menu bar, which includes the following options:
 
Each viewport has a "View" menu bar, which includes the following options:
 
* '''Render Mode''': the mode that will be used by the viewport to draw objects
 
* '''Render Mode''': the mode that will be used by the viewport to draw objects
''' '''Shaded''': drawing will be fully done, using lighting just like ingame. Ortho presets cannot use this mode.
+
**'''Shaded''': drawing will be fully done, using lighting just like ingame. Ortho presets cannot use this mode.
''' '''Wireframe''': only edge lines for polygons will be drawn in this mode.
+
**'''Wireframe''': only edge lines for polygons will be drawn in this mode.
* '''Presets''': choosing an item from this submenu will reset the viewport to a preset. An ortho preset means that it will use orthographic mode, so no perspective distortion will be seen. All presets reset the camera target to a (0,0,0) position. One out of the following presets can be picked:
+
*'''Presets''': choosing an item from this submenu will reset the viewport to a preset. An ortho preset means that it will use orthographic mode, so no perspective distortion will be seen. All presets reset the camera target to a (0,0,0) position. One out of the following presets can be picked:
''' '''Front''': ortho preset, scene will be seen from the front.
+
**'''Front''': ortho preset, scene will be seen from the front.
''' '''Right''': ortho preset, scene will be seen from the right side of the objects, pointing to the left.
+
**'''Right''': ortho preset, scene will be seen from the right side of the objects, pointing to the left.
''' '''Top''': ortho preset, scene will be seen top-bottom.
+
**'''Top''': ortho preset, scene will be seen top-bottom.
''' '''Perspective''': this is the only perspective mode, will reset the camera position to (10,10,10).
+
**'''Perspective''': this is the only perspective mode, will reset the camera position to (10,10,10).
 
* '''Show Grid''': toggles showing of the helper grid.
 
* '''Show Grid''': toggles showing of the helper grid.
 
* '''Show Axes''': toggles showing of the XYZ axes.
 
* '''Show Axes''': toggles showing of the XYZ axes.
Line 79: Line 79:
 
All movement and looking will be done using the mouse. In a nutshell, there are three basic movements that can be done, all need the 'view' key to be pressed (default left Alt). When this key is held, the red focus frame will turn yellow. These movements are listed next:
 
All movement and looking will be done using the mouse. In a nutshell, there are three basic movements that can be done, all need the 'view' key to be pressed (default left Alt). When this key is held, the red focus frame will turn yellow. These movements are listed next:
  
 +
'''Linux Note:''' Left Super (aka "Windows" or Apple key) and the Z key are also the view key as the Alt key is usually bound by the Window Manager.
 +
'''Mac OS X Note:''' A three button mouse is required to use the editor.
  
'''Linux Note:''' Left Super (aka "Windows" or Apple key) and the Z key are also the view key as the Alt key is usually bound by the Window Manager.<br />'''Mac %%OS%% X Note:''' A three button mouse is required to use the editor.
+
*'''Tumble''': pressing the 'view' key and the left mouse button at the same time will activate the Tumble mode. This means the camera target will stay in place while the camera will orbit around it.
 
+
*'''Track''': pressing the 'view' key and the middle mouse button at the same time will activate the Track mode. According to the track mode that is set, this will behave in two different ways:     
''' '''Tumble''': pressing the 'view' key and the left mouse button at the same time will activate the Tumble mode. This means the camera target will stay in place while the camera will orbit around it.
+
*#'''Tracking lock to grid is disabled:''' the camera target will move along the current screen plane, meaning it will move left-right or up-down along with the mouse. The camera position will stay the same with respect to the target.
''' '''Track''': pressing the 'view' key and the middle mouse button at the same time will activate the Track mode. According to the track mode that is set, this will behave in two different ways:     
+
*#'''Tracking lock to grid is enabled:''' this allows the user to click on the grid, hold and drag to get a camera displacement. Pretty useful when one wants to cover large distances. This mode is forced in ortho views.
'''* Tracking lock to grid is disabled: the camera target will move along the current screen plane, meaning it will move left-right or up-down along with the mouse. The camera position will stay the same with respect to the target.
+
*'''Zoom''': pressing the 'view' key and the right mouse button at the same time will activate the Zoom mode. Moving the mouse forward/backward will then zoom in/out respectively. Note there are limits for zooming in and out. You can also zoom in/out by rolling the mouse wheel up/down.
'''* Tracking lock to grid is enabled: this allows the user to click on the grid, hold and drag to get a camera displacement. Pretty useful when one wants to cover large distances. This mode is forced in ortho views.
 
''' '''Zoom''': pressing the 'view' key and the right mouse button at the same time will activate the Zoom mode. Moving the mouse forward/backward will then zoom in/out respectively. Note there are limits for zooming in and out. You can also zoom in/out by rolling the mouse wheel up/down.
 
  
 
=== Enlarging a viewport ===
 
=== Enlarging a viewport ===
 
When working in a viewport, the common thing to do is enlarging it. This can be done by clicking on the 'enlarge button' in the lower toolbar, or pressing the shortcut for it (spacebar).
 
When working in a viewport, the common thing to do is enlarging it. This can be done by clicking on the 'enlarge button' in the lower toolbar, or pressing the shortcut for it (spacebar).
 
 
  
 
== Lower Toolbar ==
 
== Lower Toolbar ==
 
You can find some useful controls in this bar located at all times at the lower part of the screen.
 
You can find some useful controls in this bar located at all times at the lower part of the screen.
[[model_lowertoolbar.jpg]]
 
  
# Grid Controls:   
+
[[File:model_lowertoolbar.jpg]]
''' '''Grid Plane''': cycles through the available grid planes (XZ, XY, YZ).
+
 
''' '''Toggle Snap''' (magnet button): enables/disables snapping for translation (over grid), rotation and scale.
+
#Grid Controls:   
''' '''Grid Height''': height of the plane, measured on the plane normal.
+
#*'''Grid Plane''': cycles through the available grid planes (XZ, XY, YZ).
''' '''Snap Separation''': separation of snapping points.
+
#*'''Toggle Snap''' (magnet button): enables/disables snapping for translation (over grid), rotation and scale.
# '''Enlarge Viewport button''': will toggle enlargement of the focused viewport.
+
#*'''Grid Height''': height of the plane, measured on the plane normal.
# '''Entity Preview button''': will toggle the [[:hpl2:tools:editors:model_editor:preview|entity preview window]].
+
#*'''Snap Separation''': separation of snapping points.
# Misc controls:
+
#'''Enlarge Viewport button''': will toggle enlargement of the focused viewport.
''' '''A''': toggles global ambient lighting
+
#'''Entity Preview button''': will toggle the [[:hpl2:tools:editors:model_editor:preview|entity preview window]].
''' '''P''': togles global point light
+
#Misc controls (Note: these are not shortcuts):
''' '''LT''': toggles Lock to grid for tracking in focused viewport
+
#*'''A''': toggles global ambient lighting
''' '''F''': focus on current selection
+
#*'''P''': togles global point light
 +
#*'''LT''': toggles Lock to grid for tracking in focused viewport
 +
#*'''F''': focus on current selection
  
 
== Types of Objects ==
 
== Types of Objects ==

Revision as of 02:20, 24 July 2020

Model Editor

The Model Editor is our own application to create entities. An entity (saved in a .ent file) is composed of a mesh and a set of physical properties, bodies, and optionally joints and sub-entities. It can also contain animations for an animated entity, such as NPCs. Also worth noting is that an entity must be set up with a user defined type.

Overview

When run, the first screen we get to see is like this:

Modeleditoroverview.jpg

Each part of the screen has a specific function, as follows:

  1. Main menu bar: this is where every non-editor command lies, as well as some edition ones.
  2. EditMode sidebar: here you will find a set of buttons used to switch the current behaviour of the editor. More on this later.
  3. EditMode window area: any helper input the current EditMode needs will appear here.
  4. Viewport area: this area of the screen is reserved for the viewports, which are used to actually see what you are doing to the map. Every viewport has its own menu bar, to control some parameters of the visualization.
  5. Lower toolbar: some tools that are either viewport-dependent or global are located here.

These will be explained in the following sections.

Main Menu bar

This is a menu bar, just like in any other windowed application. Available options for this particular editor are as follows:

  • File
    • New: This command will reset the map to an empty one, and the editor to a default state as well.
    • Open: This will load an entity file in the editor.
    • Save: Use this to save your work to a file in disk. Will ask for a file name when no file has been created.
    • Save As: This will also save your work, but will ask for a file name everytime it is called.
    • Import Mesh: This option will open a dialog for importing a mesh file into the entity.
    • Open Recent: This will show a list of up to 10 files that have been recently loaded or saved.
    • Quit: This will exit the program.
  • Edit
    • Undo: Use this to undo the last action. Note that not everything you can do in the editor is undo-able.
    • Redo: Use this to redo the last undone action.
    • Delete: This will delete the current selected objects. Note that not all objects can be deleted.
    • Clone: This will create copy objects out of the currently selected ones. Note that not all objects can be cloned.
  • View
    • Outline: This will bring up the Outline Window. It can be used to edit attachments with ease.
  • Settings
    • User defined variables: This will bring up the User Defined Variables window. Use this to set up a defined type to your created entity.
    • Animations: This will bring up the Animations window. Animations are added and its parameters set here.

EditMode selection bar

Here you will be able to switch between the different EditModes available in this editor. An EditMode describes the state the editor is going to work in when selected. These five EditModes can be found in this editor and the Level Editor:

The following EditModes are exclusive to the Model Editor:

  • Shape EditMode: physical bodies are created over shapes. Create shapes with this EditMode.
  • Joint EditMode: using this mode you will be able to create joints. Joints are used to add contraints to body movements.

Viewport area

This area is meant to actually show what the map contains. There are four viewports in this editor, and their initial setup is shown in this picture:

Model viewports.jpg

Viewport in focus

When working on a map, only one viewport will be focused at a time. This is shown by a red highlight around the currently focused viewport (in the picture above, focus is on the lower right viewport). To set the focus on a viewport, just move the mouse into it.

In the Level Editor, some controls for the currently focused viewport is shown in the Lower Toolbar.

View Menu

Each viewport has a "View" menu bar, which includes the following options:

  • Render Mode: the mode that will be used by the viewport to draw objects
    • Shaded: drawing will be fully done, using lighting just like ingame. Ortho presets cannot use this mode.
    • Wireframe: only edge lines for polygons will be drawn in this mode.
  • Presets: choosing an item from this submenu will reset the viewport to a preset. An ortho preset means that it will use orthographic mode, so no perspective distortion will be seen. All presets reset the camera target to a (0,0,0) position. One out of the following presets can be picked:
    • Front: ortho preset, scene will be seen from the front.
    • Right: ortho preset, scene will be seen from the right side of the objects, pointing to the left.
    • Top: ortho preset, scene will be seen top-bottom.
    • Perspective: this is the only perspective mode, will reset the camera position to (10,10,10).
  • Show Grid: toggles showing of the helper grid.
  • Show Axes: toggles showing of the XYZ axes.

Moving and looking around

All movement and looking will be done using the mouse. In a nutshell, there are three basic movements that can be done, all need the 'view' key to be pressed (default left Alt). When this key is held, the red focus frame will turn yellow. These movements are listed next:

Linux Note: Left Super (aka "Windows" or Apple key) and the Z key are also the view key as the Alt key is usually bound by the Window Manager. Mac OS X Note: A three button mouse is required to use the editor.

  • Tumble: pressing the 'view' key and the left mouse button at the same time will activate the Tumble mode. This means the camera target will stay in place while the camera will orbit around it.
  • Track: pressing the 'view' key and the middle mouse button at the same time will activate the Track mode. According to the track mode that is set, this will behave in two different ways:
    1. Tracking lock to grid is disabled: the camera target will move along the current screen plane, meaning it will move left-right or up-down along with the mouse. The camera position will stay the same with respect to the target.
    2. Tracking lock to grid is enabled: this allows the user to click on the grid, hold and drag to get a camera displacement. Pretty useful when one wants to cover large distances. This mode is forced in ortho views.
  • Zoom: pressing the 'view' key and the right mouse button at the same time will activate the Zoom mode. Moving the mouse forward/backward will then zoom in/out respectively. Note there are limits for zooming in and out. You can also zoom in/out by rolling the mouse wheel up/down.

Enlarging a viewport

When working in a viewport, the common thing to do is enlarging it. This can be done by clicking on the 'enlarge button' in the lower toolbar, or pressing the shortcut for it (spacebar).

Lower Toolbar

You can find some useful controls in this bar located at all times at the lower part of the screen.

Model lowertoolbar.jpg

  1. Grid Controls:
    • Grid Plane: cycles through the available grid planes (XZ, XY, YZ).
    • Toggle Snap (magnet button): enables/disables snapping for translation (over grid), rotation and scale.
    • Grid Height: height of the plane, measured on the plane normal.
    • Snap Separation: separation of snapping points.
  2. Enlarge Viewport button: will toggle enlargement of the focused viewport.
  3. Entity Preview button: will toggle the entity preview window.
  4. Misc controls (Note: these are not shortcuts):
    • A: toggles global ambient lighting
    • P: togles global point light
    • LT: toggles Lock to grid for tracking in focused viewport
    • F: focus on current selection

Types of Objects

These are the kinds of objects that you can create and place in this editor. Details on each one and parameter listing in the following links:

The following types are exclusive to the Model Editor