1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GetMeshMaterial</title>
<category>Objects</category>
<subcat>Display</subcat>
<version>5.1 OC</version>
<syntax>
<rtype>string</rtype>
<params>
<param>
<type>int</type>
<name>submesh</name>
<desc>If the mesh is composed of multiple submeshes then this parameter can be used to specify the submesh whose material to query.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Returns the material currently set for the calling object. May also be called from definition context to return the default material of the graphics of this definition.</desc>
<examples>
<example>
<code><funclink>if</funclink>(<funclink>GetMeshMaterial</funclink>() == "Clonk_Body")
<funclink>SetMeshMaterial</funclink>("Clonk_Body_EyesClosed")
else
<funclink>SetMeshMaterial</funclink>("Clonk_Body");</code>
<text>If a clonk has its eyes open then this script makes it close them, otherwise they are opened.</text>
</example>
<example>
<code><funclink>for</funclink> (var i=0,mat; mat=<funclink>GetID</funclink>()->GetMeshMaterial(i); ++i)
<funclink>SetMeshMaterial</funclink>(mat, i);</code>
<text>Resets the mesh material of all submeshes of this object to their respective defaults.</text>
</example>
</examples>
<related><funclink>SetMeshMaterial</funclink></related>
</func>
<author>Clonk-Karl</author><date>2010-04</date>
<author>Sven2</author><date>2014-04</date>
</funcs>
|