Viz Plug-ins User Guide

Version 5.0 | Published December 20, 2022 ©

DataMaterial

images/download/attachments/95401955/plugins_datamaterial-icon.png
The DataMaterial plug-in changes the material parameters of the controlled container.

Note: This plug-in is located in: Plugins -> Container plug-ins -> Data

Information: DataPool plug-ins only work properly on a single channel on the same machine.

The data specifies any combination of the ambient, diffuse, specular, emission and alpha parameters of the material. The data format is:

[AMBIENT r g b] [DIFFUSE r g b] [SPECULAR r g b] [EMISSION r g b] [ALPHA a]

This format can specify new values for separate material components.

  • [COLOR r g b]: Specifies a color using red green and blue values.

    Note: All color values (r g b) are numbers between 0 and 255. Alpha values are float numbers between 0 and 100.

  • [MATERIAL name]: Specifies a material name from the Viz material library. The message format is: MATERIAL MATERIAL*<name>, where <name> is the full path to a material in Viz material library.

Example

  • If the received data is MAT[0-3]=DIFFUSE 255 0 0, DIFFUSE 0 255 0, DIFFUSE 0 0 255; then the diffuse component of the material of the first child is red, the diffuse component of the material of the second child is green and, the diffuse component of the material of the third child is blue.

  • If the data received is MAT=COLOR 255 0 0; then all the container materials are set to red.

  • If the data received is MAT=MATERIAL MATERIAL*blue; then the material is set to the blue material in Viz material library.

  • If the data received is MAT=MATERIAL MATERIAL*<UUID>; then the material is set to the material of the given UUID.

    Note: DataMaterial plug-in does not work unless the controlled containers have a material on them. If controlling child containers from a top node, each of the controlled child containers must have a material attached to it. The top container hosting the DataMaterial plug-in doesn’t need to have a material attached to it.

    Note: Only first level of child containers with materials are affected, grandchildren containers with materials are not affected.

Advanced Color Control

The Advanced Color Control simplifies the way to set the DataMaterial field.

Color Property Mode

If the Advanced Color Control option is set to On, the drop-down list Color Property Mode is shown. The list shows all available modes:

COLOR, AMBIENT, DIFFUSE, SPECULAR, EMISSION, ALPHA, MATERIAL.

The effect when using the Advanced Color Control is that the needed Prefix for DataPool is set automatically by the plug-in.

Color Property Example

On a container with a geometry, a material and the plug-in DataMaterial with field set to "mat", these are the DataPool settings:

  • With Advanced Color Control set to Off: mat=MATERIAL MATERIAL*GLOBALS/redMaterial

  • With Advanced Color Control set to On and Color Property Mode set to MATERIAL: mat=MATERIAL*GLOBALS/redMaterial

Color Format

Note: The Color Format is not enabled for ALPHA and MATERIAL.

This parameter provides multiple input formats for colors. Supported are following formats:

Format

Range RGB

Range Alpha

Example

R G B (int)

0 - 255

-

236 132 39

R G B (float)

0.0 - 1.0

-

0.9255 0.5176 0.1529

RGBA (hex)

00 - FF

00 - FF

EC84277F

ARGB (hex)

00 - FF

00 - FF

7FEC8427

RGB (hex)

00 - FF

-

EC8427

R G B A (int)

0 - 255

0 - 100

236 132 39 50

R G B A (float)

0.0 - 1.0

0.0 - 1.0

0.9255 0.5176 0.1529 0.5

A R G B (int)

0 - 255

0 - 100

50 236 132 39

A R G B (float)

0.0 - 1.0

0.0 - 1.0

0.5 0.9255 0.5176 0.1529