1 /* 2 Open Asset Import Library (assimp) 3 ---------------------------------------------------------------------- 4 5 Copyright (c) 2006-2021, assimp team 6 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 12 following 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 43 /** @file BlenderScene.h 44 * @brief Intermediate representation of a BLEND scene. 45 */ 46 #ifndef INCLUDED_AI_BLEND_SCENE_H 47 #define INCLUDED_AI_BLEND_SCENE_H 48 49 #include "BlenderDNA.h" 50 51 namespace Assimp { 52 namespace Blender { 53 54 // Minor parts of this file are extracts from blender data structures, 55 // declared in the ./source/blender/makesdna directory. 56 // Stuff that is not used by Assimp is commented. 57 58 // NOTE 59 // this file serves as input data to the `./scripts/genblenddna.py` 60 // script. This script generates the actual binding code to read a 61 // blender file with a possibly different DNA into our structures. 62 // Only `struct` declarations are considered and the following 63 // rules must be obeyed in order for the script to work properly: 64 // 65 // * C++ style comments only 66 // 67 // * Structures may include the primitive types char, int, short, 68 // float, double. Signed specifiers are not allowed on 69 // integers. Enum types are allowed, but they must have been 70 // defined in this header. 71 // 72 // * Structures may aggregate other structures, unless not defined 73 // in this header. 74 // 75 // * Pointers to other structures or primitive types are allowed. 76 // No references or double pointers or arrays of pointers. 77 // A pointer to a T is normally written as std::shared_ptr, while a 78 // pointer to an array of elements is written as boost:: 79 // shared_array. To avoid cyclic pointers, use raw pointers in 80 // one direction. 81 // 82 // * Arrays can have maximally two-dimensions. Any non-pointer 83 // type can form them. 84 // 85 // * Multiple fields can be declare in a single line (i.e `int a,b;`) 86 // provided they are neither pointers nor arrays. 87 // 88 // * One of WARN, FAIL can be appended to the declaration ( 89 // prior to the semicolon to specify the error handling policy if 90 // this field is missing in the input DNA). If none of those 91 // is specified the default policy is to substitute a default 92 // value for the field. 93 // 94 95 // warn if field is missing, substitute default value 96 #ifdef WARN 97 #undef WARN 98 #endif 99 #define WARN 100 101 // fail the import if the field does not exist 102 #ifdef FAIL 103 #undef FAIL 104 #endif 105 #define FAIL 106 107 struct Object; 108 struct MTex; 109 struct Image; 110 struct Collection; 111 112 #include <memory> 113 114 #define AI_BLEND_MESH_MAX_VERTS 2000000000L 115 116 static const size_t MaxNameLen = 1024; 117 118 // ------------------------------------------------------------------------------- 119 struct ID : ElemBase { 120 char name[MaxNameLen] WARN; 121 short flag; 122 }; 123 124 // ------------------------------------------------------------------------------- 125 struct ListBase : ElemBase { 126 std::shared_ptr<ElemBase> first; 127 std::shared_ptr<ElemBase> last; 128 }; 129 130 // ------------------------------------------------------------------------------- 131 struct PackedFile : ElemBase { 132 int size WARN; 133 int seek WARN; 134 std::shared_ptr<FileOffset> data WARN; 135 }; 136 137 // ------------------------------------------------------------------------------- 138 struct GroupObject : ElemBase { 139 std::shared_ptr<GroupObject> prev, next FAIL; 140 std::shared_ptr<Object> ob; 141 }; 142 143 // ------------------------------------------------------------------------------- 144 struct Group : ElemBase { 145 ID id FAIL; 146 int layer; 147 148 std::shared_ptr<GroupObject> gobject; 149 }; 150 151 // ------------------------------------------------------------------------------- 152 struct CollectionObject : ElemBase { 153 //CollectionObject* prev; 154 std::shared_ptr<CollectionObject> next; 155 Object *ob; 156 }; 157 158 // ------------------------------------------------------------------------------- 159 struct CollectionChild : ElemBase { 160 std::shared_ptr<CollectionChild> next, prev; 161 std::shared_ptr<Collection> collection; 162 }; 163 164 // ------------------------------------------------------------------------------- 165 struct Collection : ElemBase { 166 ID id FAIL; 167 ListBase gobject; // CollectionObject 168 ListBase children; // CollectionChild 169 }; 170 171 // ------------------------------------------------------------------------------- 172 struct World : ElemBase { 173 ID id FAIL; 174 }; 175 176 // ------------------------------------------------------------------------------- 177 struct MVert : ElemBase { 178 float co[3] FAIL; 179 float no[3] FAIL; // read as short and divided through / 32767.f 180 char flag; 181 int mat_nr WARN; 182 int bweight; 183 MVertMVert184 MVert() : 185 ElemBase(), flag(0), mat_nr(0), bweight(0) {} 186 }; 187 188 // ------------------------------------------------------------------------------- 189 struct MEdge : ElemBase { 190 int v1, v2 FAIL; 191 char crease, bweight; 192 short flag; 193 }; 194 195 // ------------------------------------------------------------------------------- 196 struct MLoop : ElemBase { 197 int v, e; 198 }; 199 200 // ------------------------------------------------------------------------------- 201 struct MLoopUV : ElemBase { 202 float uv[2]; 203 int flag; 204 }; 205 206 // ------------------------------------------------------------------------------- 207 // Note that red and blue are not swapped, as with MCol 208 struct MLoopCol : ElemBase { 209 unsigned char r, g, b, a; 210 }; 211 212 // ------------------------------------------------------------------------------- 213 struct MPoly : ElemBase { 214 int loopstart; 215 int totloop; 216 short mat_nr; 217 char flag; 218 }; 219 220 // ------------------------------------------------------------------------------- 221 struct MTexPoly : ElemBase { 222 Image *tpage; 223 char flag, transp; 224 short mode, tile, pad; 225 }; 226 227 // ------------------------------------------------------------------------------- 228 struct MCol : ElemBase { 229 char r, g, b, a FAIL; 230 }; 231 232 // ------------------------------------------------------------------------------- 233 struct MFace : ElemBase { 234 int v1, v2, v3, v4 FAIL; 235 int mat_nr FAIL; 236 char flag; 237 }; 238 239 // ------------------------------------------------------------------------------- 240 struct TFace : ElemBase { 241 float uv[4][2] FAIL; 242 int col[4] FAIL; 243 char flag; 244 short mode; 245 short tile; 246 short unwrap; 247 }; 248 249 // ------------------------------------------------------------------------------- 250 struct MTFace : ElemBase { MTFaceMTFace251 MTFace() : 252 flag(0), 253 mode(0), 254 tile(0), 255 unwrap(0) { 256 } 257 258 float uv[4][2] FAIL; 259 char flag; 260 short mode; 261 short tile; 262 short unwrap; 263 264 // std::shared_ptr<Image> tpage; 265 }; 266 267 // ------------------------------------------------------------------------------- 268 struct MDeformWeight : ElemBase { 269 int def_nr FAIL; 270 float weight FAIL; 271 }; 272 273 // ------------------------------------------------------------------------------- 274 struct MDeformVert : ElemBase { 275 vector<MDeformWeight> dw WARN; 276 int totweight; 277 }; 278 279 // ------------------------------------------------------------------------------- 280 #define MA_RAYMIRROR 0x40000 281 #define MA_TRANSPARENCY 0x10000 282 #define MA_RAYTRANSP 0x20000 283 #define MA_ZTRANSP 0x00040 284 285 struct Material : ElemBase { 286 ID id FAIL; 287 288 float r, g, b WARN; 289 float specr, specg, specb WARN; 290 short har; 291 float ambr, ambg, ambb WARN; 292 float mirr, mirg, mirb; 293 float emit WARN; 294 float ray_mirror; 295 float alpha WARN; 296 float ref; 297 float translucency; 298 int mode; 299 float roughness; 300 float darkness; 301 float refrac; 302 303 float amb; 304 float ang; 305 float spectra; 306 float spec; 307 float zoffs; 308 float add; 309 float fresnel_mir; 310 float fresnel_mir_i; 311 float fresnel_tra; 312 float fresnel_tra_i; 313 float filter; 314 float tx_limit; 315 float tx_falloff; 316 float gloss_mir; 317 float gloss_tra; 318 float adapt_thresh_mir; 319 float adapt_thresh_tra; 320 float aniso_gloss_mir; 321 float dist_mir; 322 float hasize; 323 float flaresize; 324 float subsize; 325 float flareboost; 326 float strand_sta; 327 float strand_end; 328 float strand_ease; 329 float strand_surfnor; 330 float strand_min; 331 float strand_widthfade; 332 float sbias; 333 float lbias; 334 float shad_alpha; 335 float param; 336 float rms; 337 float rampfac_col; 338 float rampfac_spec; 339 float friction; 340 float fh; 341 float reflect; 342 float fhdist; 343 float xyfrict; 344 float sss_radius; 345 float sss_col; 346 float sss_error; 347 float sss_scale; 348 float sss_ior; 349 float sss_colfac; 350 float sss_texfac; 351 float sss_front; 352 float sss_back; 353 354 short material_type; 355 short flag; 356 short ray_depth; 357 short ray_depth_tra; 358 short samp_gloss_mir; 359 short samp_gloss_tra; 360 short fadeto_mir; 361 short shade_flag; 362 short flarec; 363 short starc; 364 short linec; 365 short ringc; 366 short pr_lamp; 367 short pr_texture; 368 short ml_flag; 369 short texco; 370 short mapto; 371 short ramp_show; 372 short pad3; 373 short dynamode; 374 short pad2; 375 short sss_flag; 376 short sss_preset; 377 short shadowonly_flag; 378 short index; 379 short vcol_alpha; 380 short pad4; 381 382 char seed1; 383 char seed2; 384 385 std::shared_ptr<Group> group; 386 387 short diff_shader WARN; 388 short spec_shader WARN; 389 390 std::shared_ptr<MTex> mtex[18]; 391 }; 392 393 /* 394 CustomDataLayer 104 395 396 int type 0 4 397 int offset 4 4 398 int flag 8 4 399 int active 12 4 400 int active_rnd 16 4 401 int active_clone 20 4 402 int active_mask 24 4 403 int uid 28 4 404 char name 32 64 405 void *data 96 8 406 */ 407 struct CustomDataLayer : ElemBase { 408 int type; 409 int offset; 410 int flag; 411 int active; 412 int active_rnd; 413 int active_clone; 414 int active_mask; 415 int uid; 416 char name[64]; 417 std::shared_ptr<ElemBase> data; // must be converted to real type according type member 418 CustomDataLayerCustomDataLayer419 CustomDataLayer() : 420 ElemBase(), 421 type(0), 422 offset(0), 423 flag(0), 424 active(0), 425 active_rnd(0), 426 active_clone(0), 427 active_mask(0), 428 uid(0), 429 data(nullptr) { 430 memset(name, 0, sizeof name); 431 } 432 }; 433 434 /* 435 CustomData 208 436 437 CustomDataLayer *layers 0 8 438 int typemap 8 168 439 int pad_i1 176 4 440 int totlayer 180 4 441 int maxlayer 184 4 442 int totsize 188 4 443 BLI_mempool *pool 192 8 444 CustomDataExternal *external 200 8 445 */ 446 struct CustomData : ElemBase { 447 vector<std::shared_ptr<struct CustomDataLayer>> layers; 448 int typemap[42]; // CD_NUMTYPES 449 int totlayer; 450 int maxlayer; 451 int totsize; 452 /* 453 std::shared_ptr<BLI_mempool> pool; 454 std::shared_ptr<CustomDataExternal> external; 455 */ 456 }; 457 458 // ------------------------------------------------------------------------------- 459 struct Mesh : ElemBase { 460 ID id FAIL; 461 462 int totface FAIL; 463 int totedge FAIL; 464 int totvert FAIL; 465 int totloop; 466 int totpoly; 467 468 short subdiv; 469 short subdivr; 470 short subsurftype; 471 short smoothresh; 472 473 vector<MFace> mface FAIL; 474 vector<MTFace> mtface; 475 vector<TFace> tface; 476 vector<MVert> mvert FAIL; 477 vector<MEdge> medge WARN; 478 vector<MLoop> mloop; 479 vector<MLoopUV> mloopuv; 480 vector<MLoopCol> mloopcol; 481 vector<MPoly> mpoly; 482 vector<MTexPoly> mtpoly; 483 vector<MDeformVert> dvert; 484 vector<MCol> mcol; 485 486 vector<std::shared_ptr<Material>> mat FAIL; 487 488 struct CustomData vdata; 489 struct CustomData edata; 490 struct CustomData fdata; 491 struct CustomData pdata; 492 struct CustomData ldata; 493 }; 494 495 // ------------------------------------------------------------------------------- 496 struct Library : ElemBase { 497 ID id FAIL; 498 499 char name[240] WARN; 500 char filename[240] FAIL; 501 std::shared_ptr<Library> parent WARN; 502 }; 503 504 // ------------------------------------------------------------------------------- 505 struct Camera : ElemBase { 506 enum Type { 507 Type_PERSP = 0, 508 Type_ORTHO = 1 509 }; 510 511 ID id FAIL; 512 513 Type type, flag WARN; 514 float lens WARN; 515 float sensor_x WARN; 516 float clipsta, clipend; 517 }; 518 519 // ------------------------------------------------------------------------------- 520 struct Lamp : ElemBase { 521 522 enum FalloffType { 523 FalloffType_Constant = 0x0, 524 FalloffType_InvLinear = 0x1, 525 FalloffType_InvSquare = 0x2 526 //,FalloffType_Curve = 0x3 527 //,FalloffType_Sliders = 0x4 528 }; 529 530 enum Type { 531 Type_Local = 0x0, 532 Type_Sun = 0x1, 533 Type_Spot = 0x2, 534 Type_Hemi = 0x3, 535 Type_Area = 0x4 536 //,Type_YFPhoton = 0x5 537 }; 538 539 ID id FAIL; 540 //AnimData *adt; 541 542 Type type FAIL; 543 short flags; 544 545 //int mode; 546 547 short colormodel, totex; 548 float r, g, b, k WARN; 549 //float shdwr, shdwg, shdwb; 550 551 float energy, dist, spotsize, spotblend; 552 //float haint; 553 554 float constant_coefficient; 555 float linear_coefficient; 556 float quadratic_coefficient; 557 558 float att1, att2; 559 //struct CurveMapping *curfalloff; 560 FalloffType falloff_type; 561 562 //float clipsta, clipend, shadspotsize; 563 //float bias, soft, compressthresh; 564 //short bufsize, samp, buffers, filtertype; 565 //char bufflag, buftype; 566 567 //short ray_samp, ray_sampy, ray_sampz; 568 //short ray_samp_type; 569 short area_shape; 570 float area_size, area_sizey, area_sizez; 571 //float adapt_thresh; 572 //short ray_samp_method; 573 574 //short texact, shadhalostep; 575 576 //short sun_effect_type; 577 //short skyblendtype; 578 //float horizon_brightness; 579 //float spread; 580 float sun_brightness; 581 //float sun_size; 582 //float backscattered_light; 583 //float sun_intensity; 584 //float atm_turbidity; 585 //float atm_inscattering_factor; 586 //float atm_extinction_factor; 587 //float atm_distance_factor; 588 //float skyblendfac; 589 //float sky_exposure; 590 //short sky_colorspace; 591 592 // int YF_numphotons, YF_numsearch; 593 // short YF_phdepth, YF_useqmc, YF_bufsize, YF_pad; 594 // float YF_causticblur, YF_ltradius; 595 596 // float YF_glowint, YF_glowofs; 597 // short YF_glowtype, YF_pad2; 598 599 //struct Ipo *ipo; 600 //struct MTex *mtex[18]; 601 // short pr_texture; 602 603 //struct PreviewImage *preview; 604 }; 605 606 // ------------------------------------------------------------------------------- 607 struct ModifierData : ElemBase { 608 enum ModifierType { 609 eModifierType_None = 0, 610 eModifierType_Subsurf, 611 eModifierType_Lattice, 612 eModifierType_Curve, 613 eModifierType_Build, 614 eModifierType_Mirror, 615 eModifierType_Decimate, 616 eModifierType_Wave, 617 eModifierType_Armature, 618 eModifierType_Hook, 619 eModifierType_Softbody, 620 eModifierType_Boolean, 621 eModifierType_Array, 622 eModifierType_EdgeSplit, 623 eModifierType_Displace, 624 eModifierType_UVProject, 625 eModifierType_Smooth, 626 eModifierType_Cast, 627 eModifierType_MeshDeform, 628 eModifierType_ParticleSystem, 629 eModifierType_ParticleInstance, 630 eModifierType_Explode, 631 eModifierType_Cloth, 632 eModifierType_Collision, 633 eModifierType_Bevel, 634 eModifierType_Shrinkwrap, 635 eModifierType_Fluidsim, 636 eModifierType_Mask, 637 eModifierType_SimpleDeform, 638 eModifierType_Multires, 639 eModifierType_Surface, 640 eModifierType_Smoke, 641 eModifierType_ShapeKey 642 }; 643 644 std::shared_ptr<ElemBase> next WARN; 645 std::shared_ptr<ElemBase> prev WARN; 646 647 int type, mode; 648 char name[32]; 649 }; 650 651 // ------------------------------------------------------------------------------- 652 struct SubsurfModifierData : ElemBase { 653 654 enum Type { 655 656 TYPE_CatmullClarke = 0x0, 657 TYPE_Simple = 0x1 658 }; 659 660 enum Flags { 661 // some omitted 662 FLAGS_SubsurfUV = 1 << 3 663 }; 664 665 ModifierData modifier FAIL; 666 short subdivType WARN; 667 short levels FAIL; 668 short renderLevels; 669 short flags; 670 }; 671 672 // ------------------------------------------------------------------------------- 673 struct MirrorModifierData : ElemBase { 674 675 enum Flags { 676 Flags_CLIPPING = 1 << 0, 677 Flags_MIRROR_U = 1 << 1, 678 Flags_MIRROR_V = 1 << 2, 679 Flags_AXIS_X = 1 << 3, 680 Flags_AXIS_Y = 1 << 4, 681 Flags_AXIS_Z = 1 << 5, 682 Flags_VGROUP = 1 << 6 683 }; 684 685 ModifierData modifier FAIL; 686 687 short axis, flag; 688 float tolerance; 689 std::shared_ptr<Object> mirror_ob; 690 }; 691 692 // ------------------------------------------------------------------------------- 693 struct Object : ElemBase { 694 ID id FAIL; 695 696 enum Type { 697 Type_EMPTY = 0, 698 Type_MESH = 1, 699 Type_CURVE = 2, 700 Type_SURF = 3, 701 Type_FONT = 4, 702 Type_MBALL = 5 703 704 , 705 Type_LAMP = 10, 706 Type_CAMERA = 11 707 708 , 709 Type_WAVE = 21, 710 Type_LATTICE = 22 711 }; 712 713 Type type FAIL; 714 float obmat[4][4] WARN; 715 float parentinv[4][4] WARN; 716 char parsubstr[32] WARN; 717 718 Object *parent WARN; 719 std::shared_ptr<Object> track WARN; 720 721 std::shared_ptr<Object> proxy, proxy_from, proxy_group WARN; 722 std::shared_ptr<Group> dup_group WARN; 723 std::shared_ptr<ElemBase> data FAIL; 724 725 ListBase modifiers; 726 ObjectObject727 Object() : 728 ElemBase(), type(Type_EMPTY), parent(nullptr), track(), proxy(), proxy_from(), data() { 729 // empty 730 } 731 }; 732 733 // ------------------------------------------------------------------------------- 734 struct Base : ElemBase { 735 Base *prev WARN; 736 std::shared_ptr<Base> next WARN; 737 std::shared_ptr<Object> object WARN; 738 BaseBase739 Base() : 740 ElemBase(), prev(nullptr), next(), object() { 741 // empty 742 // empty 743 } 744 }; 745 746 // ------------------------------------------------------------------------------- 747 struct Scene : ElemBase { 748 ID id FAIL; 749 750 std::shared_ptr<Object> camera WARN; 751 std::shared_ptr<World> world WARN; 752 std::shared_ptr<Base> basact WARN; 753 std::shared_ptr<Collection> master_collection WARN; 754 755 ListBase base; 756 SceneScene757 Scene() : 758 ElemBase(), camera(), world(), basact(), master_collection() { 759 // empty 760 } 761 }; 762 763 // ------------------------------------------------------------------------------- 764 struct Image : ElemBase { 765 ID id FAIL; 766 767 char name[240] WARN; 768 769 //struct anim *anim; 770 771 short ok, flag; 772 short source, type, pad, pad1; 773 int lastframe; 774 775 short tpageflag, totbind; 776 short xrep, yrep; 777 short twsta, twend; 778 //unsigned int bindcode; 779 //unsigned int *repbind; 780 781 std::shared_ptr<PackedFile> packedfile; 782 //struct PreviewImage * preview; 783 784 float lastupdate; 785 int lastused; 786 short animspeed; 787 788 short gen_x, gen_y, gen_type; 789 ImageImage790 Image() : 791 ElemBase() { 792 // empty 793 } 794 }; 795 796 // ------------------------------------------------------------------------------- 797 struct Tex : ElemBase { 798 799 // actually, the only texture type we support is Type_IMAGE 800 enum Type { 801 Type_CLOUDS = 1, 802 Type_WOOD = 2, 803 Type_MARBLE = 3, 804 Type_MAGIC = 4, 805 Type_BLEND = 5, 806 Type_STUCCI = 6, 807 Type_NOISE = 7, 808 Type_IMAGE = 8, 809 Type_PLUGIN = 9, 810 Type_ENVMAP = 10, 811 Type_MUSGRAVE = 11, 812 Type_VORONOI = 12, 813 Type_DISTNOISE = 13, 814 Type_POINTDENSITY = 14, 815 Type_VOXELDATA = 15 816 }; 817 818 enum ImageFlags { 819 ImageFlags_INTERPOL = 1, 820 ImageFlags_USEALPHA = 2, 821 ImageFlags_MIPMAP = 4, 822 ImageFlags_IMAROT = 16, 823 ImageFlags_CALCALPHA = 32, 824 ImageFlags_NORMALMAP = 2048, 825 ImageFlags_GAUSS_MIP = 4096, 826 ImageFlags_FILTER_MIN = 8192, 827 ImageFlags_DERIVATIVEMAP = 16384 828 }; 829 830 ID id FAIL; 831 // AnimData *adt; 832 833 //float noisesize, turbul; 834 //float bright, contrast, rfac, gfac, bfac; 835 //float filtersize; 836 837 //float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain; 838 //float dist_amount, ns_outscale; 839 840 //float vn_w1; 841 //float vn_w2; 842 //float vn_w3; 843 //float vn_w4; 844 //float vn_mexp; 845 //short vn_distm, vn_coltype; 846 847 //short noisedepth, noisetype; 848 //short noisebasis, noisebasis2; 849 850 //short flag; 851 ImageFlags imaflag; 852 Type type FAIL; 853 //short stype; 854 855 //float cropxmin, cropymin, cropxmax, cropymax; 856 //int texfilter; 857 //int afmax; 858 //short xrepeat, yrepeat; 859 //short extend; 860 861 //short fie_ima; 862 //int len; 863 //int frames, offset, sfra; 864 865 //float checkerdist, nabla; 866 //float norfac; 867 868 //ImageUser iuser; 869 870 //bNodeTree *nodetree; 871 //Ipo *ipo; 872 std::shared_ptr<Image> ima WARN; 873 //PluginTex *plugin; 874 //ColorBand *coba; 875 //EnvMap *env; 876 //PreviewImage * preview; 877 //PointDensity *pd; 878 //VoxelData *vd; 879 880 //char use_nodes; 881 TexTex882 Tex() : 883 ElemBase(), imaflag(ImageFlags_INTERPOL), type(Type_CLOUDS), ima() { 884 // empty 885 } 886 }; 887 888 // ------------------------------------------------------------------------------- 889 struct MTex : ElemBase { 890 891 enum Projection { 892 Proj_N = 0, 893 Proj_X = 1, 894 Proj_Y = 2, 895 Proj_Z = 3 896 }; 897 898 enum Flag { 899 Flag_RGBTOINT = 0x1, 900 Flag_STENCIL = 0x2, 901 Flag_NEGATIVE = 0x4, 902 Flag_ALPHAMIX = 0x8, 903 Flag_VIEWSPACE = 0x10 904 }; 905 906 enum BlendType { 907 BlendType_BLEND = 0, 908 BlendType_MUL = 1, 909 BlendType_ADD = 2, 910 BlendType_SUB = 3, 911 BlendType_DIV = 4, 912 BlendType_DARK = 5, 913 BlendType_DIFF = 6, 914 BlendType_LIGHT = 7, 915 BlendType_SCREEN = 8, 916 BlendType_OVERLAY = 9, 917 BlendType_BLEND_HUE = 10, 918 BlendType_BLEND_SAT = 11, 919 BlendType_BLEND_VAL = 12, 920 BlendType_BLEND_COLOR = 13 921 }; 922 923 enum MapType { 924 MapType_COL = 1, 925 MapType_NORM = 2, 926 MapType_COLSPEC = 4, 927 MapType_COLMIR = 8, 928 MapType_REF = 16, 929 MapType_SPEC = 32, 930 MapType_EMIT = 64, 931 MapType_ALPHA = 128, 932 MapType_HAR = 256, 933 MapType_RAYMIRR = 512, 934 MapType_TRANSLU = 1024, 935 MapType_AMB = 2048, 936 MapType_DISPLACE = 4096, 937 MapType_WARP = 8192 938 }; 939 940 // short texco, maptoneg; 941 MapType mapto; 942 943 BlendType blendtype; 944 std::shared_ptr<Object> object; 945 std::shared_ptr<Tex> tex; 946 char uvname[32]; 947 948 Projection projx, projy, projz; 949 char mapping; 950 float ofs[3], size[3], rot; 951 952 int texflag; 953 short colormodel, pmapto, pmaptoneg; 954 //short normapspace, which_output; 955 //char brush_map_mode; 956 float r, g, b, k WARN; 957 //float def_var, rt; 958 959 //float colfac, varfac; 960 961 float norfac; 962 //float dispfac, warpfac; 963 float colspecfac, mirrfac, alphafac; 964 float difffac, specfac, emitfac, hardfac; 965 //float raymirrfac, translfac, ambfac; 966 //float colemitfac, colreflfac, coltransfac; 967 //float densfac, scatterfac, reflfac; 968 969 //float timefac, lengthfac, clumpfac; 970 //float kinkfac, roughfac, padensfac; 971 //float lifefac, sizefac, ivelfac, pvelfac; 972 //float shadowfac; 973 //float zenupfac, zendownfac, blendfac; 974 MTexMTex975 MTex() : 976 ElemBase() { 977 // empty 978 } 979 }; 980 981 } // namespace Blender 982 } // namespace Assimp 983 #endif 984