Skip to main content

GetObjectMaterial

warning

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

Description​

Get the material data from an index of the object.

NameDescription
objectidThe ID of the object.
materialIndexThe material index on the object. (0 to 15)
&modelidA variable in which to store the model ID, passed by reference.
textureLibrary[]An array into which to store the textureLibrary, passed by reference.
textureLibrarySizeThe size of the textureLibrary.
textureName[]An array into which to store the textureName, passed by reference.
textureNameSizeThe size of the textureName.
&materialColourA variable in which to store the materialColour, passed by reference.

Returns​

true - The function was executed successfully.

false - The function failed to execute. The object specified does not exist or an invalid material index is specified.

Examples​

new objectid = CreateObject(19371, 978.71143, -925.25708, 42.63720, 0.00000, 0.00000, 2.00000);
SetObjectMaterial(objectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);

new
modelid,
textureLibrary[16],
textureName[16],
materialColour;

GetObjectMaterial(objectid, 0, modelid, textureLibrary, sizeof(textureLibrary), textureName, sizeof(textureName), materialColour);
// modelid = 19341
// textureLibrary = "egg_texts"
// textureName = "easter_egg01"
// materialColour = 0xFFFFFFFF