Documentation/Entity Types/Base/DecorativeObjectManager.type

From NeoAxis Engine Wiki

Jump to: navigation, search
Go to higher level
Decorative09.jpg

Contents

Decorative Object Manager

Purpose

This manager of decorative objects is designed for easy creation and deployment of large arrays of decorative map objects (eg. foliage or stones). With it you can easily paint large amounts of vegetation. This Editor is not recommended for placing large objects such as trees.

Working with the editor

Using this editor you can apply decorative objects on virtually any surface (be it HeightmapTerrain or even StaticMesh). Most of the time you will be applying them for 'HeightmapTerrain' though.

Before you can use the Decorative Object Manager, you will need some terrain to apply it to. So first, create a HeightmapTerrain and in the same folder (Types\Base) a little higher, create DecorativeObjectManager. Click on the map and see that DecorativeObjectManager was added in the Map Entities window. Select this object (click on the empty checkbox in the Map Entities window) and notice that it's properties appeared in the Properties window on the right side of your screen.

Decorative01.jpg

There is not much to set in the Properties. But in the bottom part of the window there is a Edit button . Clicking it will open the main window of the DecorativeObjectManager editor.

DecorativeObjectManager 002.jpg

Clicking on the little X on the top of DecorativeObjects window will close it.

Adding decorative elements

Take a look at 6 pre-made decorative objects. There are 2 kinds of grass (GrassGreen and GrassBrown), 2 types of flowers (FlowerWhite and FlowerYellow), one set of stones (DecorativeStones) and one type of other foliage (Ear).

By selecting any of the elements and moving the cursor on the map, we see a green circle around our cursor. If we now click on the terrain we will see that a number of objects of the selected type appear within this circle.

DecorativeObjectManager 003.jpg

You can edit the radius of this circle by changing Radius. There are 2 ways to do that. The first is to move the slider, and the second is to set the exact value in the window above the slider. For this we have two arrows (up and down) on the right.

Removing decorative elements

To remove the selected type of decorative object, we need to select it from the DecorativeObjects list and then change the Tool from Paint to Clear. Click your mouse button over the objects you want to clear or hold the left mouse button and move your mouse to clear a bigger area.

Tip: You can quickly switch from Paint to Clear by holding down Shift key.

Note: Clear operation works only for the selected type of decorative objects! 
In order to remove the decorative objects of another type, you need to choose their type.

List of created elements

Decorative02.jpg

Let's look at the second tab called Created.

In here, we see a list of all the decorative objects placed on the map and their number. Each of the objects is sorted by type. If you select a type of objects, you have two actions available:

Title Description
Update Allows you to recalculate the position (height) for all the objects and randomize their scale and rotation.
Delete All Button allows you to remove all objects of the selected type from the map.

Creating new types of decorative objects

If you need to create some new decorative objects, you have to start NeoAxis Resource Editor. All pre-made decorative elements are held in /Data/Types/DecorativeObjects, and it would be a good idea to keep all new decorative elements in there as well.

Decorative Objects are made of one or more .mesh files, so to make a new decorative object you first need a model, texture, and material to create a .mesh. For the purposes of this little tutorial, we will use already existing stones but with a different texture.

Decorative03.jpg

Create the model as you would normally do in a 3D application (such as 3D Studio Max or Maya), export it to .mesh format, create .highMaterial file for use with the model and assign it. For instructions how to do this, refer to Export models from Autodesk 3ds Max and Overview of Material Editor.

Lets assume that you have a set of textured .mesh files ready in a folder inside /Data/Types/DecorativeObjects. Right click on that folder and create New Resource.

Decorative04.jpg

From the New Resource window select Entity Type and click Continue. In the next window give your entity a name and select set class type to DecorativeObject.

Decorative05.jpg

Your new object will appear in the selected folder. Double click on it to enter Edit Mode.

Properties

Take a look at Properties window:

Decorative06.jpg
Property Description
BatchSize The size of batch when generating geometry for the GPU.
CastShadows If set to True the .mesh files in collection will cast shadows.

Note: a large number of objects that cast shadows can decrease performance. Use with caution.

DestroyBatchOnDistance If set to True batches that are not visible will be destroyed in memory and generated only if visible. Very useful feature to save computer memory.
DistanceBetweenObjects Defines minimum distance between objects that you place on the map.
Items Here you assign .mesh files to this entity.
ScaleRange Allows to set the range of sizes for objects placed on the map. If set to "1 1" all generated objects will be of the same size.
StoreObjectsPositionInVertices Usually necessary for VegetationMaterial to allow waving. Positions are stored in Semantic: TextureCoordinates, Index: 4.
VisibilityDistance Defines the visibility distance. Objects that are further from camera than the set distance will not be rendered. 0 means that the entity will be visible at all times.
AllowEditorCreate Set this to True to allow this entity to be created from the Map Editor.
AllowEmptyName Defines whether this entity must have a name.
ClassInfo Displays the name of class for this entity. This field cannot be edited.
Name Displays the name of this entity. This field cannot be edited.
NetworkType Here you can set the network type for this entity. Available options are: NotSynchronized, ServerOnly, ClientOnly and Synchronized.

To add your .mesh files to the entity, click on the Browse icon in Items property. This opens the Item Collection Editor. Now press the Add button and click on MeshName property in the right side of the editor. Another window will open, allowing you to select a .mesh file.

Decorative07.jpg

There is also another property - Probability. This defines how likely the mesh is to appear in a collection once you place it on the map. 1 is the default value, and the higher it is, the higher chances of occurrence. You can add some more .mesh files to the collection or remove them if necessary. Hit OK once you finished. Change other entity properties if you need. Your new Decorative Object is now ready to use in Map Editor.

Decorative08.jpg