1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2021, assimp team
7 
8 All rights reserved.
9 
10 Redistribution and use of this software in source and binary forms,
11 with or without modification, are permitted provided that the following
12 conditions are met:
13 
14 * Redistributions of source code must retain the above
15   copyright notice, this list of conditions and the
16   following disclaimer.
17 
18 * Redistributions in binary form must reproduce the above
19   copyright notice, this list of conditions and the
20   following disclaimer in the documentation and/or other
21   materials provided with the distribution.
22 
23 * Neither the name of the assimp team, nor the names of its
24   contributors may be used to endorse or promote products
25   derived from this software without specific prior
26   written permission of the assimp team.
27 
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 ---------------------------------------------------------------------------
40 */
41 
42 /** @file material.h
43  *  @brief Defines the material system of the library
44  */
45 #pragma once
46 #ifndef AI_MATERIAL_H_INC
47 #define AI_MATERIAL_H_INC
48 
49 #ifdef __GNUC__
50 #pragma GCC system_header
51 #endif
52 
53 #include <assimp/types.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 // Name for default materials (2nd is used if meshes have UV coords)
60 #define AI_DEFAULT_MATERIAL_NAME "DefaultMaterial"
61 
62 // ---------------------------------------------------------------------------
63 /** @brief Defines how the Nth texture of a specific type is combined with
64  *  the result of all previous layers.
65  *
66  *  Example (left: key, right: value): <br>
67  *  @code
68  *  DiffColor0     - gray
69  *  DiffTextureOp0 - aiTextureOpMultiply
70  *  DiffTexture0   - tex1.png
71  *  DiffTextureOp0 - aiTextureOpAdd
72  *  DiffTexture1   - tex2.png
73  *  @endcode
74  *  Written as equation, the final diffuse term for a specific pixel would be:
75  *  @code
76  *  diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) +
77  *     sampleTex(DiffTexture1,UV0) * diffContrib;
78  *  @endcode
79  *  where 'diffContrib' is the intensity of the incoming light for that pixel.
80  */
81 enum aiTextureOp {
82     /** T = T1 * T2 */
83     aiTextureOp_Multiply = 0x0,
84 
85     /** T = T1 + T2 */
86     aiTextureOp_Add = 0x1,
87 
88     /** T = T1 - T2 */
89     aiTextureOp_Subtract = 0x2,
90 
91     /** T = T1 / T2 */
92     aiTextureOp_Divide = 0x3,
93 
94     /** T = (T1 + T2) - (T1 * T2) */
95     aiTextureOp_SmoothAdd = 0x4,
96 
97     /** T = T1 + (T2-0.5) */
98     aiTextureOp_SignedAdd = 0x5,
99 
100 #ifndef SWIG
101     _aiTextureOp_Force32Bit = INT_MAX
102 #endif
103 };
104 
105 // ---------------------------------------------------------------------------
106 /** @brief Defines how UV coordinates outside the [0...1] range are handled.
107  *
108  *  Commonly referred to as 'wrapping mode'.
109  */
110 enum aiTextureMapMode {
111     /** A texture coordinate u|v is translated to u%1|v%1
112      */
113     aiTextureMapMode_Wrap = 0x0,
114 
115     /** Texture coordinates outside [0...1]
116      *  are clamped to the nearest valid value.
117      */
118     aiTextureMapMode_Clamp = 0x1,
119 
120     /** If the texture coordinates for a pixel are outside [0...1]
121      *  the texture is not applied to that pixel
122      */
123     aiTextureMapMode_Decal = 0x3,
124 
125     /** A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and
126      *  1-(u%1)|1-(v%1) otherwise
127      */
128     aiTextureMapMode_Mirror = 0x2,
129 
130 #ifndef SWIG
131     _aiTextureMapMode_Force32Bit = INT_MAX
132 #endif
133 };
134 
135 // ---------------------------------------------------------------------------
136 /** @brief Defines how the mapping coords for a texture are generated.
137  *
138  *  Real-time applications typically require full UV coordinates, so the use of
139  *  the aiProcess_GenUVCoords step is highly recommended. It generates proper
140  *  UV channels for non-UV mapped objects, as long as an accurate description
141  *  how the mapping should look like (e.g spherical) is given.
142  *  See the #AI_MATKEY_MAPPING property for more details.
143  */
144 enum aiTextureMapping {
145     /** The mapping coordinates are taken from an UV channel.
146      *
147      *  #AI_MATKEY_UVWSRC property specifies from which UV channel
148      *  the texture coordinates are to be taken from (remember,
149      *  meshes can have more than one UV channel).
150     */
151     aiTextureMapping_UV = 0x0,
152 
153     /** Spherical mapping */
154     aiTextureMapping_SPHERE = 0x1,
155 
156     /** Cylindrical mapping */
157     aiTextureMapping_CYLINDER = 0x2,
158 
159     /** Cubic mapping */
160     aiTextureMapping_BOX = 0x3,
161 
162     /** Planar mapping */
163     aiTextureMapping_PLANE = 0x4,
164 
165     /** Undefined mapping. Have fun. */
166     aiTextureMapping_OTHER = 0x5,
167 
168 #ifndef SWIG
169     _aiTextureMapping_Force32Bit = INT_MAX
170 #endif
171 };
172 
173 // ---------------------------------------------------------------------------
174 /** @brief Defines the purpose of a texture
175  *
176  *  This is a very difficult topic. Different 3D packages support different
177  *  kinds of textures. For very common texture types, such as bumpmaps, the
178  *  rendering results depend on implementation details in the rendering
179  *  pipelines of these applications. Assimp loads all texture references from
180  *  the model file and tries to determine which of the predefined texture
181  *  types below is the best choice to match the original use of the texture
182  *  as closely as possible.<br>
183  *
184  *  In content pipelines you'll usually define how textures have to be handled,
185  *  and the artists working on models have to conform to this specification,
186  *  regardless which 3D tool they're using.
187  */
188 enum aiTextureType {
189     /** Dummy value.
190      *
191      *  No texture, but the value to be used as 'texture semantic'
192      *  (#aiMaterialProperty::mSemantic) for all material properties
193      *  *not* related to textures.
194      */
195     aiTextureType_NONE = 0,
196 
197     /** LEGACY API MATERIALS
198      * Legacy refers to materials which
199      * Were originally implemented in the specifications around 2000.
200      * These must never be removed, as most engines support them.
201      */
202 
203     /** The texture is combined with the result of the diffuse
204      *  lighting equation.
205      *  OR
206      *  PBR Specular/Glossiness
207      */
208     aiTextureType_DIFFUSE = 1,
209 
210     /** The texture is combined with the result of the specular
211      *  lighting equation.
212      *  OR
213      *  PBR Specular/Glossiness
214      */
215     aiTextureType_SPECULAR = 2,
216 
217     /** The texture is combined with the result of the ambient
218      *  lighting equation.
219      */
220     aiTextureType_AMBIENT = 3,
221 
222     /** The texture is added to the result of the lighting
223      *  calculation. It isn't influenced by incoming light.
224      */
225     aiTextureType_EMISSIVE = 4,
226 
227     /** The texture is a height map.
228      *
229      *  By convention, higher gray-scale values stand for
230      *  higher elevations from the base height.
231      */
232     aiTextureType_HEIGHT = 5,
233 
234     /** The texture is a (tangent space) normal-map.
235      *
236      *  Again, there are several conventions for tangent-space
237      *  normal maps. Assimp does (intentionally) not
238      *  distinguish here.
239      */
240     aiTextureType_NORMALS = 6,
241 
242     /** The texture defines the glossiness of the material.
243      *
244      *  The glossiness is in fact the exponent of the specular
245      *  (phong) lighting equation. Usually there is a conversion
246      *  function defined to map the linear color values in the
247      *  texture to a suitable exponent. Have fun.
248     */
249     aiTextureType_SHININESS = 7,
250 
251     /** The texture defines per-pixel opacity.
252      *
253      *  Usually 'white' means opaque and 'black' means
254      *  'transparency'. Or quite the opposite. Have fun.
255     */
256     aiTextureType_OPACITY = 8,
257 
258     /** Displacement texture
259      *
260      *  The exact purpose and format is application-dependent.
261      *  Higher color values stand for higher vertex displacements.
262     */
263     aiTextureType_DISPLACEMENT = 9,
264 
265     /** Lightmap texture (aka Ambient Occlusion)
266      *
267      *  Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
268      *  covered by this material property. The texture contains a
269      *  scaling value for the final color value of a pixel. Its
270      *  intensity is not affected by incoming light.
271     */
272     aiTextureType_LIGHTMAP = 10,
273 
274     /** Reflection texture
275      *
276      * Contains the color of a perfect mirror reflection.
277      * Rarely used, almost never for real-time applications.
278     */
279     aiTextureType_REFLECTION = 11,
280 
281     /** PBR Materials
282      * PBR definitions from maya and other modelling packages now use this standard.
283      * This was originally introduced around 2012.
284      * Support for this is in game engines like Godot, Unreal or Unity3D.
285      * Modelling packages which use this are very common now.
286      */
287 
288     aiTextureType_BASE_COLOR = 12,
289     aiTextureType_NORMAL_CAMERA = 13,
290     aiTextureType_EMISSION_COLOR = 14,
291     aiTextureType_METALNESS = 15,
292     aiTextureType_DIFFUSE_ROUGHNESS = 16,
293     aiTextureType_AMBIENT_OCCLUSION = 17,
294 
295     /** PBR Material Modifiers
296     * Some modern renderers have further PBR modifiers that may be overlaid
297     * on top of the 'base' PBR materials for additional realism.
298     * These use multiple texture maps, so only the base type is directly defined
299     */
300 
301     /** Sheen
302     * Generally used to simulate textiles that are covered in a layer of microfibers
303     * eg velvet
304     * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_sheen
305     */
306     aiTextureType_SHEEN = 19,
307 
308     /** Clearcoat
309     * Simulates a layer of 'polish' or 'laquer' layered on top of a PBR substrate
310     * https://autodesk.github.io/standard-surface/#closures/coating
311     * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat
312     */
313     aiTextureType_CLEARCOAT = 20,
314 
315     /** Transmission
316     * Simulates transmission through the surface
317     * May include further information such as wall thickness
318     */
319     aiTextureType_TRANSMISSION = 21,
320 
321     /** Unknown texture
322      *
323      *  A texture reference that does not match any of the definitions
324      *  above is considered to be 'unknown'. It is still imported,
325      *  but is excluded from any further post-processing.
326     */
327     aiTextureType_UNKNOWN = 18,
328 
329 #ifndef SWIG
330     _aiTextureType_Force32Bit = INT_MAX
331 #endif
332 };
333 
334 #define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
335 
336 // -------------------------------------------------------------------------------
337 // Get a string for a given aiTextureType
338 ASSIMP_API const char *TextureTypeToString(enum aiTextureType in);
339 
340 // ---------------------------------------------------------------------------
341 /** @brief Defines all shading models supported by the library
342  *
343  *  Property: #AI_MATKEY_SHADING_MODEL
344  *
345  *  The list of shading modes has been taken from Blender.
346  *  See Blender documentation for more information. The API does
347  *  not distinguish between "specular" and "diffuse" shaders (thus the
348  *  specular term for diffuse shading models like Oren-Nayar remains
349  *  undefined). <br>
350  *  Again, this value is just a hint. Assimp tries to select the shader whose
351  *  most common implementation matches the original rendering results of the
352  *  3D modeler which wrote a particular model as closely as possible.
353  *
354  */
355 enum aiShadingMode {
356     /** Flat shading. Shading is done on per-face base,
357      *  diffuse only. Also known as 'faceted shading'.
358      */
359     aiShadingMode_Flat = 0x1,
360 
361     /** Simple Gouraud shading.
362      */
363     aiShadingMode_Gouraud = 0x2,
364 
365     /** Phong-Shading -
366      */
367     aiShadingMode_Phong = 0x3,
368 
369     /** Phong-Blinn-Shading
370      */
371     aiShadingMode_Blinn = 0x4,
372 
373     /** Toon-Shading per pixel
374      *
375      *  Also known as 'comic' shader.
376      */
377     aiShadingMode_Toon = 0x5,
378 
379     /** OrenNayar-Shading per pixel
380      *
381      *  Extension to standard Lambertian shading, taking the
382      *  roughness of the material into account
383      */
384     aiShadingMode_OrenNayar = 0x6,
385 
386     /** Minnaert-Shading per pixel
387      *
388      *  Extension to standard Lambertian shading, taking the
389      *  "darkness" of the material into account
390      */
391     aiShadingMode_Minnaert = 0x7,
392 
393     /** CookTorrance-Shading per pixel
394      *
395      *  Special shader for metallic surfaces.
396      */
397     aiShadingMode_CookTorrance = 0x8,
398 
399     /** No shading at all. Constant light influence of 1.0.
400     * Also known as "Unlit"
401     */
402     aiShadingMode_NoShading = 0x9,
403     aiShadingMode_Unlit = aiShadingMode_NoShading, // Alias
404 
405     /** Fresnel shading
406      */
407     aiShadingMode_Fresnel = 0xa,
408 
409     /** Physically-Based Rendering (PBR) shading using
410     * Bidirectional scattering/reflectance distribution function (BSDF/BRDF)
411     * There are multiple methods under this banner, and model files may provide
412     * data for more than one PBR-BRDF method.
413     * Applications should use the set of provided properties to determine which
414     * of their preferred PBR rendering methods are likely to be available
415     * eg:
416     * - If AI_MATKEY_METALLIC_FACTOR is set, then a Metallic/Roughness is available
417     * - If AI_MATKEY_GLOSSINESS_FACTOR is set, then a Specular/Glossiness is available
418     * Note that some PBR methods allow layering of techniques
419     */
420     aiShadingMode_PBR_BRDF = 0xb,
421 
422 #ifndef SWIG
423     _aiShadingMode_Force32Bit = INT_MAX
424 #endif
425 };
426 
427 // ---------------------------------------------------------------------------
428 /** @brief Defines some mixed flags for a particular texture.
429  *
430  *  Usually you'll instruct your cg artists how textures have to look like ...
431  *  and how they will be processed in your application. However, if you use
432  *  Assimp for completely generic loading purposes you might also need to
433  *  process these flags in order to display as many 'unknown' 3D models as
434  *  possible correctly.
435  *
436  *  This corresponds to the #AI_MATKEY_TEXFLAGS property.
437 */
438 enum aiTextureFlags {
439     /** The texture's color values have to be inverted (component-wise 1-n)
440      */
441     aiTextureFlags_Invert = 0x1,
442 
443     /** Explicit request to the application to process the alpha channel
444      *  of the texture.
445      *
446      *  Mutually exclusive with #aiTextureFlags_IgnoreAlpha. These
447      *  flags are set if the library can say for sure that the alpha
448      *  channel is used/is not used. If the model format does not
449      *  define this, it is left to the application to decide whether
450      *  the texture alpha channel - if any - is evaluated or not.
451      */
452     aiTextureFlags_UseAlpha = 0x2,
453 
454     /** Explicit request to the application to ignore the alpha channel
455      *  of the texture.
456      *
457      *  Mutually exclusive with #aiTextureFlags_UseAlpha.
458      */
459     aiTextureFlags_IgnoreAlpha = 0x4,
460 
461 #ifndef SWIG
462     _aiTextureFlags_Force32Bit = INT_MAX
463 #endif
464 };
465 
466 // ---------------------------------------------------------------------------
467 /** @brief Defines alpha-blend flags.
468  *
469  *  If you're familiar with OpenGL or D3D, these flags aren't new to you.
470  *  They define *how* the final color value of a pixel is computed, basing
471  *  on the previous color at that pixel and the new color value from the
472  *  material.
473  *  The blend formula is:
474  *  @code
475  *    SourceColor * SourceBlend + DestColor * DestBlend
476  *  @endcode
477  *  where DestColor is the previous color in the frame-buffer at this
478  *  position and SourceColor is the material color before the transparency
479  *  calculation.<br>
480  *  This corresponds to the #AI_MATKEY_BLEND_FUNC property.
481 */
482 enum aiBlendMode {
483     /**
484      *  Formula:
485      *  @code
486      *  SourceColor*SourceAlpha + DestColor*(1-SourceAlpha)
487      *  @endcode
488      */
489     aiBlendMode_Default = 0x0,
490 
491     /** Additive blending
492      *
493      *  Formula:
494      *  @code
495      *  SourceColor*1 + DestColor*1
496      *  @endcode
497      */
498     aiBlendMode_Additive = 0x1,
499 
500 // we don't need more for the moment, but we might need them
501 // in future versions ...
502 
503 #ifndef SWIG
504     _aiBlendMode_Force32Bit = INT_MAX
505 #endif
506 };
507 
508 #include "./Compiler/pushpack1.h"
509 
510 // ---------------------------------------------------------------------------
511 /** @brief Defines how an UV channel is transformed.
512  *
513  *  This is just a helper structure for the #AI_MATKEY_UVTRANSFORM key.
514  *  See its documentation for more details.
515  *
516  *  Typically you'll want to build a matrix of this information. However,
517  *  we keep separate scaling/translation/rotation values to make it
518  *  easier to process and optimize UV transformations internally.
519  */
520 struct aiUVTransform {
521     /** Translation on the u and v axes.
522      *
523      *  The default value is (0|0).
524      */
525     C_STRUCT aiVector2D mTranslation;
526 
527     /** Scaling on the u and v axes.
528      *
529      *  The default value is (1|1).
530      */
531     C_STRUCT aiVector2D mScaling;
532 
533     /** Rotation - in counter-clockwise direction.
534      *
535      *  The rotation angle is specified in radians. The
536      *  rotation center is 0.5f|0.5f. The default value
537      *  0.f.
538      */
539     ai_real mRotation;
540 
541 #ifdef __cplusplus
aiUVTransformaiUVTransform542     aiUVTransform() AI_NO_EXCEPT
543             : mTranslation(0.0, 0.0),
544               mScaling(1.0, 1.0),
545               mRotation(0.0) {
546         // nothing to be done here ...
547     }
548 #endif
549 };
550 
551 #include "./Compiler/poppack1.h"
552 
553 //! @cond AI_DOX_INCLUDE_INTERNAL
554 // ---------------------------------------------------------------------------
555 /** @brief A very primitive RTTI system for the contents of material
556  *  properties.
557  */
558 enum aiPropertyTypeInfo {
559     /** Array of single-precision (32 Bit) floats
560      *
561      *  It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
562      *  aiMaterial::Get()) to query properties stored in floating-point format.
563      *  The material system performs the type conversion automatically.
564     */
565     aiPTI_Float = 0x1,
566 
567     /** Array of double-precision (64 Bit) floats
568      *
569      *  It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
570      *  aiMaterial::Get()) to query properties stored in floating-point format.
571      *  The material system performs the type conversion automatically.
572     */
573     aiPTI_Double = 0x2,
574 
575     /** The material property is an aiString.
576      *
577      *  Arrays of strings aren't possible, aiGetMaterialString() (or the
578      *  C++-API aiMaterial::Get()) *must* be used to query a string property.
579     */
580     aiPTI_String = 0x3,
581 
582     /** Array of (32 Bit) integers
583      *
584      *  It is possible to use aiGetMaterialFloat[Array]() (or the C++-API
585      *  aiMaterial::Get()) to query properties stored in integer format.
586      *  The material system performs the type conversion automatically.
587     */
588     aiPTI_Integer = 0x4,
589 
590     /** Simple binary buffer, content undefined. Not convertible to anything.
591     */
592     aiPTI_Buffer = 0x5,
593 
594 /** This value is not used. It is just there to force the
595      *  compiler to map this enum to a 32 Bit integer.
596      */
597 #ifndef SWIG
598     _aiPTI_Force32Bit = INT_MAX
599 #endif
600 };
601 
602 // ---------------------------------------------------------------------------
603 /** @brief Data structure for a single material property
604  *
605  *  As an user, you'll probably never need to deal with this data structure.
606  *  Just use the provided aiGetMaterialXXX() or aiMaterial::Get() family
607  *  of functions to query material properties easily. Processing them
608  *  manually is faster, but it is not the recommended way. It isn't worth
609  *  the effort. <br>
610  *  Material property names follow a simple scheme:
611  *  @code
612  *    $<name>
613  *    ?<name>
614  *       A public property, there must be corresponding AI_MATKEY_XXX define
615  *       2nd: Public, but ignored by the #aiProcess_RemoveRedundantMaterials
616  *       post-processing step.
617  *    ~<name>
618  *       A temporary property for internal use.
619  *  @endcode
620  *  @see aiMaterial
621  */
622 struct aiMaterialProperty {
623     /** Specifies the name of the property (key)
624      *  Keys are generally case insensitive.
625      */
626     C_STRUCT aiString mKey;
627 
628     /** Textures: Specifies their exact usage semantic.
629      * For non-texture properties, this member is always 0
630      * (or, better-said, #aiTextureType_NONE).
631      */
632     unsigned int mSemantic;
633 
634     /** Textures: Specifies the index of the texture.
635      *  For non-texture properties, this member is always 0.
636      */
637     unsigned int mIndex;
638 
639     /** Size of the buffer mData is pointing to, in bytes.
640      *  This value may not be 0.
641      */
642     unsigned int mDataLength;
643 
644     /** Type information for the property.
645      *
646      * Defines the data layout inside the data buffer. This is used
647      * by the library internally to perform debug checks and to
648      * utilize proper type conversions.
649      * (It's probably a hacky solution, but it works.)
650      */
651     C_ENUM aiPropertyTypeInfo mType;
652 
653     /** Binary buffer to hold the property's value.
654      * The size of the buffer is always mDataLength.
655      */
656     char *mData;
657 
658 #ifdef __cplusplus
659 
aiMaterialPropertyaiMaterialProperty660     aiMaterialProperty() AI_NO_EXCEPT
661             : mSemantic(0),
662               mIndex(0),
663               mDataLength(0),
664               mType(aiPTI_Float),
665               mData(nullptr) {
666         // empty
667     }
668 
~aiMaterialPropertyaiMaterialProperty669     ~aiMaterialProperty() {
670         delete[] mData;
671         mData = nullptr;
672     }
673 
674 #endif
675 };
676 //! @endcond
677 
678 #ifdef __cplusplus
679 } // We need to leave the "C" block here to allow template member functions
680 #endif
681 
682 // ---------------------------------------------------------------------------
683 /** @brief Data structure for a material
684 *
685 *  Material data is stored using a key-value structure. A single key-value
686 *  pair is called a 'material property'. C++ users should use the provided
687 *  member functions of aiMaterial to process material properties, C users
688 *  have to stick with the aiMaterialGetXXX family of unbound functions.
689 *  The library defines a set of standard keys (AI_MATKEY_XXX).
690 */
691 #ifdef __cplusplus
692 struct ASSIMP_API aiMaterial
693 #else
694 struct aiMaterial
695 #endif
696 {
697 
698 #ifdef __cplusplus
699 
700 public:
701     aiMaterial();
702     ~aiMaterial();
703 
704     // -------------------------------------------------------------------
705     /**
706       * @brief  Returns the name of the material.
707       * @return The name of the material.
708       */
709     // -------------------------------------------------------------------
710     aiString GetName() const;
711 
712     // -------------------------------------------------------------------
713     /** @brief Retrieve an array of Type values with a specific key
714      *  from the material
715      *
716      * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
717      * @param type .. set by AI_MATKEY_XXX
718      * @param idx .. set by AI_MATKEY_XXX
719      * @param pOut Pointer to a buffer to receive the result.
720      * @param pMax Specifies the size of the given buffer, in Type's.
721      * Receives the number of values (not bytes!) read.
722      * NULL is a valid value for this parameter.
723      */
724     template <typename Type>
725     aiReturn Get(const char *pKey, unsigned int type,
726             unsigned int idx, Type *pOut, unsigned int *pMax) const;
727 
728     aiReturn Get(const char *pKey, unsigned int type,
729             unsigned int idx, int *pOut, unsigned int *pMax) const;
730 
731     aiReturn Get(const char *pKey, unsigned int type,
732             unsigned int idx, ai_real *pOut, unsigned int *pMax) const;
733 
734     // -------------------------------------------------------------------
735     /** @brief Retrieve a Type value with a specific key
736      *  from the material
737      *
738      * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
739     * @param type Specifies the type of the texture to be retrieved (
740     *    e.g. diffuse, specular, height map ...)
741     * @param idx Index of the texture to be retrieved.
742      * @param pOut Reference to receive the output value
743      */
744     template <typename Type>
745     aiReturn Get(const char *pKey, unsigned int type,
746             unsigned int idx, Type &pOut) const;
747 
748     aiReturn Get(const char *pKey, unsigned int type,
749             unsigned int idx, int &pOut) const;
750 
751     aiReturn Get(const char *pKey, unsigned int type,
752             unsigned int idx, ai_real &pOut) const;
753 
754     aiReturn Get(const char *pKey, unsigned int type,
755             unsigned int idx, aiString &pOut) const;
756 
757     aiReturn Get(const char *pKey, unsigned int type,
758             unsigned int idx, aiColor3D &pOut) const;
759 
760     aiReturn Get(const char *pKey, unsigned int type,
761             unsigned int idx, aiColor4D &pOut) const;
762 
763     aiReturn Get(const char *pKey, unsigned int type,
764             unsigned int idx, aiUVTransform &pOut) const;
765 
766     // -------------------------------------------------------------------
767     /** Get the number of textures for a particular texture type.
768      *  @param type Texture type to check for
769      *  @return Number of textures for this type.
770      *  @note A texture can be easily queried using #GetTexture() */
771     unsigned int GetTextureCount(aiTextureType type) const;
772 
773     // -------------------------------------------------------------------
774     /** Helper function to get all parameters pertaining to a
775      *  particular texture slot from a material.
776      *
777      *  This function is provided just for convenience, you could also
778      *  read the single material properties manually.
779      *  @param type Specifies the type of the texture to be retrieved (
780      *    e.g. diffuse, specular, height map ...)
781      *  @param index Index of the texture to be retrieved. The function fails
782      *    if there is no texture of that type with this index.
783      *    #GetTextureCount() can be used to determine the number of textures
784      *    per texture type.
785      *  @param path Receives the path to the texture.
786      *    Use aiScene::GetEmbeddedTexture() method to determine if returned path
787      *    is an image file to be opened or a string key of embedded texture stored in the corresponding scene
788      *    (could be a '*' followed by the id of the texture in case of no name)
789      *    NULL is a valid value.
790      *  @param mapping The texture mapping.
791      *    NULL is allowed as value.
792      *  @param uvindex Receives the UV index of the texture.
793      *    NULL is a valid value.
794      *  @param blend Receives the blend factor for the texture
795      *    NULL is a valid value.
796      *  @param op Receives the texture operation to be performed between
797      *    this texture and the previous texture. NULL is allowed as value.
798      *  @param mapmode Receives the mapping modes to be used for the texture.
799      *    The parameter may be NULL but if it is a valid pointer it MUST
800      *    point to an array of 3 aiTextureMapMode's (one for each
801      *    axis: UVW order (=XYZ)).
802      */
803     // -------------------------------------------------------------------
804     aiReturn GetTexture(aiTextureType type,
805             unsigned int index,
806             C_STRUCT aiString *path,
807             aiTextureMapping *mapping = NULL,
808             unsigned int *uvindex = NULL,
809             ai_real *blend = NULL,
810             aiTextureOp *op = NULL,
811             aiTextureMapMode *mapmode = NULL) const;
812 
813     // Setters
814 
815     // ------------------------------------------------------------------------------
816     /** @brief Add a property with a given key and type info to the material
817      *  structure
818      *
819      *  @param pInput Pointer to input data
820      *  @param pSizeInBytes Size of input data
821      *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
822      *  @param type Set by the AI_MATKEY_XXX macro
823      *  @param index Set by the AI_MATKEY_XXX macro
824      *  @param pType Type information hint */
825     aiReturn AddBinaryProperty(const void *pInput,
826             unsigned int pSizeInBytes,
827             const char *pKey,
828             unsigned int type,
829             unsigned int index,
830             aiPropertyTypeInfo pType);
831 
832     // ------------------------------------------------------------------------------
833     /** @brief Add a string property with a given key and type info to the
834      *  material structure
835      *
836      *  @param pInput Input string
837      *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
838      *  @param type Set by the AI_MATKEY_XXX macro
839      *  @param index Set by the AI_MATKEY_XXX macro */
840     aiReturn AddProperty(const aiString *pInput,
841             const char *pKey,
842             unsigned int type = 0,
843             unsigned int index = 0);
844 
845     // ------------------------------------------------------------------------------
846     /** @brief Add a property with a given key to the material structure
847      *  @param pInput Pointer to the input data
848      *  @param pNumValues Number of values in the array
849      *  @param pKey Key/Usage of the property (AI_MATKEY_XXX)
850      *  @param type Set by the AI_MATKEY_XXX macro
851      *  @param index Set by the AI_MATKEY_XXX macro  */
852     template <class TYPE>
853     aiReturn AddProperty(const TYPE *pInput,
854             unsigned int pNumValues,
855             const char *pKey,
856             unsigned int type = 0,
857             unsigned int index = 0);
858 
859     aiReturn AddProperty(const aiVector3D *pInput,
860             unsigned int pNumValues,
861             const char *pKey,
862             unsigned int type = 0,
863             unsigned int index = 0);
864 
865     aiReturn AddProperty(const aiColor3D *pInput,
866             unsigned int pNumValues,
867             const char *pKey,
868             unsigned int type = 0,
869             unsigned int index = 0);
870 
871     aiReturn AddProperty(const aiColor4D *pInput,
872             unsigned int pNumValues,
873             const char *pKey,
874             unsigned int type = 0,
875             unsigned int index = 0);
876 
877     aiReturn AddProperty(const int *pInput,
878             unsigned int pNumValues,
879             const char *pKey,
880             unsigned int type = 0,
881             unsigned int index = 0);
882 
883     aiReturn AddProperty(const float *pInput,
884             unsigned int pNumValues,
885             const char *pKey,
886             unsigned int type = 0,
887             unsigned int index = 0);
888 
889     aiReturn AddProperty(const double *pInput,
890             unsigned int pNumValues,
891             const char *pKey,
892             unsigned int type = 0,
893             unsigned int index = 0);
894 
895     aiReturn AddProperty(const aiUVTransform *pInput,
896             unsigned int pNumValues,
897             const char *pKey,
898             unsigned int type = 0,
899             unsigned int index = 0);
900 
901     // ------------------------------------------------------------------------------
902     /** @brief Remove a given key from the list.
903      *
904      *  The function fails if the key isn't found
905      *  @param pKey Key to be deleted
906      *  @param type Set by the AI_MATKEY_XXX macro
907      *  @param index Set by the AI_MATKEY_XXX macro  */
908     aiReturn RemoveProperty(const char *pKey,
909             unsigned int type = 0,
910             unsigned int index = 0);
911 
912     // ------------------------------------------------------------------------------
913     /** @brief Removes all properties from the material.
914      *
915      *  The data array remains allocated so adding new properties is quite fast.  */
916     void Clear();
917 
918     // ------------------------------------------------------------------------------
919     /** Copy the property list of a material
920      *  @param pcDest Destination material
921      *  @param pcSrc Source material
922      */
923     static void CopyPropertyList(aiMaterial *pcDest,
924             const aiMaterial *pcSrc);
925 
926 #endif
927 
928     /** List of all material properties loaded. */
929     C_STRUCT aiMaterialProperty **mProperties;
930 
931     /** Number of properties in the data base */
932     unsigned int mNumProperties;
933 
934     /** Storage allocated */
935     unsigned int mNumAllocated;
936 };
937 
938 // Go back to extern "C" again
939 #ifdef __cplusplus
940 extern "C" {
941 #endif
942 
943 // ---------------------------------------------------------------------------
944 #define AI_MATKEY_NAME "?mat.name", 0, 0
945 #define AI_MATKEY_TWOSIDED "$mat.twosided", 0, 0
946 #define AI_MATKEY_SHADING_MODEL "$mat.shadingm", 0, 0
947 #define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe", 0, 0
948 #define AI_MATKEY_BLEND_FUNC "$mat.blend", 0, 0
949 #define AI_MATKEY_OPACITY "$mat.opacity", 0, 0
950 #define AI_MATKEY_TRANSPARENCYFACTOR "$mat.transparencyfactor", 0, 0
951 #define AI_MATKEY_BUMPSCALING "$mat.bumpscaling", 0, 0
952 #define AI_MATKEY_SHININESS "$mat.shininess", 0, 0
953 #define AI_MATKEY_REFLECTIVITY "$mat.reflectivity", 0, 0
954 #define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent", 0, 0
955 #define AI_MATKEY_REFRACTI "$mat.refracti", 0, 0
956 #define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse", 0, 0
957 #define AI_MATKEY_COLOR_AMBIENT "$clr.ambient", 0, 0
958 #define AI_MATKEY_COLOR_SPECULAR "$clr.specular", 0, 0
959 #define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive", 0, 0
960 #define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent", 0, 0
961 #define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective", 0, 0
962 #define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global", 0, 0
963 #define AI_MATKEY_GLOBAL_SHADERLANG "?sh.lang", 0, 0
964 #define AI_MATKEY_SHADER_VERTEX "?sh.vs", 0, 0
965 #define AI_MATKEY_SHADER_FRAGMENT "?sh.fs", 0, 0
966 #define AI_MATKEY_SHADER_GEO "?sh.gs", 0, 0
967 #define AI_MATKEY_SHADER_TESSELATION "?sh.ts", 0, 0
968 #define AI_MATKEY_SHADER_PRIMITIVE "?sh.ps", 0, 0
969 #define AI_MATKEY_SHADER_COMPUTE "?sh.cs", 0, 0
970 
971 // ---------------------------------------------------------------------------
972 // PBR material support
973 // --------------------
974 // Properties defining PBR rendering techniques
975 #define AI_MATKEY_USE_COLOR_MAP "$mat.useColorMap", 0, 0
976 
977 // Metallic/Roughness Workflow
978 // ---------------------------
979 // Base RGBA color factor. Will be multiplied by final base color texture values if extant
980 // Note: Importers may choose to copy this into AI_MATKEY_COLOR_DIFFUSE for compatibility
981 // with renderers and formats that do not support Metallic/Roughness PBR
982 #define AI_MATKEY_BASE_COLOR "$clr.base", 0, 0
983 #define AI_MATKEY_BASE_COLOR_TEXTURE aiTextureType_BASE_COLOR, 0
984 #define AI_MATKEY_USE_METALLIC_MAP "$mat.useMetallicMap", 0, 0
985 // Metallic factor. 0.0 = Full Dielectric, 1.0 = Full Metal
986 #define AI_MATKEY_METALLIC_FACTOR "$mat.metallicFactor", 0, 0
987 #define AI_MATKEY_METALLIC_TEXTURE aiTextureType_METALNESS, 0
988 #define AI_MATKEY_USE_ROUGHNESS_MAP "$mat.useRoughnessMap", 0, 0
989 // Roughness factor. 0.0 = Perfectly Smooth, 1.0 = Completely Rough
990 #define AI_MATKEY_ROUGHNESS_FACTOR "$mat.roughnessFactor", 0, 0
991 #define AI_MATKEY_ROUGHNESS_TEXTURE aiTextureType_DIFFUSE_ROUGHNESS, 0
992 
993 // Specular/Glossiness Workflow
994 // ---------------------------
995 // Diffuse/Albedo Color. Note: Pure Metals have a diffuse of {0,0,0}
996 // AI_MATKEY_COLOR_DIFFUSE
997 // Specular Color.
998 // Note: Metallic/Roughness may also have a Specular Color
999 // AI_MATKEY_COLOR_SPECULAR
1000 #define AI_MATKEY_SPECULAR_FACTOR "$mat.specularFactor", 0, 0
1001 // Glossiness factor. 0.0 = Completely Rough, 1.0 = Perfectly Smooth
1002 #define AI_MATKEY_GLOSSINESS_FACTOR "$mat.glossinessFactor", 0, 0
1003 
1004 // Sheen
1005 // -----
1006 // Sheen base RGB color. Default {0,0,0}
1007 #define AI_MATKEY_SHEEN_COLOR_FACTOR "$clr.sheen.factor", 0, 0
1008 // Sheen Roughness Factor.
1009 #define AI_MATKEY_SHEEN_ROUGHNESS_FACTOR "$mat.sheen.roughnessFactor", 0, 0
1010 #define AI_MATKEY_SHEEN_COLOR_TEXTURE aiTextureType_SHEEN, 0
1011 #define AI_MATKEY_SHEEN_ROUGHNESS_TEXTURE aiTextureType_SHEEN, 1
1012 
1013 // Clearcoat
1014 // ---------
1015 // Clearcoat layer intensity. 0.0 = none (disabled)
1016 #define AI_MATKEY_CLEARCOAT_FACTOR "$mat.clearcoat.factor", 0, 0
1017 #define AI_MATKEY_CLEARCOAT_ROUGHNESS_FACTOR "$mat.clearcoat.roughnessFactor", 0, 0
1018 #define AI_MATKEY_CLEARCOAT_TEXTURE aiTextureType_CLEARCOAT, 0
1019 #define AI_MATKEY_CLEARCOAT_ROUGHNESS_TEXTURE aiTextureType_CLEARCOAT, 1
1020 #define AI_MATKEY_CLEARCOAT_NORMAL_TEXTURE aiTextureType_CLEARCOAT, 2
1021 
1022 // Transmission
1023 // ------------
1024 // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission
1025 // Base percentage of light transmitted through the surface. 0.0 = Opaque, 1.0 = Fully transparent
1026 #define AI_MATKEY_TRANSMISSION_FACTOR "$mat.transmission.factor", 0, 0
1027 // Texture defining percentage of light transmitted through the surface.
1028 // Multiplied by AI_MATKEY_TRANSMISSION_FACTOR
1029 #define AI_MATKEY_TRANSMISSION_TEXTURE aiTextureType_TRANSMISSION, 0
1030 
1031 // Volume
1032 // ------------
1033 // https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_volume
1034 // The thickness of the volume beneath the surface. If the value is 0 the material is thin-walled. Otherwise the material is a volume boundary.
1035 #define AI_MATKEY_VOLUME_THICKNESS_FACTOR "$mat.volume.thicknessFactor", 0, 0
1036 // Texture that defines the thickness.
1037 // Multiplied by AI_MATKEY_THICKNESS_FACTOR
1038 #define AI_MATKEY_VOLUME_THICKNESS_TEXTURE aiTextureType_TRANSMISSION, 1
1039 // Density of the medium given as the average distance that light travels in the medium before interacting with a particle.
1040 #define AI_MATKEY_VOLUME_ATTENUATION_DISTANCE "$mat.volume.attenuationDistance", 0, 0
1041 // The color that white light turns into due to absorption when reaching the attenuation distance.
1042 #define AI_MATKEY_VOLUME_ATTENUATION_COLOR "$mat.volume.attenuationColor", 0, 0
1043 
1044 // Emissive
1045 // --------
1046 #define AI_MATKEY_USE_EMISSIVE_MAP "$mat.useEmissiveMap", 0, 0
1047 #define AI_MATKEY_EMISSIVE_INTENSITY "$mat.emissiveIntensity", 0, 0
1048 #define AI_MATKEY_USE_AO_MAP "$mat.useAOMap", 0, 0
1049 
1050 // ---------------------------------------------------------------------------
1051 // Pure key names for all texture-related properties
1052 //! @cond MATS_DOC_FULL
1053 #define _AI_MATKEY_TEXTURE_BASE "$tex.file"
1054 #define _AI_MATKEY_UVWSRC_BASE "$tex.uvwsrc"
1055 #define _AI_MATKEY_TEXOP_BASE "$tex.op"
1056 #define _AI_MATKEY_MAPPING_BASE "$tex.mapping"
1057 #define _AI_MATKEY_TEXBLEND_BASE "$tex.blend"
1058 #define _AI_MATKEY_MAPPINGMODE_U_BASE "$tex.mapmodeu"
1059 #define _AI_MATKEY_MAPPINGMODE_V_BASE "$tex.mapmodev"
1060 #define _AI_MATKEY_TEXMAP_AXIS_BASE "$tex.mapaxis"
1061 #define _AI_MATKEY_UVTRANSFORM_BASE "$tex.uvtrafo"
1062 #define _AI_MATKEY_TEXFLAGS_BASE "$tex.flags"
1063 //! @endcond
1064 
1065 // ---------------------------------------------------------------------------
1066 #define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE, type, N
1067 
1068 // For backward compatibility and simplicity
1069 //! @cond MATS_DOC_FULL
1070 #define AI_MATKEY_TEXTURE_DIFFUSE(N) \
1071     AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, N)
1072 
1073 #define AI_MATKEY_TEXTURE_SPECULAR(N) \
1074     AI_MATKEY_TEXTURE(aiTextureType_SPECULAR, N)
1075 
1076 #define AI_MATKEY_TEXTURE_AMBIENT(N) \
1077     AI_MATKEY_TEXTURE(aiTextureType_AMBIENT, N)
1078 
1079 #define AI_MATKEY_TEXTURE_EMISSIVE(N) \
1080     AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE, N)
1081 
1082 #define AI_MATKEY_TEXTURE_NORMALS(N) \
1083     AI_MATKEY_TEXTURE(aiTextureType_NORMALS, N)
1084 
1085 #define AI_MATKEY_TEXTURE_HEIGHT(N) \
1086     AI_MATKEY_TEXTURE(aiTextureType_HEIGHT, N)
1087 
1088 #define AI_MATKEY_TEXTURE_SHININESS(N) \
1089     AI_MATKEY_TEXTURE(aiTextureType_SHININESS, N)
1090 
1091 #define AI_MATKEY_TEXTURE_OPACITY(N) \
1092     AI_MATKEY_TEXTURE(aiTextureType_OPACITY, N)
1093 
1094 #define AI_MATKEY_TEXTURE_DISPLACEMENT(N) \
1095     AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT, N)
1096 
1097 #define AI_MATKEY_TEXTURE_LIGHTMAP(N) \
1098     AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP, N)
1099 
1100 #define AI_MATKEY_TEXTURE_REFLECTION(N) \
1101     AI_MATKEY_TEXTURE(aiTextureType_REFLECTION, N)
1102 
1103 //! @endcond
1104 
1105 // ---------------------------------------------------------------------------
1106 #define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE, type, N
1107 
1108 // For backward compatibility and simplicity
1109 //! @cond MATS_DOC_FULL
1110 #define AI_MATKEY_UVWSRC_DIFFUSE(N) \
1111     AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE, N)
1112 
1113 #define AI_MATKEY_UVWSRC_SPECULAR(N) \
1114     AI_MATKEY_UVWSRC(aiTextureType_SPECULAR, N)
1115 
1116 #define AI_MATKEY_UVWSRC_AMBIENT(N) \
1117     AI_MATKEY_UVWSRC(aiTextureType_AMBIENT, N)
1118 
1119 #define AI_MATKEY_UVWSRC_EMISSIVE(N) \
1120     AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE, N)
1121 
1122 #define AI_MATKEY_UVWSRC_NORMALS(N) \
1123     AI_MATKEY_UVWSRC(aiTextureType_NORMALS, N)
1124 
1125 #define AI_MATKEY_UVWSRC_HEIGHT(N) \
1126     AI_MATKEY_UVWSRC(aiTextureType_HEIGHT, N)
1127 
1128 #define AI_MATKEY_UVWSRC_SHININESS(N) \
1129     AI_MATKEY_UVWSRC(aiTextureType_SHININESS, N)
1130 
1131 #define AI_MATKEY_UVWSRC_OPACITY(N) \
1132     AI_MATKEY_UVWSRC(aiTextureType_OPACITY, N)
1133 
1134 #define AI_MATKEY_UVWSRC_DISPLACEMENT(N) \
1135     AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT, N)
1136 
1137 #define AI_MATKEY_UVWSRC_LIGHTMAP(N) \
1138     AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP, N)
1139 
1140 #define AI_MATKEY_UVWSRC_REFLECTION(N) \
1141     AI_MATKEY_UVWSRC(aiTextureType_REFLECTION, N)
1142 
1143 //! @endcond
1144 // ---------------------------------------------------------------------------
1145 #define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE, type, N
1146 
1147 // For backward compatibility and simplicity
1148 //! @cond MATS_DOC_FULL
1149 #define AI_MATKEY_TEXOP_DIFFUSE(N) \
1150     AI_MATKEY_TEXOP(aiTextureType_DIFFUSE, N)
1151 
1152 #define AI_MATKEY_TEXOP_SPECULAR(N) \
1153     AI_MATKEY_TEXOP(aiTextureType_SPECULAR, N)
1154 
1155 #define AI_MATKEY_TEXOP_AMBIENT(N) \
1156     AI_MATKEY_TEXOP(aiTextureType_AMBIENT, N)
1157 
1158 #define AI_MATKEY_TEXOP_EMISSIVE(N) \
1159     AI_MATKEY_TEXOP(aiTextureType_EMISSIVE, N)
1160 
1161 #define AI_MATKEY_TEXOP_NORMALS(N) \
1162     AI_MATKEY_TEXOP(aiTextureType_NORMALS, N)
1163 
1164 #define AI_MATKEY_TEXOP_HEIGHT(N) \
1165     AI_MATKEY_TEXOP(aiTextureType_HEIGHT, N)
1166 
1167 #define AI_MATKEY_TEXOP_SHININESS(N) \
1168     AI_MATKEY_TEXOP(aiTextureType_SHININESS, N)
1169 
1170 #define AI_MATKEY_TEXOP_OPACITY(N) \
1171     AI_MATKEY_TEXOP(aiTextureType_OPACITY, N)
1172 
1173 #define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
1174     AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT, N)
1175 
1176 #define AI_MATKEY_TEXOP_LIGHTMAP(N) \
1177     AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP, N)
1178 
1179 #define AI_MATKEY_TEXOP_REFLECTION(N) \
1180     AI_MATKEY_TEXOP(aiTextureType_REFLECTION, N)
1181 
1182 //! @endcond
1183 // ---------------------------------------------------------------------------
1184 #define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE, type, N
1185 
1186 // For backward compatibility and simplicity
1187 //! @cond MATS_DOC_FULL
1188 #define AI_MATKEY_MAPPING_DIFFUSE(N) \
1189     AI_MATKEY_MAPPING(aiTextureType_DIFFUSE, N)
1190 
1191 #define AI_MATKEY_MAPPING_SPECULAR(N) \
1192     AI_MATKEY_MAPPING(aiTextureType_SPECULAR, N)
1193 
1194 #define AI_MATKEY_MAPPING_AMBIENT(N) \
1195     AI_MATKEY_MAPPING(aiTextureType_AMBIENT, N)
1196 
1197 #define AI_MATKEY_MAPPING_EMISSIVE(N) \
1198     AI_MATKEY_MAPPING(aiTextureType_EMISSIVE, N)
1199 
1200 #define AI_MATKEY_MAPPING_NORMALS(N) \
1201     AI_MATKEY_MAPPING(aiTextureType_NORMALS, N)
1202 
1203 #define AI_MATKEY_MAPPING_HEIGHT(N) \
1204     AI_MATKEY_MAPPING(aiTextureType_HEIGHT, N)
1205 
1206 #define AI_MATKEY_MAPPING_SHININESS(N) \
1207     AI_MATKEY_MAPPING(aiTextureType_SHININESS, N)
1208 
1209 #define AI_MATKEY_MAPPING_OPACITY(N) \
1210     AI_MATKEY_MAPPING(aiTextureType_OPACITY, N)
1211 
1212 #define AI_MATKEY_MAPPING_DISPLACEMENT(N) \
1213     AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT, N)
1214 
1215 #define AI_MATKEY_MAPPING_LIGHTMAP(N) \
1216     AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP, N)
1217 
1218 #define AI_MATKEY_MAPPING_REFLECTION(N) \
1219     AI_MATKEY_MAPPING(aiTextureType_REFLECTION, N)
1220 
1221 //! @endcond
1222 // ---------------------------------------------------------------------------
1223 #define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE, type, N
1224 
1225 // For backward compatibility and simplicity
1226 //! @cond MATS_DOC_FULL
1227 #define AI_MATKEY_TEXBLEND_DIFFUSE(N) \
1228     AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE, N)
1229 
1230 #define AI_MATKEY_TEXBLEND_SPECULAR(N) \
1231     AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR, N)
1232 
1233 #define AI_MATKEY_TEXBLEND_AMBIENT(N) \
1234     AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT, N)
1235 
1236 #define AI_MATKEY_TEXBLEND_EMISSIVE(N) \
1237     AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE, N)
1238 
1239 #define AI_MATKEY_TEXBLEND_NORMALS(N) \
1240     AI_MATKEY_TEXBLEND(aiTextureType_NORMALS, N)
1241 
1242 #define AI_MATKEY_TEXBLEND_HEIGHT(N) \
1243     AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT, N)
1244 
1245 #define AI_MATKEY_TEXBLEND_SHININESS(N) \
1246     AI_MATKEY_TEXBLEND(aiTextureType_SHININESS, N)
1247 
1248 #define AI_MATKEY_TEXBLEND_OPACITY(N) \
1249     AI_MATKEY_TEXBLEND(aiTextureType_OPACITY, N)
1250 
1251 #define AI_MATKEY_TEXBLEND_DISPLACEMENT(N) \
1252     AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT, N)
1253 
1254 #define AI_MATKEY_TEXBLEND_LIGHTMAP(N) \
1255     AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP, N)
1256 
1257 #define AI_MATKEY_TEXBLEND_REFLECTION(N) \
1258     AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION, N)
1259 
1260 //! @endcond
1261 // ---------------------------------------------------------------------------
1262 #define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE, type, N
1263 
1264 // For backward compatibility and simplicity
1265 //! @cond MATS_DOC_FULL
1266 #define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N) \
1267     AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE, N)
1268 
1269 #define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
1270     AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR, N)
1271 
1272 #define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N) \
1273     AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT, N)
1274 
1275 #define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
1276     AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE, N)
1277 
1278 #define AI_MATKEY_MAPPINGMODE_U_NORMALS(N) \
1279     AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS, N)
1280 
1281 #define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N) \
1282     AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT, N)
1283 
1284 #define AI_MATKEY_MAPPINGMODE_U_SHININESS(N) \
1285     AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS, N)
1286 
1287 #define AI_MATKEY_MAPPINGMODE_U_OPACITY(N) \
1288     AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY, N)
1289 
1290 #define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
1291     AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT, N)
1292 
1293 #define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
1294     AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP, N)
1295 
1296 #define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N) \
1297     AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION, N)
1298 
1299 //! @endcond
1300 // ---------------------------------------------------------------------------
1301 #define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE, type, N
1302 
1303 // For backward compatibility and simplicity
1304 //! @cond MATS_DOC_FULL
1305 #define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N) \
1306     AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE, N)
1307 
1308 #define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
1309     AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR, N)
1310 
1311 #define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N) \
1312     AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT, N)
1313 
1314 #define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
1315     AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE, N)
1316 
1317 #define AI_MATKEY_MAPPINGMODE_V_NORMALS(N) \
1318     AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS, N)
1319 
1320 #define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N) \
1321     AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT, N)
1322 
1323 #define AI_MATKEY_MAPPINGMODE_V_SHININESS(N) \
1324     AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS, N)
1325 
1326 #define AI_MATKEY_MAPPINGMODE_V_OPACITY(N) \
1327     AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY, N)
1328 
1329 #define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
1330     AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT, N)
1331 
1332 #define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
1333     AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP, N)
1334 
1335 #define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N) \
1336     AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION, N)
1337 
1338 //! @endcond
1339 // ---------------------------------------------------------------------------
1340 #define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE, type, N
1341 
1342 // For backward compatibility and simplicity
1343 //! @cond MATS_DOC_FULL
1344 #define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N) \
1345     AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE, N)
1346 
1347 #define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N) \
1348     AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR, N)
1349 
1350 #define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N) \
1351     AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT, N)
1352 
1353 #define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N) \
1354     AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE, N)
1355 
1356 #define AI_MATKEY_TEXMAP_AXIS_NORMALS(N) \
1357     AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS, N)
1358 
1359 #define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
1360     AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT, N)
1361 
1362 #define AI_MATKEY_TEXMAP_AXIS_SHININESS(N) \
1363     AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS, N)
1364 
1365 #define AI_MATKEY_TEXMAP_AXIS_OPACITY(N) \
1366     AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY, N)
1367 
1368 #define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N) \
1369     AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT, N)
1370 
1371 #define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N) \
1372     AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP, N)
1373 
1374 #define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
1375     AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION, N)
1376 
1377 //! @endcond
1378 // ---------------------------------------------------------------------------
1379 #define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE, type, N
1380 
1381 // For backward compatibility and simplicity
1382 //! @cond MATS_DOC_FULL
1383 #define AI_MATKEY_UVTRANSFORM_DIFFUSE(N) \
1384     AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE, N)
1385 
1386 #define AI_MATKEY_UVTRANSFORM_SPECULAR(N) \
1387     AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR, N)
1388 
1389 #define AI_MATKEY_UVTRANSFORM_AMBIENT(N) \
1390     AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT, N)
1391 
1392 #define AI_MATKEY_UVTRANSFORM_EMISSIVE(N) \
1393     AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE, N)
1394 
1395 #define AI_MATKEY_UVTRANSFORM_NORMALS(N) \
1396     AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS, N)
1397 
1398 #define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
1399     AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT, N)
1400 
1401 #define AI_MATKEY_UVTRANSFORM_SHININESS(N) \
1402     AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS, N)
1403 
1404 #define AI_MATKEY_UVTRANSFORM_OPACITY(N) \
1405     AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY, N)
1406 
1407 #define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N) \
1408     AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT, N)
1409 
1410 #define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N) \
1411     AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP, N)
1412 
1413 #define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
1414     AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION, N)
1415 
1416 #define AI_MATKEY_UVTRANSFORM_UNKNOWN(N) \
1417     AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN, N)
1418 
1419 //! @endcond
1420 // ---------------------------------------------------------------------------
1421 #define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE, type, N
1422 
1423 // For backward compatibility and simplicity
1424 //! @cond MATS_DOC_FULL
1425 #define AI_MATKEY_TEXFLAGS_DIFFUSE(N) \
1426     AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE, N)
1427 
1428 #define AI_MATKEY_TEXFLAGS_SPECULAR(N) \
1429     AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR, N)
1430 
1431 #define AI_MATKEY_TEXFLAGS_AMBIENT(N) \
1432     AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT, N)
1433 
1434 #define AI_MATKEY_TEXFLAGS_EMISSIVE(N) \
1435     AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE, N)
1436 
1437 #define AI_MATKEY_TEXFLAGS_NORMALS(N) \
1438     AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS, N)
1439 
1440 #define AI_MATKEY_TEXFLAGS_HEIGHT(N) \
1441     AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT, N)
1442 
1443 #define AI_MATKEY_TEXFLAGS_SHININESS(N) \
1444     AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS, N)
1445 
1446 #define AI_MATKEY_TEXFLAGS_OPACITY(N) \
1447     AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY, N)
1448 
1449 #define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N) \
1450     AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT, N)
1451 
1452 #define AI_MATKEY_TEXFLAGS_LIGHTMAP(N) \
1453     AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP, N)
1454 
1455 #define AI_MATKEY_TEXFLAGS_REFLECTION(N) \
1456     AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION, N)
1457 
1458 #define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \
1459     AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN, N)
1460 
1461 //! @endcond
1462 //!
1463 // ---------------------------------------------------------------------------
1464 /** @brief Retrieve a material property with a specific key from the material
1465  *
1466  * @param pMat Pointer to the input material. May not be NULL
1467  * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
1468  * @param type Specifies the type of the texture to be retrieved (
1469  *    e.g. diffuse, specular, height map ...)
1470  * @param index Index of the texture to be retrieved.
1471  * @param pPropOut Pointer to receive a pointer to a valid aiMaterialProperty
1472  *        structure or NULL if the key has not been found. */
1473 // ---------------------------------------------------------------------------
1474 ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(
1475         const C_STRUCT aiMaterial *pMat,
1476         const char *pKey,
1477         unsigned int type,
1478         unsigned int index,
1479         const C_STRUCT aiMaterialProperty **pPropOut);
1480 
1481 // ---------------------------------------------------------------------------
1482 /** @brief Retrieve an array of float values with a specific key
1483  *  from the material
1484  *
1485  * Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
1486  * example reads the #AI_MATKEY_UVTRANSFORM property of the first diffuse texture)
1487  * @code
1488  * aiUVTransform trafo;
1489  * unsigned int max = sizeof(aiUVTransform);
1490  * if (AI_SUCCESS != aiGetMaterialFloatArray(mat, AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,0),
1491  *    (float*)&trafo, &max) || sizeof(aiUVTransform) != max)
1492  * {
1493  *   // error handling
1494  * }
1495  * @endcode
1496  *
1497  * @param pMat Pointer to the input material. May not be NULL
1498  * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
1499  * @param pOut Pointer to a buffer to receive the result.
1500  * @param pMax Specifies the size of the given buffer, in float's.
1501  *        Receives the number of values (not bytes!) read.
1502  * @param type (see the code sample above)
1503  * @param index (see the code sample above)
1504  * @return Specifies whether the key has been found. If not, the output
1505  *   arrays remains unmodified and pMax is set to 0.*/
1506 // ---------------------------------------------------------------------------
1507 ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
1508         const C_STRUCT aiMaterial *pMat,
1509         const char *pKey,
1510         unsigned int type,
1511         unsigned int index,
1512         ai_real *pOut,
1513         unsigned int *pMax);
1514 
1515 // ---------------------------------------------------------------------------
1516 /** @brief Retrieve a single float property with a specific key from the material.
1517 *
1518 * Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
1519 * example reads the #AI_MATKEY_SHININESS_STRENGTH property of the first diffuse texture)
1520 * @code
1521 * float specStrength = 1.f; // default value, remains unmodified if we fail.
1522 * aiGetMaterialFloat(mat, AI_MATKEY_SHININESS_STRENGTH,
1523 *    (float*)&specStrength);
1524 * @endcode
1525 *
1526 * @param pMat Pointer to the input material. May not be NULL
1527 * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
1528 * @param pOut Receives the output float.
1529 * @param type (see the code sample above)
1530 * @param index (see the code sample above)
1531 * @return Specifies whether the key has been found. If not, the output
1532 *   float remains unmodified.*/
1533 // ---------------------------------------------------------------------------
aiGetMaterialFloat(const C_STRUCT aiMaterial * pMat,const char * pKey,unsigned int type,unsigned int index,ai_real * pOut)1534 inline aiReturn aiGetMaterialFloat(const C_STRUCT aiMaterial *pMat,
1535         const char *pKey,
1536         unsigned int type,
1537         unsigned int index,
1538         ai_real *pOut) {
1539     return aiGetMaterialFloatArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0);
1540 }
1541 
1542 // ---------------------------------------------------------------------------
1543 /** @brief Retrieve an array of integer values with a specific key
1544  *  from a material
1545  *
1546  * See the sample for aiGetMaterialFloatArray for more information.*/
1547 ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial *pMat,
1548         const char *pKey,
1549         unsigned int type,
1550         unsigned int index,
1551         int *pOut,
1552         unsigned int *pMax);
1553 
1554 // ---------------------------------------------------------------------------
1555 /** @brief Retrieve an integer property with a specific key from a material
1556  *
1557  * See the sample for aiGetMaterialFloat for more information.*/
1558 // ---------------------------------------------------------------------------
aiGetMaterialInteger(const C_STRUCT aiMaterial * pMat,const char * pKey,unsigned int type,unsigned int index,int * pOut)1559 inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial *pMat,
1560         const char *pKey,
1561         unsigned int type,
1562         unsigned int index,
1563         int *pOut) {
1564     return aiGetMaterialIntegerArray(pMat, pKey, type, index, pOut, (unsigned int *)0x0);
1565 }
1566 
1567 // ---------------------------------------------------------------------------
1568 /** @brief Retrieve a color value from the material property table
1569 *
1570 * See the sample for aiGetMaterialFloat for more information*/
1571 // ---------------------------------------------------------------------------
1572 ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial *pMat,
1573         const char *pKey,
1574         unsigned int type,
1575         unsigned int index,
1576         C_STRUCT aiColor4D *pOut);
1577 
1578 // ---------------------------------------------------------------------------
1579 /** @brief Retrieve a aiUVTransform value from the material property table
1580 *
1581 * See the sample for aiGetMaterialFloat for more information*/
1582 // ---------------------------------------------------------------------------
1583 ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial *pMat,
1584         const char *pKey,
1585         unsigned int type,
1586         unsigned int index,
1587         C_STRUCT aiUVTransform *pOut);
1588 
1589 // ---------------------------------------------------------------------------
1590 /** @brief Retrieve a string from the material property table
1591 *
1592 * See the sample for aiGetMaterialFloat for more information.*/
1593 // ---------------------------------------------------------------------------
1594 ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial *pMat,
1595         const char *pKey,
1596         unsigned int type,
1597         unsigned int index,
1598         C_STRUCT aiString *pOut);
1599 
1600 // ---------------------------------------------------------------------------
1601 /** Get the number of textures for a particular texture type.
1602  *  @param[in] pMat Pointer to the input material. May not be NULL
1603  *  @param type Texture type to check for
1604  *  @return Number of textures for this type.
1605  *  @note A texture can be easily queried using #aiGetMaterialTexture() */
1606 // ---------------------------------------------------------------------------
1607 ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial *pMat,
1608         C_ENUM aiTextureType type);
1609 
1610 // ---------------------------------------------------------------------------
1611 /** @brief Helper function to get all values pertaining to a particular
1612  *  texture slot from a material structure.
1613  *
1614  *  This function is provided just for convenience. You could also read the
1615  *  texture by parsing all of its properties manually. This function bundles
1616  *  all of them in a huge function monster.
1617  *
1618  *  @param[in] mat Pointer to the input material. May not be NULL
1619  *  @param[in] type Specifies the texture stack to read from (e.g. diffuse,
1620  *     specular, height map ...).
1621  *  @param[in] index Index of the texture. The function fails if the
1622  *     requested index is not available for this texture type.
1623  *     #aiGetMaterialTextureCount() can be used to determine the number of
1624  *     textures in a particular texture stack.
1625  *  @param[out] path Receives the output path
1626  *     If the texture is embedded, receives a '*' followed by the id of
1627  *     the texture (for the textures stored in the corresponding scene) which
1628  *     can be converted to an int using a function like atoi.
1629  *     This parameter must be non-null.
1630  *  @param mapping The texture mapping mode to be used.
1631  *      Pass NULL if you're not interested in this information.
1632  *  @param[out] uvindex For UV-mapped textures: receives the index of the UV
1633  *      source channel. Unmodified otherwise.
1634  *      Pass NULL if you're not interested in this information.
1635  *  @param[out] blend Receives the blend factor for the texture
1636  *      Pass NULL if you're not interested in this information.
1637  *  @param[out] op Receives the texture blend operation to be perform between
1638  *      this texture and the previous texture.
1639  *      Pass NULL if you're not interested in this information.
1640  *  @param[out] mapmode Receives the mapping modes to be used for the texture.
1641  *      Pass NULL if you're not interested in this information. Otherwise,
1642  *      pass a pointer to an array of two aiTextureMapMode's (one for each
1643  *      axis, UV order).
1644  *  @param[out] flags Receives the the texture flags.
1645  *  @return AI_SUCCESS on success, otherwise something else. Have fun.*/
1646 // ---------------------------------------------------------------------------
1647 #ifdef __cplusplus
1648 ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial *mat,
1649         aiTextureType type,
1650         unsigned int index,
1651         aiString *path,
1652         aiTextureMapping *mapping = NULL,
1653         unsigned int *uvindex = NULL,
1654         ai_real *blend = NULL,
1655         aiTextureOp *op = NULL,
1656         aiTextureMapMode *mapmode = NULL,
1657         unsigned int *flags = NULL);
1658 #else
1659 C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial *mat,
1660         C_ENUM aiTextureType type,
1661         unsigned int index,
1662         C_STRUCT aiString *path,
1663         C_ENUM aiTextureMapping *mapping /*= NULL*/,
1664         unsigned int *uvindex /*= NULL*/,
1665         ai_real *blend /*= NULL*/,
1666         C_ENUM aiTextureOp *op /*= NULL*/,
1667         C_ENUM aiTextureMapMode *mapmode /*= NULL*/,
1668         unsigned int *flags /*= NULL*/);
1669 #endif // !#ifdef __cplusplus
1670 
1671 #ifdef __cplusplus
1672 }
1673 
1674 #include "material.inl"
1675 
1676 #endif //!__cplusplus
1677 
1678 #endif //!!AI_MATERIAL_H_INC
1679