Click or drag to resize

Type and Metadata Programming

Event HandlersManual / Advanced / Type and Metadata ProgrammingAdd-on Creation

Type and Metadata Programming

Type programming

NeoAxis Engine environment provides opportunities for object types modification. By "object types", abilities for adjusting and reusing objects as a types is implied. From programming perspective that is similar to classes creation, inheritance, and other OOP features. NeoAxis Engine editor has fully functional environment for this kind of programming, which is mostly can be performed visually.

Let's see an example. We'll create and adjust an object in space. It will be created as a separate resource. Then we will add an object of this type in a separate resource on a new scene.

First image demonstrates scene and a modified object.


Second image shows how to to place this kind of object on a new scene. New object has been created, and it's like an instance of previously created type.

Screenshot999999328 2.png

Next image shows three objects, two of which are modified.


That was simple example of types usage. Current engine architecture and its tools allow following:

  • Type inheritance.
  • Add nested objects to the type.
  • Add properties, methods, events to the objects in the editor.
  • Hide nested objects of the type, implementing object encapsulation.

All these features can be used for 3D projects development.

Metadata programming

Metadata programming includes the ability to add virtual properties to objects and creation of virtual methods.

Type Settings form

This editor allows you to customize the hiding of properties and nested objects. This is done using the Type Settings form, which can be opened via clicking the button in the upper right corner of the Settings Window window.

Screenshot999999542 2.png

Opened form.


On examples of "Material base.material", "Material inheritance.scene" you can see how it works. Files are in Assets\Samples\Starter Content\Scenes\Material inheritance. This example demonstrates the inheritance of materials, the hiding of properties, the use of virtual properties.

The file "Material base.material" is a material that has the virtual property Color added. All other properties and Shader graph attached object are hidden using the Type Settings form.

Screenshot999999544 2.png

The file "Material inheritance.material" is an example of using the material. As you can see, only the Color property is available. There are no other properties, as there is no nested "Shader graph". Along the way, an example demonstrates the possibilities of instancing of materials.

Screenshot999999545 2.png
See also
Event HandlersAdd-on Creation