UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials

Unigine::Materials Class

Unigine materials. This interface provides access to Unigine material manager functions.

To use this class, include the UnigineMaterials.h file.

Unigine::Materials Class

Members


virtual ~Materials ()

Virtual destructor.

static Materials * get ()

Return a pointer to the existing material manager.

Return value

Pointer to the existing material manager.

virtual int create (const char * name) const =0

Creates an empty material library.

Arguments

  • const char * name - Material library name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int load (const char * name) const =0

Loads the material library from the file.

Arguments

  • const char * name - Material library name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int save (const char * name) const =0

Saves the material library into the file.

Arguments

  • const char * name - Material library name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int clear (const char * name) const =0

Clears the material library by its name.

Arguments

  • const char * name - Material library name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int getNumLibraries () const =0

Returns the number of loaded material libraries.

Return value

The number of loaded material libraries.

virtual const char * getLibraryName (int num) const =0

Returns the material library name.

Arguments

  • int num - Material library number.

Return value

The name of material library.

virtual int isLibraryEditable (int num) const =0

Returns the material library editable flag.

Arguments

  • int num - Material library number.

Return value

The editable flag.

virtual int isLibrary (const char * name) const =0

Checks the material library by its name.

Arguments

  • const char * name - Material library name.

Return value

Returns 1 if the material library is loaded; otherwise, 0 is returned.

virtual int findLibrary (const char * name) const =0

Finds the material library by its name.

Arguments

  • const char * name - Material library name.

Return value

Material library number.

virtual int getNumMaterials (int library) const =0

Returns the number of library materials.

Arguments

  • int library - Library number.

Return value

The number of library materials.

virtual MaterialPtr getMaterial (int library, int num) const =0

Returns the material.

Arguments

  • int library - Library number.
  • int num - Material number.

Return value

Material smart pointer.

virtual const char * getMaterialName (int library, int num) const =0

Returns the material name.

Arguments

  • int library - Library number.
  • int num - Material number.

Return value

The name of material.

virtual int isMaterial (const char * name) const =0

Checks the material by its name.

Arguments

  • const char * name - Material name.

Return value

Returns 1 if the material is loaded; otherwise, 0 is returned.

virtual MaterialPtr findMaterial (const char * name) const =0

Finds the material by its name.

Arguments

  • const char * name - Material name.

Return value

Material smart pointer.

virtual int findMaterialLibrary (const char * name) const =0

Finds the material library by material name.

Arguments

  • const char * name - Material name.

Return value

Material library number.

virtual int findMaterialLibrary (const MaterialPtr & material) const =0

Finds the material library by material name.

Arguments

  • const MaterialPtr & material - Material smart pointer.

Return value

Material library number.

virtual int findLibraryMaterial (int library, const char * name) const =0

Finds the material in the specified material library.

Arguments

  • int library - Library number.
  • const char * name - Material name.

Return value

Material number.

virtual int findLibraryMaterial (int library, const MaterialPtr & material) const =0

Finds the material in the specified material library.

Arguments

  • int library - Library number.
  • const MaterialPtr & material - Material smart pointer.

Return value

Material number.

virtual int cloneMaterial (const char * name, const char * new_library, const char * new_name) const =0

Clones material into the specified material library.

Arguments

  • const char * name - Material name.
  • const char * new_library - New material library name.
  • const char * new_name - New material name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int inheritMaterial (const char * name, const char * new_library, const char * new_name) const =0

Inherits material into the specified material library.

Arguments

  • const char * name - Material name.
  • const char * new_library - New material library name.
  • const char * new_name - New material name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int moveMaterial (const char * name, const char * new_library, const char * new_name) const =0

Moves material into the specified material library.

Arguments

  • const char * name - Material name.
  • const char * new_library - New material library name.
  • const char * new_name - New material name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

virtual int removeMaterial (const char * name) const =0

Remove material by its name.

Arguments

  • const char * name - Material name.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.
Last update: 2017-07-03