miniassimp

diff include/miniassimp/material.h @ 0:879c81d94345

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Jan 2019 18:19:26 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/miniassimp/material.h	Mon Jan 28 18:19:26 2019 +0200
     1.3 @@ -0,0 +1,1576 @@
     1.4 +/*
     1.5 +---------------------------------------------------------------------------
     1.6 +Open Asset Import Library (assimp)
     1.7 +---------------------------------------------------------------------------
     1.8 +
     1.9 +Copyright (c) 2006-2018, assimp team
    1.10 +
    1.11 +
    1.12 +
    1.13 +All rights reserved.
    1.14 +
    1.15 +Redistribution and use of this software in source and binary forms,
    1.16 +with or without modification, are permitted provided that the following
    1.17 +conditions are met:
    1.18 +
    1.19 +* Redistributions of source code must retain the above
    1.20 +  copyright notice, this list of conditions and the
    1.21 +  following disclaimer.
    1.22 +
    1.23 +* Redistributions in binary form must reproduce the above
    1.24 +  copyright notice, this list of conditions and the
    1.25 +  following disclaimer in the documentation and/or other
    1.26 +  materials provided with the distribution.
    1.27 +
    1.28 +* Neither the name of the assimp team, nor the names of its
    1.29 +  contributors may be used to endorse or promote products
    1.30 +  derived from this software without specific prior
    1.31 +  written permission of the assimp team.
    1.32 +
    1.33 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.34 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.35 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.36 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    1.37 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.38 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.39 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.40 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    1.41 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    1.42 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.43 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.44 +---------------------------------------------------------------------------
    1.45 +*/
    1.46 +
    1.47 +/** @file material.h
    1.48 + *  @brief Defines the material system of the library
    1.49 + */
    1.50 +#pragma once
    1.51 +#ifndef AI_MATERIAL_H_INC
    1.52 +#define AI_MATERIAL_H_INC
    1.53 +
    1.54 +#include "types.h"
    1.55 +
    1.56 +#ifdef __cplusplus
    1.57 +extern "C" {
    1.58 +#endif
    1.59 +
    1.60 +// Name for default materials (2nd is used if meshes have UV coords)
    1.61 +#define AI_DEFAULT_MATERIAL_NAME          "DefaultMaterial"
    1.62 +
    1.63 +// ---------------------------------------------------------------------------
    1.64 +/** @brief Defines how the Nth texture of a specific type is combined with
    1.65 + *  the result of all previous layers.
    1.66 + *
    1.67 + *  Example (left: key, right: value): <br>
    1.68 + *  @code
    1.69 + *  DiffColor0     - gray
    1.70 + *  DiffTextureOp0 - aiTextureOpMultiply
    1.71 + *  DiffTexture0   - tex1.png
    1.72 + *  DiffTextureOp0 - aiTextureOpAdd
    1.73 + *  DiffTexture1   - tex2.png
    1.74 + *  @endcode
    1.75 + *  Written as equation, the final diffuse term for a specific pixel would be:
    1.76 + *  @code
    1.77 + *  diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) +
    1.78 + *     sampleTex(DiffTexture1,UV0) * diffContrib;
    1.79 + *  @endcode
    1.80 + *  where 'diffContrib' is the intensity of the incoming light for that pixel.
    1.81 + */
    1.82 +enum aiTextureOp
    1.83 +{
    1.84 +    /** T = T1 * T2 */
    1.85 +    aiTextureOp_Multiply = 0x0,
    1.86 +
    1.87 +    /** T = T1 + T2 */
    1.88 +    aiTextureOp_Add = 0x1,
    1.89 +
    1.90 +    /** T = T1 - T2 */
    1.91 +    aiTextureOp_Subtract = 0x2,
    1.92 +
    1.93 +    /** T = T1 / T2 */
    1.94 +    aiTextureOp_Divide = 0x3,
    1.95 +
    1.96 +    /** T = (T1 + T2) - (T1 * T2) */
    1.97 +    aiTextureOp_SmoothAdd = 0x4,
    1.98 +
    1.99 +    /** T = T1 + (T2-0.5) */
   1.100 +    aiTextureOp_SignedAdd = 0x5,
   1.101 +
   1.102 +
   1.103 +#ifndef SWIG
   1.104 +    _aiTextureOp_Force32Bit = INT_MAX
   1.105 +#endif
   1.106 +};
   1.107 +
   1.108 +// ---------------------------------------------------------------------------
   1.109 +/** @brief Defines how UV coordinates outside the [0...1] range are handled.
   1.110 + *
   1.111 + *  Commonly referred to as 'wrapping mode'.
   1.112 + */
   1.113 +enum aiTextureMapMode
   1.114 +{
   1.115 +    /** A texture coordinate u|v is translated to u%1|v%1
   1.116 +     */
   1.117 +    aiTextureMapMode_Wrap = 0x0,
   1.118 +
   1.119 +    /** Texture coordinates outside [0...1]
   1.120 +     *  are clamped to the nearest valid value.
   1.121 +     */
   1.122 +    aiTextureMapMode_Clamp = 0x1,
   1.123 +
   1.124 +    /** If the texture coordinates for a pixel are outside [0...1]
   1.125 +     *  the texture is not applied to that pixel
   1.126 +     */
   1.127 +    aiTextureMapMode_Decal = 0x3,
   1.128 +
   1.129 +    /** A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and
   1.130 +     *  1-(u%1)|1-(v%1) otherwise
   1.131 +     */
   1.132 +    aiTextureMapMode_Mirror = 0x2,
   1.133 +
   1.134 +#ifndef SWIG
   1.135 +    _aiTextureMapMode_Force32Bit = INT_MAX
   1.136 +#endif
   1.137 +};
   1.138 +
   1.139 +// ---------------------------------------------------------------------------
   1.140 +/** @brief Defines how the mapping coords for a texture are generated.
   1.141 + *
   1.142 + *  Real-time applications typically require full UV coordinates, so the use of
   1.143 + *  the aiProcess_GenUVCoords step is highly recommended. It generates proper
   1.144 + *  UV channels for non-UV mapped objects, as long as an accurate description
   1.145 + *  how the mapping should look like (e.g spherical) is given.
   1.146 + *  See the #AI_MATKEY_MAPPING property for more details.
   1.147 + */
   1.148 +enum aiTextureMapping
   1.149 +{
   1.150 +    /** The mapping coordinates are taken from an UV channel.
   1.151 +     *
   1.152 +     *  The #AI_MATKEY_UVWSRC key specifies from which UV channel
   1.153 +     *  the texture coordinates are to be taken from (remember,
   1.154 +     *  meshes can have more than one UV channel).
   1.155 +    */
   1.156 +    aiTextureMapping_UV = 0x0,
   1.157 +
   1.158 +     /** Spherical mapping */
   1.159 +    aiTextureMapping_SPHERE = 0x1,
   1.160 +
   1.161 +     /** Cylindrical mapping */
   1.162 +    aiTextureMapping_CYLINDER = 0x2,
   1.163 +
   1.164 +     /** Cubic mapping */
   1.165 +    aiTextureMapping_BOX = 0x3,
   1.166 +
   1.167 +     /** Planar mapping */
   1.168 +    aiTextureMapping_PLANE = 0x4,
   1.169 +
   1.170 +     /** Undefined mapping. Have fun. */
   1.171 +    aiTextureMapping_OTHER = 0x5,
   1.172 +
   1.173 +
   1.174 +#ifndef SWIG
   1.175 +    _aiTextureMapping_Force32Bit = INT_MAX
   1.176 +#endif
   1.177 +};
   1.178 +
   1.179 +// ---------------------------------------------------------------------------
   1.180 +/** @brief Defines the purpose of a texture
   1.181 + *
   1.182 + *  This is a very difficult topic. Different 3D packages support different
   1.183 + *  kinds of textures. For very common texture types, such as bumpmaps, the
   1.184 + *  rendering results depend on implementation details in the rendering
   1.185 + *  pipelines of these applications. Assimp loads all texture references from
   1.186 + *  the model file and tries to determine which of the predefined texture
   1.187 + *  types below is the best choice to match the original use of the texture
   1.188 + *  as closely as possible.<br>
   1.189 + *
   1.190 + *  In content pipelines you'll usually define how textures have to be handled,
   1.191 + *  and the artists working on models have to conform to this specification,
   1.192 + *  regardless which 3D tool they're using.
   1.193 + */
   1.194 +enum aiTextureType
   1.195 +{
   1.196 +    /** Dummy value.
   1.197 +     *
   1.198 +     *  No texture, but the value to be used as 'texture semantic'
   1.199 +     *  (#aiMaterialProperty::mSemantic) for all material properties
   1.200 +     *  *not* related to textures.
   1.201 +     */
   1.202 +    aiTextureType_NONE = 0x0,
   1.203 +
   1.204 +
   1.205 +
   1.206 +    /** The texture is combined with the result of the diffuse
   1.207 +     *  lighting equation.
   1.208 +     */
   1.209 +    aiTextureType_DIFFUSE = 0x1,
   1.210 +
   1.211 +    /** The texture is combined with the result of the specular
   1.212 +     *  lighting equation.
   1.213 +     */
   1.214 +    aiTextureType_SPECULAR = 0x2,
   1.215 +
   1.216 +    /** The texture is combined with the result of the ambient
   1.217 +     *  lighting equation.
   1.218 +     */
   1.219 +    aiTextureType_AMBIENT = 0x3,
   1.220 +
   1.221 +    /** The texture is added to the result of the lighting
   1.222 +     *  calculation. It isn't influenced by incoming light.
   1.223 +     */
   1.224 +    aiTextureType_EMISSIVE = 0x4,
   1.225 +
   1.226 +    /** The texture is a height map.
   1.227 +     *
   1.228 +     *  By convention, higher gray-scale values stand for
   1.229 +     *  higher elevations from the base height.
   1.230 +     */
   1.231 +    aiTextureType_HEIGHT = 0x5,
   1.232 +
   1.233 +    /** The texture is a (tangent space) normal-map.
   1.234 +     *
   1.235 +     *  Again, there are several conventions for tangent-space
   1.236 +     *  normal maps. Assimp does (intentionally) not
   1.237 +     *  distinguish here.
   1.238 +     */
   1.239 +    aiTextureType_NORMALS = 0x6,
   1.240 +
   1.241 +    /** The texture defines the glossiness of the material.
   1.242 +     *
   1.243 +     *  The glossiness is in fact the exponent of the specular
   1.244 +     *  (phong) lighting equation. Usually there is a conversion
   1.245 +     *  function defined to map the linear color values in the
   1.246 +     *  texture to a suitable exponent. Have fun.
   1.247 +    */
   1.248 +    aiTextureType_SHININESS = 0x7,
   1.249 +
   1.250 +    /** The texture defines per-pixel opacity.
   1.251 +     *
   1.252 +     *  Usually 'white' means opaque and 'black' means
   1.253 +     *  'transparency'. Or quite the opposite. Have fun.
   1.254 +    */
   1.255 +    aiTextureType_OPACITY = 0x8,
   1.256 +
   1.257 +    /** Displacement texture
   1.258 +     *
   1.259 +     *  The exact purpose and format is application-dependent.
   1.260 +     *  Higher color values stand for higher vertex displacements.
   1.261 +    */
   1.262 +    aiTextureType_DISPLACEMENT = 0x9,
   1.263 +
   1.264 +    /** Lightmap texture (aka Ambient Occlusion)
   1.265 +     *
   1.266 +     *  Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
   1.267 +     *  covered by this material property. The texture contains a
   1.268 +     *  scaling value for the final color value of a pixel. Its
   1.269 +     *  intensity is not affected by incoming light.
   1.270 +    */
   1.271 +    aiTextureType_LIGHTMAP = 0xA,
   1.272 +
   1.273 +    /** Reflection texture
   1.274 +     *
   1.275 +     * Contains the color of a perfect mirror reflection.
   1.276 +     * Rarely used, almost never for real-time applications.
   1.277 +    */
   1.278 +    aiTextureType_REFLECTION = 0xB,
   1.279 +
   1.280 +    /** Unknown texture
   1.281 +     *
   1.282 +     *  A texture reference that does not match any of the definitions
   1.283 +     *  above is considered to be 'unknown'. It is still imported,
   1.284 +     *  but is excluded from any further postprocessing.
   1.285 +    */
   1.286 +    aiTextureType_UNKNOWN = 0xC,
   1.287 +
   1.288 +
   1.289 +#ifndef SWIG
   1.290 +    _aiTextureType_Force32Bit = INT_MAX
   1.291 +#endif
   1.292 +};
   1.293 +
   1.294 +#define AI_TEXTURE_TYPE_MAX  aiTextureType_UNKNOWN
   1.295 +
   1.296 +// ---------------------------------------------------------------------------
   1.297 +/** @brief Defines all shading models supported by the library
   1.298 + *
   1.299 + *  The list of shading modes has been taken from Blender.
   1.300 + *  See Blender documentation for more information. The API does
   1.301 + *  not distinguish between "specular" and "diffuse" shaders (thus the
   1.302 + *  specular term for diffuse shading models like Oren-Nayar remains
   1.303 + *  undefined). <br>
   1.304 + *  Again, this value is just a hint. Assimp tries to select the shader whose
   1.305 + *  most common implementation matches the original rendering results of the
   1.306 + *  3D modeller which wrote a particular model as closely as possible.
   1.307 + */
   1.308 +enum aiShadingMode
   1.309 +{
   1.310 +    /** Flat shading. Shading is done on per-face base,
   1.311 +     *  diffuse only. Also known as 'faceted shading'.
   1.312 +     */
   1.313 +    aiShadingMode_Flat = 0x1,
   1.314 +
   1.315 +    /** Simple Gouraud shading.
   1.316 +     */
   1.317 +    aiShadingMode_Gouraud = 0x2,
   1.318 +
   1.319 +    /** Phong-Shading -
   1.320 +     */
   1.321 +    aiShadingMode_Phong = 0x3,
   1.322 +
   1.323 +    /** Phong-Blinn-Shading
   1.324 +     */
   1.325 +    aiShadingMode_Blinn = 0x4,
   1.326 +
   1.327 +    /** Toon-Shading per pixel
   1.328 +     *
   1.329 +     *  Also known as 'comic' shader.
   1.330 +     */
   1.331 +    aiShadingMode_Toon = 0x5,
   1.332 +
   1.333 +    /** OrenNayar-Shading per pixel
   1.334 +     *
   1.335 +     *  Extension to standard Lambertian shading, taking the
   1.336 +     *  roughness of the material into account
   1.337 +     */
   1.338 +    aiShadingMode_OrenNayar = 0x6,
   1.339 +
   1.340 +    /** Minnaert-Shading per pixel
   1.341 +     *
   1.342 +     *  Extension to standard Lambertian shading, taking the
   1.343 +     *  "darkness" of the material into account
   1.344 +     */
   1.345 +    aiShadingMode_Minnaert = 0x7,
   1.346 +
   1.347 +    /** CookTorrance-Shading per pixel
   1.348 +     *
   1.349 +     *  Special shader for metallic surfaces.
   1.350 +     */
   1.351 +    aiShadingMode_CookTorrance = 0x8,
   1.352 +
   1.353 +    /** No shading at all. Constant light influence of 1.0.
   1.354 +    */
   1.355 +    aiShadingMode_NoShading = 0x9,
   1.356 +
   1.357 +     /** Fresnel shading
   1.358 +     */
   1.359 +    aiShadingMode_Fresnel = 0xa,
   1.360 +
   1.361 +
   1.362 +#ifndef SWIG
   1.363 +    _aiShadingMode_Force32Bit = INT_MAX
   1.364 +#endif
   1.365 +};
   1.366 +
   1.367 +
   1.368 +// ---------------------------------------------------------------------------
   1.369 +/** @brief Defines some mixed flags for a particular texture.
   1.370 + *
   1.371 + *  Usually you'll instruct your cg artists how textures have to look like ...
   1.372 + *  and how they will be processed in your application. However, if you use
   1.373 + *  Assimp for completely generic loading purposes you might also need to
   1.374 + *  process these flags in order to display as many 'unknown' 3D models as
   1.375 + *  possible correctly.
   1.376 + *
   1.377 + *  This corresponds to the #AI_MATKEY_TEXFLAGS property.
   1.378 +*/
   1.379 +enum aiTextureFlags
   1.380 +{
   1.381 +    /** The texture's color values have to be inverted (componentwise 1-n)
   1.382 +     */
   1.383 +    aiTextureFlags_Invert = 0x1,
   1.384 +
   1.385 +    /** Explicit request to the application to process the alpha channel
   1.386 +     *  of the texture.
   1.387 +     *
   1.388 +     *  Mutually exclusive with #aiTextureFlags_IgnoreAlpha. These
   1.389 +     *  flags are set if the library can say for sure that the alpha
   1.390 +     *  channel is used/is not used. If the model format does not
   1.391 +     *  define this, it is left to the application to decide whether
   1.392 +     *  the texture alpha channel - if any - is evaluated or not.
   1.393 +     */
   1.394 +    aiTextureFlags_UseAlpha = 0x2,
   1.395 +
   1.396 +    /** Explicit request to the application to ignore the alpha channel
   1.397 +     *  of the texture.
   1.398 +     *
   1.399 +     *  Mutually exclusive with #aiTextureFlags_UseAlpha.
   1.400 +     */
   1.401 +    aiTextureFlags_IgnoreAlpha = 0x4,
   1.402 +
   1.403 +#ifndef SWIG
   1.404 +      _aiTextureFlags_Force32Bit = INT_MAX
   1.405 +#endif
   1.406 +};
   1.407 +
   1.408 +
   1.409 +// ---------------------------------------------------------------------------
   1.410 +/** @brief Defines alpha-blend flags.
   1.411 + *
   1.412 + *  If you're familiar with OpenGL or D3D, these flags aren't new to you.
   1.413 + *  They define *how* the final color value of a pixel is computed, basing
   1.414 + *  on the previous color at that pixel and the new color value from the
   1.415 + *  material.
   1.416 + *  The blend formula is:
   1.417 + *  @code
   1.418 + *    SourceColor * SourceBlend + DestColor * DestBlend
   1.419 + *  @endcode
   1.420 + *  where DestColor is the previous color in the framebuffer at this
   1.421 + *  position and SourceColor is the material color before the transparency
   1.422 + *  calculation.<br>
   1.423 + *  This corresponds to the #AI_MATKEY_BLEND_FUNC property.
   1.424 +*/
   1.425 +enum aiBlendMode
   1.426 +{
   1.427 +    /**
   1.428 +     *  Formula:
   1.429 +     *  @code
   1.430 +     *  SourceColor*SourceAlpha + DestColor*(1-SourceAlpha)
   1.431 +     *  @endcode
   1.432 +     */
   1.433 +    aiBlendMode_Default = 0x0,
   1.434 +
   1.435 +    /** Additive blending
   1.436 +     *
   1.437 +     *  Formula:
   1.438 +     *  @code
   1.439 +     *  SourceColor*1 + DestColor*1
   1.440 +     *  @endcode
   1.441 +     */
   1.442 +    aiBlendMode_Additive = 0x1,
   1.443 +
   1.444 +    // we don't need more for the moment, but we might need them
   1.445 +    // in future versions ...
   1.446 +
   1.447 +#ifndef SWIG
   1.448 +    _aiBlendMode_Force32Bit = INT_MAX
   1.449 +#endif
   1.450 +};
   1.451 +
   1.452 +
   1.453 +#include "./Compiler/pushpack1.h"
   1.454 +
   1.455 +// ---------------------------------------------------------------------------
   1.456 +/** @brief Defines how an UV channel is transformed.
   1.457 + *
   1.458 + *  This is just a helper structure for the #AI_MATKEY_UVTRANSFORM key.
   1.459 + *  See its documentation for more details.
   1.460 + *
   1.461 + *  Typically you'll want to build a matrix of this information. However,
   1.462 + *  we keep separate scaling/translation/rotation values to make it
   1.463 + *  easier to process and optimize UV transformations internally.
   1.464 + */
   1.465 +struct aiUVTransform
   1.466 +{
   1.467 +    /** Translation on the u and v axes.
   1.468 +     *
   1.469 +     *  The default value is (0|0).
   1.470 +     */
   1.471 +    C_STRUCT aiVector2D mTranslation;
   1.472 +
   1.473 +    /** Scaling on the u and v axes.
   1.474 +     *
   1.475 +     *  The default value is (1|1).
   1.476 +     */
   1.477 +    C_STRUCT aiVector2D mScaling;
   1.478 +
   1.479 +    /** Rotation - in counter-clockwise direction.
   1.480 +     *
   1.481 +     *  The rotation angle is specified in radians. The
   1.482 +     *  rotation center is 0.5f|0.5f. The default value
   1.483 +     *  0.f.
   1.484 +     */
   1.485 +    ai_real mRotation;
   1.486 +
   1.487 +
   1.488 +#ifdef __cplusplus
   1.489 +    aiUVTransform() AI_NO_EXCEPT
   1.490 +        :   mTranslation (0.0,0.0)
   1.491 +        ,   mScaling    (1.0,1.0)
   1.492 +        ,   mRotation   (0.0)
   1.493 +    {
   1.494 +        // nothing to be done here ...
   1.495 +    }
   1.496 +#endif
   1.497 +
   1.498 +};
   1.499 +
   1.500 +#include "./Compiler/poppack1.h"
   1.501 +
   1.502 +//! @cond AI_DOX_INCLUDE_INTERNAL
   1.503 +// ---------------------------------------------------------------------------
   1.504 +/** @brief A very primitive RTTI system for the contents of material
   1.505 + *  properties.
   1.506 + */
   1.507 +enum aiPropertyTypeInfo
   1.508 +{
   1.509 +    /** Array of single-precision (32 Bit) floats
   1.510 +     *
   1.511 +     *  It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
   1.512 +     *  aiMaterial::Get()) to query properties stored in floating-point format.
   1.513 +     *  The material system performs the type conversion automatically.
   1.514 +    */
   1.515 +    aiPTI_Float   = 0x1,
   1.516 +
   1.517 +    /** Array of double-precision (64 Bit) floats
   1.518 +     *
   1.519 +     *  It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
   1.520 +     *  aiMaterial::Get()) to query properties stored in floating-point format.
   1.521 +     *  The material system performs the type conversion automatically.
   1.522 +    */
   1.523 +    aiPTI_Double   = 0x2,
   1.524 +
   1.525 +    /** The material property is an aiString.
   1.526 +     *
   1.527 +     *  Arrays of strings aren't possible, aiGetMaterialString() (or the
   1.528 +     *  C++-API aiMaterial::Get()) *must* be used to query a string property.
   1.529 +    */
   1.530 +    aiPTI_String  = 0x3,
   1.531 +
   1.532 +    /** Array of (32 Bit) integers
   1.533 +     *
   1.534 +     *  It is possible to use aiGetMaterialFloat[Array]() (or the C++-API
   1.535 +     *  aiMaterial::Get()) to query properties stored in integer format.
   1.536 +     *  The material system performs the type conversion automatically.
   1.537 +    */
   1.538 +    aiPTI_Integer = 0x4,
   1.539 +
   1.540 +
   1.541 +    /** Simple binary buffer, content undefined. Not convertible to anything.
   1.542 +    */
   1.543 +    aiPTI_Buffer  = 0x5,
   1.544 +
   1.545 +
   1.546 +     /** This value is not used. It is just there to force the
   1.547 +     *  compiler to map this enum to a 32 Bit integer.
   1.548 +     */
   1.549 +#ifndef SWIG
   1.550 +     _aiPTI_Force32Bit = INT_MAX
   1.551 +#endif
   1.552 +};
   1.553 +
   1.554 +// ---------------------------------------------------------------------------
   1.555 +/** @brief Data structure for a single material property
   1.556 + *
   1.557 + *  As an user, you'll probably never need to deal with this data structure.
   1.558 + *  Just use the provided aiGetMaterialXXX() or aiMaterial::Get() family
   1.559 + *  of functions to query material properties easily. Processing them
   1.560 + *  manually is faster, but it is not the recommended way. It isn't worth
   1.561 + *  the effort. <br>
   1.562 + *  Material property names follow a simple scheme:
   1.563 + *  @code
   1.564 + *    $<name>
   1.565 + *    ?<name>
   1.566 + *       A public property, there must be corresponding AI_MATKEY_XXX define
   1.567 + *       2nd: Public, but ignored by the #aiProcess_RemoveRedundantMaterials
   1.568 + *       post-processing step.
   1.569 + *    ~<name>
   1.570 + *       A temporary property for internal use.
   1.571 + *  @endcode
   1.572 + *  @see aiMaterial
   1.573 + */
   1.574 +struct aiMaterialProperty
   1.575 +{
   1.576 +    /** Specifies the name of the property (key)
   1.577 +     *  Keys are generally case insensitive.
   1.578 +     */
   1.579 +    C_STRUCT aiString mKey;
   1.580 +
   1.581 +    /** Textures: Specifies their exact usage semantic.
   1.582 +     * For non-texture properties, this member is always 0
   1.583 +     * (or, better-said, #aiTextureType_NONE).
   1.584 +     */
   1.585 +    unsigned int mSemantic;
   1.586 +
   1.587 +    /** Textures: Specifies the index of the texture.
   1.588 +     *  For non-texture properties, this member is always 0.
   1.589 +     */
   1.590 +    unsigned int mIndex;
   1.591 +
   1.592 +    /** Size of the buffer mData is pointing to, in bytes.
   1.593 +     *  This value may not be 0.
   1.594 +     */
   1.595 +    unsigned int mDataLength;
   1.596 +
   1.597 +    /** Type information for the property.
   1.598 +     *
   1.599 +     * Defines the data layout inside the data buffer. This is used
   1.600 +     * by the library internally to perform debug checks and to
   1.601 +     * utilize proper type conversions.
   1.602 +     * (It's probably a hacky solution, but it works.)
   1.603 +     */
   1.604 +    C_ENUM aiPropertyTypeInfo mType;
   1.605 +
   1.606 +    /** Binary buffer to hold the property's value.
   1.607 +     * The size of the buffer is always mDataLength.
   1.608 +     */
   1.609 +    char* mData;
   1.610 +
   1.611 +#ifdef __cplusplus
   1.612 +
   1.613 +    aiMaterialProperty() AI_NO_EXCEPT
   1.614 +    : mSemantic( 0 )
   1.615 +    , mIndex( 0 )
   1.616 +    , mDataLength( 0 )
   1.617 +    , mType( aiPTI_Float )
   1.618 +    , mData(0) {
   1.619 +        // empty
   1.620 +    }
   1.621 +
   1.622 +    ~aiMaterialProperty()   {
   1.623 +        delete[] mData;
   1.624 +        mData = 0;
   1.625 +    }
   1.626 +
   1.627 +#endif
   1.628 +};
   1.629 +//! @endcond
   1.630 +
   1.631 +#ifdef __cplusplus
   1.632 +} // We need to leave the "C" block here to allow template member functions
   1.633 +#endif
   1.634 +
   1.635 +// ---------------------------------------------------------------------------
   1.636 +/** @brief Data structure for a material
   1.637 +*
   1.638 +*  Material data is stored using a key-value structure. A single key-value
   1.639 +*  pair is called a 'material property'. C++ users should use the provided
   1.640 +*  member functions of aiMaterial to process material properties, C users
   1.641 +*  have to stick with the aiMaterialGetXXX family of unbound functions.
   1.642 +*  The library defines a set of standard keys (AI_MATKEY_XXX).
   1.643 +*/
   1.644 +#ifdef __cplusplus
   1.645 +struct ASSIMP_API aiMaterial
   1.646 +#else
   1.647 +struct aiMaterial
   1.648 +#endif
   1.649 +{
   1.650 +
   1.651 +#ifdef __cplusplus
   1.652 +
   1.653 +public:
   1.654 +
   1.655 +    aiMaterial();
   1.656 +    ~aiMaterial();
   1.657 +
   1.658 +    // -------------------------------------------------------------------
   1.659 +    /**
   1.660 +      * @brief  Returns the name of the material.
   1.661 +      * @return The name of the material.
   1.662 +      */
   1.663 +    // -------------------------------------------------------------------
   1.664 +    aiString GetName();
   1.665 +
   1.666 +    // -------------------------------------------------------------------
   1.667 +    /** @brief Retrieve an array of Type values with a specific key
   1.668 +     *  from the material
   1.669 +     *
   1.670 +     * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
   1.671 +     * @param type .. set by AI_MATKEY_XXX
   1.672 +     * @param idx .. set by AI_MATKEY_XXX
   1.673 +     * @param pOut Pointer to a buffer to receive the result.
   1.674 +     * @param pMax Specifies the size of the given buffer, in Type's.
   1.675 +     * Receives the number of values (not bytes!) read.
   1.676 +     * NULL is a valid value for this parameter.
   1.677 +     */
   1.678 +    template <typename Type>
   1.679 +    aiReturn Get(const char* pKey,unsigned int type,
   1.680 +        unsigned int idx, Type* pOut, unsigned int* pMax) const;
   1.681 +
   1.682 +    aiReturn Get(const char* pKey,unsigned int type,
   1.683 +        unsigned int idx, int* pOut, unsigned int* pMax) const;
   1.684 +
   1.685 +    aiReturn Get(const char* pKey,unsigned int type,
   1.686 +        unsigned int idx, ai_real* pOut, unsigned int* pMax) const;
   1.687 +
   1.688 +    // -------------------------------------------------------------------
   1.689 +    /** @brief Retrieve a Type value with a specific key
   1.690 +     *  from the material
   1.691 +     *
   1.692 +     * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
   1.693 +    * @param type Specifies the type of the texture to be retrieved (
   1.694 +    *    e.g. diffuse, specular, height map ...)
   1.695 +    * @param idx Index of the texture to be retrieved.
   1.696 +     * @param pOut Reference to receive the output value
   1.697 +     */
   1.698 +    template <typename Type>
   1.699 +    aiReturn Get(const char* pKey,unsigned int type,
   1.700 +        unsigned int idx,Type& pOut) const;
   1.701 +
   1.702 +
   1.703 +    aiReturn Get(const char* pKey,unsigned int type,
   1.704 +        unsigned int idx, int& pOut) const;
   1.705 +
   1.706 +    aiReturn Get(const char* pKey,unsigned int type,
   1.707 +        unsigned int idx, ai_real& pOut) const;
   1.708 +
   1.709 +    aiReturn Get(const char* pKey,unsigned int type,
   1.710 +        unsigned int idx, aiString& pOut) const;
   1.711 +
   1.712 +    aiReturn Get(const char* pKey,unsigned int type,
   1.713 +        unsigned int idx, aiColor3D& pOut) const;
   1.714 +
   1.715 +    aiReturn Get(const char* pKey,unsigned int type,
   1.716 +        unsigned int idx, aiColor4D& pOut) const;
   1.717 +
   1.718 +    aiReturn Get(const char* pKey,unsigned int type,
   1.719 +        unsigned int idx, aiUVTransform& pOut) const;
   1.720 +
   1.721 +    // -------------------------------------------------------------------
   1.722 +    /** Get the number of textures for a particular texture type.
   1.723 +     *  @param type Texture type to check for
   1.724 +     *  @return Number of textures for this type.
   1.725 +     *  @note A texture can be easily queried using #GetTexture() */
   1.726 +    unsigned int GetTextureCount(aiTextureType type) const;
   1.727 +
   1.728 +    // -------------------------------------------------------------------
   1.729 +    /** Helper function to get all parameters pertaining to a
   1.730 +     *  particular texture slot from a material.
   1.731 +     *
   1.732 +     *  This function is provided just for convenience, you could also
   1.733 +     *  read the single material properties manually.
   1.734 +     *  @param type Specifies the type of the texture to be retrieved (
   1.735 +     *    e.g. diffuse, specular, height map ...)
   1.736 +     *  @param index Index of the texture to be retrieved. The function fails
   1.737 +     *    if there is no texture of that type with this index.
   1.738 +     *    #GetTextureCount() can be used to determine the number of textures
   1.739 +     *    per texture type.
   1.740 +     *  @param path Receives the path to the texture.
   1.741 +     *    If the texture is embedded, receives a '*' followed by the id of
   1.742 +     *    the texture (for the textures stored in the corresponding scene) which
   1.743 +     *    can be converted to an int using a function like atoi.
   1.744 +     *    NULL is a valid value.
   1.745 +     *  @param mapping The texture mapping.
   1.746 +     *    NULL is allowed as value.
   1.747 +     *  @param uvindex Receives the UV index of the texture.
   1.748 +     *    NULL is a valid value.
   1.749 +     *  @param blend Receives the blend factor for the texture
   1.750 +     *    NULL is a valid value.
   1.751 +     *  @param op Receives the texture operation to be performed between
   1.752 +     *    this texture and the previous texture. NULL is allowed as value.
   1.753 +     *  @param mapmode Receives the mapping modes to be used for the texture.
   1.754 +     *    The parameter may be NULL but if it is a valid pointer it MUST
   1.755 +     *    point to an array of 3 aiTextureMapMode's (one for each
   1.756 +     *    axis: UVW order (=XYZ)).
   1.757 +     */
   1.758 +    // -------------------------------------------------------------------
   1.759 +    aiReturn GetTexture(aiTextureType type,
   1.760 +        unsigned int  index,
   1.761 +        C_STRUCT aiString* path,
   1.762 +        aiTextureMapping* mapping   = NULL,
   1.763 +        unsigned int* uvindex       = NULL,
   1.764 +        ai_real* blend              = NULL,
   1.765 +        aiTextureOp* op             = NULL,
   1.766 +        aiTextureMapMode* mapmode   = NULL) const;
   1.767 +
   1.768 +
   1.769 +    // Setters
   1.770 +
   1.771 +
   1.772 +    // ------------------------------------------------------------------------------
   1.773 +    /** @brief Add a property with a given key and type info to the material
   1.774 +     *  structure
   1.775 +     *
   1.776 +     *  @param pInput Pointer to input data
   1.777 +     *  @param pSizeInBytes Size of input data
   1.778 +     *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
   1.779 +     *  @param type Set by the AI_MATKEY_XXX macro
   1.780 +     *  @param index Set by the AI_MATKEY_XXX macro
   1.781 +     *  @param pType Type information hint */
   1.782 +    aiReturn AddBinaryProperty (const void* pInput,
   1.783 +        unsigned int pSizeInBytes,
   1.784 +        const char* pKey,
   1.785 +        unsigned int type ,
   1.786 +        unsigned int index ,
   1.787 +        aiPropertyTypeInfo pType);
   1.788 +
   1.789 +    // ------------------------------------------------------------------------------
   1.790 +    /** @brief Add a string property with a given key and type info to the
   1.791 +     *  material structure
   1.792 +     *
   1.793 +     *  @param pInput Input string
   1.794 +     *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
   1.795 +     *  @param type Set by the AI_MATKEY_XXX macro
   1.796 +     *  @param index Set by the AI_MATKEY_XXX macro */
   1.797 +    aiReturn AddProperty (const aiString* pInput,
   1.798 +        const char* pKey,
   1.799 +        unsigned int type  = 0,
   1.800 +        unsigned int index = 0);
   1.801 +
   1.802 +    // ------------------------------------------------------------------------------
   1.803 +    /** @brief Add a property with a given key to the material structure
   1.804 +     *  @param pInput Pointer to the input data
   1.805 +     *  @param pNumValues Number of values in the array
   1.806 +     *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
   1.807 +     *  @param type Set by the AI_MATKEY_XXX macro
   1.808 +     *  @param index Set by the AI_MATKEY_XXX macro  */
   1.809 +    template<class TYPE>
   1.810 +    aiReturn AddProperty (const TYPE* pInput,
   1.811 +        unsigned int pNumValues,
   1.812 +        const char* pKey,
   1.813 +        unsigned int type  = 0,
   1.814 +        unsigned int index = 0);
   1.815 +
   1.816 +    aiReturn AddProperty (const aiVector3D* pInput,
   1.817 +        unsigned int pNumValues,
   1.818 +        const char* pKey,
   1.819 +        unsigned int type  = 0,
   1.820 +        unsigned int index = 0);
   1.821 +
   1.822 +    aiReturn AddProperty (const aiColor3D* pInput,
   1.823 +        unsigned int pNumValues,
   1.824 +        const char* pKey,
   1.825 +        unsigned int type  = 0,
   1.826 +        unsigned int index = 0);
   1.827 +
   1.828 +    aiReturn AddProperty (const aiColor4D* pInput,
   1.829 +        unsigned int pNumValues,
   1.830 +        const char* pKey,
   1.831 +        unsigned int type  = 0,
   1.832 +        unsigned int index = 0);
   1.833 +
   1.834 +    aiReturn AddProperty (const int* pInput,
   1.835 +        unsigned int pNumValues,
   1.836 +        const char* pKey,
   1.837 +        unsigned int type  = 0,
   1.838 +        unsigned int index = 0);
   1.839 +
   1.840 +    aiReturn AddProperty (const float* pInput,
   1.841 +        unsigned int pNumValues,
   1.842 +        const char* pKey,
   1.843 +        unsigned int type  = 0,
   1.844 +        unsigned int index = 0);
   1.845 +
   1.846 +    aiReturn AddProperty (const double* pInput,
   1.847 +        unsigned int pNumValues,
   1.848 +        const char* pKey,
   1.849 +        unsigned int type  = 0,
   1.850 +        unsigned int index = 0);
   1.851 +
   1.852 +    aiReturn AddProperty (const aiUVTransform* pInput,
   1.853 +        unsigned int pNumValues,
   1.854 +        const char* pKey,
   1.855 +        unsigned int type  = 0,
   1.856 +        unsigned int index = 0);
   1.857 +
   1.858 +    // ------------------------------------------------------------------------------
   1.859 +    /** @brief Remove a given key from the list.
   1.860 +     *
   1.861 +     *  The function fails if the key isn't found
   1.862 +     *  @param pKey Key to be deleted
   1.863 +     *  @param type Set by the AI_MATKEY_XXX macro
   1.864 +     *  @param index Set by the AI_MATKEY_XXX macro  */
   1.865 +    aiReturn RemoveProperty (const char* pKey,
   1.866 +        unsigned int type  = 0,
   1.867 +        unsigned int index = 0);
   1.868 +
   1.869 +    // ------------------------------------------------------------------------------
   1.870 +    /** @brief Removes all properties from the material.
   1.871 +     *
   1.872 +     *  The data array remains allocated so adding new properties is quite fast.  */
   1.873 +    void Clear();
   1.874 +
   1.875 +    // ------------------------------------------------------------------------------
   1.876 +    /** Copy the property list of a material
   1.877 +     *  @param pcDest Destination material
   1.878 +     *  @param pcSrc Source material
   1.879 +     */
   1.880 +    static void CopyPropertyList(aiMaterial* pcDest,
   1.881 +        const aiMaterial* pcSrc);
   1.882 +
   1.883 +
   1.884 +#endif
   1.885 +
   1.886 +    /** List of all material properties loaded. */
   1.887 +    C_STRUCT aiMaterialProperty** mProperties;
   1.888 +
   1.889 +    /** Number of properties in the data base */
   1.890 +    unsigned int mNumProperties;
   1.891 +
   1.892 +     /** Storage allocated */
   1.893 +    unsigned int mNumAllocated;
   1.894 +};
   1.895 +
   1.896 +// Go back to extern "C" again
   1.897 +#ifdef __cplusplus
   1.898 +extern "C" {
   1.899 +#endif
   1.900 +
   1.901 +// ---------------------------------------------------------------------------
   1.902 +#define AI_MATKEY_NAME "?mat.name",0,0
   1.903 +#define AI_MATKEY_TWOSIDED "$mat.twosided",0,0
   1.904 +#define AI_MATKEY_SHADING_MODEL "$mat.shadingm",0,0
   1.905 +#define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe",0,0
   1.906 +#define AI_MATKEY_BLEND_FUNC "$mat.blend",0,0
   1.907 +#define AI_MATKEY_OPACITY "$mat.opacity",0,0
   1.908 +#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
   1.909 +#define AI_MATKEY_SHININESS "$mat.shininess",0,0
   1.910 +#define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
   1.911 +#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
   1.912 +#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
   1.913 +#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
   1.914 +#define AI_MATKEY_COLOR_AMBIENT "$clr.ambient",0,0
   1.915 +#define AI_MATKEY_COLOR_SPECULAR "$clr.specular",0,0
   1.916 +#define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive",0,0
   1.917 +#define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
   1.918 +#define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
   1.919 +#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global",0,0
   1.920 +
   1.921 +// ---------------------------------------------------------------------------
   1.922 +// Pure key names for all texture-related properties
   1.923 +//! @cond MATS_DOC_FULL
   1.924 +#define _AI_MATKEY_TEXTURE_BASE         "$tex.file"
   1.925 +#define _AI_MATKEY_UVWSRC_BASE          "$tex.uvwsrc"
   1.926 +#define _AI_MATKEY_TEXOP_BASE           "$tex.op"
   1.927 +#define _AI_MATKEY_MAPPING_BASE         "$tex.mapping"
   1.928 +#define _AI_MATKEY_TEXBLEND_BASE        "$tex.blend"
   1.929 +#define _AI_MATKEY_MAPPINGMODE_U_BASE   "$tex.mapmodeu"
   1.930 +#define _AI_MATKEY_MAPPINGMODE_V_BASE   "$tex.mapmodev"
   1.931 +#define _AI_MATKEY_TEXMAP_AXIS_BASE     "$tex.mapaxis"
   1.932 +#define _AI_MATKEY_UVTRANSFORM_BASE     "$tex.uvtrafo"
   1.933 +#define _AI_MATKEY_TEXFLAGS_BASE        "$tex.flags"
   1.934 +//! @endcond
   1.935 +
   1.936 +// ---------------------------------------------------------------------------
   1.937 +#define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE,type,N
   1.938 +
   1.939 +// For backward compatibility and simplicity
   1.940 +//! @cond MATS_DOC_FULL
   1.941 +#define AI_MATKEY_TEXTURE_DIFFUSE(N)    \
   1.942 +    AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE,N)
   1.943 +
   1.944 +#define AI_MATKEY_TEXTURE_SPECULAR(N)   \
   1.945 +    AI_MATKEY_TEXTURE(aiTextureType_SPECULAR,N)
   1.946 +
   1.947 +#define AI_MATKEY_TEXTURE_AMBIENT(N)    \
   1.948 +    AI_MATKEY_TEXTURE(aiTextureType_AMBIENT,N)
   1.949 +
   1.950 +#define AI_MATKEY_TEXTURE_EMISSIVE(N)   \
   1.951 +    AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE,N)
   1.952 +
   1.953 +#define AI_MATKEY_TEXTURE_NORMALS(N)    \
   1.954 +    AI_MATKEY_TEXTURE(aiTextureType_NORMALS,N)
   1.955 +
   1.956 +#define AI_MATKEY_TEXTURE_HEIGHT(N) \
   1.957 +    AI_MATKEY_TEXTURE(aiTextureType_HEIGHT,N)
   1.958 +
   1.959 +#define AI_MATKEY_TEXTURE_SHININESS(N)  \
   1.960 +    AI_MATKEY_TEXTURE(aiTextureType_SHININESS,N)
   1.961 +
   1.962 +#define AI_MATKEY_TEXTURE_OPACITY(N)    \
   1.963 +    AI_MATKEY_TEXTURE(aiTextureType_OPACITY,N)
   1.964 +
   1.965 +#define AI_MATKEY_TEXTURE_DISPLACEMENT(N)   \
   1.966 +    AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT,N)
   1.967 +
   1.968 +#define AI_MATKEY_TEXTURE_LIGHTMAP(N)   \
   1.969 +    AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP,N)
   1.970 +
   1.971 +#define AI_MATKEY_TEXTURE_REFLECTION(N) \
   1.972 +    AI_MATKEY_TEXTURE(aiTextureType_REFLECTION,N)
   1.973 +
   1.974 +//! @endcond
   1.975 +
   1.976 +// ---------------------------------------------------------------------------
   1.977 +#define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE,type,N
   1.978 +
   1.979 +// For backward compatibility and simplicity
   1.980 +//! @cond MATS_DOC_FULL
   1.981 +#define AI_MATKEY_UVWSRC_DIFFUSE(N) \
   1.982 +    AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE,N)
   1.983 +
   1.984 +#define AI_MATKEY_UVWSRC_SPECULAR(N)    \
   1.985 +    AI_MATKEY_UVWSRC(aiTextureType_SPECULAR,N)
   1.986 +
   1.987 +#define AI_MATKEY_UVWSRC_AMBIENT(N) \
   1.988 +    AI_MATKEY_UVWSRC(aiTextureType_AMBIENT,N)
   1.989 +
   1.990 +#define AI_MATKEY_UVWSRC_EMISSIVE(N)    \
   1.991 +    AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE,N)
   1.992 +
   1.993 +#define AI_MATKEY_UVWSRC_NORMALS(N) \
   1.994 +    AI_MATKEY_UVWSRC(aiTextureType_NORMALS,N)
   1.995 +
   1.996 +#define AI_MATKEY_UVWSRC_HEIGHT(N)  \
   1.997 +    AI_MATKEY_UVWSRC(aiTextureType_HEIGHT,N)
   1.998 +
   1.999 +#define AI_MATKEY_UVWSRC_SHININESS(N)   \
  1.1000 +    AI_MATKEY_UVWSRC(aiTextureType_SHININESS,N)
  1.1001 +
  1.1002 +#define AI_MATKEY_UVWSRC_OPACITY(N) \
  1.1003 +    AI_MATKEY_UVWSRC(aiTextureType_OPACITY,N)
  1.1004 +
  1.1005 +#define AI_MATKEY_UVWSRC_DISPLACEMENT(N)    \
  1.1006 +    AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT,N)
  1.1007 +
  1.1008 +#define AI_MATKEY_UVWSRC_LIGHTMAP(N)    \
  1.1009 +    AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP,N)
  1.1010 +
  1.1011 +#define AI_MATKEY_UVWSRC_REFLECTION(N)  \
  1.1012 +    AI_MATKEY_UVWSRC(aiTextureType_REFLECTION,N)
  1.1013 +
  1.1014 +//! @endcond
  1.1015 +// ---------------------------------------------------------------------------
  1.1016 +#define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE,type,N
  1.1017 +
  1.1018 +// For backward compatibility and simplicity
  1.1019 +//! @cond MATS_DOC_FULL
  1.1020 +#define AI_MATKEY_TEXOP_DIFFUSE(N)  \
  1.1021 +    AI_MATKEY_TEXOP(aiTextureType_DIFFUSE,N)
  1.1022 +
  1.1023 +#define AI_MATKEY_TEXOP_SPECULAR(N) \
  1.1024 +    AI_MATKEY_TEXOP(aiTextureType_SPECULAR,N)
  1.1025 +
  1.1026 +#define AI_MATKEY_TEXOP_AMBIENT(N)  \
  1.1027 +    AI_MATKEY_TEXOP(aiTextureType_AMBIENT,N)
  1.1028 +
  1.1029 +#define AI_MATKEY_TEXOP_EMISSIVE(N) \
  1.1030 +    AI_MATKEY_TEXOP(aiTextureType_EMISSIVE,N)
  1.1031 +
  1.1032 +#define AI_MATKEY_TEXOP_NORMALS(N)  \
  1.1033 +    AI_MATKEY_TEXOP(aiTextureType_NORMALS,N)
  1.1034 +
  1.1035 +#define AI_MATKEY_TEXOP_HEIGHT(N)   \
  1.1036 +    AI_MATKEY_TEXOP(aiTextureType_HEIGHT,N)
  1.1037 +
  1.1038 +#define AI_MATKEY_TEXOP_SHININESS(N)    \
  1.1039 +    AI_MATKEY_TEXOP(aiTextureType_SHININESS,N)
  1.1040 +
  1.1041 +#define AI_MATKEY_TEXOP_OPACITY(N)  \
  1.1042 +    AI_MATKEY_TEXOP(aiTextureType_OPACITY,N)
  1.1043 +
  1.1044 +#define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
  1.1045 +    AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT,N)
  1.1046 +
  1.1047 +#define AI_MATKEY_TEXOP_LIGHTMAP(N) \
  1.1048 +    AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP,N)
  1.1049 +
  1.1050 +#define AI_MATKEY_TEXOP_REFLECTION(N)   \
  1.1051 +    AI_MATKEY_TEXOP(aiTextureType_REFLECTION,N)
  1.1052 +
  1.1053 +//! @endcond
  1.1054 +// ---------------------------------------------------------------------------
  1.1055 +#define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE,type,N
  1.1056 +
  1.1057 +// For backward compatibility and simplicity
  1.1058 +//! @cond MATS_DOC_FULL
  1.1059 +#define AI_MATKEY_MAPPING_DIFFUSE(N)    \
  1.1060 +    AI_MATKEY_MAPPING(aiTextureType_DIFFUSE,N)
  1.1061 +
  1.1062 +#define AI_MATKEY_MAPPING_SPECULAR(N)   \
  1.1063 +    AI_MATKEY_MAPPING(aiTextureType_SPECULAR,N)
  1.1064 +
  1.1065 +#define AI_MATKEY_MAPPING_AMBIENT(N)    \
  1.1066 +    AI_MATKEY_MAPPING(aiTextureType_AMBIENT,N)
  1.1067 +
  1.1068 +#define AI_MATKEY_MAPPING_EMISSIVE(N)   \
  1.1069 +    AI_MATKEY_MAPPING(aiTextureType_EMISSIVE,N)
  1.1070 +
  1.1071 +#define AI_MATKEY_MAPPING_NORMALS(N)    \
  1.1072 +    AI_MATKEY_MAPPING(aiTextureType_NORMALS,N)
  1.1073 +
  1.1074 +#define AI_MATKEY_MAPPING_HEIGHT(N) \
  1.1075 +    AI_MATKEY_MAPPING(aiTextureType_HEIGHT,N)
  1.1076 +
  1.1077 +#define AI_MATKEY_MAPPING_SHININESS(N)  \
  1.1078 +    AI_MATKEY_MAPPING(aiTextureType_SHININESS,N)
  1.1079 +
  1.1080 +#define AI_MATKEY_MAPPING_OPACITY(N)    \
  1.1081 +    AI_MATKEY_MAPPING(aiTextureType_OPACITY,N)
  1.1082 +
  1.1083 +#define AI_MATKEY_MAPPING_DISPLACEMENT(N)   \
  1.1084 +    AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT,N)
  1.1085 +
  1.1086 +#define AI_MATKEY_MAPPING_LIGHTMAP(N)   \
  1.1087 +    AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP,N)
  1.1088 +
  1.1089 +#define AI_MATKEY_MAPPING_REFLECTION(N) \
  1.1090 +    AI_MATKEY_MAPPING(aiTextureType_REFLECTION,N)
  1.1091 +
  1.1092 +//! @endcond
  1.1093 +// ---------------------------------------------------------------------------
  1.1094 +#define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE,type,N
  1.1095 +
  1.1096 +// For backward compatibility and simplicity
  1.1097 +//! @cond MATS_DOC_FULL
  1.1098 +#define AI_MATKEY_TEXBLEND_DIFFUSE(N)   \
  1.1099 +    AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE,N)
  1.1100 +
  1.1101 +#define AI_MATKEY_TEXBLEND_SPECULAR(N)  \
  1.1102 +    AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR,N)
  1.1103 +
  1.1104 +#define AI_MATKEY_TEXBLEND_AMBIENT(N)   \
  1.1105 +    AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT,N)
  1.1106 +
  1.1107 +#define AI_MATKEY_TEXBLEND_EMISSIVE(N)  \
  1.1108 +    AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE,N)
  1.1109 +
  1.1110 +#define AI_MATKEY_TEXBLEND_NORMALS(N)   \
  1.1111 +    AI_MATKEY_TEXBLEND(aiTextureType_NORMALS,N)
  1.1112 +
  1.1113 +#define AI_MATKEY_TEXBLEND_HEIGHT(N)    \
  1.1114 +    AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT,N)
  1.1115 +
  1.1116 +#define AI_MATKEY_TEXBLEND_SHININESS(N) \
  1.1117 +    AI_MATKEY_TEXBLEND(aiTextureType_SHININESS,N)
  1.1118 +
  1.1119 +#define AI_MATKEY_TEXBLEND_OPACITY(N)   \
  1.1120 +    AI_MATKEY_TEXBLEND(aiTextureType_OPACITY,N)
  1.1121 +
  1.1122 +#define AI_MATKEY_TEXBLEND_DISPLACEMENT(N)  \
  1.1123 +    AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT,N)
  1.1124 +
  1.1125 +#define AI_MATKEY_TEXBLEND_LIGHTMAP(N)  \
  1.1126 +    AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP,N)
  1.1127 +
  1.1128 +#define AI_MATKEY_TEXBLEND_REFLECTION(N)    \
  1.1129 +    AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION,N)
  1.1130 +
  1.1131 +//! @endcond
  1.1132 +// ---------------------------------------------------------------------------
  1.1133 +#define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE,type,N
  1.1134 +
  1.1135 +// For backward compatibility and simplicity
  1.1136 +//! @cond MATS_DOC_FULL
  1.1137 +#define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N)  \
  1.1138 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE,N)
  1.1139 +
  1.1140 +#define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
  1.1141 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR,N)
  1.1142 +
  1.1143 +#define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N)  \
  1.1144 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT,N)
  1.1145 +
  1.1146 +#define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
  1.1147 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE,N)
  1.1148 +
  1.1149 +#define AI_MATKEY_MAPPINGMODE_U_NORMALS(N)  \
  1.1150 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS,N)
  1.1151 +
  1.1152 +#define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N)   \
  1.1153 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT,N)
  1.1154 +
  1.1155 +#define AI_MATKEY_MAPPINGMODE_U_SHININESS(N)    \
  1.1156 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS,N)
  1.1157 +
  1.1158 +#define AI_MATKEY_MAPPINGMODE_U_OPACITY(N)  \
  1.1159 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY,N)
  1.1160 +
  1.1161 +#define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
  1.1162 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT,N)
  1.1163 +
  1.1164 +#define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
  1.1165 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP,N)
  1.1166 +
  1.1167 +#define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N)   \
  1.1168 +    AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION,N)
  1.1169 +
  1.1170 +//! @endcond
  1.1171 +// ---------------------------------------------------------------------------
  1.1172 +#define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE,type,N
  1.1173 +
  1.1174 +// For backward compatibility and simplicity
  1.1175 +//! @cond MATS_DOC_FULL
  1.1176 +#define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N)  \
  1.1177 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE,N)
  1.1178 +
  1.1179 +#define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
  1.1180 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR,N)
  1.1181 +
  1.1182 +#define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N)  \
  1.1183 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT,N)
  1.1184 +
  1.1185 +#define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
  1.1186 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE,N)
  1.1187 +
  1.1188 +#define AI_MATKEY_MAPPINGMODE_V_NORMALS(N)  \
  1.1189 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS,N)
  1.1190 +
  1.1191 +#define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N)   \
  1.1192 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT,N)
  1.1193 +
  1.1194 +#define AI_MATKEY_MAPPINGMODE_V_SHININESS(N)    \
  1.1195 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS,N)
  1.1196 +
  1.1197 +#define AI_MATKEY_MAPPINGMODE_V_OPACITY(N)  \
  1.1198 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY,N)
  1.1199 +
  1.1200 +#define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
  1.1201 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT,N)
  1.1202 +
  1.1203 +#define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
  1.1204 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP,N)
  1.1205 +
  1.1206 +#define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N)   \
  1.1207 +    AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION,N)
  1.1208 +
  1.1209 +//! @endcond
  1.1210 +// ---------------------------------------------------------------------------
  1.1211 +#define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE,type,N
  1.1212 +
  1.1213 +// For backward compatibility and simplicity
  1.1214 +//! @cond MATS_DOC_FULL
  1.1215 +#define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N)    \
  1.1216 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE,N)
  1.1217 +
  1.1218 +#define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N)   \
  1.1219 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR,N)
  1.1220 +
  1.1221 +#define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N)    \
  1.1222 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT,N)
  1.1223 +
  1.1224 +#define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N)   \
  1.1225 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE,N)
  1.1226 +
  1.1227 +#define AI_MATKEY_TEXMAP_AXIS_NORMALS(N)    \
  1.1228 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS,N)
  1.1229 +
  1.1230 +#define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
  1.1231 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT,N)
  1.1232 +
  1.1233 +#define AI_MATKEY_TEXMAP_AXIS_SHININESS(N)  \
  1.1234 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS,N)
  1.1235 +
  1.1236 +#define AI_MATKEY_TEXMAP_AXIS_OPACITY(N)    \
  1.1237 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY,N)
  1.1238 +
  1.1239 +#define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N)   \
  1.1240 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT,N)
  1.1241 +
  1.1242 +#define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N)   \
  1.1243 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP,N)
  1.1244 +
  1.1245 +#define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
  1.1246 +    AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION,N)
  1.1247 +
  1.1248 +//! @endcond
  1.1249 +// ---------------------------------------------------------------------------
  1.1250 +#define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE,type,N
  1.1251 +
  1.1252 +// For backward compatibility and simplicity
  1.1253 +//! @cond MATS_DOC_FULL
  1.1254 +#define AI_MATKEY_UVTRANSFORM_DIFFUSE(N)    \
  1.1255 +    AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,N)
  1.1256 +
  1.1257 +#define AI_MATKEY_UVTRANSFORM_SPECULAR(N)   \
  1.1258 +    AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR,N)
  1.1259 +
  1.1260 +#define AI_MATKEY_UVTRANSFORM_AMBIENT(N)    \
  1.1261 +    AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT,N)
  1.1262 +
  1.1263 +#define AI_MATKEY_UVTRANSFORM_EMISSIVE(N)   \
  1.1264 +    AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE,N)
  1.1265 +
  1.1266 +#define AI_MATKEY_UVTRANSFORM_NORMALS(N)    \
  1.1267 +    AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS,N)
  1.1268 +
  1.1269 +#define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
  1.1270 +    AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT,N)
  1.1271 +
  1.1272 +#define AI_MATKEY_UVTRANSFORM_SHININESS(N)  \
  1.1273 +    AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS,N)
  1.1274 +
  1.1275 +#define AI_MATKEY_UVTRANSFORM_OPACITY(N)    \
  1.1276 +    AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY,N)
  1.1277 +
  1.1278 +#define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N)   \
  1.1279 +    AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT,N)
  1.1280 +
  1.1281 +#define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N)   \
  1.1282 +    AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP,N)
  1.1283 +
  1.1284 +#define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
  1.1285 +    AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION,N)
  1.1286 +
  1.1287 +#define AI_MATKEY_UVTRANSFORM_UNKNOWN(N)    \
  1.1288 +    AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN,N)
  1.1289 +
  1.1290 +//! @endcond
  1.1291 +// ---------------------------------------------------------------------------
  1.1292 +#define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE,type,N
  1.1293 +
  1.1294 +// For backward compatibility and simplicity
  1.1295 +//! @cond MATS_DOC_FULL
  1.1296 +#define AI_MATKEY_TEXFLAGS_DIFFUSE(N)   \
  1.1297 +    AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE,N)
  1.1298 +
  1.1299 +#define AI_MATKEY_TEXFLAGS_SPECULAR(N)  \
  1.1300 +    AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR,N)
  1.1301 +
  1.1302 +#define AI_MATKEY_TEXFLAGS_AMBIENT(N)   \
  1.1303 +    AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT,N)
  1.1304 +
  1.1305 +#define AI_MATKEY_TEXFLAGS_EMISSIVE(N)  \
  1.1306 +    AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE,N)
  1.1307 +
  1.1308 +#define AI_MATKEY_TEXFLAGS_NORMALS(N)   \
  1.1309 +    AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS,N)
  1.1310 +
  1.1311 +#define AI_MATKEY_TEXFLAGS_HEIGHT(N)    \
  1.1312 +    AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT,N)
  1.1313 +
  1.1314 +#define AI_MATKEY_TEXFLAGS_SHININESS(N) \
  1.1315 +    AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS,N)
  1.1316 +
  1.1317 +#define AI_MATKEY_TEXFLAGS_OPACITY(N)   \
  1.1318 +    AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY,N)
  1.1319 +
  1.1320 +#define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N)  \
  1.1321 +    AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT,N)
  1.1322 +
  1.1323 +#define AI_MATKEY_TEXFLAGS_LIGHTMAP(N)  \
  1.1324 +    AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP,N)
  1.1325 +
  1.1326 +#define AI_MATKEY_TEXFLAGS_REFLECTION(N)    \
  1.1327 +    AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION,N)
  1.1328 +
  1.1329 +#define AI_MATKEY_TEXFLAGS_UNKNOWN(N)   \
  1.1330 +    AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN,N)
  1.1331 +
  1.1332 +//! @endcond
  1.1333 +//!
  1.1334 +// ---------------------------------------------------------------------------
  1.1335 +/** @brief Retrieve a material property with a specific key from the material
  1.1336 + *
  1.1337 + * @param pMat Pointer to the input material. May not be NULL
  1.1338 + * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
  1.1339 + * @param type Specifies the type of the texture to be retrieved (
  1.1340 + *    e.g. diffuse, specular, height map ...)
  1.1341 + * @param index Index of the texture to be retrieved.
  1.1342 + * @param pPropOut Pointer to receive a pointer to a valid aiMaterialProperty
  1.1343 + *        structure or NULL if the key has not been found. */
  1.1344 +// ---------------------------------------------------------------------------
  1.1345 +ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(
  1.1346 +    const C_STRUCT aiMaterial* pMat,
  1.1347 +    const char* pKey,
  1.1348 +    unsigned int type,
  1.1349 +    unsigned int  index,
  1.1350 +    const C_STRUCT aiMaterialProperty** pPropOut);
  1.1351 +
  1.1352 +// ---------------------------------------------------------------------------
  1.1353 +/** @brief Retrieve an array of float values with a specific key
  1.1354 + *  from the material
  1.1355 + *
  1.1356 + * Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
  1.1357 + * example reads the #AI_MATKEY_UVTRANSFORM property of the first diffuse texture)
  1.1358 + * @code
  1.1359 + * aiUVTransform trafo;
  1.1360 + * unsigned int max = sizeof(aiUVTransform);
  1.1361 + * if (AI_SUCCESS != aiGetMaterialFloatArray(mat, AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,0),
  1.1362 + *    (float*)&trafo, &max) || sizeof(aiUVTransform) != max)
  1.1363 + * {
  1.1364 + *   // error handling
  1.1365 + * }
  1.1366 + * @endcode
  1.1367 + *
  1.1368 + * @param pMat Pointer to the input material. May not be NULL
  1.1369 + * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
  1.1370 + * @param pOut Pointer to a buffer to receive the result.
  1.1371 + * @param pMax Specifies the size of the given buffer, in float's.
  1.1372 + *        Receives the number of values (not bytes!) read.
  1.1373 + * @param type (see the code sample above)
  1.1374 + * @param index (see the code sample above)
  1.1375 + * @return Specifies whether the key has been found. If not, the output
  1.1376 + *   arrays remains unmodified and pMax is set to 0.*/
  1.1377 +// ---------------------------------------------------------------------------
  1.1378 +ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
  1.1379 +    const C_STRUCT aiMaterial* pMat,
  1.1380 +    const char* pKey,
  1.1381 +    unsigned int type,
  1.1382 +    unsigned int index,
  1.1383 +    ai_real* pOut,
  1.1384 +    unsigned int* pMax);
  1.1385 +
  1.1386 +
  1.1387 +#ifdef __cplusplus
  1.1388 +
  1.1389 +// ---------------------------------------------------------------------------
  1.1390 +/** @brief Retrieve a single float property with a specific key from the material.
  1.1391 +*
  1.1392 +* Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
  1.1393 +* example reads the #AI_MATKEY_SHININESS_STRENGTH property of the first diffuse texture)
  1.1394 +* @code
  1.1395 +* float specStrength = 1.f; // default value, remains unmodified if we fail.
  1.1396 +* aiGetMaterialFloat(mat, AI_MATKEY_SHININESS_STRENGTH,
  1.1397 +*    (float*)&specStrength);
  1.1398 +* @endcode
  1.1399 +*
  1.1400 +* @param pMat Pointer to the input material. May not be NULL
  1.1401 +* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
  1.1402 +* @param pOut Receives the output float.
  1.1403 +* @param type (see the code sample above)
  1.1404 +* @param index (see the code sample above)
  1.1405 +* @return Specifies whether the key has been found. If not, the output
  1.1406 +*   float remains unmodified.*/
  1.1407 +// ---------------------------------------------------------------------------
  1.1408 +inline aiReturn aiGetMaterialFloat(const aiMaterial* pMat,
  1.1409 +    const char* pKey,
  1.1410 +    unsigned int type,
  1.1411 +    unsigned int index,
  1.1412 +    ai_real* pOut)
  1.1413 +{
  1.1414 +    return aiGetMaterialFloatArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
  1.1415 +}
  1.1416 +
  1.1417 +#else
  1.1418 +
  1.1419 +// Use our friend, the C preprocessor
  1.1420 +#define aiGetMaterialFloat (pMat, type, index, pKey, pOut) \
  1.1421 +    aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
  1.1422 +
  1.1423 +#endif //!__cplusplus
  1.1424 +
  1.1425 +
  1.1426 +// ---------------------------------------------------------------------------
  1.1427 +/** @brief Retrieve an array of integer values with a specific key
  1.1428 + *  from a material
  1.1429 + *
  1.1430 + * See the sample for aiGetMaterialFloatArray for more information.*/
  1.1431 +ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial* pMat,
  1.1432 +     const char* pKey,
  1.1433 +     unsigned int  type,
  1.1434 +     unsigned int  index,
  1.1435 +     int* pOut,
  1.1436 +     unsigned int* pMax);
  1.1437 +
  1.1438 +
  1.1439 +#ifdef __cplusplus
  1.1440 +
  1.1441 +// ---------------------------------------------------------------------------
  1.1442 +/** @brief Retrieve an integer property with a specific key from a material
  1.1443 + *
  1.1444 + * See the sample for aiGetMaterialFloat for more information.*/
  1.1445 +// ---------------------------------------------------------------------------
  1.1446 +inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial* pMat,
  1.1447 +    const char* pKey,
  1.1448 +    unsigned int type,
  1.1449 +    unsigned int index,
  1.1450 +    int* pOut)
  1.1451 +{
  1.1452 +    return aiGetMaterialIntegerArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
  1.1453 +}
  1.1454 +
  1.1455 +#else
  1.1456 +
  1.1457 +// use our friend, the C preprocessor
  1.1458 +#define aiGetMaterialInteger (pMat, type, index, pKey, pOut) \
  1.1459 +    aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
  1.1460 +
  1.1461 +#endif //!__cplusplus
  1.1462 +
  1.1463 +
  1.1464 +
  1.1465 +// ---------------------------------------------------------------------------
  1.1466 +/** @brief Retrieve a color value from the material property table
  1.1467 +*
  1.1468 +* See the sample for aiGetMaterialFloat for more information*/
  1.1469 +// ---------------------------------------------------------------------------
  1.1470 +ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat,
  1.1471 +    const char* pKey,
  1.1472 +    unsigned int type,
  1.1473 +    unsigned int index,
  1.1474 +    C_STRUCT aiColor4D* pOut);
  1.1475 +
  1.1476 +
  1.1477 +// ---------------------------------------------------------------------------
  1.1478 +/** @brief Retrieve a aiUVTransform value from the material property table
  1.1479 +*
  1.1480 +* See the sample for aiGetMaterialFloat for more information*/
  1.1481 +// ---------------------------------------------------------------------------
  1.1482 +ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial* pMat,
  1.1483 +    const char* pKey,
  1.1484 +    unsigned int type,
  1.1485 +    unsigned int index,
  1.1486 +    C_STRUCT aiUVTransform* pOut);
  1.1487 +
  1.1488 +
  1.1489 +// ---------------------------------------------------------------------------
  1.1490 +/** @brief Retrieve a string from the material property table
  1.1491 +*
  1.1492 +* See the sample for aiGetMaterialFloat for more information.*/
  1.1493 +// ---------------------------------------------------------------------------
  1.1494 +ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial* pMat,
  1.1495 +    const char* pKey,
  1.1496 +    unsigned int type,
  1.1497 +    unsigned int index,
  1.1498 +    C_STRUCT aiString* pOut);
  1.1499 +
  1.1500 +// ---------------------------------------------------------------------------
  1.1501 +/** Get the number of textures for a particular texture type.
  1.1502 + *  @param[in] pMat Pointer to the input material. May not be NULL
  1.1503 + *  @param type Texture type to check for
  1.1504 + *  @return Number of textures for this type.
  1.1505 + *  @note A texture can be easily queried using #aiGetMaterialTexture() */
  1.1506 +// ---------------------------------------------------------------------------
  1.1507 +ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMat,
  1.1508 +    C_ENUM aiTextureType type);
  1.1509 +
  1.1510 +// ---------------------------------------------------------------------------
  1.1511 +/** @brief Helper function to get all values pertaining to a particular
  1.1512 + *  texture slot from a material structure.
  1.1513 + *
  1.1514 + *  This function is provided just for convenience. You could also read the
  1.1515 + *  texture by parsing all of its properties manually. This function bundles
  1.1516 + *  all of them in a huge function monster.
  1.1517 + *
  1.1518 + *  @param[in] mat Pointer to the input material. May not be NULL
  1.1519 + *  @param[in] type Specifies the texture stack to read from (e.g. diffuse,
  1.1520 + *     specular, height map ...).
  1.1521 + *  @param[in] index Index of the texture. The function fails if the
  1.1522 + *     requested index is not available for this texture type.
  1.1523 + *     #aiGetMaterialTextureCount() can be used to determine the number of
  1.1524 + *     textures in a particular texture stack.
  1.1525 + *  @param[out] path Receives the output path
  1.1526 + *     If the texture is embedded, receives a '*' followed by the id of
  1.1527 + *     the texture (for the textures stored in the corresponding scene) which
  1.1528 + *     can be converted to an int using a function like atoi.
  1.1529 + *     This parameter must be non-null.
  1.1530 + *  @param mapping The texture mapping mode to be used.
  1.1531 + *      Pass NULL if you're not interested in this information.
  1.1532 + *  @param[out] uvindex For UV-mapped textures: receives the index of the UV
  1.1533 + *      source channel. Unmodified otherwise.
  1.1534 + *      Pass NULL if you're not interested in this information.
  1.1535 + *  @param[out] blend Receives the blend factor for the texture
  1.1536 + *      Pass NULL if you're not interested in this information.
  1.1537 + *  @param[out] op Receives the texture blend operation to be perform between
  1.1538 + *      this texture and the previous texture.
  1.1539 + *      Pass NULL if you're not interested in this information.
  1.1540 + *  @param[out] mapmode Receives the mapping modes to be used for the texture.
  1.1541 + *      Pass NULL if you're not interested in this information. Otherwise,
  1.1542 + *      pass a pointer to an array of two aiTextureMapMode's (one for each
  1.1543 + *      axis, UV order).
  1.1544 + *  @param[out] flags Receives the the texture flags.
  1.1545 + *  @return AI_SUCCESS on success, otherwise something else. Have fun.*/
  1.1546 +// ---------------------------------------------------------------------------
  1.1547 +#ifdef __cplusplus
  1.1548 +ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
  1.1549 +    aiTextureType type,
  1.1550 +    unsigned int  index,
  1.1551 +    aiString* path,
  1.1552 +    aiTextureMapping* mapping   = NULL,
  1.1553 +    unsigned int* uvindex       = NULL,
  1.1554 +    ai_real* blend              = NULL,
  1.1555 +    aiTextureOp* op             = NULL,
  1.1556 +    aiTextureMapMode* mapmode   = NULL,
  1.1557 +    unsigned int* flags         = NULL);
  1.1558 +#else
  1.1559 +C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
  1.1560 +    C_ENUM aiTextureType type,
  1.1561 +    unsigned int  index,
  1.1562 +    C_STRUCT aiString* path,
  1.1563 +    C_ENUM aiTextureMapping* mapping    /*= NULL*/,
  1.1564 +    unsigned int* uvindex               /*= NULL*/,
  1.1565 +    ai_real* blend                      /*= NULL*/,
  1.1566 +    C_ENUM aiTextureOp* op              /*= NULL*/,
  1.1567 +    C_ENUM aiTextureMapMode* mapmode    /*= NULL*/,
  1.1568 +    unsigned int* flags                 /*= NULL*/);
  1.1569 +#endif // !#ifdef __cplusplus
  1.1570 +
  1.1571 +
  1.1572 +#ifdef __cplusplus
  1.1573 +}
  1.1574 +
  1.1575 +#include "material.inl"
  1.1576 +
  1.1577 +#endif //!__cplusplus
  1.1578 +
  1.1579 +#endif //!!AI_MATERIAL_H_INC