Compare commits
3640 Commits
issue_3165
...
master
Author | SHA1 | Date |
---|---|---|
Pichas | f4c7606faf | |
Kim Kulling | 66187a77cf | |
PatrickD | 5c7acc968b | |
Lux | f81ea6986c | |
dataisland | ab12e8d8ba | |
dataisland | 3bd98611d7 | |
dataisland | d468e633b1 | |
Kim Kulling | 4024726eca | |
Kim Kulling | cd0ef869e3 | |
RichardTea | ed3fccd5db | |
Matthias Möller | ff2dc2fb2e | |
Tobias Rittig, Ph.D. | f69e55058d | |
RichardTea | c1ffbfec06 | |
Kim Kulling | c35200e38e | |
Kim Kulling | 1e09642382 | |
Kim Kulling | edaf87f186 | |
Olivier Chafik | 88340d0ce0 | |
Fav | 5e912e68da | |
Vincent Fazio | ae0ff8a88a | |
Aliaksandr Kasmachou | 924106188e | |
Haixi | 389bdedda7 | |
Olivier Chafik | f39f53e860 | |
OGAWA KenIchi | 11daaf79a5 | |
Matthias Möller | 3e7e4c8c52 | |
Vincent Fazio | 4338817ca2 | |
dependabot[bot] | fd7ad4a9d8 | |
dependabot[bot] | a7a424e0a7 | |
dependabot[bot] | f0ca4df704 | |
imdongye | d32370ff12 | |
Sanchikuuus | 12ed0286e4 | |
Kim Kulling | bb9db8409f | |
sacereda | d83904e3ee | |
Kim Kulling | bc6710a116 | |
OGAWA KenIchi | 10e97b2f4a | |
Steve M | d95a5c60ef | |
Matthias Möller | 12cdbb712c | |
Måns Andersen | b992ff278b | |
Måns Andersen | 9485d49e93 | |
RichardTea | f950f61a52 | |
RichardTea | afe06f2298 | |
mkuritsu | d41b6b253d | |
Nathan V. Morrical | 09b981d943 | |
Kimbatt | 48c3a0ec46 | |
Kim Kulling | a37d748c17 | |
Kim Kulling | e63d3ed8e7 | |
Kim Kulling | 104a70f845 | |
Florian Born | 76de7cedf4 | |
JensEhrhardt-eOPUS | c55158cd82 | |
Kim Kulling | 571ba09dc7 | |
Kim Kulling | db19f62a0c | |
Stoyan Gaydarov | 5d5e0bad3c | |
Kim Kulling | 9cf03b4ddc | |
Vincent Fazio | 91e93578c7 | |
Kim Kulling | da281b7f48 | |
Kim Kulling | 35e4f1bf64 | |
Steve M | 0cb1693689 | |
Kim Kulling | d3bec44990 | |
Kim Kulling | b0aae04801 | |
Stepan Hrbek | 206839d4f2 | |
Kim Kulling | 193f2c5d87 | |
Kim Kulling | bff00b15f1 | |
Matthias Möller | d5cb1fe01f | |
Kim Kulling | fe6e25080b | |
Kim Kulling | ddb74c2bbd | |
Brad D | 625528d02c | |
Markus Prettner | 7e053cc641 | |
Matthias Möller | 35976a4eb4 | |
ThatOSDev | dd1474e280 | |
Matthias Möller | 0b19b7d73b | |
Julian Knodt | d0703a5a3a | |
Kim Kulling | cdf8394ccc | |
Garux | dd10fb6ee4 | |
Stepan Hrbek | adff2f388a | |
ycn2022 | 0afd366dcb | |
michaelsctts | 77f7706a97 | |
Kim Kulling | 5c2a33f230 | |
mosfet80 | 0cef794abd | |
Kim Kulling | 07ab05cc41 | |
Kim Kulling | a51500ba2b | |
mosfet80 | 75091d4529 | |
Kim Kulling | 907da122e9 | |
Kim Kulling | 81858f9e62 | |
Kim Kulling | 97cbecb859 | |
Kim Kulling | a722e33027 | |
Kim Kulling | 75a10fedd0 | |
Kim Kulling | e963a863ce | |
Bradly Landucci | 8231d99a85 | |
Kim Kulling | 0d546b3d2e | |
Kim Kulling | 43634b8b27 | |
mosfet80 | 83d7216726 | |
Daniel Simon | 329fee2f0b | |
Kim Kulling | 4584719362 | |
Kim Kulling | 30466aaf16 | |
vengine | ec5242a1a0 | |
Daniel Simon | 6fa4f0ff5e | |
Kim Kulling | fd3f092d6e | |
Jean-Louis Boudrand | 787c9afdf7 | |
Kim Kulling | 2521909b8c | |
Kim Kulling | 04afb63d34 | |
Kim Kulling | 942518a4ff | |
Kim Kulling | 10df90ec14 | |
Julian Uy | b6d53a0047 | |
Kim Kulling | 001bb01eb2 | |
Kim Kulling | 325b0a543f | |
Garux | 47dbabadcd | |
Kim Kulling | c953739487 | |
Garux | 00b6db86ab | |
陈瑞锋 | 4621676424 | |
Johannes Unterguggenberger | 47ef79672e | |
Kim Kulling | c05895f3c7 | |
Succ3s | 7bda0f88ca | |
Zeun | b71b8f77ee | |
Kim Kulling | 85f084a4ce | |
Stephen Gold | 08c1adc015 | |
mosfet80 | 3ff7851ff9 | |
mosfet80 | 64d88276ef | |
Alex Rønne Petersen | b8aa68a080 | |
Kim Kulling | 8b9ed34eaa | |
Kim Kulling | b41ffa5561 | |
mosfet80 | 4a3e0e46ac | |
Tom Heaton | 1f920ee1fe | |
mosfet80 | 778ce90a04 | |
Alejandro González | 790aad4b62 | |
RoboSchmied | 52c2b6896a | |
Oleg Ivanov | 9d11b220eb | |
Julian Knodt | 39ce0c0456 | |
Kristjan Skutta | feb861f17b | |
mosfet80 | 730aa9d0b7 | |
mosfet80 | 072320df4f | |
Kim Kulling | fcb1444b84 | |
Laura Hermanns | 727774f181 | |
Bao Anchang | bb9101ae9e | |
sSsA01 | f95050e7aa | |
Kim Kulling | 01231d0e60 | |
Kim Kulling | 0664882763 | |
Kim Kulling | 4d6dd80257 | |
Kim Kulling | 94bc568d13 | |
Adam Mizerski | 4b9f46dbda | |
Séverin Lemaignan | a3708e3464 | |
Emily Banerjee | ff5b0ae575 | |
fvbj | 2d98f6a880 | |
Julian Knodt | c877a15140 | |
mosfet80 | 1164844ce4 | |
dependabot[bot] | a8c8e75a17 | |
Florian Born | f59a5fab1a | |
Galen Xiao | b7b6601a75 | |
Stephen Gold | bc6673b4b2 | |
Steve M | 005399a671 | |
Kim Kulling | 3990ec80a1 | |
Kim Kulling | 3476c79801 | |
Kim Kulling | f956351942 | |
Kim Kulling | c08e3b4abb | |
Kim Kulling | d5f35582d4 | |
tigertang | a02085ea98 | |
Kim Kulling | a8d30f7e91 | |
Kim Kulling | c6fe03f7a5 | |
seanth | 8cde65bfe8 | |
seanth | 240fa97fed | |
seanth | 727001b0ca | |
julianknodt | bdc08dd4a9 | |
Stephen Gold | ac29847d56 | |
Robert Reif | 81c20a5c61 | |
Andre Schulz | 74af43f655 | |
Andre Schulz | 9d71a275c3 | |
Kim Kulling | c8ca1a48ec | |
Steve M | ea9aa863ff | |
Steve M | cb8150b3e8 | |
copycd | b571501559 | |
Hamza | 6a0e1d5467 | |
tangxin | 9776d47cca | |
dependabot[bot] | ec122eb348 | |
copycd | 6bcdf989fb | |
Kim Kulling | 5cbdb6c63b | |
Kim Kulling | 636fbd65b3 | |
Kim Kulling | 263bebb5ba | |
Kim Kulling | 5d5496f1ad | |
Kim Kulling | 69dae9599a | |
Kim Kulling | 9dddef9b9d | |
Kim Kulling | b9576e6992 | |
Kim Kulling | 274f64cbf1 | |
Kim Kulling | 7b54b0f406 | |
Alexander Wagner | df33d33e8f | |
Marka Ragnos | 3ce8a58d41 | |
Alexander Wagner | d03ab3ef27 | |
Alexander Wagner | e86f1acb9b | |
Alexander Wagner | 4034df8b6e | |
Kim Kulling | 88084a67fc | |
Alexey Medvedev | 762ad8e9b7 | |
Alexey Medvedev | dc399f7343 | |
Alexey Medvedev | a72289b327 | |
Stephen Gold | 213d73ebc6 | |
Futuremappermydud | a0b3df6dbd | |
Stephen Gold | 769e82ce5e | |
Maksim Kostin | d311fa95c6 | |
Stephen Gold | e765862d24 | |
Maksim Kostin | f701d702e4 | |
ccn | a63a6011c5 | |
IOhannes m zmölnig | 6f715edfa0 | |
IOhannes m zmölnig | bfdd154d14 | |
IOhannes m zmölnig | 6f70e220e4 | |
Kim Kulling | 85f64c9131 | |
Kim Kulling | 01f2549abe | |
Kim Kulling | 384db8686e | |
Kim Kulling | 77a8f019e3 | |
ccn | 254619901b | |
ccn | 56e0ba58e1 | |
Alexandre Avenel | e4e2c63e0c | |
Alexandre Avenel | bfe8745b90 | |
Alexandre Avenel | aae93691b9 | |
Florian Born | 6004290dde | |
Wojciech Matyjewicz | 069e19487c | |
Wojciech Matyjewicz | 2235518b3c | |
copycd | 8648c2af45 | |
Kim Kulling | f0e7448fdc | |
julianknodt | 9efbbe0a69 | |
Kim Kulling | 4535e37fc6 | |
Kim Kulling | 8cf2d6e588 | |
Kim Kulling | aa3abb3c06 | |
Kim Kulling | 0b0ec713f6 | |
julianknodt | 28ab0a094a | |
Tárcio Vinícius | 46b19cc6a4 | |
Martin Aumüller | a521b23ab5 | |
Kim Kulling | 108e3192a2 | |
Kim Kulling | f844c3397d | |
Pavel Lukandiy | a7cfa3264a | |
Kim Kulling | c1deb808fa | |
Kim Kulling | 25aee03f66 | |
Sébastien Loriot | c44e3427aa | |
julianknodt | 1169d3bc8c | |
David Marčinković | 945c77d699 | |
Kim Kulling | 020554e213 | |
Kim Kulling | 2a347014f3 | |
Kim Kulling | a531c72f7f | |
Kawashima Satoshi | 666ecd3f1f | |
Kim Kulling | 5d60cf228a | |
Kim Kulling | 2f78d48d6b | |
Kim Kulling | 3c1423d5a5 | |
Kim Kulling | 1ee13872b1 | |
Kim Kulling | 01322ec831 | |
fvbj | 8fcc65a8af | |
Kim Kulling | 5b8cfa920b | |
Kim Kulling | d7cde43367 | |
ockeymm | 7b6bf139cf | |
ockeymm | b2bfe6d253 | |
ockeymm | 7a4d8ec412 | |
Begasus | 7a26433846 | |
mosfet80 | 6a08c39e3a | |
Stephen Gold | 4b193dbee3 | |
Kim Kulling | f9d3e7015b | |
mosfet80 | f1b8df01d5 | |
Kim Kulling | c421247be9 | |
Kim Kulling | cebb06280d | |
Kim Kulling | 967d61edc5 | |
Kim Kulling | 997d380c3a | |
Kim Kulling | 13945a5c5b | |
Kim Kulling | e5e3e07b84 | |
Kim Kulling | bad725ec86 | |
Kim Kulling | fb23ef7c02 | |
Kim Kulling | 0c5138cb39 | |
Kim Kulling | 9d12dd6df3 | |
Kim Kulling | 7fb4b24cb5 | |
Батхишиг | fa71b84c1c | |
Kim Kulling | 59b1234496 | |
FailCake | f9f7ab0658 | |
dependabot[bot] | c7307ae84d | |
Kim Kulling | c4d3c1dd67 | |
Kim Kulling | 2af4247260 | |
Kim Kulling | aa1996e143 | |
Kim Kulling | 3cf7d28bc4 | |
mosfet80 | c3544f1f98 | |
Kim Kulling | 0ff0bd7a6e | |
OGAWA KenIchi | 8d8a0a5af7 | |
Kim Kulling | e673d1fd9e | |
Kim Kulling | e41fe74b2a | |
Kim Kulling | 8c8f974ea3 | |
Kim Kulling | f623870dd1 | |
Kim Kulling | e79d105957 | |
Kim Kulling | 0afaf976b9 | |
Kim Kulling | b52731c707 | |
Kim Kulling | 97227d7a4c | |
Kim Kulling | cc2c5d3ae3 | |
Kim Kulling | 2f6f58707d | |
Kim Kulling | b9ea538e6f | |
Kim Kulling | 215caa65aa | |
Kim Kulling | 80a03071ba | |
Kim Kulling | fa69c47d45 | |
Kim Kulling | fe6730f225 | |
Kim Kulling | 60b6d80936 | |
Kim Kulling | c953c9b76f | |
AnyOldName3 | e50233b2c1 | |
tangxin | 4389c3d80c | |
zhucan | d07934bf25 | |
zhucan | 554fa8f5e2 | |
zhucan | 2b4606c082 | |
朱灿 | 3a03fe31b1 | |
zhucan | 32716002ac | |
Alex | 081cae6a95 | |
Alex | 7cbf4c4136 | |
Alex | bc7ef58b49 | |
Kim Kulling | 72c10d856f | |
Alex | 5c45cdc0ad | |
Kim Kulling | 3a02de4d28 | |
Kim Kulling | d77903423f | |
Aaron | 0bfc588c39 | |
PencilAmazing | 2e60cb6ae6 | |
Kim Kulling | 556c89b5f1 | |
Kim Kulling | e5d9339c21 | |
Kim Kulling | 461601e9ff | |
Kim Kulling | 1c5dc86afb | |
Martin Weber | d8a7399a04 | |
Kim Kulling | df9c5cdb9f | |
Kim Kulling | 79dcc289d0 | |
Kim Kulling | aa5b41446c | |
Pavel Rojtberg | 20a2cc4c94 | |
Pavel Rojtberg | 2baadf2fe5 | |
Alex | b9460dd959 | |
Gargaj | 49ed0711d1 | |
Gargaj | 8312b31d27 | |
Martin Weber | bb1873dd22 | |
Alex | f7e7f82b9d | |
PencilAmazing | b5032db741 | |
PencilAmazing | d6edfad8bb | |
PencilAmazing | cf5ffdc366 | |
Alex | d7dc88e0d0 | |
Kim Kulling | 60989a598e | |
Kim Kulling | 439b3369c1 | |
sfjohnston | dd40b0ccee | |
sfjohnston | 3ec8a36764 | |
Kim Kulling | 131bc61d47 | |
Kim Kulling | d05dbfa8c9 | |
Kim Kulling | 20cb815290 | |
Kim Kulling | 0ab7de70cd | |
Marco Feuerstein | 37a1366fb7 | |
Marco Feuerstein | 52e5c3f39e | |
Kim Kulling | 64e0ba2625 | |
Kim Kulling | bf7ccb6206 | |
Kim Kulling | a5a4090989 | |
Kim Kulling | 8c871ed4f0 | |
Jérôme Leclercq | 46be2d3380 | |
Steve M | ca7f6de671 | |
Steve M | 3161f0e754 | |
Kim Kulling | 5b7ff294b8 | |
Kim Kulling | 16021ef9ac | |
Marco Feuerstein | 0e7cd18c8b | |
Kim Kulling | f66a7fd6bf | |
Steve M | 1e6c7063b6 | |
Marco Feuerstein | bf38d67935 | |
Kim Kulling | cf7d363766 | |
Kim Kulling | 11f024b395 | |
Kim Kulling | 53846430ce | |
sfjohnston | c7afea3cd7 | |
Kim Kulling | e2b19ef776 | |
Kim Kulling | fe49a9ed94 | |
Marco Feuerstein | 87cac888e4 | |
Marco Feuerstein | bdde968677 | |
Marco Feuerstein | 506baa21e6 | |
Marco Feuerstein | 0256047168 | |
Kim Kulling | 3423949490 | |
Kim Kulling | e08cb0b5b8 | |
PencilAmazing | 668db327f4 | |
Marco Feuerstein | 8b005eaa83 | |
Kim Kulling | 6308de6e5b | |
Kim Kulling | 90ff723b6c | |
Kim Kulling | 9a94b26cdc | |
Kim Kulling | ed903543a7 | |
Kim Kulling | d3ee157342 | |
Kim Kulling | a5bb4b59e4 | |
Alex | 093e35dd54 | |
Alex | edb8375702 | |
Kim Kulling | 0dcfe2f72c | |
Kim Kulling | d1ad4e54d7 | |
Kim Kulling | 5770faac10 | |
PencilAmazing | f1561f03ce | |
PencilAmazing | 57306bcd63 | |
PencilAmazing | 96eb87265e | |
PencilAmazing | 0bacc7134d | |
PencilAmazing | 19da9cc84d | |
dog | 3e1fd74940 | |
Kim Kulling | 7d542eb795 | |
PencilAmazing | 537b445a59 | |
Alex | 6f3bfb5b60 | |
Alex | 3838a8aaf8 | |
Kim Kulling | e4cac7d00b | |
Kim Kulling | 8a65dcc19e | |
Kim Kulling | 3e74453b69 | |
Kim Kulling | 42386b829c | |
Kim Kulling | b44dfd5ecf | |
Kim Kulling | b61fc49c30 | |
Marco Feuerstein | 82d3f47432 | |
Marco Feuerstein | b2cad5c58d | |
Marco Feuerstein | d1edaa949b | |
Abdelhadi | ac2cf2f71b | |
Marco Feuerstein | 59f2620164 | |
Marco Feuerstein | 261c7769b8 | |
Marco Feuerstein | 2875de132f | |
Marco Feuerstein | 17fac97b04 | |
Marco Feuerstein | 1c0f3c5f87 | |
Marco Feuerstein | a2bdfdd05a | |
Kim Kulling | 03934128fc | |
Kim Kulling | 7ae88225b3 | |
Kim Kulling | 5a568d485c | |
Kim Kulling | 507a3d2f8d | |
Kim Kulling | 876b1a0d6e | |
Kim Kulling | c9111fe89a | |
Kim Kulling | e7a0985886 | |
Kim Kulling | f55eebad06 | |
Kim Kulling | 8f61427880 | |
Kim Kulling | 1ec3dbd11a | |
Kim Kulling | 1791eac7ff | |
mosfet80 | 3da92e05eb | |
Kim Kulling | f24224fdc5 | |
Kim Kulling | d2411a7ecd | |
Tomas Maly | 5d3f3281f4 | |
Kim Kulling | db6c1a8b1c | |
Kim Kulling | 8937248f7c | |
Kim Kulling | ef6bf03acd | |
Kim Kulling | 27c4de3419 | |
Kim Kulling | 141e278e1f | |
Kim Kulling | 41e2b0f5dc | |
Kim Kulling | 1830a8aad2 | |
Kim Kulling | 47575f759f | |
Kim Kulling | ff36ea7e23 | |
Kim Kulling | bce2fdbbe9 | |
Kim Kulling | b1181b1086 | |
Kim Kulling | 96d0c0769e | |
Kim Kulling | 7005a9caa2 | |
Kim Kulling | ed0dff2a7e | |
Kim Kulling | 6b1a2e91d5 | |
Kim Kulling | 4a658202ca | |
Kim Kulling | 438f9fe568 | |
Kim Kulling | 1477f696e0 | |
Kim Kulling | 3545aab937 | |
mosfet80 | 46ea0a7d7c | |
mosfet80 | 26c4505c53 | |
Séverin Lemaignan | a4258929ce | |
Andrea Reale | 86c332fec7 | |
Andrea Reale | 8a3ec3ca2f | |
Andrea Reale | ce59d49dd9 | |
Andrea Reale | 8741da2036 | |
Kim Kulling | bd65af0d44 | |
Kim Kulling | b94392d199 | |
Kim Kulling | 63e1b071df | |
Kim Kulling | 6502b97d3e | |
Kim Kulling | 3d19cd9362 | |
Kim Kulling | 9c9d72169f | |
Kim Kulling | 7f0c388ad8 | |
Kim Kulling | 10059e6431 | |
emaame | 22c8d97b54 | |
Scott Johnston | aab3c8010c | |
Kim Kulling | 9c54540a19 | |
Kim Kulling | 693d681813 | |
Kim Kulling | 3939d35f18 | |
Alex | 36dfa3bed3 | |
Alex | b158b716d1 | |
Alex | 9ef71fe231 | |
Alex | 5bb1c6debd | |
Alex | b3a1c72c8f | |
Alex | 646d3591b6 | |
Alex | 496a4bf156 | |
Alex | 8012657169 | |
Alex | dbd15fd351 | |
Alex | 86aecf395e | |
Alex | c6c95b69f6 | |
Alex | 54b0c00418 | |
Alex | f897b0c461 | |
Kim Kulling | 4180b1fd08 | |
Kim Kulling | 3ccf242bdb | |
Kim Kulling | feb0303fd0 | |
Kim Kulling | bef66deeda | |
Kim Kulling | 1ab4161cd7 | |
Kim Kulling | 186d7fd606 | |
Kim Kulling | 9950bb4ed6 | |
Kim Kulling | 11dede8fc4 | |
Kim Kulling | d5844f26b5 | |
Kim Kulling | 839bed3274 | |
Alex | 4c16a6a16b | |
Kim Kulling | 49a6eec294 | |
Kristjan Skutta | cb86029153 | |
Kim Kulling | d9268dcf96 | |
Kim Kulling | 02d5ab294c | |
Alex | f5683b6f3a | |
mosfet80 | 05ab5c2e3b | |
Kim Kulling | 513e62e1c9 | |
Alex | 23f9990b22 | |
Kim Kulling | 915e146307 | |
Alex | 5cc4a61d66 | |
Alex | 6c5fe9d76f | |
Alex | 57a55aa4d4 | |
Alex | f4d3b6e862 | |
mosfet80 | 62cefd5b27 | |
Alex | d3506c24e7 | |
Kim Kulling | e30823fb1d | |
Kim Kulling | b6c0fdd6e0 | |
Kim Kulling | d9a8837a5b | |
Kim Kulling | 628dde4a91 | |
Kim Kulling | c22ddfda2b | |
Kim Kulling | 1538669f70 | |
Alex | 4cc70cb73c | |
Alex | 54f5d01190 | |
Alex | c3e69b5b82 | |
mosfet80 | 462755e5ba | |
mosfet80 | 1f5c7da822 | |
Kim Kulling | bee751b5f9 | |
Kim Kulling | 466f6960ac | |
Kim Kulling | 17c1a9125f | |
Kim Kulling | 0b53243b8f | |
Kim Kulling | f43cfa1fba | |
Kim Kulling | 0f4667fce4 | |
Kim Kulling | ca848c5b09 | |
Kim Kulling | 0794b41d55 | |
Kim Kulling | d73595b85d | |
mosfet80 | e4621a3142 | |
Samuel Kogler | 0fbd2f5894 | |
Kim Kulling | 9f593d70b5 | |
Kim Kulling | b7a8c4ba75 | |
Kim Kulling | 3a09fd0c85 | |
Kim Kulling | e947471549 | |
Kim Kulling | 0e06a5f945 | |
Kim Kulling | 03163a1dda | |
Kim Kulling | 7e16d4046e | |
Kim Kulling | 0dfd491d97 | |
Kim Kulling | 9c45f727e3 | |
Kim Kulling | 18b6cffe14 | |
Kim Kulling | 94905d445f | |
Kim Kulling | 71a4977dd1 | |
Kim Kulling | 8ad4bb0b2c | |
Kim Kulling | b5b6400320 | |
Kim Kulling | aed43878ef | |
Kim Kulling | ad399adf4b | |
Kim Kulling | 121f09b62a | |
Kim Kulling | 0c4d5909f8 | |
Kim Kulling | e627f691a8 | |
Kim Kulling | f3e5a4835d | |
Kim Kulling | 478ce8af5a | |
Kim Kulling | 9d6b32f5c5 | |
Kim Kulling | 41102eeda6 | |
Lutz Hören | 9ea37b5330 | |
Kim Kulling | ade4514752 | |
Florian Born | d825eb7cf0 | |
Mathieu Westphal | 69145c8929 | |
Kim Kulling | cb22d531a6 | |
Kim Kulling | 8cbfb44e9c | |
Kim Kulling | 1243325f10 | |
Kim Kulling | 75d024c91b | |
Kim Kulling | 167d811ff7 | |
Kim Kulling | d58201a579 | |
Jackie9527 | fbf8799cb5 | |
Samuel Kogler | 55cb19f924 | |
Samuel Kogler | f32c21e6b3 | |
Kim Kulling | b8877798ed | |
Kim Kulling | c50b87fa6c | |
Kim Kulling | 92aa22e902 | |
ParkBook | a923d1f89b | |
Jackie9527 | 92d426de2b | |
Jackie9527 | 51494e1b4f | |
Jackie9527 | cdefc9f7aa | |
Jackie9527 | cabf3a5d17 | |
Jackie9527 | a8e7c23605 | |
Kim Kulling | 5c5b0f97b7 | |
Suhajda Tamás | 71043ec164 | |
Kim Kulling | cea40f293a | |
Kim Kulling | 230bee2e34 | |
Kim Kulling | 6442158676 | |
Kim Kulling | cf89990569 | |
Kim Kulling | 9c2594a1dc | |
Kim Kulling | 07aae9eaee | |
Kim Kulling | 4dc341955a | |
Kim Kulling | 71366fff8e | |
Kim Kulling | ee6e05bb86 | |
Kim Kulling | 965ebaf78b | |
Kim Kulling | 97addc7cdc | |
Kim Kulling | 1ecb8e9196 | |
Dan Rosser | cd9de860ce | |
Kim Kulling | 87a288ebd3 | |
Jackie9527 | ff17f1fe3d | |
Jackie9527 | 46677b835c | |
Jackie9527 | 1244e58274 | |
Jackie9527 | 5738b3d172 | |
Jackie9527 | 739cf15a1e | |
Jackie9527 | c0947b704e | |
Jackie9527 | 1b826afeda | |
Jackie9527 | 4d962057e5 | |
Jackie9527 | 12bc34a45c | |
Jackie9527 | 0a05a1f17f | |
Jackie9527 | cec41f6dd5 | |
Jackie9527 | 7620a69e3e | |
Jackie9527 | 9e80dfc42d | |
Jackie9527 | 01488046e6 | |
Kim Kulling | b1afa41047 | |
Kim Kulling | 1517983ab5 | |
Kim Kulling | 45946ec01b | |
Kim Kulling | fd59a2209b | |
Kim Kulling | 9e056218cf | |
Kim Kulling | d51f033e20 | |
Kim Kulling | 074af85734 | |
Kim Kulling | 133f730c11 | |
Kim Kulling | 0023f9b09a | |
Kim Kulling | ca937788ee | |
Kim Kulling | 333f7d5ee0 | |
Kim Kulling | aee4df9be8 | |
Kim Kulling | 5d841ec9a5 | |
Kim Kulling | 13c9db2310 | |
Kim Kulling | 8bc64ec147 | |
Kim Kulling | 8cf74c7663 | |
Kim Kulling | 7e8aabcbb4 | |
Adam Beili | e193220ad8 | |
Suhajda Tamás | 3dd08cdd60 | |
Suhajda Tamás | 74509ef8bd | |
Jackie9527 | d4c21ba9a8 | |
Jackie9527 | 116ceeca31 | |
Jackie9527 | a7cb3b4dbb | |
Jackie9527 | 55c6eaee0c | |
Jackie9527 | 502bceb6e8 | |
Jackie9527 | a87585668d | |
Steve M | 5b2f78ac20 | |
Suhajda Tamás | 23a3e8cf2d | |
Kim Kulling | 679eb972e6 | |
Kim Kulling | 89ccc89298 | |
Kim Kulling | 8705940801 | |
Kim Kulling | 1733d9f795 | |
Kim Kulling | 17d8e991cc | |
Kim Kulling | 17bdd5f9b5 | |
Kim Kulling | 414091ab11 | |
Kim Kulling | e6f26fc52e | |
Kim Kulling | ccbcf15a21 | |
Kim Kulling | 4e34e77226 | |
Steve M | f68f1f6bf2 | |
Suhajda Tamás | 9d76493ad8 | |
Kim Kulling | a259277498 | |
Kim Kulling | f2efcd77bc | |
Suhajda Tamás | 9915e875bf | |
Kim Kulling | 8aa959fa19 | |
Kim Kulling | ca79916048 | |
Kim Kulling | d6885d4025 | |
Kim Kulling | 19ff57a6c3 | |
Kim Kulling | df21b6799f | |
Ani | ae121bfbb0 | |
Steve M | 70aceb203a | |
liedtkeInTUM | 97e31a895e | |
Kim Kulling | 9fba0ee31b | |
Kim Kulling | acdb6684ba | |
Steve M | 9c5ab67b64 | |
Jackie9527 | dacaebc078 | |
Jackie9527 | bddb4559a1 | |
Jackie9527 | 7df4efea44 | |
Jackie9527 | e36812a449 | |
Jackie9527 | 87c309566f | |
Steve M | 6d668382ec | |
Steve M | e1678f11e6 | |
Jackie9527 | 20b2f857c5 | |
Jackie9527 | 4d2512dcae | |
Jackie9527 | 04066ece8e | |
Jackie9527 | 1dcb5da1cd | |
Jackie9527 | 94067994cc | |
Jackie9527 | 6b54761310 | |
Sven Liedtke | 5cf9d3abf7 | |
Kim Kulling | 7c64b6c599 | |
Kim Kulling | 203e1468df | |
Kim Kulling | 9c17c8c39a | |
liedtkeInTUM | d032c3162a | |
Sven Liedtke | 6d65e9c393 | |
Kim Kulling | 85b470a3ee | |
Kim Kulling | 6fa2f86d6b | |
Kim Kulling | 4daf8c36bc | |
aniongithub | 4438b3ecc9 | |
Kim Kulling | 5d6ca9808d | |
Kim Kulling | 55fa3d4251 | |
Kim Kulling | 3801d7e78f | |
Kim Kulling | f4e9930e50 | |
Adam Beili | 8ac0af5c58 | |
Adam Beili | b6ecba9114 | |
Adam Beili | 83053f3d56 | |
Adam Beili | fa00571049 | |
Kim Kulling | d8201bdb6f | |
Adam Beili | c9177b7811 | |
Turo Lamminen | 6832aa227a | |
Turo Lamminen | bed2cf1a23 | |
Turo Lamminen | e8d4a11af5 | |
Turo Lamminen | 0e657b575b | |
Kim Kulling | e02a1ff577 | |
Kim Kulling | e6c63cbee2 | |
Kim Kulling | 03aee802b2 | |
inhosens | 7095c4f52f | |
Steve M | fc1a88deb4 | |
Kim Kulling | f43281e89b | |
Kim Kulling | 7437f20d0a | |
Kim Kulling | c32f4b71b7 | |
Turo Lamminen | 5ddd18d1c7 | |
inhosens | 7cc0c06fdb | |
Steve M | 9552769f82 | |
Kim Kulling | c546a4a73a | |
Kim Kulling | 4e645a0412 | |
Kim Kulling | cf3c9d515a | |
Kim Kulling | d8e2fc30a0 | |
Steve M | d902c2293d | |
Kim Kulling | 6360c90ac0 | |
Kim Kulling | f81bb90f89 | |
Turo Lamminen | 65440f17a1 | |
Turo Lamminen | ea3cc37890 | |
Turo Lamminen | 48d89622ee | |
Inho Lee | cdfdd75a66 | |
Kim Kulling | 6da160f14d | |
Kim Kulling | e7e4e3100f | |
Turo Lamminen | 3a69e353f3 | |
Steve M | 92409a821d | |
Steve M | e2063b3ba6 | |
Steve M | 95616cf5b5 | |
Kim Kulling | e394bda707 | |
Kim Kulling | 5a4f7c0a37 | |
Kim Kulling | 435181f5f5 | |
Kim Kulling | 88f3b950c7 | |
Kim Kulling | 16f9ba4935 | |
Kim Kulling | b5f68d73ab | |
Kim Kulling | da1ec4de91 | |
Kim Kulling | 7e5a178637 | |
Kim Kulling | c537bd78d0 | |
Kim Kulling | 59d9711928 | |
Kim Kulling | 45c1da26b3 | |
Kim Kulling | 31ae9cde1c | |
Kim Kulling | 1147f0c8bd | |
Kim Kulling | 2acfc125c3 | |
Marc-Antoine Lortie | eb3b48e523 | |
Marc-Antoine Lortie | 25ab05eb49 | |
Marc-Antoine Lortie | 4c015077b8 | |
Marc-Antoine Lortie | 054dacd068 | |
Marc-Antoine Lortie | 7bc4c12956 | |
Marc-Antoine Lortie | d500f60490 | |
Marc-Antoine Lortie | 3c2a425869 | |
Marc-Antoine Lortie | 4b4cb55f22 | |
Kim Kulling | fdcc45d010 | |
Kim Kulling | 3840c8bd8d | |
Florian Born | 8176c6a0e4 | |
Kim Kulling | 6e1959f061 | |
Kim Kulling | c9539f67e3 | |
Florian Born | 60cefdd549 | |
Kim Kulling | e308474163 | |
Kim Kulling | ffd222334f | |
Kim Kulling | 2f7882cb8d | |
Kim Kulling | 63dae0a7f2 | |
Kim Kulling | c82a6d05b0 | |
Florian Born | dfd70b5c10 | |
Kim Kulling | 0ed957f70a | |
Kim Kulling | 348e672567 | |
Turo Lamminen | f3767a4eb2 | |
Turo Lamminen | b534584198 | |
Kim Kulling | 980e156251 | |
Kim Kulling | 366243f7ef | |
Kim Kulling | 05249353d4 | |
Kim Kulling | 8476a2c832 | |
Kim Kulling | 8c9580cfd3 | |
Urs Hanselmann | 8fb83af079 | |
Kim Kulling | 3a73ce37e4 | |
Kim Kulling | 4f48348af8 | |
Florian Born | 069b3ecdf8 | |
Kim Kulling | 44c2785663 | |
Kim Kulling | 5082c940d0 | |
Kim Kulling | 8171e041fa | |
Kim Kulling | c089f11768 | |
Kim Kulling | c305b50f13 | |
Urs Hanselmann | dcb89cf107 | |
Urs Hanselmann | 2efd48dee2 | |
Urs Hanselmann | 4fa433c8ff | |
Urs Hanselmann | 1520aff680 | |
Urs Hanselmann | 74c406dd26 | |
Jackie9527 | 424f53b4d6 | |
Urs Hanselmann | 011382424b | |
Kim Kulling | 7916f87404 | |
Jackie9527 | a0c29202be | |
Jackie9527 | 02a4276924 | |
Kim Kulling | 6ed433d011 | |
Kim Kulling | b82c193dfd | |
Kim Kulling | 1092f0d94e | |
Jackie9527 | 09dd0d0c2e | |
Jackie9527 | f7f54036f2 | |
Jackie9527 | 39efe4c832 | |
Kim Kulling | 534ee288c5 | |
Kim Kulling | 60da5e7e96 | |
Kim Kulling | 7f2760fe2f | |
Kim Kulling | a1aace74e5 | |
FeeshWyvern | f9fcf33aaa | |
FeeshWyvern | 94d9773548 | |
Kim Kulling | 90333340d6 | |
Jackie9527 | 437958ef91 | |
Turo Lamminen | e8f0eb930d | |
Turo Lamminen | 3bdc43a216 | |
Turo Lamminen | 657c1d8ad0 | |
Turo Lamminen | 3bdfecb0ed | |
Turo Lamminen | be28f0949b | |
Turo Lamminen | 53c6cc0966 | |
Turo Lamminen | 92f7c50c91 | |
Turo Lamminen | 28d4e394c0 | |
Turo Lamminen | bb5a6abae0 | |
Kim Kulling | 46ae8534f7 | |
Kim Kulling | eb73464055 | |
Kim Kulling | a14696b9ec | |
Kim Kulling | 2c3d52a5a1 | |
Kim Kulling | 408c41d687 | |
Kim Kulling | c8d50dc83f | |
Kim Kulling | 27225fadc1 | |
Kim Kulling | 4d6b7ff8b4 | |
Kim Kulling | 277e19106a | |
Kim Kulling | 009cd6c64a | |
Kim Kulling | 6aac7a2458 | |
Turo Lamminen | 2d448616d0 | |
Kim Kulling | 7de21694e9 | |
Kim Kulling | 65b0553b8d | |
Johan Mattsson | fa4273ee1f | |
Johan Mattsson | f8132bf17c | |
Kim Kulling | ad2f0682e7 | |
Kim Kulling | 1f0bcdf54c | |
Kim Kulling | c8a0119e45 | |
Kim Kulling | 3ad67771fe | |
Aaron Jacobs | 53e5f19b14 | |
Aaron Jacobs | e4386d3013 | |
Anton Vaneev | 2cd3da4831 | |
Kim Kulling | 3585dd577d | |
Kim Kulling | 7877dab43a | |
Kim Kulling | bc8a122d88 | |
Kim Kulling | 4950d02bac | |
Kim Kulling | 9898138516 | |
Shammel Lee | 4c723a4ec8 | |
Kim Kulling | bfa19f6900 | |
Kim Kulling | 779912e84e | |
Kim Kulling | bb9b583bcf | |
Kim Kulling | 156a393b84 | |
Kim Kulling | bde9a6a3c3 | |
Kim Kulling | 7b3f70a08b | |
jiannanya | 2390822baf | |
Kim Kulling | 4cf1ee98f6 | |
Kim Kulling | b7d08fc8f2 | |
Kim Kulling | b170370e5c | |
ockeymm123 | 57fc7144a7 | |
sunjc | fb146b7d39 | |
Kim Kulling | dd6bcecf56 | |
Kim Kulling | 0c05682baf | |
sunjc | 647f1e47fa | |
Kim Kulling | 487c03f547 | |
Kim Kulling | 839cd35a54 | |
Kim Kulling | e6877cf20f | |
Kim Kulling | e9c95d484e | |
Matthias Möller | db72c6ee38 | |
Robert Reif | 88ef9eecc1 | |
Kim Kulling | 8c6b3fe69a | |
Turo Lamminen | 9453342491 | |
Turo Lamminen | 8d405d60d9 | |
Kim Kulling | dbd0ae8f22 | |
Kim Kulling | 14b80f1ac4 | |
Kim Kulling | ea7321aae2 | |
Turo Lamminen | a2273df48e | |
Kim Kulling | 213b536282 | |
Kim Kulling | 6999caa683 | |
PencilAmazing | feb3e9ff7a | |
Kim Kulling | ce2f947eb1 | |
Kim Kulling | b55e29b915 | |
Kim Kulling | 5caae1a86d | |
Kim Kulling | e4c85645c6 | |
Kim Kulling | 47303c2d28 | |
Kim Kulling | 5c286b8c13 | |
Kim Kulling | d2d8b84f83 | |
Kim Kulling | d6b8d61066 | |
PencilAmazing | 527d110917 | |
krishty | df28e7830f | |
Kim Kulling | 77e34eedc0 | |
Steve M | eff13f6a40 | |
Shaun Reed | ffbeb2db18 | |
Shaun Reed | 37903f8ed2 | |
PencilAmazing | 6dc12f57a2 | |
Kim Kulling | 3e7121e1cc | |
Kim Kulling | 57054415cf | |
Kim Kulling | 8463242449 | |
PencilAmazing | 4d733d80f1 | |
Kim Kulling | b31c04e37c | |
Kim Kulling | 4d5e47a870 | |
Kim Kulling | f830d7998e | |
Kim Kulling | a7c4399c26 | |
PencilAmazing | cb8320945d | |
Kim Kulling | 036f2b3771 | |
Kim Kulling | a9ce8a967d | |
Kim Kulling | 3e20502e0f | |
Kim Kulling | ff9b6c8d79 | |
Kim Kulling | 3bd2f788f6 | |
AdamCichocki | 5ed09b7ab6 | |
AdamCichocki | 72b178b9fc | |
Kim Kulling | cff81568f3 | |
Kim Kulling | f2f967b8ba | |
Kim Kulling | c48507beea | |
Kim Kulling | f8bc8293ce | |
Kim Kulling | 303c30668f | |
Kim Kulling | bf57eef8f2 | |
Kim Kulling | 7ad36b8925 | |
Kim Kulling | 43d336311e | |
Kim Kulling | 5ed01bcfa3 | |
Kim Kulling | 9e1de3ec6e | |
Kim Kulling | 288d49b721 | |
Kim Kulling | 81cf1369db | |
Kim Kulling | ab0a119626 | |
lsnoel | 8d1256f472 | |
Kim Kulling | d331a7e5d4 | |
lsnoel | eb5d3c51e8 | |
Krishty | 72f360710a | |
shimaowo | 20acfeaf97 | |
Kim Kulling | 67eae8ee5a | |
shimaowo | b298b79a46 | |
Martin Mory | 7f6e96747b | |
Kim Kulling | d640a89035 | |
Martin Mory | a89d5c7cea | |
Kim Kulling | e9f95e5ab6 | |
Kim Kulling | 6a8f169103 | |
Kim Kulling | 19dec716d3 | |
Krishty | 36305cf987 | |
Krishty | 43a062a5d7 | |
shimaowo | 39cbef1e21 | |
Krishty | 3d3e856925 | |
Krishty | 793284a766 | |
Krishty | 5cbc00a595 | |
Krishty | bad76fd0f1 | |
Krishty | e5c02e8d45 | |
Martin Mory | 43c0f8bb3d | |
Kim Kulling | 70edec0efb | |
Kim Kulling | 2d37f49f51 | |
Kim Kulling | eb328ce69d | |
Steve M | b2672c082d | |
Daniel Rösner | 74af523b3e | |
Kim Kulling | 33c32b6b35 | |
Kim Kulling | b393132b58 | |
Kim Kulling | 9ace81a3d2 | |
Kim Kulling | f6457e1c87 | |
Kim Kulling | fa7d3aa0c0 | |
Kim Kulling | 2af29f4836 | |
Kim Kulling | 96b071bdb1 | |
Kim Kulling | 767644cd3f | |
Kim Kulling | df8a9bb2b8 | |
Kim Kulling | 35162c19b2 | |
Kim Kulling | 8c57382b20 | |
Andy Maloney | 465566a87e | |
Andy Maloney | e893248e7c | |
Kim Kulling | 05279f8bbd | |
sfjohnston | 25f0146f44 | |
Kim Kulling | 7eadcebc9f | |
Kim Kulling | ef5dd8c451 | |
Kim Kulling | a8e50be781 | |
Kim Kulling | 883667c61a | |
Kim Kulling | 89b5011759 | |
Kim Kulling | 022c385571 | |
Kim Kulling | 76de8ba1f4 | |
RKJ | 6743274b31 | |
Kim Kulling | 1e2cff6383 | |
Kim Kulling | 376f66a06d | |
Kim Kulling | 5c763f471c | |
Kim Kulling | c3d15a3f51 | |
Kim Kulling | c92b84e38d | |
Kim Kulling | 7c6e33fef1 | |
Kim Kulling | db8ff41679 | |
Kim Kulling | 2612950b7b | |
Kim Kulling | ee02c389ca | |
sashashura | 917352dd8b | |
Alex | 90769ef3e6 | |
Alex | d5294be00b | |
Umesh Rajesh Ramchandani | 2d372b302f | |
Kim Kulling | 0fdae2879d | |
Kim Kulling | fec39154ed | |
Kim Kulling | b2b85bf971 | |
Kim Kulling | 769b47ed0e | |
Kim Kulling | 3f66b92797 | |
Kim Kulling | 65bedac389 | |
Kim Kulling | 9d57ac9cc5 | |
Kim Kulling | 81f85a6f93 | |
Gargaj | 9c839f2d9a | |
Gargaj | 07d4e83f43 | |
Kim Kulling | 28c155bfb4 | |
Kim Kulling | f8bb7704ad | |
Kim Kulling | 62486c6e7c | |
Kim Kulling | d8b9e2b64b | |
Kim Kulling | b0987f4513 | |
Kim Kulling | f578b15759 | |
Kim Kulling | 497e286cfa | |
Thomas Köppe | 7d06d798af | |
Adam Beili | 54068637ee | |
Kim Kulling | 8fb7ba3444 | |
Kim Kulling | 6f6f77232e | |
Kim Kulling | 22cff318dc | |
Kim Kulling | f3f533c390 | |
Kim Kulling | b6adb9f2dd | |
Kim Kulling | 8f0e2db974 | |
Kim Kulling | 10b99dc4ca | |
Kim Kulling | 1476d50c7d | |
naota29 | ab82428bb5 | |
Kim Kulling | 88041152ac | |
Kim Kulling | 5689ac7869 | |
David Korczynski | 355ebbedf3 | |
Justice Colby | 371d5c78f4 | |
Kim Kulling | b3daec65a0 | |
John Alexander Le Roux | 80449dd014 | |
Kim Kulling | 1d1cd93371 | |
Adam Beili | 5441f07d05 | |
Kim Kulling | 6392dbfe4d | |
Adam | 1cd5841b2f | |
Adam Beili | 3b5e34ab30 | |
Adam Beili | 863637a27e | |
Jan Krassnigg | 08f2f0f82f | |
Kim Kulling | 11fe77c446 | |
Kim Kulling | 3c51eafaf4 | |
Adam Beili | b8b515cbed | |
Aaron Gokaslan | b2cfe47d4e | |
Kim Kulling | 7f35bfb9e3 | |
Kim Kulling | 97d7f685ba | |
Kim Kulling | 49b3649264 | |
Kim Kulling | bea3924fce | |
Adam | ffaf378ee6 | |
Adam Beili | ce7a52fd19 | |
Adam | 822b240694 | |
Adam Beili | 95d98ec98b | |
Adam Beili | 49bc22ddb5 | |
Aaron Gokaslan | 3730b7414f | |
Aaron Gokaslan | d635bc6914 | |
Aaron Gokaslan | ccfb175460 | |
Kim Kulling | cfed74516b | |
Kim Kulling | b717b1cd3e | |
Aaron Gokaslan | 97cb1c6b15 | |
Aaron Gokaslan | 5a0df03d2b | |
Adam Beili | 945d93b46a | |
Adam | 852ea8325c | |
Aaron Gokaslan | 899f8e1d17 | |
Aaron Gokaslan | 02378b5e70 | |
Aaron Gokaslan | 8da3d277c7 | |
Kim Kulling | 9a5d628232 | |
Kim Kulling | 99e515fbfd | |
Kim Kulling | c2967cf79a | |
Sergey | ac87b9ce7e | |
Kim Kulling | f8f12c8609 | |
Kim Kulling | 35136bc90c | |
Kim Kulling | 57c156019f | |
Kim Kulling | 07aef23d24 | |
emvivre | a77dcffb19 | |
Kim Kulling | a3c209f2ca | |
Kim Kulling | e7cea5a283 | |
emvivre | 0bef3a2e0b | |
Kim Kulling | 565539bb68 | |
emvivre | fad49e0d12 | |
Kim Kulling | 4ac3b1fef5 | |
Kim Kulling | e2f54d3c48 | |
François Lozes | e17976e6e2 | |
Ralf Habacker | 3705336467 | |
Kim Kulling | 5a89d6fee1 | |
Kim Kulling | 2e6c2315a2 | |
Kim Kulling | 002d50a54d | |
Oliver Matthews | 29032b176b | |
slinky55 | e0fb1674d1 | |
slinky55 | 38ccb7e6c9 | |
slinky55 | 5f28370f7f | |
Kim Kulling | b70277e1ab | |
slinky55 | e2e45f7a14 | |
Kim Kulling | 981677d4b9 | |
Kim Kulling | 4b65d65af3 | |
felix | 0be5c567c9 | |
Kim Kulling | 232d809ecc | |
Kim Kulling | 816b8e6156 | |
feishengfei | 789168ba31 | |
Kim Kulling | ca11fceb65 | |
Kim Kulling | 92c7419a28 | |
Kim Kulling | e477533a6d | |
Povilas Kanapickas | f6a590065c | |
Povilas Kanapickas | 22494bde17 | |
Kim Kulling | 9510132f3d | |
Kim Kulling | 9a11cabb06 | |
Kim Kulling | 18cbe89a4c | |
Florian Born | 7eb9edf0b9 | |
Kim Kulling | 65b14ef79d | |
Kim Kulling | 6415c0bfc9 | |
Kim Kulling | 1f61f0c3de | |
Kim Kulling | f1766c4bd5 | |
Alex | 79c9c82026 | |
Alex | f39606589e | |
Kim Kulling | a165dbc6ff | |
Kim Kulling | 295b0f4dbf | |
Kim Kulling | c976ceec90 | |
Kim Kulling | be2eaac5a7 | |
Kim Kulling | 9d797c1489 | |
Kim Kulling | 8d9a0f777d | |
Kim Kulling | 704a187c90 | |
Kim Kulling | 34eaf2d092 | |
Kim Kulling | f59dd695c8 | |
Kim Kulling | 128922a798 | |
Kim Kulling | 2324e1ea51 | |
Kim Kulling | 09fe87b6d4 | |
Kim Kulling | b3c7bdbdd6 | |
Bernd Waibel | 8ce6f5ad27 | |
Kim Kulling | 1944c45944 | |
Kim Kulling | 93e356b47d | |
Kim Kulling | ff0c50236b | |
Kim Kulling | c67ff12b06 | |
Kim Kulling | 4804101f1d | |
Kim Kulling | 7ebe21958d | |
Kim Kulling | e4c77aa4fa | |
曾是然 | 9fab0af16a | |
Kim Kulling | 0dd5cfe3bf | |
Kim Kulling | 7be7e5d93e | |
Kim Kulling | b2ea018fd5 | |
Aaron Gokaslan | 20755f4200 | |
Kim Kulling | 7b874983d0 | |
Kim Kulling | 9519a62dd2 | |
Kim Kulling | 6a1a7c43cc | |
Kim Kulling | ad1d0fcb45 | |
Kim Kulling | 3af53a42aa | |
Kim Kulling | fff977c0b5 | |
Kim Kulling | d475c132bf | |
HiMemX | 4c9d270a5e | |
HiMemX | 7872297ab7 | |
HiMemX | 396e7bcdb4 | |
Kim Kulling | 7116f46672 | |
Kim Kulling | 8895ecf243 | |
Kim Kulling | 362ff08855 | |
Kim Kulling | edaf7fb7eb | |
Kim Kulling | af0b29f30d | |
Kim Kulling | 57f4163c67 | |
Chris | 4b0e38e44f | |
Gargaj | d15b4ad7ef | |
Kim Kulling | fd6c534efc | |
Kim Kulling | 2a667cc637 | |
Kim Kulling | de83245f42 | |
Aaron Gokaslan | 411171fa45 | |
Aaron Gokaslan | e3b01e10db | |
Aaron Gokaslan | 4c6652f5b0 | |
Gargaj | a22aa75bca | |
Kim Kulling | f527e56f22 | |
Kim Kulling | 80ae9afe4e | |
Kim Kulling | 2c3538fc46 | |
Kim Kulling | fbb69df8be | |
Kim Kulling | 25d7510b8c | |
Kim Kulling | 6539b8685f | |
Kim Kulling | e34becff62 | |
Kim Kulling | 8352f0478a | |
Kim Kulling | 0571ee21fb | |
Kim Kulling | 02e6c425f9 | |
Kim Kulling | e4c383324a | |
Kim Kulling | 14186bcd6b | |
J.G.Adams | 9cd723e282 | |
Aaron Gokaslan | e93fa6699a | |
Aaron Gokaslan | 6fa21dcc6e | |
Kim Kulling | 46e571e497 | |
Kim Kulling | 2b30b7e062 | |
Kim Kulling | 066f3f5f14 | |
Kim Kulling | 659195d852 | |
Turo Lamminen | 0d8723a3eb | |
Turo Lamminen | 654ae3af4e | |
Kim Kulling | 88c69d4edc | |
Aaron Gokaslan | 25add7baa2 | |
Kim Kulling | 87f601531c | |
Kim Kulling | aa521569f7 | |
Aaron Gokaslan | b176061c41 | |
Aaron Gokaslan | 27edb43600 | |
Turo Lamminen | f890bc791f | |
Turo Lamminen | 68bc6a06b9 | |
Turo Lamminen | 03397d42e2 | |
Turo Lamminen | 795c0abcc8 | |
Turo Lamminen | 1ca44acebc | |
Turo Lamminen | 712671e81a | |
Turo Lamminen | 5f28c51c03 | |
Kim Kulling | 04997ccbf3 | |
Kim Kulling | 2013ae114a | |
Turo Lamminen | 94c3ec57af | |
vkaytsanov | 4c143eb581 | |
Turo Lamminen | 1c59de42fc | |
Turo Lamminen | d2dc0401c3 | |
Turo Lamminen | 30555282fe | |
Turo Lamminen | 219dbbd4af | |
Turo Lamminen | 56b6446913 | |
Turo Lamminen | 90d1464405 | |
Turo Lamminen | 2e64880abf | |
Turo Lamminen | e43e3e11b9 | |
Turo Lamminen | 2c1943cd10 | |
Kim Kulling | a0f375162d | |
Kim Kulling | 89c4640744 | |
vkaytsanov | d469c7b161 | |
Kim Kulling | 0dabe020a9 | |
Kim Kulling | c9fc957535 | |
Kim Kulling | bd64cc88df | |
Kim Kulling | baf14f6c16 | |
Koekto-code | 0e4ba1fdd1 | |
Kim Kulling | 888468e8f7 | |
Bengt Rosenberger | 76daadb95d | |
Aleks L | 4b85eb59c2 | |
Ville Voutilainen | 253f8bfa62 | |
Kim Kulling | 17c6491c91 | |
Kim Kulling | e419d6898c | |
Kim Kulling | 4aaa807704 | |
Kim Kulling | b3b064eb69 | |
Kim Kulling | ec131d0345 | |
Kim Kulling | 1b0682297d | |
Kim Kulling | 5084a4d155 | |
Kim Kulling | 0422dff537 | |
Kim Kulling | 2c4f51e863 | |
Kim Kulling | 9e0261ea7a | |
Bengt Rosenberger | abfe8ad413 | |
Bengt Rosenberger | f20071d740 | |
Bengt Rosenberger | da58fbe8fb | |
Bengt Rosenberger | cb4d0ab7aa | |
Bengt Rosenberger | 233198baef | |
Bengt Rosenberger | 99c3104588 | |
Kim Kulling | 8c63ed0455 | |
Måns Andersen | 0ada8b3b5e | |
Kim Kulling | dabaa7bdae | |
Kim Kulling | eac0876c9b | |
Kim Kulling | dddfb74902 | |
Kim Kulling | c349035cd1 | |
Kim Kulling | 85f86ec076 | |
Kim Kulling | 0513eff44f | |
Kim Kulling | f6bcb160d0 | |
Kim Kulling | 75e678a0c5 | |
Bernd Waibel | fb653e8381 | |
Kim Kulling | 46aa7a548c | |
Kim Kulling | 340d800739 | |
Kim Kulling | 8abacebad7 | |
Kim Kulling | 173fad738f | |
Kim Kulling | cb43690aad | |
Kim Kulling | 4f6640278a | |
Kim Kulling | 53a4b43ec1 | |
Kim Kulling | b0210cb3cf | |
Bengt Rosenberger | 2b804c638f | |
Engin Manap | 7c75a4c59b | |
Kim Kulling | 3c253ca3e5 | |
Kim Kulling | 73542f3830 | |
Kim Kulling | 9bd2b4da50 | |
Bengt Rosenberger | bdee65e577 | |
Bengt Rosenberger | 517fd3c76c | |
Bengt Rosenberger | 5a2b811ba3 | |
Bengt Rosenberger | 417481d17f | |
Kim Kulling | f07bc2c5b9 | |
Kim Kulling | 749fe898b1 | |
Kim Kulling | 05ececc387 | |
Kim Kulling | 316f6e841c | |
sashashura | 9ddc3a64d7 | |
sashashura | 772cfdc757 | |
sashashura | 94c0e9d890 | |
sashashura | a4274930e4 | |
sashashura | 0c07ea7c71 | |
Kim Kulling | 0a9a23a056 | |
Kim Kulling | bc6acedb33 | |
Engin Manap | 684909a691 | |
Engin Manap | 3e424f8119 | |
Koekto-code | d109db152c | |
Kim Kulling | d8f42279a6 | |
Kim Kulling | 6ad8ea395a | |
Engin Manap | e63426b89c | |
Engin Manap | 8a90ba8a39 | |
Kim Kulling | b2d0ac18cf | |
Engin Manap | 3890b5dff5 | |
Engin Manap | c3a89fd2d0 | |
Engin Manap | ae276987a0 | |
Engin Manap | a10abe0283 | |
Robert Osfield | 8e062792cd | |
Kim Kulling | 1c646057ce | |
Kim Kulling | ee3aaf7446 | |
Kim Kulling | ab4223f671 | |
tanolino | c23146bb20 | |
Kim Kulling | c5dfcac08a | |
tanolino | 24d110199a | |
Kim Kulling | e254f80a3a | |
Kim Kulling | a1f9a299e9 | |
Kim Kulling | e59b8fb448 | |
Kim Kulling | 70b2db19a8 | |
Hector Piteau | e77ab52dba | |
Kim Kulling | 7e4a20f843 | |
Kim Kulling | e9b08f35b2 | |
Kim Kulling | bac3432733 | |
Hector Piteau | 579bd6b13e | |
Kim Kulling | e3c94c6412 | |
Kim Kulling | 3ae1a37a41 | |
Kim Kulling | 8d5ed5dfe5 | |
Kim Kulling | 395b9f535e | |
Kim Kulling | 77a2cdee76 | |
Kim Kulling | 0db8b3daae | |
dependabot[bot] | 9a3bde0e6d | |
Kim Kulling | 422ed5279a | |
Kim Kulling | 44fad544e6 | |
dependabot[bot] | 15030fb7b1 | |
Kim Kulling | 744ed2256b | |
Kim Kulling | ec2db278e3 | |
Kim Kulling | 2ee7727d86 | |
Kim Kulling | 13bee0d5e6 | |
Kim Kulling | eeae6eac26 | |
Kim Kulling | 2d994e1a28 | |
dependabot[bot] | b05ff26569 | |
dependabot[bot] | 200e43b99d | |
Kim Kulling | c1012b4af0 | |
Kim Kulling | 4a5ad50828 | |
Kim Kulling | f4c8b55b33 | |
Kim Kulling | 90b75cd6e7 | |
Kim Kulling | 50638f98f5 | |
Kim Kulling | 5bce9e8ce5 | |
Kim Kulling | a6b1a35748 | |
Kim Kulling | 6d26e91fc1 | |
Kim Kulling | 245cd66d11 | |
Kim Kulling | 636d8bffe5 | |
Kim Kulling | 9063216893 | |
Kim Kulling | 43f060663f | |
Kim Kulling | 55625d1af5 | |
Kim Kulling | be700a0480 | |
Kim Kulling | eee6269cd1 | |
Luca Della Vedova | 0924c4710b | |
Kim Kulling | e1e8477732 | |
Kim Kulling | 96ccaa03a0 | |
Kim Kulling | f76be1a631 | |
kimmi | 3d692c72ba | |
kimmi | d3c8201614 | |
Kim Kulling | b6f3c8eb15 | |
Kim Kulling | 2de95c77a4 | |
Kim Kulling | 33b672288c | |
Kim Kulling | 5598356157 | |
Kim Kulling | 6cebe2c1f1 | |
Kim Kulling | 855537f232 | |
Kim Kulling | be2e6a1b24 | |
Kim Kulling | 038ae8c028 | |
Onur Berk Töre | b392ff5ad1 | |
Onur Berk Tore | 4f06c41802 | |
Kim Kulling | 3f3f4dc6b7 | |
Gargaj | bca5650578 | |
Kim Kulling | fff74a4ac0 | |
Kim Kulling | ad2a1546eb | |
Onur Berk Tore | c2060a1f7e | |
Onur Berk Tore | 1b53f41787 | |
kovacsv | 2486a681c1 | |
Kim Kulling | 67fe6643c3 | |
PercentBoat4164 | 487a9aca2f | |
Luca Della Vedova | 079b7deb33 | |
hgdagon | ce8081bd0a | |
Kim Kulling | b8812d2b4f | |
Kim Kulling | 5adea2dbcf | |
Kim Kulling | aaa19903c6 | |
naveen | a5a38775f1 | |
Kim Kulling | 0768a13057 | |
Kim Kulling | 02b0c89fa4 | |
Kim Kulling | 4fb5cf4ba6 | |
Kim Kulling | 34cb936844 | |
Kim Kulling | b9fdf6d3ca | |
Kim Kulling | bc2786d830 | |
Kim Kulling | e7daa5759b | |
Kim Kulling | 7a64f751ab | |
Kim Kulling | 988b5c1f36 | |
Kim Kulling | 096aee2c25 | |
ethaninfinity | d018c3b555 | |
ethaninfinity | c5b6b26b8b | |
ethaninfinity | 4961241c09 | |
Matthew Clendening | aca02190a7 | |
Kim Kulling | 49fdd12fdf | |
Kim Kulling | 680ea6b0e0 | |
Kim Kulling | 39a4627519 | |
Kim Kulling | 530ae2b192 | |
Kim Kulling | 638fda66da | |
nsg | 96d2052ed0 | |
Kim Kulling | 7fcd961a20 | |
Kim Kulling | 03532eaec3 | |
Underdisc | 17289985a4 | |
Underdisc | 02e0d1d05c | |
nsg | 681eb3e91e | |
Kim Kulling | 2e944686f8 | |
Kim Kulling | b7a70ac707 | |
Kim Kulling | 43c767dd62 | |
Kim Kulling | 05867f4752 | |
Kim Kulling | de4fe01c94 | |
Kim Kulling | e28becbaf5 | |
Kim Kulling | e5cd85ac0c | |
Kim Kulling | 4b25eb6c4b | |
Kim Kulling | c0e141a6a9 | |
Kim Kulling | b00923ebcd | |
Kim Kulling | 4e22635406 | |
Kim Kulling | 472e15c405 | |
Kim Kulling | 4b923f0603 | |
Kim Kulling | 234e55fbb1 | |
Gargaj | f612865f22 | |
Matthew Clendening | 26233f1b77 | |
Piroska Gabor | ddc63119b5 | |
hgdagon | efbcdccac9 | |
hgdagon | affa85a36b | |
Piroska Gabor | 7ce447294f | |
Luca Della Vedova | 6b0a7a21a4 | |
Kim Kulling | ed3e218550 | |
Kim Kulling | e0696486b2 | |
Kim Kulling | e5a2b00719 | |
tanolino | 002d6dc016 | |
Kim Kulling | 4d451fe437 | |
Kim Kulling | c623a363a6 | |
Kim Kulling | c8dafe0d28 | |
Kim Kulling | 58af6ba9db | |
Kim Kulling | deb1698cbe | |
motazmuhammad | 78dbef8711 | |
motazmuhammad | 36d730fc4e | |
motazmuhammad | 5d8b1649a4 | |
Kim Kulling | 1b3e9e4e01 | |
Kim Kulling | e284fe67b8 | |
motazmuhammad | 0ffb91fbf1 | |
Kim Kulling | f44a94e118 | |
Kim Kulling | 9e4fc9a40c | |
Kim Kulling | 16b7b35b04 | |
Kim Kulling | 0f780fe141 | |
Kim Kulling | eeb524a76b | |
Aaron Gokaslan | 787fcc160a | |
hgdagon | cd9f417b84 | |
Kim Kulling | ff43768d24 | |
Kim Kulling | 31c9a8b0ed | |
Kim Kulling | 6c943471f9 | |
hgdagon | 7338833f3b | |
hgdagon | 85d47dc359 | |
Kim Kulling | 25118d230e | |
Kim Kulling | 39f5b723f3 | |
Kim Kulling | 1f68f66162 | |
ALittleStardust | 7bda8b7a77 | |
hgdagon | f86700f6f4 | |
hgdagon | 1c2caec2bd | |
hgdagon | 26ab3ce480 | |
hgdagon | e59326a738 | |
hgdagon | 936cc791f2 | |
hgdagon | e1f0f50010 | |
hgdagon | 18bfbaeee1 | |
hgdagon | e97e7574ae | |
hgdagon | 4faae3d0e9 | |
hgdagon | 209c302f56 | |
Kim Kulling | abfb26ab6f | |
Kim Kulling | 3dd2dbd916 | |
Kim Kulling | f4b1a23010 | |
Kim Kulling | bfb46ca5ef | |
Kim Kulling | e8abb0fc1c | |
IOhannes m zmölnig | 1d3d5c4bb6 | |
Kim Kulling | d5c798f325 | |
hgdagon | bf32c4c408 | |
U-DESKTOP-0R560PH\George | a7e2b3ad30 | |
U-DESKTOP-0R560PH\George | 63183a048c | |
U-DESKTOP-0R560PH\George | 694dc8a0c3 | |
U-DESKTOP-0R560PH\George | 94ebe71969 | |
Kim Kulling | 64a6968254 | |
Kim Kulling | 0afb594f40 | |
Kim Kulling | 6cdd1d3cc6 | |
Kim Kulling | 461370946c | |
Kim Kulling | 1a47f52eb8 | |
Kim Kulling | 92bdb993e9 | |
Kim Kulling | 1ac9173e8c | |
Kim Kulling | 0b3232ce10 | |
Kim Kulling | 66cfe0cdf4 | |
Kim Kulling | 174b2fcf59 | |
Kim Kulling | 37ec378b60 | |
Kim Kulling | 458a0314aa | |
Kim Kulling | 6c2f1378e3 | |
Kim Kulling | d3a8306f59 | |
Kim Kulling | cce62fded1 | |
Kim Kulling | 88a9598ded | |
Kim Kulling | d14bff5a9f | |
Kim Kulling | f3c9c7b413 | |
Florian Born | a415f33fb5 | |
Florian Born | 7f0509ae87 | |
Kim Kulling | 02f070667a | |
Kim Kulling | d6aa3db4ef | |
Kim Kulling | 41fbc5e715 | |
Florian Born | 0355ae967f | |
Florian Born | 320775b939 | |
Florian Born | d3646c3118 | |
Florian Born | 2b3c49cb93 | |
Florian Born | 1d6ed840fb | |
Kim Kulling | 37be87b0bd | |
Kim Kulling | 7f913c180b | |
Mykhailo418 | 8a1dc87b4c | |
Mykhailo418 | e3def37f42 | |
Mykhailo418 | 863e3e0ccb | |
Ichiro | 9ab6ebd363 | |
Ichiro | 128242e371 | |
RedSkittleFox | feec92022f | |
RedSkittleFox | 5ab1be8d04 | |
Kim Kulling | b699d3a26a | |
RedSkittleFox | f26dc74f21 | |
RedSkittleFox | b38c25fe09 | |
Kim Kulling | aa814a522d | |
Kim Kulling | dc8ba61095 | |
Kim Kulling | ae9f5b6fc5 | |
Kim Kulling | 26e471ad62 | |
Guangmo Lin | 778ac976b2 | |
Kim Kulling | 6943e59886 | |
hgdagon | 518d50d2e6 | |
Kim Kulling | e5747dad9b | |
Kim Kulling | 5c438963c0 | |
Kim Kulling | 97c7ab3c05 | |
Kim Kulling | fa5a8476ee | |
Kim Kulling | b8658cefe0 | |
Carlos Martinez Perez | 2bfb78f91d | |
Kim Kulling | 75ab2beb06 | |
Kim Kulling | 88dadd6c40 | |
Kim Kulling | 8109689dc2 | |
Kim Kulling | 42adc82354 | |
xiaohunqupo | a050dee096 | |
xiaohunqupo | de6e90a657 | |
xiaohunqupo | 2152aae2a3 | |
xiaohunqupo | b08c04b87a | |
xiaohunqupo | cc515746f7 | |
Danny许 | 8e075ce713 | |
Danny许 | 18c4ebaa13 | |
Danny许 | f985fe12cc | |
Danny许 | 422a45694a | |
Filip Lundgren | 4175198d04 | |
Carlos Martinez Perez | 257927d7cf | |
Kim Kulling | ba6c67c328 | |
Kim Kulling | 0a56065962 | |
Jan Krassnigg | 537c46a42a | |
Carlos Martinez Perez | 90a24440db | |
Promit Roy | 5ec7e57b99 | |
Promit Roy | 68d33a6e13 | |
Kim Kulling | 19f2a624a9 | |
Promit Roy | 765b38cf04 | |
Kim Kulling | a916a0eda5 | |
Kim Kulling | c2b05acaa6 | |
Kim Kulling | a828114a1d | |
Kim Kulling | 552f3a308d | |
Kim Kulling | 784d9615f5 | |
Kim Kulling | 6484dd6825 | |
Kim Kulling | d594e6eea4 | |
Kim Kulling | bcee205542 | |
Kim Kulling | 0904490150 | |
Kim Kulling | 7919461951 | |
Kim Kulling | e4fb0e0960 | |
Kim Kulling | d87111983a | |
Kim Kulling | b1dc8cfe56 | |
Kim Kulling | 7296ffc3f5 | |
Kim Kulling | b567497a17 | |
Kim Kulling | e1dae1402e | |
Kim Kulling | 68f3386c7b | |
Kim Kulling | 9e0357a8b6 | |
Kim Kulling | 72888c49f6 | |
eyhn | cd7df53a72 | |
jaefunk | 4457d9300a | |
Kim Kulling | 0ef830d2b1 | |
Sergio Acereda | 729ab8ae33 | |
Sergio Acereda | 26bb601d8f | |
Sergio Acereda | 51e248909f | |
jaefunk | e02d51ec24 | |
Kim Kulling | a305d14b8f | |
Kim Kulling | 5e69517742 | |
Kim Kulling | 1b3ae63527 | |
Kim Kulling | 47f004517f | |
Jonas Karlsson | c14eccefaf | |
Terence Russell | efe92e9ec1 | |
Kim Kulling | 1bf5dd2731 | |
kimkulling | 26598dc6bd | |
kimkulling | 76e10b96fc | |
Terence Russell | b35879989c | |
Kim Kulling | 7aa87a9765 | |
Kim Kulling | 40d896ccc1 | |
Kim Kulling | ba379c20e1 | |
Kim Kulling | 92b5c284ce | |
Kim Kulling | 9ca9254445 | |
Kim Kulling | 7eb5fd0e4e | |
Kim Kulling | 80a8807c47 | |
Kim Kulling | d4527d4e87 | |
Sergio Acereda | a2543e7151 | |
Sergio Acereda | a1e03e3481 | |
Sergio Acereda | cfe84b9260 | |
Sergio Acereda | 52008ec989 | |
youkeyao | 9b227fc262 | |
RichardTea | 8a6a1fc2df | |
RichardTea | d704824be3 | |
Kim Kulling | bbcefbd034 | |
Jaroslav Pribyl | 62930076af | |
Rahul Sheth | e368a69824 | |
Kim Kulling | 3957fbba8b | |
Rahul Sheth | 8e59287b94 | |
sola | c73ff82fc4 | |
Kim Kulling | 04858c5d89 | |
Kim Kulling | 94178df61b | |
Kim Kulling | 1b2f705ee4 | |
Kim Kulling | 0dc24ab3a7 | |
Kim Kulling | cf96639119 | |
Kim Kulling | 72da1e6d7b | |
Kim Kulling | e3001f1eb7 | |
Kim Kulling | 6f31254ae1 | |
Terence Russell | 3a09d19374 | |
Terence Russell | 4ddacdb5df | |
Kim Kulling | 466b34cf53 | |
Kim Kulling | aa04ee89f1 | |
Kim Kulling | a6808b868c | |
Jaroslav Přibyl | 480d6fee2a | |
Jaroslav Přibyl | 62c9347985 | |
Kim Kulling | ba785910d1 | |
Kim Kulling | caaeef2b56 | |
Kim Kulling | a34688230d | |
Kim Kulling | 52b106bf7e | |
Kim Kulling | eed5570c39 | |
Kim Kulling | 3e7294feeb | |
Kim Kulling | 2c33ed1087 | |
Kim Kulling | b625961197 | |
Kim Kulling | 03f44cd983 | |
Kim Kulling | 5c53726c8e | |
Kim Kulling | 96522bc114 | |
Kim Kulling | b825740df7 | |
Kim Kulling | f952100dbb | |
Kim Kulling | 14874d26f4 | |
youkeyao | ad766cb738 | |
ChenJunshuai | efc60076dc | |
Terence Russell | 17123ed4a1 | |
Kim Kulling | dff3620138 | |
Jean-Christophe Fillion-Robin | 33a48c6ca6 | |
Kim Kulling | 510504a2c6 | |
Kim Kulling | 9bf5d01469 | |
Kim Kulling | 9e23d771bc | |
Kim Kulling | 76a7614c4b | |
Kim Kulling | 50d7e6fc61 | |
Kim Kulling | 067c5d9ec4 | |
Kim Kulling | 884bb39391 | |
Kim Kulling | 5d8e5fd130 | |
Kim Kulling | 7c13b16d30 | |
Kim Kulling | 416f823866 | |
Kim Kulling | c718500c55 | |
Kim Kulling | 9a585d7b3c | |
Kim Kulling | 52b6c4f7c0 | |
Kim Kulling | 3e09d462fa | |
Kim Kulling | 97c7e084c2 | |
Kim Kulling | 23b43d1825 | |
Kim Kulling | 27bcddfb1a | |
Tomas Maly | acf73659d8 | |
Kim Kulling | dcd5c1dcfd | |
Kim Kulling | ce61ea56a5 | |
Kim Kulling | ed8612ea35 | |
Kim Kulling | 389fc11e5b | |
Kim Kulling | a9e2864cb4 | |
Kim Kulling | 836d12b9af | |
Kim Kulling | 9a15ca1007 | |
Kim Kulling | eb5a7938e0 | |
Kim Kulling | 9335cc30ab | |
Kim Kulling | ecfb9757d0 | |
Kim Kulling | d643146192 | |
Kim Kulling | a595cdad06 | |
Kim Kulling | ce880331df | |
Kim Kulling | 4141260fc9 | |
Kim Kulling | 6c4addf158 | |
IOhannes m zmölnig (Debian/GNU) | ed6b6cd65c | |
Tomas Maly | 3976f9a092 | |
Kim Kulling | a214b0833f | |
Kim Kulling | f217bd4b5f | |
Kim Kulling | 305d1f45aa | |
Kim Kulling | 50b00d33b5 | |
Kim Kulling | 5698d41bf9 | |
Kim Kulling | 06fffb4f83 | |
Kim Kulling | 83d4ab8563 | |
Kim Kulling | 91737f1cc9 | |
Kim Kulling | c4a66ae988 | |
Kim Kulling | 1d34cb2c72 | |
Kim Kulling | c5634be708 | |
Kim Kulling | 6cc469a5ae | |
Kim Kulling | 8b1d94d6b1 | |
Kim Kulling | d45af75a5e | |
Ben Sewell | 3e6fc3a64b | |
Kim Kulling | c142676908 | |
Kim Kulling | c1968823ad | |
Kim Kulling | 985a5b9667 | |
Kim Kulling | cbc4459dda | |
Kim Kulling | 43763f53d6 | |
Kim Kulling | 15b08f643a | |
Kim Kulling | 17d5633a5b | |
Kim Kulling | 4cb76e6a18 | |
Kim Kulling | 12b01dd575 | |
Kim Kulling | 7b24437f06 | |
Kim Kulling | ec63fe74ee | |
Kim Kulling | 088658b359 | |
Kim Kulling | b4dee9220d | |
Kim Kulling | ffc13f18ba | |
Kim Kulling | 331cb5ac72 | |
Kim Kulling | c3b91dd766 | |
Kim Kulling | ea5996307a | |
Kim Kulling | efd1d36aa9 | |
Kim Kulling | 959af1ac4d | |
Kim Kulling | 7350baea93 | |
Kim Kulling | cf47411742 | |
Kim Kulling | 1e80630d5d | |
Kim Kulling | 037732c429 | |
Kim Kulling | cff213d4dd | |
Kim Kulling | 9d0006fecb | |
Kim Kulling | 5af79cac1d | |
Kim Kulling | 141c6ca270 | |
Jeremy Sigrist | 59f28e168e | |
Kim Kulling | 3cca102531 | |
Kim Kulling | 6e50b04ae0 | |
Kim Kulling | f21ff66505 | |
Kim Kulling | f16e4fadc7 | |
Ben Sewell | 415b0e19d9 | |
Ben Sewell | 65f2353105 | |
Kim Kulling | cbde086bfb | |
Kim Kulling | acd70b35a0 | |
Kim Kulling | 6ad7505376 | |
Kim Kulling | 05746acb07 | |
Léon | db162939b2 | |
Kim Kulling | 41cfcc7d16 | |
Kim Kulling | f8253c3e3c | |
Kim Kulling | 7eec3f0d8f | |
Viktor Kovacs | c8ab39dd04 | |
Léon | fe40ddf9a9 | |
Kim Kulling | 5976d54437 | |
Kim Kulling | d3e24196c0 | |
Jeremy Sigrist | 5aac72791d | |
Jeremy Sigrist | e671d087e1 | |
Léon | 8a7576b85c | |
Viktor Kovacs | c71f4bc95a | |
Léon | 7f2ab47b5a | |
Kim Kulling | 6a640a2de8 | |
Kim Kulling | 9d06bd4678 | |
Kim Kulling | 5dcaf445c3 | |
tanolino | f8abb015de | |
Dan Rosser | e6cc187a7e | |
Kim Kulling | d68224f2ed | |
Kim Kulling | a2c2b64877 | |
Kim Kulling | f63b10bf45 | |
Viktor Kovacs | 6b9732721a | |
Kim Kulling | 50c7301a38 | |
Dan Rosser | 00bf74ad6d | |
Ben Wolsieffer | 629c8850ec | |
Kim Kulling | 8134cae998 | |
Kim Kulling | 30f1583dde | |
Kim Kulling | 1d8667bfdc | |
Dan Rosser | 9c4255b486 | |
Kim Kulling | cb3e846a19 | |
Kim Kulling | 8cb5ab69b0 | |
Kim Kulling | b40d9abdb9 | |
Kim Kulling | 776130534b | |
Kim Kulling | 6a1f720f68 | |
Alex Rebert | b14b34d2b8 | |
Alex Rebert | 310c81aaa2 | |
Alex Rebert | 34d8fba100 | |
tanolino | 089fc7311a | |
tanolino | 04d2d13172 | |
Kim Kulling | 1d815fc23e | |
Kim Kulling | a591944c04 | |
Colin Reeder | 87e9dbac40 | |
kovacsv | 125acf9ec8 | |
kovacsv | bbe12240ca | |
Kim Kulling | c2375a4ff0 | |
Kim Kulling | ab19cff328 | |
Kim Kulling | 049a241855 | |
Kim Kulling | a86ab45161 | |
Peter Seiderer | a099fe7cd3 | |
Kim Kulling | 85dd84cc78 | |
Kim Kulling | 0a5bd792de | |
Kim Kulling | c882731688 | |
Jérôme Leclercq | 81fc50f612 | |
Vyacheslav Vanin | 2da06dd41a | |
Kim Kulling | 54a8da1d55 | |
Kim Kulling | d44641398f | |
Garux | d11d2fc60d | |
Kim Kulling | 4d7e817bd8 | |
Kim Kulling | db2500c393 | |
Kim Kulling | 64af16c427 | |
Kim Kulling | 635153b3a4 | |
Kim Kulling | 7ec52e9e02 | |
Kim Kulling | 2c66d4d3a2 | |
Kim Kulling | 215f4e1f4d | |
Kim Kulling | 2eb86d75b8 | |
Rene Sepulveda | 19371af6e6 | |
Kim Kulling | cab7b330ee | |
Kim Kulling | 80b0b897ed | |
Kim Kulling | 572e31ddcb | |
Kim Kulling | 9dfd401624 | |
Kim Kulling | 5a46597e47 | |
Kim Kulling | 01f68dd916 | |
Garux | 46f618a6ef | |
Garux | 7fc4603579 | |
sssaoi | d7bf8d6e07 | |
Vyacheslav Vanin | 53968550e4 | |
Kim Kulling | 6693e7e08c | |
Kim Kulling | 3e97329fa1 | |
Kim Kulling | c72e3905c2 | |
Kim Kulling | 2ffa0c59eb | |
Kim Kulling | af42d53c92 | |
Kim Kulling | c4d858cf4d | |
Kim Kulling | 7a29147095 | |
Kim Kulling | efdaf603b0 | |
Kim Kulling | 46b28a442b | |
Vyacheslav.Vanin | 1afe7e6255 | |
Kim Kulling | 26dc168449 | |
rumgot | 92aef9236f | |
Kim Kulling | 8322e393c5 | |
Kim Kulling | 003942aafe | |
Kim Kulling | 0491eb3591 | |
Viktor Kovacs | d619f7015a | |
Kim Kulling | 65bc801734 | |
Kim Kulling | e4f38810ca | |
Kim Kulling | cb657e4c13 | |
Kim Kulling | 052594568a | |
Kim Kulling | 54e60b031e | |
Viktor Kovacs | 4959924dab | |
Kim Kulling | 819d9f7257 | |
Kim Kulling | 33c6762272 | |
Kim Kulling | 6bb856335f | |
Kim Kulling | 68682d75b5 | |
Inho Lee | c2297e9199 | |
Viktor Kovacs | d2c8cb755e | |
Kim Kulling | ea2e442046 | |
Kim Kulling | e51feac2c5 | |
Kim Kulling | 1e4861f86e | |
kovacsv | 2be6bac4b0 | |
IOhannes m zmölnig | 9a7ee0ac14 | |
IOhannes m zmölnig | 6e090c88b8 | |
RichardTea | 75e7d0f6ef | |
Kim Kulling | 70f5cca9c3 | |
Kim Kulling | 5b4829155c | |
Kim Kulling | 983b20cda6 | |
Kim Kulling | 16149348ed | |
IOhannes m zmölnig | 0e2ac2a91c | |
IOhannes m zmölnig | c8cdf3009e | |
IOhannes m zmölnig | 23d7811276 | |
IOhannes m zmölnig | 836963428e | |
Kim Kulling | 8c9a148776 | |
Kim Kulling | 834ec20008 | |
Kim Kulling | cc05b4c8f1 | |
Kim Kulling | d6f3f292f2 | |
Inho Lee | 4a37aa2ef8 | |
Kim Kulling | 745f5e7e65 | |
Pencil Amazing | 095bd67e10 | |
Pencil Amazing | e831ecf3c2 | |
Pencil Amazing | 44fa1ec6a7 | |
Kim Kulling | 70c1aec7c7 | |
Kim Kulling | 34daf87428 | |
Max Vollmer (Microsoft Havok) | 5e1188c44e | |
Max Vollmer (Microsoft Havok) | 0015823bef | |
Max Vollmer (Microsoft Havok) | 38382715f7 | |
Kim Kulling | da8772c57b | |
Jan Krassnigg | 1a5d66714f | |
Kim Kulling | 690e558b88 | |
Thomas Nicky Thulesen | 8b78a63b50 | |
RichardTea | d18709b899 | |
RichardTea | 5143044cc8 | |
RichardTea | 2fdf52488f | |
RichardTea | 42766af702 | |
Kim Kulling | 889e559696 | |
Kim Kulling | b22098c234 | |
Kim Kulling | 85ea57dcdb | |
Robin Dousse | 6819b84b8b | |
ruyo | 60bfde78eb | |
Kim Kulling | bf1f142a72 | |
Kim Kulling | aeba7a43a0 | |
Kim Kulling | 9ebd74bd26 | |
Kim Kulling | 9267f4c5b8 | |
Kim Kulling | 0d857bcf9f | |
Ralf Habacker | 2ceb18746b | |
Kim Kulling | 3db1592f7e | |
RichardTea | 74b3be194d | |
RichardTea | bab8b8dbab | |
RichardTea | 33845cd019 | |
Kim Kulling | b1c83f437f | |
Kim Kulling | ce3101ea4e | |
RichardTea | c24f99cd0e | |
Kim Kulling | c174575cf8 | |
Kim Kulling | 1ee8c1b51f | |
Kim Kulling | 595799b1bc | |
Kim Kulling | a5a091c138 | |
Kim Kulling | e8732341f4 | |
Jérémie Dumas | b0d564467e | |
Jérémie Dumas | 78d72bff59 | |
Kim Kulling | 05115b07b4 | |
Kim Kulling | b1c336799c | |
Kim Kulling | c3ac5569c5 | |
Kim Kulling | 4fa3648132 | |
Kim Kulling | f48731622b | |
Kim Kulling | fc0617280e | |
freizhang | b9937994ca | |
freizhang | 6e6807ee6c | |
freizhang | 1407491a67 | |
Jérémie Dumas | 57d22e4dbf | |
Kim Kulling | 159fadebbf | |
Kim Kulling | 0beacc3854 | |
Kim Kulling | f03dcc27c0 | |
Kim Kulling | fe73213420 | |
Kim Kulling | e2ccd17494 | |
Kim Kulling | 157e032bde | |
Kim Kulling | 37c81e7a28 | |
Kim Kulling | 2e5e176bf3 | |
Kim Kulling | c22524351a | |
Kim Kulling | 97b8e41997 | |
Kim Kulling | a7a6b96ca8 | |
Kim Kulling | 6f853be88c | |
Kim Kulling | b43a84a496 | |
Kim Kulling | ece61c6c68 | |
Kim Kulling | 608bccd9cf | |
Kim Kulling | 13731b37c4 | |
Kim Kulling | 4abf37ace6 | |
Kim Kulling | 4854978108 | |
Kim Kulling | 1f8edd5959 | |
Kim Kulling | 43b0ef181a | |
Kim Kulling | add7f1355e | |
Kim Kulling | 7120504c46 | |
Kim Kulling | 8a1563d61a | |
Kim Kulling | eafb79e7dc | |
Kim Kulling | 952f0a53c9 | |
Viktor Kovacs | b6994c5e1f | |
Kim Kulling | 9f28ef4c25 | |
Kim Kulling | a31c979abc | |
Kim Kulling | 8ed18621db | |
Kim Kulling | fe511fddc4 | |
Kim Kulling | 39664d608d | |
Kim Kulling | baf3f00644 | |
Kim Kulling | d4755648b4 | |
Kim Kulling | 5fd2a5559c | |
Kim Kulling | c01d33a77a | |
Kim Kulling | 83950845ee | |
Kim Kulling | 8a613a8655 | |
Kim Kulling | e206d699da | |
iraj mohtasham | 7ddd9b2484 | |
Kim Kulling | 50ba15191b | |
Aaron Gokaslan | b8a10e62f9 | |
RichardTea | 86a25b62e4 | |
Kim Kulling | 30143e9626 | |
RichardTea | aaae3e3a10 | |
RichardTea | 9433fc526a | |
RichardTea | 69cafe64b4 | |
RichardTea | ee19ce6021 | |
Jeremie Dumas | cedf1819c3 | |
Kim Kulling | 2b4b3e820b | |
Kim Kulling | 5a3401b69f | |
kovacsv | 3b2a9d1543 | |
Alex Rebert | 145f972d76 | |
Kim Kulling | 3664fe20c0 | |
Kim Kulling | 322de54323 | |
Kim Kulling | 7f4839a26c | |
Alex Rebert | e900617796 | |
Daniel-Genkin | f28500dd0f | |
Alex Rebert | 6f07e89fdf | |
Alex Rebert | 1909b3e8d2 | |
Alex Rebert | 6a3ac623b9 | |
Alex Rebert | 107371657b | |
Alex Rebert | 1fe9d405f5 | |
Alex Rebert | 932dfe0562 | |
Alex Rebert | 30f17aa206 | |
Kim Kulling | d273a784d0 | |
Kim Kulling | 5333e41607 | |
Kim Kulling | e5cd5733e1 | |
Daniel-Genkin | 6e5600a9a5 | |
Kim Kulling | 8c0b869998 | |
Kim Kulling | 817fbed8c2 | |
Kim Kulling | 5af71feef2 | |
Kim Kulling | 0e38cec58c | |
Kim Kulling | e01b488075 | |
Malcolm Tyrrell | 2239442c64 | |
Malcolm Tyrrell | db0127859a | |
Kim Kulling | 791cb195be | |
Kim Kulling | f81d7c0b3e | |
Kim Kulling | f3baab1153 | |
Malcolm Tyrrell | 4ba99c1bb0 | |
Malcolm Tyrrell | c644f9d719 | |
Malcolm Tyrrell | 4d10f5d133 | |
Malcolm Tyrrell | 5b13b97f27 | |
Kim Kulling | a83db61289 | |
Kim Kulling | cff5035b5f | |
Kim Kulling | e157d7550b | |
Kim Kulling | 36c937cc19 | |
Kim Kulling | 6689438696 | |
Kim Kulling | e7b9118b96 | |
Kim Kulling | 11cb1a170f | |
Kim Kulling | 0e3d058504 | |
Kim Kulling | 4caae783ae | |
Kim Kulling | a82dc887fc | |
Kim Kulling | f678e67974 | |
Lassi Helynranta | a01a5b4e3a | |
IOhannes m zmölnig | 1a9403e787 | |
IOhannes m zmölnig | 3b8126d26a | |
Malcolm Tyrrell | 5a1bcc6aa5 | |
Malcolm Tyrrell | ceddfe19d8 | |
Malcolm Tyrrell | 7788c1a04e | |
Malcolm Tyrrell | a283a255a5 | |
diharaw | 0fb66f8437 | |
diharaw | b01d008bc0 | |
diharaw | 0738742611 | |
Marc | ad0d945c80 | |
Marc | 656b0b25d8 | |
Kim Kulling | babf3b8e3d | |
Davide Pizzolotto | ae951fbef9 | |
Kim Kulling | 3e4cca4d2f | |
Kim Kulling | ac6b8988df | |
Kim Kulling | 2f5a31110c | |
Kim Kulling | 1f76b2e6b9 | |
diharaw | 46a7de7a0b | |
diharaw | addd541251 | |
diharaw | d3276de47d | |
diharaw | 200bf8df7a | |
Kim Kulling | 96e2f1cd5b | |
Kim Kulling | 6cb6a6acdd | |
Kim Kulling | d286aadbdf | |
Kim Kulling | 95263b2e54 | |
Kim Kulling | 590307dba9 | |
Kim Kulling | fb5b5e9d40 | |
Kim Kulling | 4fd7330808 | |
Hill Ma | e6543cbd85 | |
Kim Kulling | d814e9067a | |
Kim Kulling | 95d1232922 | |
Hill Ma | 79f3368c85 | |
René Martin | e92177cb99 | |
Kim Kulling | d0f7200196 | |
René Martin | 65173df9d9 | |
krishty | 8c84afaff0 | |
Artenuvielle | 70dfdb8f9d | |
René Martin | a8a6aa2bd8 | |
Mark's Offline | 1eb0d18371 | |
Kim Kulling | 71a87b653c | |
Kim Kulling | 880a2f25bb | |
Kim Kulling | 9553894c3b | |
Kim Kulling | 8a975549a9 | |
Kim Kulling | 113217790b | |
Kim Kulling | 0fef0e1101 | |
Kim Kulling | 8ba4d30d7c | |
Kim Kulling | 002cdcdd7f | |
Ingo Wald | e9d03f3379 | |
Kim Kulling | 18531e3677 | |
Artenuvielle | c7e9c6580a | |
René Martin | dfb0d66437 | |
René Martin | 3f6a371b64 | |
Krishty | 5895c0c22c | |
Krishty | 4cf4e7454f | |
Hill Ma | 93edbe883f | |
Kim Kulling | 0dabce2754 | |
Kim Kulling | d34cd103f4 | |
Kim Kulling | bc0a2762df | |
Kim Kulling | f47479aba4 | |
Kim Kulling | be0ab89afe | |
Kim Kulling | dfd95633a4 | |
Kim Kulling | 9834dc7fc0 | |
Kim Kulling | 2acfdbe0c5 | |
René Martin | 3001d88172 | |
Kim Kulling | e70b05b41a | |
Kim Kulling | 768024d5a0 | |
Kim Kulling | 30c6606718 | |
Kim Kulling | 74e8a6a366 | |
Kim Kulling | 209167c41f | |
Max Vollmer (Microsoft Havok) | bf8e36ae28 | |
Max Vollmer (Microsoft Havok) | 72ea80b41f | |
Kim Kulling | d710d0700f | |
Max Vollmer (Microsoft Havok) | 4c86772091 | |
Madrich | 9b535d1c15 | |
Madrich | 43a3c4a05e | |
Kim Kulling | 155db25883 | |
Kim Kulling | f888910a2a | |
Doug Roeper | 96f0787f51 | |
Max Vollmer (Microsoft Havok) | 51f294c587 | |
Viktor Kovacs | 82d8c4e849 | |
Kim Kulling | 5e86fead8e | |
Kim Kulling | 38c611a02c | |
Kim Kulling | e2c2a60c45 | |
Kim Kulling | c9d35b6edc | |
Kim Kulling | ceafa95610 | |
kirillsurkov | 5ca2cbb7ae | |
Kim Kulling | c9b76f5255 | |
Kim Kulling | df739f00dd | |
Kim Kulling | 69051bbc2c | |
Kim Kulling | a7bc858698 | |
Kim Kulling | 3e090b21f5 | |
Viktor Kovacs | b9b62d106c | |
kovacsv | b39f38b73c | |
Kim Kulling | 6841397798 | |
Kim Kulling | 999192489c | |
Kim Kulling | afd0f65ceb | |
Kim Kulling | a45878c41a | |
Kim Kulling | e5bf7f7e07 | |
Kim Kulling | eabfc05bbb | |
Kim Kulling | 6439305379 | |
Kim Kulling | 61ba320a04 | |
Kim Kulling | e7085199f2 | |
Kim Kulling | fe31ac295c | |
Kim Kulling | a71baaeedf | |
Kim Kulling | 7cc076b27a | |
kovacsv | cb262dab5e | |
kovacsv | 37ba067839 | |
kovacsv | 0590a39159 | |
Kim Kulling | d2b7e9c38c | |
Kim Kulling | f24101546b | |
Kim Kulling | 1452b33cbd | |
kimmi | 18f58947a4 | |
kimmi | 38dcd3583c | |
kimmi | c396bc78b1 | |
Kim Kulling | 7fa2bfbb70 | |
Kim Kulling | 21603c9f83 | |
Kim Kulling | aa90f51849 | |
kovacsv | 468aa50aed | |
陶浩然 | d926c5ed61 | |
Kim Kulling | ceced70df0 | |
Kim Kulling | f3903e34a4 | |
Kim Kulling | 4766d75943 | |
Kim Kulling | a486a698e8 | |
Kim Kulling | 4ce638838d | |
Kim Kulling | a850f312ac | |
Kim Kulling | c28aab2ed6 | |
Kim Kulling | 27231c3f52 | |
Kim Kulling | 4caba7de8a | |
Max Vollmer (Microsoft Havok) | c1e830cf3b | |
Max Vollmer (Microsoft Havok) | de2f5cf021 | |
Spectrum76 | 4d8c518ed0 | |
Kim Kulling | 4b1ff645e3 | |
Mykhailo Smoliakov | 26defda671 | |
Robert Ubiñas | b95df54225 | |
Robert Ubiñas | 58cae73401 | |
Robert Ubiñas | 69c152d7c1 | |
krishty | aac77e58b6 | |
Mykhailo Smoliakov | c3fcbfd2c1 | |
Kim Kulling | fcc7ad52a1 | |
Kim Kulling | a16cd95b16 | |
Kim Kulling | 843e16868c | |
Kim Kulling | a55518f6fc | |
Kim Kulling | 58f91000c8 | |
Kim Kulling | 89eadb934f | |
Kim Kulling | 89d17d1ea8 | |
Kim Kulling | 0aa36ee550 | |
krishty | 73b25d2578 | |
krishty | f8fe3d1341 | |
krishty | 00b22d1397 | |
krishty | 6cb54d1c95 | |
Kim Kulling | 76e3092b2a | |
Kim Kulling | d09d7a9e13 | |
Kim Kulling | 87d53ce0cb | |
bearbit | 408b5053a4 | |
Hill Ma | 538cb3125c | |
Hill Ma | 8d6d6b48c3 | |
Spectrum76 | bd2067fa8a | |
krishty | 1ee2be8c5c | |
Kim Kulling | 00a2cd20f9 | |
Kim Kulling | 8f02c29023 | |
Spectrum76 | 6ce5248931 | |
Krishty | bb53961fa9 | |
Krishty | a1eaaaa0e3 | |
Krishty | 42a7611f85 | |
Krishty | 4991f728c8 | |
Krishty | 758116b083 | |
Krishty | 738c31c3ea | |
xiaohunqupo | d065513e27 | |
Kim Kulling | fc22d6cdae | |
Kim Kulling | f87550fdbc | |
xiaohunqupo | 8ee2c721d9 | |
xiaohunqupo | 9923cd0e06 | |
Kim Kulling | 8748f8591c | |
Kim Kulling | 92af44f092 | |
Kim Kulling | 209c66dff1 | |
Kim Kulling | aeae2cf242 | |
Kim Kulling | e8e720d584 | |
Kim Kulling | 291c0a4faa | |
Kim Kulling | df2e7208fb | |
Kim Kulling | c3a097abc9 | |
Kim Kulling | 16c3f82222 | |
Kim Kulling | 26538a4f4a | |
Kim Kulling | b7f88f3063 | |
Kim Kulling | a96e7e6e2b | |
Kim Kulling | 4e28a3072f | |
Kim Kulling | 1757513890 | |
Kim Kulling | d554b4950d | |
Kim Kulling | 0372c8c65d | |
Kim Kulling | e07af07311 | |
Kim Kulling | f3cb23c0c7 | |
Kim Kulling | 33da6ab376 | |
Kim Kulling | aa8628abef | |
Kim Kulling | e9d7ec4ba5 | |
Kim Kulling | d0885af634 | |
Kim Kulling | 9036d3bd12 | |
Kim Kulling | 9f2540a2a8 | |
Kim Kulling | e13ce4b624 | |
Adrian Perez | a10f918071 | |
Adrian Perez | 30d342534a | |
Adrian Perez | 5285736ba0 | |
Kim Kulling | 22099605e3 | |
Kim Kulling | 5171aa52d1 | |
Kim Kulling | 5693bc71f3 | |
Hill Ma | aa883eda19 | |
Kim Kulling | cb5686653f | |
Kim Kulling | e791f09aeb | |
Kim Kulling | f3addb3ba4 | |
RichardTea | 632b2db97c | |
Rahul Sheth | 6e863b2435 | |
RichardTea | 0c6c238956 | |
Kim Kulling | 23e416de3b | |
Kim Kulling | a08c1c1d67 | |
Kim Kulling | 9c207cd865 | |
RichardTea | bff1d012bd | |
RichardTea | 206b2436d4 | |
Kim Kulling | d37ef516f8 | |
Kim Kulling | 15bbab2d9e | |
Kim Kulling | bd28c285fc | |
Kim Kulling | d678fb7406 | |
Manuel López Antequera | e49ee6cfb2 | |
Rahul Sheth | 1b37b74f9e | |
Rahul Sheth | 0a5e49252d | |
Kim Kulling | 1d33131e90 | |
Promit Roy | 90c115cb3f | |
Kim Kulling | 939dacdbee | |
Kim Kulling | 240eb36980 | |
arkeon | 3cbd31900c | |
DESKTOP-HEFITKI\Iraj | 391080d2e6 | |
Kim Kulling | 1ea3cb545d | |
Kim Kulling | 0a48a35382 | |
Kim Kulling | 3ea4baad81 | |
Kim Kulling | 01930101c7 | |
Kim Kulling | 67c45e2d87 | |
Kim Kulling | 59ab791a47 | |
Promit Roy | 7c822f23bd | |
Jerome St-Louis | e3d54860ec | |
Pankaj003 | 72075f984e | |
Kim Kulling | d855ec2472 | |
Jerome St-Louis | 0e41efb050 | |
Aaron Gokaslan | f435ce8c2c | |
Kim Kulling | b38b65ff49 | |
Kim Kulling | 012ce30577 | |
Kim Kulling | bd9b28bc45 | |
Kim Kulling | d18d838812 | |
Kim Kulling | b5350899b2 | |
Kim Kulling | 28ca0d13d3 | |
Kim Kulling | 00bf757688 | |
Jerome St-Louis | 170063643c | |
Aaron Gokaslan | 8e3a159141 | |
Pankaj Tyagi | 6170c49155 | |
Evangel63 | e736538df3 | |
Kim Kulling | bf82caba18 | |
Kim Kulling | c447fc6892 | |
Kim Kulling | 1faedc136a | |
Aaron Gokaslan | 24d4be958d | |
Aaron Gokaslan | 544148a626 | |
Kim Kulling | 760953c834 | |
Kim Kulling | 36815b014b | |
Kim Kulling | 53d2cf975a | |
Aaron Gokaslan | b17c2f29e9 | |
Aaron Gokaslan | 1650868701 | |
Aaron Gokaslan | 94c3abd841 | |
Kim Kulling | 951d5158c5 | |
ihsinme | d699e7b56e | |
Kim Kulling | 43a5c6c8e3 | |
Kim Kulling | 9512e9ac1e | |
Kim Kulling | 376b3b2eff | |
Kim Kulling | a8c75c34a1 | |
Kim Kulling | 089375bd63 | |
Hill Ma | fe8c4ebd8c | |
Andreas Buhr | e27074594f | |
Kim Kulling | fdb9ce6445 | |
Kim Kulling | a34b9d1c95 | |
Hill Ma | 148b8c66a8 | |
Hill Ma | af748755e1 | |
Kim Kulling | a6558ca249 | |
ihsinme | 6a78ef5652 | |
RichardTea | a909341767 | |
RichardTea | f412595887 | |
RichardTea | 985f3ee665 | |
RichardTea | fb039bb9eb | |
RichardTea | 4a66ec25d0 | |
RichardTea | 4476352882 | |
Kim Kulling | a9b29abee6 | |
Kim Kulling | 9a851cac7b | |
Kim Kulling | a0388b1727 | |
Evangel | 064ffc625b | |
Evangel | 3de20af3cc | |
Evangel | a7a30baf27 | |
Evangel | 7f0efa0866 | |
Evangel | 5be2330fbb | |
Evangel | 6d413444b5 | |
Evangel | 36c8cdf3de | |
RichardTea | fbf75963dc | |
RichardTea | 230f367ef9 | |
RichardTea | c86522e552 | |
RichardTea | 4b4d6b1326 | |
ihsinme | 6dd9ab062c | |
Kim Kulling | 6db142ee51 | |
Kim Kulling | ebb9b1b2af | |
RichardTea | 9f9d77f882 | |
Kim Kulling | 391d3195df | |
Scott Baldric | 1deacf32be | |
Kim Kulling | 199aa5dd66 | |
Kim Kulling | fc4ebefaa4 | |
Hill Ma | ef739c1703 | |
Scott Baldric | ca1ab8b11b | |
Kim Kulling | c58fe0c98f | |
Hill Ma | 121c0e7d0c | |
Kim Kulling | 790203ee9d | |
Kim Kulling | cdc1bf8e10 | |
Scott Baldric | 8039351a67 | |
Kim Kulling | a8ddc74426 | |
Kim Kulling | 1126fa5218 | |
Kim Kulling | d33cf1dc0c | |
Scott Baldric | 444fc9c373 | |
Kim Kulling | 84db4d3a08 | |
Kim Kulling | b0e7271449 | |
Kim Kulling | e6b83feb9f | |
Kim Kulling | 1a493613c1 | |
Kim Kulling | a3b3ab1d44 | |
Kim Kulling | 742250c5fb | |
Kim Kulling | a716f741d8 | |
Kim Kulling | bf0f8d4c1b | |
Kim Kulling | cc912f09f7 | |
Kim Kulling | 22b49efbd0 | |
Kim Kulling | d2da600d08 | |
Kim Kulling | e0d1a36523 | |
Kim Kulling | b4fc41bc09 | |
Kim Kulling | d600b45cd2 | |
Kim Kulling | f28331b202 | |
Kim Kulling | 3a32612b71 | |
Kim Kulling | 84a2e1fc92 | |
Kim Kulling | c8510a1a82 | |
Kim Kulling | d4199ee968 | |
Kim Kulling | dd3d03a4ae | |
Kim Kulling | 35c506fcf8 | |
Kim Kulling | 77ce4080b6 | |
Garux | 3b565444c3 | |
Garux | c776924adf | |
Kim Kulling | c04759ccc4 | |
Kim Kulling | 8f18820bb2 | |
Kim Kulling | 9be76c1ba5 | |
Kim Kulling | 09bb79c68a | |
Matthias Möller | 7534b149cf | |
Kim Kulling | 1f6fe4b5ad | |
Kim Kulling | 2559befaca | |
Kim Kulling | c6c7e84c00 | |
Kim Kulling | 3c51ff771c | |
Kim Kulling | 2b8a06340c | |
Kim Kulling | 919ae69fe8 | |
Kim Kulling | eadffe8e3a | |
Kim Kulling | 59467b204a | |
Kim Kulling | 15bdc09863 | |
Kim Kulling | 70cc1630fa | |
Kim Kulling | 57b1040a0c | |
Kim Kulling | 48e99d2e0a | |
Kim Kulling | 64d5f21627 | |
Kim Kulling | 7258441153 | |
Carsten Rudolph | c33a4b2634 | |
Carsten Rudolph | 0905252833 | |
Evangel63 | c557cf970a | |
Kim Kulling | ce0f696c71 | |
Kim Kulling | aa8d746dc3 | |
Evangel63 | f6b9e93e24 | |
Kim Kulling | 29e5f5fed1 | |
Kim Kulling | d4fb6847d8 | |
Kim Kulling | b59db55b8c | |
Evangel | 2f4fba0703 | |
Evangel | 5468dd667e | |
Kim Kulling | 6f24e873b3 | |
Kim Kulling | 6b8a00dfa1 | |
Kim Kulling | 743b87883e | |
Kim Kulling | b5e54e4d3b | |
Kim Kulling | faeae27923 | |
Kim Kulling | 40f9d37a38 | |
Jean-François Verdon | f13515a391 | |
Jean-François Verdon | 6c104e096e | |
Kim Kulling | aeaa22cbbd | |
Kim Kulling | 770b099540 | |
Kim Kulling | ac54fe41e2 | |
Jean-François Verdon | 799384f2b8 | |
Jagoon | f96e3cde2d | |
Jean-François Verdon | b7b3c6db7e | |
Jagoon | 28e34878cb | |
Kim Kulling | 7686393fe3 | |
dlyr | 1f32743f8b | |
Kim Kulling | f675aaa871 | |
Kim Kulling | 92b8c02982 | |
RichardTea | 53790e8273 | |
Kim Kulling | ee85ebbd00 | |
Kim Kulling | 53563a8624 | |
Kim Kulling | 4f801a104e | |
Kim Kulling | b622eb5689 | |
Kim Kulling | 79da512e99 | |
Kim Kulling | 20ade095ea | |
Kim Kulling | dd0011b4a9 | |
Kim Kulling | 88ccfedd10 | |
James Franco | 1543738b1f | |
Kim Kulling | 25d0cd39f6 | |
Kim Kulling | 3726b2eef4 | |
Kim Kulling | 3fa45e6a8c | |
Kim Kulling | e01a6b4276 | |
Kim Kulling | 6cdfd3fcc1 | |
Malcolm Tyrrell | 54a27f4514 | |
Malcolm Tyrrell | 3d3462a621 | |
Malcolm Tyrrell | 084dc73b91 | |
Malcolm Tyrrell | fd5d1211f9 | |
Malcolm Tyrrell | 6e4b9d267b | |
Carsten Rudolph | 43e1e4d3d3 | |
Kim Kulling | 0c9947f8b9 | |
Kim Kulling | 6dec8ad5f3 | |
ogjamesfranco | 27135bd3e7 | |
Kim Kulling | 596f7db9f9 | |
Kim Kulling | dba4e21f7c | |
Kim Kulling | 403aef8cea | |
Kim Kulling | 348ae42212 | |
Kim Kulling | 8ab2e466f5 | |
Kim Kulling | eabae431f4 | |
Malcolm Tyrrell | 4ec01cfdcd | |
Kim Kulling | 22340469f4 | |
Malcolm Tyrrell | ad6f300b1d | |
Malcolm Tyrrell | c5f22269a8 | |
Malcolm Tyrrell | 7abfd134b6 | |
Malcolm Tyrrell | 5cd3bdd5c2 | |
Malcolm Tyrrell | 6957d34733 | |
Malcolm Tyrrell | 78145f1425 | |
Malcolm Tyrrell | 89584c167a | |
Malcolm Tyrrell | ca698c3e49 | |
Carsten Rudolph | a700285c64 | |
Chuck Claunch | 18beae988c | |
Kim Kulling | 0849f4e573 | |
Kim Kulling | b70f195805 | |
Kim Kulling | a183ad17bb | |
Malcolm Tyrrell | 58bc4bcb63 | |
Malcolm Tyrrell | 813d0aecdd | |
Kim Kulling | 7a3c8e5504 | |
Kim Kulling | 8b13223314 | |
Kim Kulling | f127144f71 | |
Kim Kulling | 3768a2194e | |
Kim Kulling | 8013c5011c | |
Kim Kulling | ad4ca71e4c | |
Kim Kulling | f197e93035 | |
Salvage | 8d20460ae4 | |
Jason C | 75af93aaa4 | |
Kim Kulling | 951c8a976c | |
Kim Kulling | 4ee2f5f69d | |
Carsten Rudolph | a54cd432cd | |
Salvage | 632e4a20a9 | |
Jason C | 00b625a2ae | |
Kim Kulling | 7ff6144c2c | |
Kim Kulling | cb7d3ac598 | |
Kim Kulling | cdc0bd00ce | |
Kim Kulling | e1a0e16a4e | |
Kim Kulling | 76ccaeb42f | |
Kim Kulling | 4807853f09 | |
Krishty | ab43f3fefd | |
Krishty | d75f8bd5b0 | |
Kim Kulling | 433620350e | |
Jason C | f87b180147 | |
Kim Kulling | b30cbcf117 | |
Kim Kulling | 38dc92c5c9 | |
Jason C | 0f85990fe3 | |
Jason C | 5cc05c26a7 | |
Kim Kulling | 319770db9d | |
Kim Kulling | 226b34bb35 | |
Jason C | 859b32c045 | |
Jason C | e37e00c51f | |
ywang | a19b708144 | |
Jason C | 9a2a0384f4 | |
Jason C | 279e9a186f | |
Jason C | 6eb15080ec | |
Jason C | 2fd6102573 | |
Jason C | 7b404788a6 | |
Carsten Rudolph | 1b33dd1965 | |
Carsten Rudolph | 8ff52c0f89 | |
Carsten Rudolph | be85f238f4 | |
Carsten Rudolph | 964778cac1 | |
Kim Kulling | 25a0eb0d67 | |
Kim Kulling | d7c65d363c | |
Kim Kulling | 8cae8c5461 | |
Kim Kulling | 56bfa1ce5c | |
ywang | 2b9d88c943 | |
Kim Kulling | 25cf5dd487 | |
Kim Kulling | 350f2ea1d3 | |
Kim Kulling | 52228a93f8 | |
Kim Kulling | b1b937ea79 | |
Kim Kulling | e120544978 | |
Kim Kulling | 1c90d28f9b | |
Kim Kulling | bc7551b778 | |
Kim Kulling | 253fdbdeda | |
Kim Kulling | f53ae076a7 | |
Kim Kulling | 90d3ff27f8 | |
Kim Kulling | 55056d11fd | |
Jason C | 7da9c42c81 | |
Jason C | c08ad2e5c2 | |
Jason C | de5c8ece6f | |
Jason C | 98f586c8d4 | |
Jason C | 470913bf27 | |
Jason C | 0d3e8b52be | |
Jason C | a80b3b25eb | |
Jason C | e52c297284 | |
Jason C | 1cd3752ec6 | |
Jason C | 7f13387487 | |
Jason C | 116ebf6e10 | |
Krishty | 6c7ee61f14 | |
Krishty | 816da9b677 | |
Jason C | 785cca1bb4 | |
Krishty | 24df52647f | |
Jason C | f5a31b70f5 | |
Kim Kulling | 992f10e7bf | |
Jason C | 7ae8a52d9f | |
Kim Kulling | b82d9f4bc7 | |
Kim Kulling | 1e89c06157 | |
Kim Kulling | 5325b327c3 | |
Kim Kulling | 3f5c3eb38c | |
Kim Kulling | 067993d607 | |
Kim Kulling | 0aadd8a3f9 | |
Kim Kulling | d1991ad949 | |
Kim Kulling | e683c6eef9 | |
Kim Kulling | 9395322e56 | |
Max Vollmer (Microsoft Havok) | 153b890b02 | |
kkulling | 2a6b84c8ea | |
Krishty | d5cde96fbd | |
Krishty | b546dfccc7 | |
kkulling | f15dcfa981 | |
kkulling | cbce6d3dad | |
Kim Kulling | 6dcbd0d566 | |
Jason C | 6e65115253 | |
Jason C | ccd1a4455e | |
Jason C | a03dc4edaa | |
Jason C | f8609c2c2d | |
Jason C | 558457e5bf | |
Jason C | 9a04f5d4b0 | |
Jason C | a9fb1e56ae | |
Jason C | c8ad8c6017 | |
Krishty | deca47225f | |
Krishty | ae93f53b51 | |
Krishty | b79b84d34e | |
Krishty | 0f3e6e2941 | |
Jason C | 200086c4c5 | |
Jason C | 7dd7a053a9 | |
Jason C | 1ec8d4b6cf | |
Jason C | 2925592c64 | |
Kim Kulling | 072aee7cbe | |
Kim Kulling | 38df0f4376 | |
Krishty | b57ce004f8 | |
Krishty | f3c18556d1 | |
Krishty | 7b6dab5e20 | |
Krishty | 2a126f9f62 | |
Kim Kulling | dc6fa58814 | |
Kim Kulling | be85eac703 | |
Kim Kulling | 875acc5166 | |
Eric Olson | f17d58cadd | |
Krishty | 8ad9c937f1 | |
Kim Kulling | cd0fd30821 | |
Kim Kulling | e85a69a960 | |
vfxgordon | 4231a86ad8 | |
kimkulling | 7690f92c81 | |
Kim Kulling | 47cacf8aa6 | |
kimkulling | ee5170c18a | |
Kim Kulling | 9c44c0ab2b | |
Kim Kulling | ff18354997 | |
kimkulling | 0e17939e8d | |
Kim Kulling | 33a85e280f | |
kkulling | 55fd820ed7 | |
Kim Kulling | 70ba2e9e74 | |
Kim Kulling | 39522178aa | |
Kim Kulling | 79802ad836 | |
Kim Kulling | 88d64388f8 | |
Kim Kulling | b87f67db4c | |
Kim Kulling | 60b99501a9 | |
Tom spot Callaway | f91b439f79 | |
Tom spot Callaway | e7211790fb | |
Krishty | fe5a23e110 | |
vfxgordon | 9ae3e88f6c | |
Kim Kulling | f29828f657 | |
Kim Kulling | 71c48581f3 | |
Kim Kulling | 9e27afe353 | |
Kim Kulling | afdec791a6 | |
Kim Kulling | e278673fe7 | |
Krishty | e73a2ed5e0 | |
Kim Kulling | 6c429a9d82 | |
Krishty | 65a2b98b86 | |
Jason C | c2d3d22271 | |
Kim Kulling | b516d940b6 | |
Kim Kulling | 78132d666f | |
Kim Kulling | f538b96e82 | |
Kim Kulling | 7843b24e03 | |
Kim Kulling | d28e2e0a39 | |
Garux | eab1c9c3c0 | |
contriteobserver | 813b64ef52 | |
contriteobserver | bf653b4bd6 | |
contriteobserver | e51bb1e77e | |
contriteobserver | 694f4c2e34 | |
contriteobserver | 302e47efc1 | |
contriteobserver | af0aca796e | |
Jason C | 07257f4c66 | |
Garux | 55abc49d6d | |
Garux | 0b7ebef497 | |
Kim Kulling | 2d51efa002 | |
Kim Kulling | 911321b97b | |
Kim Kulling | 2feda5b4b2 | |
Kim Kulling | 9b36f62cb2 | |
Kim Kulling | 60f030ccbc | |
Kim Kulling | 9ef84a67f7 | |
Kim Kulling | feeb89a1dd | |
Garux | 149224091f | |
Kim Kulling | 57091d761e | |
Kim Kulling | 0b92abe9b4 | |
vfxgordon | 5298ed8f9e | |
Kim Kulling | 73e05ab6d3 | |
Garux | edf12bd357 | |
Krishty | 666b5eff76 | |
Garux | 3717e66fae | |
Garux | 4798ff3882 | |
Garux | ebf5ef9a4b | |
Garux | db142da571 | |
Scott Baldric | f523b1e0d7 | |
Jason C | 975de81ab6 | |
Kim Kulling | 96d0524fab | |
Kim Kulling | 41e5acf060 | |
Kim Kulling | 7dd870f88c | |
Kim Kulling | 9a0b703db1 | |
Jason C | cf498c979a | |
Kim Kulling | 6abdd0cd3e | |
Scott Baldric | 8e3fe6b30b | |
Krishty | 260cc6bd26 | |
Kim Kulling | 74577ae3c7 | |
Kim Kulling | 30f55dcbbf | |
Kim Kulling | 9504957534 | |
Jason C | 3acd42c22e | |
Jason C | 708d124745 | |
Gordon Chapman | 64da2a4315 | |
Gordon Chapman | a5d0e99548 | |
Max Vollmer (Microsoft Havok) | e1d6e1f377 | |
Eric Wasylishen | ee8d1b0417 | |
Krishty | 5c64a4dc1e | |
Krishty | e6a47d93c2 | |
Kim Kulling | 7cd6ddad8a | |
Krishty | afe947d5db | |
Krishty | 628cba9490 | |
Krishty | b00de10eb3 | |
Kim Kulling | cd3e283bcb | |
Scott Baldric | 44834408c8 | |
Kim Kulling | 21d7085be6 | |
Kim Kulling | 0b14eb7523 | |
Krishty | 9dc66b0003 | |
Kim Kulling | 4db4e7206d | |
Scott Baldric | 359fcadd87 | |
Kim Kulling | 574ea5acf9 | |
Krishty | 196deea7ce | |
Kim Kulling | 31438a03a6 | |
Scott Baldric | 4b47b7a552 | |
Kim Kulling | c8ad1cb078 | |
Scott Baldric | aae3788247 | |
Kim Kulling | 8881e65d62 | |
Max Vollmer (Microsoft Havok) | 44dc08f128 | |
Max Vollmer (Microsoft Havok) | 746d5cf964 | |
Kim Kulling | 6027c10969 | |
Kim Kulling | 873c6ffabe | |
Krishty | 55dd5faafb | |
Tobias Rittig | 0643786288 | |
Kim Kulling | 0af558a11c | |
Krishty | 930cc25c0e | |
Krishty | 3fead344ad | |
Krishty | a19299d501 | |
Krishty | f761dc72f4 | |
Krishty | 6cbeca5518 | |
Kim Kulling | cd42b9954b | |
Kim Kulling | 21b56b0058 | |
Kim Kulling | 83c0dce075 | |
Kim Kulling | c282b9a775 | |
Kim Kulling | 0b61a8875a | |
Kim Kulling | bbfefd89d7 | |
Kim Kulling | bef2304c53 | |
Hill Ma | 4aa52b3af8 | |
Kim Kulling | 182418e818 | |
Kim Kulling | a6e4672df1 | |
Kim Kulling | d1eeb80e1a | |
Kim Kulling | c9ba616eb6 | |
Kim Kulling | 263d450300 | |
Kim Kulling | 67fa0a13bc | |
Kim Kulling | a3ee377af7 | |
Kim Kulling | cf4ef04a80 | |
Kim Kulling | 6eae925441 | |
Clement JACOB | e66232d8c3 | |
Patrick Walton | a44ba41413 | |
Kim Kulling | d51fce9e70 | |
Kim Kulling | 7fee914776 | |
Kim Kulling | 4eb69d1e54 | |
Scott Baldric | 31e8042071 | |
Garux | 856547be23 | |
Garux | 437d7bf8b8 | |
Kim Kulling | 06a60c43cf | |
Kim Kulling | 010c0853ea | |
Kim Kulling | eb261c6581 | |
Kim Kulling | 22413d85ad | |
Kim Kulling | cfad36d0f4 | |
Kim Kulling | 7d68eab4a7 | |
Kim Kulling | d677005487 | |
Kim Kulling | 0b628a0ebb | |
Kim Kulling | 456af8c493 | |
Kim Kulling | 80fc8538be | |
Kim Kulling | d62c89557b | |
Kim Kulling | 46e49d0b83 | |
Kim Kulling | cdb6a62cdb | |
Kim Kulling | da0543972b | |
Kim Kulling | 89a8f87dae | |
Kim Kulling | 91cb2947ac | |
Clement JACOB | a25ef8a329 | |
Kim Kulling | 18af013c9e | |
Kim Kulling | 577a8fc186 | |
Kim Kulling | 658ffe3d2c | |
Kim Kulling | 20e3261304 | |
Kim Kulling | 60794f3743 | |
Clement JACOB | 5d09105a49 | |
Clement Jacob | fc2c12ad6a | |
Clement Jacob | fc0cf2ea8d | |
Clement Jacob | 2e90fed527 | |
Clement Jacob | 596001c89c | |
Clement Jacob | 81019d5e58 | |
Clement Jacob | 6d1a0c6054 | |
Clement Jacob | 8e589221d7 | |
Kim Kulling | 3880cd225c | |
Kim Kulling | f61a41bdd9 | |
Kim Kulling | b5d4e50895 | |
Bernold Kraft | 09d3266250 | |
Elias Daler | 0bd938c024 | |
urschanselmann | 5755530bab | |
Kim Kulling | e5862c18be | |
Kim Kulling | b7df376836 | |
Bernold Kraft | 348c34811f | |
Gordon Chapman | 3fd865b4bf | |
Malcolm Tyrrell | d94ddd32b1 | |
Malcolm Tyrrell | add165c4a1 | |
Kim Kulling | d1ef28fa52 | |
Kim Kulling | 2c5fd39176 | |
urschanselmann | 0a1efe5d58 | |
Kim Kulling | 525213a045 | |
urschanselmann | 86c05a1154 | |
Kim Kulling | 5f652feb75 | |
Kim Kulling | 608b48e1fc | |
Kim Kulling | 18886686e1 | |
Alexander Gessler | 191fcafcc0 | |
Hill Ma | 3e99385f44 | |
Urs Hanselmann | d9cd07f0d9 | |
Malcolm Tyrrell | 3503252e12 | |
Malcolm Tyrrell | e4983aa16e | |
Malcolm Tyrrell | 8d86bcf0fb | |
Malcolm Tyrrell | 57652a9084 | |
Malcolm Tyrrell | 053c0f5e0a | |
jaefunk | a812fd1a0a | |
jaefunk | 37c2d33cc9 | |
Kim Kulling | 0dbaeb57e3 | |
Kim Kulling | e5417ea41f | |
Kim Kulling | 9058692d16 | |
Kim Kulling | f5dd8db45f | |
Kim Kulling | 20350ba5cb | |
Kim Kulling | f5ed217409 | |
Kim Kulling | 383dfae79b | |
Kim Kulling | 84cd1d95c7 | |
Urs Hanselmann | c0c7e6a0de | |
Urs Hanselmann | cc7e229c3c | |
jaefunk | 16f10a0533 | |
Kim Kulling | 47d36cdb97 | |
Kim Kulling | 51ad88afb6 | |
Kim Kulling | cdd0fea6e8 | |
Kim Kulling | 806b12dc8b | |
Kim Kulling | 520f64eeec | |
Kim Kulling | 732e9386aa | |
jaefunk | 5c11ca6c8a | |
ethan | b6dced4b11 | |
Kim Kulling | 6c89631581 | |
Kim Kulling | ed968367d5 | |
jaefunk | e53335e58c | |
Kim Kulling | 8a89ffa7a5 | |
Matthew Wallace | 0ebab47ca2 | |
Paul Engelhardt | dffaeade94 | |
Kim Kulling | 75144dd7fd | |
Andy Shaw | 2576c8c3a6 | |
Minmin Gong | c6c0f141f1 | |
contriteobserver | fc955a5f8a | |
Kim Kulling | ff769ecce2 | |
Kim Kulling | e09e4ab670 | |
Kim Kulling | 75210576cf | |
contriteobserver | 6ab2e8d558 | |
contriteobserver | 111752cff0 | |
Kim Kulling | 315362862a | |
Kim Kulling | 20ef096db6 | |
Kim Kulling | ff057dbcb2 | |
Kim Kulling | c669c8f1eb | |
Kim Kulling | 9e8dbd0ca5 | |
Kim Kulling | 9336341eac | |
Kim Kulling | 21c2f8bc9c | |
Kim Kulling | 143d134cd7 | |
Kim Kulling | 05ee5432f6 | |
Kim Kulling | 5b78e3fb5d | |
Kim Kulling | 861829a04b | |
Kim Kulling | aa6f983920 | |
Turo Lamminen | 2bac0a6989 | |
Max Vollmer (Microsoft Havok) | eef03c1f17 | |
Max Vollmer (Microsoft Havok) | facb7da701 | |
Turo Lamminen | 3e1c785d31 | |
thomasbiang | 5429475339 | |
ywang | 72efb4354a | |
Kim Kulling | 3c79b12e02 | |
Kim Kulling | 247fd0ce17 | |
Kim Kulling | d40f0390e3 | |
Kim Kulling | 616d924d29 | |
Kim Kulling | 26ebeaea5c | |
Kim Kulling | 3651dd5bbc | |
Kim Kulling | 80423ff5f0 | |
Kim Kulling | 6094da3493 | |
Kim Kulling | cdf786d171 | |
Alex | 2fd6666477 | |
Kim Kulling | 1d376fa91f | |
Minmin Gong | d57b78bc98 | |
Jhonny Knaak de Vargas | 6130e53cdf | |
RichardTea | f1d225c18d | |
Kim Kulling | 7be65aead7 | |
Kim Kulling | 242e9c21a9 | |
Kim Kulling | dac7243b94 | |
Kim Kulling | 5f1f2a65ce | |
Kim Kulling | 1279862e31 | |
Kim Kulling | 047b45d172 | |
Kim Kulling | 607d474400 | |
Guangmo Lin | ba7f945f99 | |
Kim Kulling | 52c66406fa | |
Kim Kulling | 8a3a727865 | |
Kim Kulling | 426c1a340f | |
Guangmo Lin | 2d4bc2d04e | |
Kim Kulling | 2cb0304e71 | |
Kim Kulling | c9ca921d09 | |
Kim Kulling | 888415246e | |
Kim Kulling | c50517d8df | |
Gargaj | 8ae8b165ca | |
Kim Kulling | cb15a0d8b0 | |
Kim Kulling | be518e50e9 | |
Kim Kulling | 6c3593eda0 | |
Kim Kulling | afbe8fb436 | |
Kim Kulling | 6b7b1caa06 | |
Kim Kulling | b67ea99dc8 | |
Kim Kulling | 6f759474bc | |
Kim Kulling | 710f1d17d4 | |
Kim Kulling | 0e941c2478 | |
Kim Kulling | ca823318c3 | |
Kim Kulling | 6784427287 | |
kimkulling | 4207c97c17 | |
Kim Kulling | c749591c72 | |
Kim Kulling | 80e7f2a513 | |
Kim Kulling | 5cf5ca4a16 | |
ywang | 9bab475302 | |
Kim Kulling | bb21ec9423 | |
Kim Kulling | 2391432523 | |
Kim Kulling | e6b8ae44cb | |
RichardTea | 42d47c7f0b | |
xiaohunqupo | c43a1ed886 | |
xiaohunqupo | 688c259584 | |
thomasbiang | d08acb85e7 | |
Kim Kulling | faf53b8e0f | |
Kim Kulling | 6ee1a32fb2 | |
Kim Kulling | 50fd5127ef | |
ywang | 793bd44cee | |
Kim Kulling | fa2354ebc3 | |
contriteobserver | 74b70cad79 | |
contriteobserver | 800d5c23c3 | |
contriteobserver | 65bc86e181 | |
RichardTea | aa10b56bc2 | |
RichardTea | b45723c384 | |
RichardTea | 82773c29ad | |
Kim Kulling | 5fbbba2fac | |
contriteobserver | 5a8e00b219 | |
contriteobserver | c86dcbe1a8 | |
Kim Kulling | 754b2ba434 | |
Minmin Gong | 9aa6ec73ba | |
Rahul Sheth | a0116c6e01 | |
Rahul Sheth | 62c991290b | |
Kim Kulling | f2543ee608 | |
Kim Kulling | d87d9f2094 | |
Kim Kulling | de827b2fec | |
Kim Kulling | 65f3569d61 | |
Kim Kulling | 79eb9ecc86 | |
Kim Kulling | 2e3d72abd3 | |
Kim Kulling | 79a442f95d | |
Kim Kulling | db8e9eb556 | |
Kim Kulling | 3174a9cac8 | |
Kim Kulling | 8d4b816dfe | |
Kim Kulling | 1afc4c045e | |
contriteobserver | e33b69a428 | |
Kim Kulling | 706d636c63 | |
RichardTea | efae3b83b1 | |
RichardTea | 48bcbbefdd | |
RichardTea | 150514fc8b | |
RichardTea | 5e7281dac6 | |
RichardTea | 26ce6ba4f6 | |
RichardTea | f6862f9697 | |
RichardTea | 6ec32b6b78 | |
RichardTea | c6fd1ce996 | |
RichardTea | 5b9d06c2fc | |
Kim Kulling | b2af2b2137 | |
Kim Kulling | 1e38f84c3a | |
Kim Kulling | ac0f1f2cab | |
Kim Kulling | c02ad323a5 | |
thomasbiang | 4ed9f3c2f4 | |
Kim Kulling | 4471c36c08 | |
Kim Kulling | 83d4227e5c | |
Kim Kulling | 1950247329 | |
RichardTea | 0c49cddae6 | |
RichardTea | 88001d1609 | |
Kim Kulling | 2cd6cd603c | |
RichardTea | d79e0c0ba9 | |
Kim Kulling | c12f747bde | |
Kim Kulling | b6b061b21a | |
RichardTea | fe97ff6474 | |
Kim Kulling | 95fe3e98a6 | |
Kim Kulling | 0244aec0a5 | |
Kim Kulling | d04b1b9e2e | |
RichardTea | c917e6513f | |
RichardTea | f39ba8ddb2 | |
RichardTea | dde7605158 | |
RichardTea | 3a7d0f5656 | |
contriteobserver | d7bf513250 | |
contriteobserver | 69fc809307 | |
contriteobserver | f92a34e0b7 | |
Kim Kulling | 4017a6da26 | |
xiaohunqupo | fbc45fecec | |
Kim Kulling | 294d4230b0 | |
Kim Kulling | 243d017463 | |
Kim Kulling | 47dd6c0786 | |
Kim Kulling | a2b889ab09 | |
Kim Kulling | e18261953d | |
Kim Kulling | 7a706be920 | |
Kim Kulling | dd0facd722 | |
contriteobserver | b48e19c28f | |
Ville Voutilainen | ec141a94c3 | |
Kim Kulling | 9dc95be939 | |
Ville Voutilainen | 6ebae5e67c | |
Kim Kulling | 5390e035d5 | |
contriteobserver | 338abded12 | |
Bart Sekura | 5f50e42535 | |
Bart Sekura | f8c512acd7 | |
thomasbiang | 91dc904ed1 | |
Kim Kulling | 28c9bccbef | |
Kim Kulling | e792455d66 | |
Kim Kulling | e321367dae | |
Kim Kulling | dc4514de82 | |
Kim Kulling | 0dcd72d420 | |
Kim Kulling | f44572157a | |
Kim Kulling | 6293c22c5c | |
Kim Kulling | c9c54822fd | |
Kim Kulling | f2d3f0dbe6 | |
Kim Kulling | 71e8c1001e | |
Kim Kulling | e435a43e53 | |
Kim Kulling | b64f1c40f4 | |
thomasbiang | b3a35364ad | |
Kim Kulling | 345726f5c8 | |
Kim Kulling | 2bcf08370d | |
Kim Kulling | 5e21b9f72d | |
Kim Kulling | 0b9cbb53ab | |
Kim Kulling | fabea8ccd0 | |
Kim Kulling | 7dcac538f8 | |
thomasbiang | d7cf7847ba | |
ywang | 01e61c8b9f | |
Kim Kulling | 4e0c4d7bb7 | |
Kim Kulling | 11a17ebfe6 | |
RichardTea | 8f4eff8d95 | |
RichardTea | c1be6c76c8 | |
RichardTea | deac3a9f6c | |
xiaohunqupo | 8ba1d38dea | |
Kim Kulling | c52e5c4da8 | |
Kim Kulling | f8dd3a9aa6 | |
Kim Kulling | ed3e745752 | |
Kim Kulling | f05a57560b | |
Kim Kulling | 22f632d8d0 | |
Kim Kulling | 5b325af79f | |
Kim Kulling | 62e231b452 | |
Kim Kulling | 5a6498af92 | |
Kim Kulling | 4008862a35 | |
Kim Kulling | d12b1e8d70 | |
Matt Pharr | 8f5148f108 | |
Dan Church | 0bc5cf9fd3 | |
Kim Kulling | 5a7f212162 | |
Kim Kulling | 9a30887117 | |
Kim Kulling | f24c042925 | |
Kim Kulling | 0803e5e6f3 | |
Kim Kulling | 0eb9005bc1 | |
Kim Kulling | 11ee9d3673 | |
Kim Kulling | 5a764fff04 | |
kimkulling | 7bb13e6272 | |
Kim Kulling | 3c1d8850a4 | |
Kim Kulling | 658fec3e61 | |
Kim Kulling | 0969bf3500 | |
Kim Kulling | 061ef1f263 | |
Kim Kulling | aed0b3e53b | |
Kim Kulling | 918c3abb32 | |
Kim Kulling | 9334e07619 | |
Kim Kulling | 8ad2661e0c | |
Matt Pharr | 17c79bcb94 | |
RichardTea | 7c9cddf786 | |
Kim Kulling | 6db343386b | |
Maki | 6d13fd6aa2 | |
Kim Kulling | 8125e06f49 | |
Kim Kulling | a9705e346a | |
Kim Kulling | e3d39b9f66 | |
Kim Kulling | 484ac21ef5 | |
Kim Kulling | 6d6a6ac11e | |
Kim Kulling | 87a6305cf0 | |
Kim Kulling | 20873cb142 | |
Matt Pharr | ff8d50c8d0 | |
Matt Pharr | 09c5564d5b | |
Matt Pharr | 1fd8646b7a | |
ihsinme | 070072370d | |
ihsinme | 2e96366d04 | |
kkulling | 9174bca3f7 | |
Matt Pharr | 1042845414 | |
Matt Pharr | 71cfd8e0cf | |
Matt Pharr | 2bc074e35a | |
Kirill Gavrilov | 0c2772e8bf | |
Madrich | 7999bc96e9 | |
Max Vollmer | d49aed4585 | |
Kim Kulling | ec08092dbf | |
Matt Pharr | 938537c884 | |
Kim Kulling | 68be7c77c0 | |
Kim Kulling | 1e81bed4d0 | |
Kim Kulling | d898ecc80c | |
Kim Kulling | 2ad4218d25 | |
Kim Kulling | 5222ab989f | |
Kim Kulling | b23ecb4864 | |
JacksonM8 | a01ef5374c | |
Kim Kulling | 53c03fa364 | |
JacksonM8 | 3eed6fa006 | |
JacksonM8 | d0e57e2554 | |
ihsinme | e1052f421b | |
ihsinme | 177304bb7c | |
Kim Kulling | ccc0a50d96 | |
Kim Kulling | cf78781fa8 | |
Kim Kulling | 43ea4d679b | |
Kim Kulling | 3298082a96 | |
Kim Kulling | 05da2123e1 | |
Kim Kulling | 48b138ce13 | |
Kim Kulling | 89d4d6b68f | |
Kim Kulling | fa24e4199c | |
Kim Kulling | 18ad1510f7 | |
Kim Kulling | 0a1535647a | |
Danny-Kint | 07aace0fdd | |
Kim Kulling | 465220b26a | |
Kim Kulling | 88e5f3416e | |
Kim Kulling | e0803b3ec2 | |
Danny-Kint | b8d947299a | |
Jean-Louis | 37df38f951 | |
Kim Kulling | 3ccfc03c48 | |
Jean-Louis | 4025c57fd0 | |
Jean-Louis | eda967bd02 | |
Danny-Kint | 3e320100e5 | |
Danny-Kint | 07b59f539d | |
Maki | ca653e0c6a | |
Jean-Louis | 629147043e | |
Fabrice Fontaine | bfe35fc06b | |
Jean-Louis | eed75aaf2c | |
Jean-Louis | 0ec8d6e285 | |
Jean-Louis | 0952038461 | |
Jean-Louis | c10d592b79 | |
Kim Kulling | 77f9c2854a | |
Kim Kulling | 404bedd8be | |
Danny-Kint | 7bb4b3fb03 | |
Kim Kulling | 3f5238d7c1 | |
Kim Kulling | 2013932e7a | |
Jean-Louis | effe52368c | |
Jean-Louis | 895137c7d7 | |
Jean-Louis | c464d01778 | |
Jean-Louis | 54be7ac582 | |
Hugo Sales | 2873d862b0 | |
Danny-Kint | dbffe25c9d | |
Danny Kabrane | 383c97e380 | |
Danny Kabrane | 2b097c1e73 | |
Danny Kabrane | 197bf1e617 | |
Danny Kabrane | f8c63d874b | |
Kim Kulling | 102d380711 | |
Kim Kulling | b4b011e764 | |
Kim Kulling | ed2b680f46 | |
Kim Kulling | 50f9fb28b6 | |
Danny Kabrane | aa9d6ce7b7 | |
Danny Kabrane | 0fdda99ea1 | |
Martin | 947d72d281 | |
Kim Kulling | 5f5f1cf7a0 | |
Danny Kabrane | 63b0a97369 | |
Kim Kulling | 981923821a | |
Martin | 6003be382c | |
cywang | b75ea77365 | |
cywang | 15cff94926 | |
wasd845 | 2250462853 | |
cywang | b6f8448b78 | |
cywang | f6dd11ca1a | |
Kim Kulling | b3e1ee3ca0 | |
Inho Lee | 4e5b25cd81 | |
Inho Lee | b8bf1eac04 | |
Martin | 8003a016c2 | |
Martin | 3718980c09 | |
Max Vollmer | a15adc9fbc | |
Max Vollmer | 9d3c0081eb | |
Max Vollmer | 1db51503d8 | |
Max Vollmer | 5436e16802 | |
Max Vollmer (Microsoft Havok) | 0e939cc450 | |
Kim Kulling | 2f1ff974fd | |
wasd845 | 4e9176d2cd | |
Jean-Louis Boudrand | 922f874e78 | |
Jean-Louis Boudrand | d18fce3f06 | |
Jean-Louis Boudrand | 33e7e2366c | |
Biswapriyo Nath | c65f2cb3fb | |
Biswapriyo Nath | e2af015a57 | |
Kim Kulling | 7dd0596010 | |
Kim Kulling | 3d49d06bcc | |
Kim Kulling | a2adef8726 | |
Kim Kulling | 80bb8ab726 | |
Jean-Louis Boudrand | 8701a86c9d | |
huiji12321 | db475e7d4a | |
Kim Kulling | 10092cd1ec | |
Kim Kulling | e4a1fb171e | |
Kim Kulling | c168c4689e | |
Kim Kulling | 99e4a10dc3 | |
tellypresence | 6db5b7046f | |
Kim Kulling | 816bbc852c | |
Kim Kulling | aee01e8345 | |
Kim Kulling | 233d834514 | |
Kim Kulling | 41904ad7ce | |
Kim Kulling | 1f8c75c871 | |
Kim Kulling | c0d7ea981a | |
Kim Kulling | 63f1b66224 | |
Kim Kulling | eccdc6dc96 | |
Kim Kulling | f87ab4b4d7 | |
Kim Kulling | 5020a0aa33 | |
Max Vollmer (Microsoft Havok) | e737adde50 | |
huiji12321 | 1910bbbdd9 | |
Kim Kulling | f67a9f253f | |
Kim Kulling | 00b626c3c5 | |
Kim Kulling | c7aeb882e6 | |
Malcolm Tyrrell | 471d2acc92 | |
Max Vollmer (Microsoft Havok) | a0ebad1698 | |
Kim Kulling | c5f45e26bd | |
Malcolm Tyrrell | 19af3f0d31 | |
Biswapriyo Nath | 8d8ba521e2 | |
Kim Kulling | 542ca843be | |
Malcolm Tyrrell | f7be3048de | |
Kim Kulling | 0458ead7a2 | |
Kim Kulling | 75204dfe7f | |
FRICOTEAUX | b47c5c8c27 | |
Kim Kulling | 223372aaba | |
Max Vollmer | 53ff0702ce | |
Max Vollmer | 7d72c78c8e | |
Max Vollmer | 6ed1488e6e | |
Oleg Bogdanov | 4d4a3c42f6 | |
Kim Kulling | 88be8ec698 | |
Kim Kulling | 9ae112309f | |
Malcolm Tyrrell | 149b8d1fd1 | |
Malcolm Tyrrell | 14f79caf41 | |
Neil Clifford | ea60563822 | |
Kim Kulling | 11b4153949 | |
Kim Kulling | 4590f06756 | |
Kim Kulling | dc9db3eaf2 | |
Kim Kulling | c059e58c5e | |
Kim Kulling | fe78310486 | |
Kim Kulling | afd69bea8a | |
Evangel | 98e42e22b8 | |
Evangel | 30584c1ec1 | |
Evangel | 67abcb10ba | |
Malcolm Tyrrell | 885a196c74 | |
Kim Kulling | 8108338215 | |
Kim Kulling | b1f3c48551 | |
Neil Clifford | fc842a0f97 | |
Neil Clifford | 7b59cc297e | |
Kim Kulling | d10bf9a0d3 | |
Inho Lee | e3083c21f0 | |
Malcolm Tyrrell | c00153089a | |
Malcolm Tyrrell | 213a9f9d55 | |
Malcolm Tyrrell | c4573a6d5c | |
Natanael Rabello | 813f171493 | |
Kim Kulling | 749a4963a2 | |
Kim Kulling | c4ba5eeeea | |
Kim Kulling | 25aaa333eb | |
Malcolm Tyrrell | 3221522f95 | |
Malcolm Tyrrell | d9b90f714a | |
Malcolm Tyrrell | 3ce0958b98 | |
Jean-François Verdon | 09ca11d063 | |
Kim Kulling | 5e7d6a0e41 | |
Kim Kulling | 647cef8a8b | |
Kim Kulling | 0d5e5790cb | |
Kim Kulling | db7e594221 | |
Kim Kulling | 21a55a34ea | |
Kim Kulling | e08690ac51 | |
Kim Kulling | b433243daf | |
Kim Kulling | 75818f26eb | |
Inho Lee | 8845d7eed3 | |
Kim Kulling | fa0951012f | |
Kim Kulling | 707ad68fba | |
Kim Kulling | c394c6fdda | |
Kim Kulling | ab34b25a03 | |
Kim Kulling | 5da3e633e3 | |
Kim Kulling | 8c91d1a3cd | |
Kim Kulling | 957e468c8a | |
Kim Kulling | a8381113eb | |
Kim Kulling | 856d4c016e | |
Malcolm Tyrrell | 0f246edb97 | |
Malcolm Tyrrell | 34e3e6293a | |
Malcolm Tyrrell | 0af05e7a60 | |
Malcolm Tyrrell | 01b2088dd3 | |
Kim Kulling | 6873d79505 | |
Malcolm Tyrrell | a68f78ab94 | |
Malcolm Tyrrell | 75570307d6 | |
Malcolm Tyrrell | 3deae8760c | |
Kim Kulling | de610b8ce9 | |
Kim Kulling | 206f28b8ad | |
Kim Kulling | bff65f3827 | |
Kim Kulling | 72bc41b50f | |
Kim Kulling | 18471a39ca | |
Kim Kulling | 8c135f779e | |
Kim Kulling | 3fd95aff4e | |
Kim Kulling | f0a0b5c85e | |
Kim Kulling | df768bdd99 | |
Kim Kulling | 753503ad83 | |
Kim Kulling | 43f7224d0c | |
Kim Kulling | 22ad7028f0 | |
Kim Kulling | 4bba338d92 | |
Kim Kulling | 7e1a8f09c5 | |
Kim Kulling | aee2e9a87d | |
Kim Kulling | 57e691e28e | |
Kim Kulling | 55feb0cb78 | |
Kim Kulling | 831af12974 | |
Max Vollmer | 4006bb71f4 | |
John Mai | cea54d1ac5 | |
Kim Kulling | 6ee5e248ee | |
Kim Kulling | 8d7e5db98c | |
Kim Kulling | a5a331847b | |
#Momo | b168d8f441 | |
#Momo | 7781fe5781 | |
Kim Kulling | b842b4a3c1 | |
Kim Kulling | f13a69a817 | |
Kim Kulling | f96698a6d2 | |
Kim Kulling | 7c5f04deed | |
Kim Kulling | bbac168ced | |
Kim Kulling | 69143ed149 | |
Kim Kulling | 080322b9e2 | |
Malcolm Tyrrell | a2cd5619b4 | |
Kim Kulling | 376e468877 | |
john | d48ac9d0a4 | |
Kim Kulling | 37c09ecb69 | |
Kim Kulling | 56e1a80e24 | |
Kim Kulling | fc11ca2f5e | |
Inho Lee | ad7f8910e9 | |
Inho Lee | 9f880e2214 | |
Kim Kulling | c035177847 | |
Malcolm Tyrrell | 0363c18f1f | |
Silvio Traversaro | 3b5212067c | |
Kim Kulling | 76d370b054 | |
Kim Kulling | dbd99bf700 | |
Kim Kulling | 828068d224 | |
Kim Kulling | f713d30e9b | |
Kim Kulling | 7660070aa4 | |
Kim Kulling | b9f83c8db8 | |
Kim Kulling | 857f62cde0 | |
Rahul Sheth | 4e57c1ee7f | |
Jukka Maatta | 6848a18999 | |
Kim Kulling | 84ef3dc0fc | |
Kim Kulling | ba1145885d | |
Rahul Sheth | b7c6719ed8 | |
Rahul Sheth | f12e6eb6f4 | |
xantares | 22ea239049 | |
Kim Kulling | 636f28965f | |
Kim Kulling | 1df00143f5 | |
Sahin Serdar Kocdemir | eb9928e029 | |
Malcolm Tyrrell | 20733537d7 | |
Kim Kulling | c7ab7ff457 | |
Optimizer0 | 1d3f8bd871 | |
Kim Kulling | 95d0443a5d | |
Optimizer0 | 152343b186 | |
Kim Kulling | d676e1a13f | |
Kim Kulling | 3b9d4cfd28 | |
Kim Kulling | 09a473ff02 | |
Kim Kulling | 52826a03f8 | |
Kim Kulling | 23f144a7b7 | |
Malcolm Tyrrell | 4bdaf20b70 | |
Isuru2000psn | f2b3ec2e0c | |
Malcolm Tyrrell | 585fb89154 | |
Malcolm Tyrrell | 57756750f6 | |
Malcolm Tyrrell | 17702605cf | |
Malcolm Tyrrell | 6b9c477763 | |
Kim Kulling | 9303fb31f6 | |
Kim Kulling | 9d296f3943 | |
kimkulling | b6dde74155 | |
kimkulling | d75fa2bb4b | |
kimkulling | c740f61f97 | |
Kim Kulling | c7f7ed8901 | |
Kim Kulling | 0191c661b5 | |
Kim Kulling | 4affe21709 | |
Kim Kulling | 0f4ce80ff1 | |
Kim Kulling | 177426185e | |
Kim Kulling | 50d21e08f3 | |
Kim Kulling | ea741fd8bd | |
Kim Kulling | b4f79411aa | |
Kim Kulling | 788099a223 | |
Kim Kulling | 6a4c338625 | |
Kim Kulling | c591f7de2f | |
Kim Kulling | 484d305987 | |
Kim Kulling | adcf84c41f | |
Kim Kulling | 880fe75671 | |
Kim Kulling | db49a541c3 | |
Kim Kulling | ef9a78b49d | |
Kim Kulling | 8f0888f7fc | |
Kim Kulling | effccfe2e6 | |
Kim Kulling | bf4ad2837f | |
Kim Kulling | 69822fd5e6 | |
Kim Kulling | c598a12340 | |
Kim Kulling | 89ac168014 | |
Kim Kulling | 1c85676a9c | |
Kim Kulling | 052cc2e070 | |
Kim Kulling | 5038f21d06 | |
Kim Kulling | 202907d471 | |
Kim Kulling | 3f97a1df2c | |
Kim Kulling | bdd3c96eee | |
Kim Kulling | 5877f81419 | |
Kim Kulling | 5230b91611 | |
Kim Kulling | 8143ea5aec | |
Kim Kulling | 9a19a4723b | |
Kim Kulling | a6b90c354b | |
Kim Kulling | 5653a82a87 | |
Kim Kulling | 9234fee35e | |
Sherief Farouk | a3c8cfc0ff | |
Kim Kulling | d6892b3f58 | |
Kim Kulling | 557273818d | |
Kim Kulling | 22dd53a4a2 | |
Kim Kulling | 34351b3cb9 | |
Kim Kulling | c0e58c1895 | |
Kim Kulling | 93ae409e74 | |
Kim Kulling | 6e91605268 | |
kimkulling | 71f20eaa8a | |
kimkulling | dee8e5bee1 | |
Kim Kulling | c4039d5cf0 | |
kimkulling | 8c88526da8 | |
Kim Kulling | 11261671a3 | |
Kim Kulling | 3e025cdc8d | |
Kim Kulling | 64c1405dfd | |
Max Vollmer (Microsoft Havok) | c9fb21661f | |
rahulshethsc | 354e09e785 | |
Rahul Sheth | aa125c48ab | |
Kim Kulling | fbc0914a21 | |
Fabian Schmidt | 338c0b753c | |
Max Vollmer (Microsoft Havok) | 9c1edaee96 | |
Kim Kulling | 14d6141f69 | |
Kim Kulling | 9e2c4e0cf4 | |
Kim Kulling | 3e5feb4320 | |
Kim Kulling | 2901f68668 | |
Kim Kulling | 0e9621012c | |
Kim Kulling | 1ff9e2b522 | |
Kim Kulling | 23defc275a | |
kimkulling | d0932c405f | |
Kim Kulling | c1f50e116a | |
Kim Kulling | 31f3812241 | |
kimkulling | 6ec07e4dc7 | |
kimkulling | cca9eddb1c | |
Max Vollmer | 615ffdf93f | |
kkulling | c2f0bf68af | |
Kim Kulling | d854f3b842 | |
Kim Kulling | bd91033172 | |
Kim Kulling | 4f30b2aa5c | |
Kim Kulling | 0618db1f99 | |
Denis Blank | f3b25b999b | |
Kim Kulling | ef6b93a949 | |
Kim Kulling | 689406fbda | |
Rahul Sheth | 78b30d1752 | |
Rahul Sheth | df56a97794 | |
Rahul Sheth | 56a3759925 | |
kimkulling | 1e6a1c63ec | |
Kim Kulling | 9ce0671134 | |
Kim Kulling | be5089ae40 | |
Kim Kulling | 075540e15a | |
Kim Kulling | 0b8ed5c03a | |
Kim Kulling | 34f343233e | |
Kim Kulling | 0c05398602 | |
kkulling | 87d2580aad | |
Gargaj | 9053dfea05 | |
Kim Kulling | 3081e83f43 | |
Kim Kulling | 4dad3eab3f | |
Kim Kulling | a7d3172dd8 | |
Chananya Freiman | 542d784457 | |
Kim Kulling | 73fa2cbe88 | |
Joshua Hyatt | 638499a278 | |
Kim Kulling | 3c2133a3b9 | |
kimkulling | e62b4e5cce | |
Kim Kulling | 6d5c388780 | |
Joshua Hyatt | dcf9a7b2d8 | |
Joshua Hyatt | 953e976de6 | |
Joshua Hyatt | cc2613f264 | |
Joshua Hyatt | c769f8d4ad | |
kimkulling | 30a4eae17f | |
kimkulling | 0730eebe6f | |
crocdialer | 3c98197be0 | |
Kim Kulling | b7e9595e54 | |
Rahul Sheth | 6b32f34fc2 | |
Rahul Sheth | b15c111805 | |
Rahul Sheth | 5f19c8890b | |
Rahul Sheth | 59c8b4ed84 | |
kimkulling | 582a8b1887 | |
kimkulling | 6f77d2e06d | |
Kim Kulling | c359b973bb | |
Rahul Sheth | 5087348a37 | |
Kim Kulling | 904f17f29f | |
Kim Kulling | 7adfe1f2d8 | |
Malcolm Tyrrell | 962fe7cd4d | |
Malcolm Tyrrell | fa93ba76fe | |
Malcolm Tyrrell | 16c227e27c | |
Malcolm Tyrrell | 8f893e3653 | |
Kim Kulling | cb631517a7 | |
Malcolm Tyrrell | 9b5e758bdd | |
Malcolm Tyrrell | 6f9c61e157 | |
Malcolm Tyrrell | 6c2ceb55f8 | |
kimkulling | d393f677ce | |
Malcolm Tyrrell | d7c65c36cd | |
Malcolm Tyrrell | 3ccf503d3e | |
Kim Kulling | 56381241c5 | |
Kim Kulling | 554ed1bf91 | |
Malcolm Tyrrell | 0f6127e90e | |
Malcolm Tyrrell | e1a0163e7e | |
Malcolm Tyrrell | b7c789da67 | |
kimkulling | 6a8edb21f8 | |
Malcolm Tyrrell | 0ffcdf160e | |
kimkulling | 7e93ae4428 | |
Malcolm Tyrrell | 974252bd8f | |
Malcolm Tyrrell | 4f1e904ec8 | |
Malcolm Tyrrell | 829ff1adf0 | |
Malcolm Tyrrell | a4110a59c5 | |
Malcolm Tyrrell | 19cdfd12df | |
Malcolm Tyrrell | b1ed751b83 | |
Kim Kulling | 48ec3ef458 | |
Arthur (fuj1n) Uzulin | 995ab805ff | |
Kim Kulling | 51a417ce6f | |
lsliegeo | 0d00ff7043 | |
Kim Kulling | 9fc00cbf74 | |
Kim Kulling | 1bbae19779 | |
Kim Kulling | b1b9fa94cf | |
Kim Kulling | 9bad20e99e | |
Kim Kulling | 45f76f36f3 | |
Kim Kulling | 153a6efecc | |
Kim Kulling | 729882debb | |
Kim Kulling | 394651e640 | |
Kim Kulling | f90bb2ca26 | |
Kim Kulling | b3f85613fc | |
Kim Kulling | 65265594ba | |
Kim Kulling | fbd9c9651d | |
Marc-Antoine Lortie | 11daed69d3 | |
Kim Kulling | 30d83d40c1 | |
kimkulling | 29b72fe6d4 | |
kimkulling | aaea564cbe | |
Kim Kulling | 4c8b9fb96d | |
kimkulling | 13d7fad7f7 | |
Kim Kulling | 8504c191db | |
Kim Kulling | 919f730844 | |
Kim Kulling | 89eb7f889a | |
Kim Kulling | 58bf23be55 | |
Kim Kulling | b94183376c | |
Kim Kulling | c238508706 | |
Kim Kulling | 1f348c5fc0 | |
Kim Kulling | aabf12827b | |
Kim Kulling | 855b47452e | |
Rafał Mikrut | c60373c0ba | |
Rafał Mikrut | 447805f01a | |
Kim Kulling | aa6c35f683 | |
Kim Kulling | e7ae576614 | |
Kim Kulling | 435bba30dd | |
Kim Kulling | 008e551f8e | |
Kim Kulling | ac8a8a5ad4 | |
Malcolm Tyrrell | 0282f358a4 | |
Malcolm Tyrrell | 301bae3967 | |
Malcolm Tyrrell | eaf0587dd8 | |
Ryan Styrczula | 3170c3d15c | |
Kim Kulling | 58b81a2590 | |
Kim Kulling | 575ce6136d | |
Rahul Sheth | ad18e365e5 | |
Kim Kulling | 6828cf2f03 | |
Kim Kulling | c7a9ef30cc | |
Kim Kulling | e8cbc0928e | |
Kim Kulling | 6886ea6c65 | |
Kim Kulling | 59e15b7fd1 | |
Kim Kulling | c62fa76cda | |
Kim Kulling | dcc8419722 | |
Kim Kulling | 07c1396b50 | |
Kim Kulling | 9a4b3fd9de | |
Kim Kulling | 8edb0d5278 | |
Kim Kulling | eb44eb13e6 | |
Kim Kulling | c67a5bd903 | |
Kim Kulling | b2df27a6f0 | |
Kim Kulling | c71dbcc37e | |
Kim Kulling | 5e0b9e0f32 | |
Kim Kulling | 0f442b1ff2 | |
Kim Kulling | 52c29612f7 | |
Kim Kulling | a33557be71 | |
Kim Kulling | ac83e3593e | |
Kim Kulling | 162c8be184 | |
Kim Kulling | a2186a0553 | |
Kim Kulling | 76a6bb36f6 | |
Kim Kulling | 6a9ca736c1 | |
MeyerFabian | 51e592123a | |
MeyerFabian | a19e4e4112 | |
MeyerFabian | 13ee2306c3 | |
RichardTea | 9cad10a995 | |
RichardTea | a4eceb7b3f | |
RichardTea | c527a33aa8 | |
RichardTea | ef37fc4632 | |
RichardTea | ce133e5add | |
RichardTea | f2e3e43fbc | |
RichardTea | 17b9403b7a | |
Kim Kulling | b2e53783de | |
Kim Kulling | 37056f0242 | |
Kim Kulling | fa486240d5 | |
Kim Kulling | 1975579268 | |
RichardTea | 719cc82a1f | |
RichardTea | 8c60879485 | |
Kim Kulling | 516bdc2a4b | |
Kim Kulling | c55ca47666 | |
Kim Kulling | 147c5f7cd2 | |
Kim Kulling | 0a165ee666 | |
Kim Kulling | deddaf49df | |
Kim Kulling | df8792d24b | |
Kim Kulling | 44fd987d57 | |
Kota Iguchi | 84e68eaf24 | |
Malcolm Tyrrell | 04df5f8b1e | |
Malcolm Tyrrell | e51e07982d | |
Malcolm Tyrrell | e1bab44e19 | |
Malcolm Tyrrell | 37e1fb9cd7 | |
Malcolm Tyrrell | f3170a96ba | |
Malcolm Tyrrell | d4f5f29b44 | |
Malcolm Tyrrell | fff6396e3c | |
Malcolm Tyrrell | 212903e935 | |
Malcolm Tyrrell | 7e7161852a | |
Malcolm Tyrrell | c0d978786e | |
Malcolm Tyrrell | a56134ba33 | |
awr1 | 77cf6e3433 | |
awr1 | 638369e995 | |
awr1 | cc8cd88d7a | |
awr1 | bad0df9a1a | |
awr1 | b3f61f8759 | |
awr1 | 3bf6963d20 | |
awr1 | 93d567e3b1 | |
awr1 | 700d8e6614 | |
Rahul Sheth | 0bad2c7b6a | |
Rahul Sheth | abc6b9ce4c | |
Rahul Sheth | 209a61d0e7 | |
Ryan Styrczula | 84e342acd7 | |
Kim Kulling | b19ebf5d54 | |
Kim Kulling | 8cfd2a4cc1 | |
Kim Kulling | 67a710efad | |
Kim Kulling | f5d5d7c5ed | |
Kim Kulling | bdcad5cd0a | |
Ryan Styrczula | 0c2f7a119c | |
Ryan Styrczula | 6619ec8253 | |
Kim Kulling | c8d759de64 | |
Kim Kulling | aff5bba9da | |
Kim Kulling | 78d0b81b6c | |
Kim Kulling | 411bf89b64 | |
Kim Kulling | eaac92830a | |
Andrew Johnson | a9a0c30932 | |
Kim Kulling | 231447c8d6 | |
Kim Kulling | b1dd77fbbc | |
Kim Kulling | ec156e4da3 | |
Kim Kulling | 306e03d497 | |
Kim Kulling | 108b3a62e5 | |
Kim Kulling | 1324b4b27d | |
Kim Kulling | b8ec93aa21 | |
Kim Kulling | 2cd1192bf1 | |
Kim Kulling | 9682ab0685 | |
Kim Kulling | 21678df589 | |
Kim Kulling | 1379175f18 | |
Robert Reif | 628394baec | |
RichardTea | d79a617e18 | |
kimkulling | 9aa468262f | |
Robert Reif | 37c74f6fa3 | |
Robert Reif | f753a6e7ad | |
Robert Reif | 6c29247180 | |
Max Vollmer (Microsoft Havok) | fb11705dd0 | |
Max Vollmer | abf43eaf74 | |
Kim Kulling | a211aff522 | |
Kim Kulling | d04f8b3174 | |
Kim Kulling | 95a23af16f | |
Kim Kulling | 77b705048b | |
Kim Kulling | 839986ca14 | |
Hill Ma | 3fb7747429 | |
Kim Kulling | d74c10dcb7 | |
Kim Kulling | 10c709831f | |
Malcolm Tyrrell | 51150cb3df | |
Kim Kulling | 693da43095 | |
Kim Kulling | b1369d0912 | |
RichardTea | 9e27fb3b89 | |
Kim Kulling | 7b7764afb9 | |
Kim Kulling | 7fda533484 | |
Kim Kulling | dea412c9a0 | |
Yingying Wang | 97085c1c05 | |
Yingying Wang | 36f899bf09 | |
Yingying Wang | 3f2e5518eb | |
Marc-Antoine Lortie | 03340787ec | |
Kim Kulling | 4ff5a06ef4 | |
Kim Kulling | 1ab7a3a16b | |
Kim Kulling | 718f81ddcf | |
Kim Kulling | eeb4a981bd | |
Kim Kulling | 9a87338854 | |
Kim Kulling | 28b65c84b0 | |
Kim Kulling | ba94bfd197 | |
Hill Ma | 30f09e9fc0 | |
Hill Ma | 0b18d27042 | |
Kim Kulling | 879ff365fc | |
Kim Kulling | b2f05a9a54 | |
Kim Kulling | fb20e15163 | |
Kim Kulling | 45531df9aa | |
Evangel | 6d85280c8d | |
Evangel | d75d59a4fd | |
Evangel | f6b4370f6a | |
Kim Kulling | b7b38c2282 | |
Kim Kulling | 8a57d5df40 | |
Kim Kulling | ba6af9ff98 | |
Kim Kulling | 50b55726d2 | |
Kim Kulling | 95e822a6ec | |
Kim Kulling | e845988c22 | |
Kim Kulling | 1466bbacf8 | |
Malcolm Tyrrell | 170c00eee7 | |
Malcolm Tyrrell | edaa8e4a80 | |
Kim Kulling | ae05dbb252 | |
Kim Kulling | 6205af4efb | |
Malcolm Tyrrell | 2977643352 | |
Malcolm Tyrrell | 9188f56839 | |
Ryan Styrczula | 5717ea466f | |
Filip Lundgren | 2006286528 | |
Filip Lundgren | ba09e1ef94 | |
Kim Kulling | 6397bfbf90 | |
Kim Kulling | c70d57be4f | |
Kota Iguchi | 6acaaee80f | |
Kim Kulling | c2a732938e | |
Kim Kulling | b3af5c5a14 | |
Kim Kulling | 4cd7e48f19 | |
Kim Kulling | bb613df543 | |
Kim Kulling | f776cc8008 | |
ywang | e65434bf82 | |
ywang | f57e7221c0 | |
Yingying Wang | 578a7ac502 | |
Yingying Wang | 8fed101432 | |
Yingying Wang | f18f1a35f6 | |
Yingying Wang | 2065512470 | |
Yingying Wang | 5d1cff5496 | |
Yingying Wang | 12dc736d94 | |
Yingying Wang | 71b16bf3df | |
Kim Kulling | a399d1bd25 | |
FRICOTEAUX | 87584eb007 | |
Yingying Wang | 98767cbb08 | |
Kim Kulling | f4dd5eafd0 | |
Kim Kulling | 2be731d1bf | |
Yingying Wang | 50f0a86798 | |
Yingying Wang | c10e409a5d | |
xiaozhuai | 80c88ffc73 | |
Yingying Wang | b8e39b58d1 | |
Yingying Wang | f6720271cb | |
RichardTea | e1decbd532 | |
Trevor David Black | a0aa067b5f | |
Trevor David Black | 2c9d3bea64 | |
Trevor David Black | 3dc550a9b2 | |
Trevor David Black | 07065e2235 | |
Trevor David Black | cb88210c62 | |
Trevor David Black | 1045fb7798 | |
Trevor David Black | f9f2d617a2 | |
Trevor David Black | 3ad53ab630 | |
Trevor David Black | 8c3b374486 | |
Kim Kulling | 03182c21b8 | |
Kim Kulling | 979153522c | |
Kim Kulling | 1a8d5667b6 | |
Kim Kulling | bd2ffc8d58 | |
Kim Kulling | c1fcee9c5a | |
Kim Kulling | 02df65d541 | |
Kim Kulling | 00ad892a49 | |
Kim Kulling | 0cb236bae3 | |
Kim Kulling | 8ef106e185 | |
Kim Kulling | 6a471b4390 | |
Kim Kulling | 02acb3f8c2 | |
Kim Kulling | 11f49f85c4 | |
Kim Kulling | a905303764 | |
Kim Kulling | d48b93cf34 | |
Madrich | a413774e24 | |
Kim Kulling | 8761f3c67a | |
Kim Kulling | db3bb22933 | |
Madrich | 5fb77f8523 | |
Madrich | 990dc9453e |
|
@ -1,2 +0,0 @@
|
||||||
service_name: travis-pro
|
|
||||||
repo_token: GZXuNlublKFy7HAewHAZLk5ZwgipTFAOA
|
|
|
@ -1,3 +1,2 @@
|
||||||
patreon: assimp
|
|
||||||
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4
|
|
||||||
open_collective: assimp
|
open_collective: assimp
|
||||||
|
patreon: assimp
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: 'Bug:'
|
||||||
|
labels: 'Bug'
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Platform (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: 'Feature-Request'
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
name: Technical debt
|
||||||
|
about: Create a report to help us to fix and detect tech debts
|
||||||
|
title: ''
|
||||||
|
labels: 'Techdebt'
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the technical debt**
|
||||||
|
A clear and concise description of what the tech debt is about.
|
||||||
|
|
||||||
|
**Better solution**
|
||||||
|
A clear and concise description of what you would expect.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
|
@ -0,0 +1,11 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
- package-ecosystem: "gitsubmodule"
|
||||||
|
directory: "/" # the .gitmodules file must be placed at the top-level directory of a git working tree
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
open-pull-requests-limit: 15 # Assimp has 15 dependencies
|
|
@ -6,54 +6,187 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # to fetch code (actions/checkout),and release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job:
|
build:
|
||||||
name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
|
name: ${{ matrix.name }}-build-and-test
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang]
|
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, ubuntu-latest-clang++]
|
||||||
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
||||||
include:
|
include:
|
||||||
- name: windows-msvc
|
- name: windows-latest-cl.exe
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
cxx: cl.exe
|
cxx: cl.exe
|
||||||
cc: cl.exe
|
cc: cl.exe
|
||||||
- name: ubuntu-clang
|
- name: ubuntu-latest-clang++
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
cxx: clang++
|
cxx: clang++
|
||||||
cc: clang
|
cc: clang
|
||||||
- name: macos-clang
|
- name: macos-latest-clang++
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
cxx: clang++
|
cxx: clang++
|
||||||
cc: clang
|
cc: clang
|
||||||
- name: ubuntu-gcc
|
- name: ubuntu-latest-g++
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
cxx: g++
|
cxx: g++
|
||||||
cc: gcc
|
cc: gcc
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
- uses: lukka/get-cmake@latest
|
- uses: lukka/get-cmake@latest
|
||||||
|
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
- uses: lukka/set-shell-env@v1
|
- name: Set Compiler Environment
|
||||||
|
uses: lukka/set-shell-env@v1
|
||||||
with:
|
with:
|
||||||
CXX: ${{ matrix.cxx }}
|
CXX: ${{ matrix.cxx }}
|
||||||
CC: ${{ matrix.cc }}
|
CC: ${{ matrix.cc }}
|
||||||
|
|
||||||
|
- name: Cache DX SDK
|
||||||
|
id: dxcache
|
||||||
|
if: contains(matrix.name, 'windows')
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: '${{ github.workspace }}/DX_SDK'
|
||||||
|
key: ${{ runner.os }}-DX_SDK
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-DX_SDK
|
||||||
|
|
||||||
|
- name: Download DXSetup
|
||||||
|
if: contains(matrix.name, 'windows') && steps.dxcache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
curl -s -o DXSDK_Jun10.exe --location https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
|
||||||
|
cmd.exe /c start /wait .\DXSDK_Jun10.exe /U /O /F /S /P "${{ github.workspace }}\DX_SDK"
|
||||||
|
|
||||||
|
- name: Set Windows specific CMake arguments
|
||||||
|
if: contains(matrix.name, 'windows')
|
||||||
|
id: windows_extra_cmake_args
|
||||||
|
run: echo ":set-output name=args::=-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set Hunter specific CMake arguments
|
||||||
|
if: contains(matrix.name, 'hunter')
|
||||||
|
id: hunter_extra_cmake_args
|
||||||
|
run: echo "args=-DBUILD_SHARED_LIBS=OFF -DASSIMP_HUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/polly/${{ matrix.toolchain }}.cmake" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: configure and build
|
- name: configure and build
|
||||||
uses: lukka/run-cmake@v2
|
uses: lukka/run-cmake@v3
|
||||||
|
env:
|
||||||
|
DXSDK_DIR: '${{ github.workspace }}/DX_SDK'
|
||||||
|
|
||||||
with:
|
with:
|
||||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
||||||
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release'
|
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release ${{ steps.windows_extra_cmake_args.outputs.args }} ${{ steps.hunter_extra_cmake_args.outputs.args }}'
|
||||||
buildWithCMakeArgs: '-- -v'
|
buildWithCMakeArgs: '--parallel 24 -v'
|
||||||
buildDirectory: '${{ github.workspace }}/build/'
|
buildDirectory: '${{ github.workspace }}/build/'
|
||||||
|
|
||||||
|
- name: Exclude certain tests in Hunter specific builds
|
||||||
|
if: contains(matrix.name, 'hunter')
|
||||||
|
id: hunter_extra_test_args
|
||||||
|
run: echo "args=--gtest_filter=-utOpenGEXImportExport.Importissue1340_EmptyCameraObject:utColladaZaeImportExport.importBlenFromFileTest" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: cd build/bin && ./unit
|
run: cd build/bin && ./unit ${{ steps.hunter_extra_test_args.outputs.args }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: matrix.name == 'windows-msvc'
|
||||||
|
with:
|
||||||
|
name: 'assimp-bins-${{ matrix.name }}'
|
||||||
|
path: build/bin/assimp*.exe
|
||||||
|
|
||||||
|
- uses: marvinpinto/action-automatic-releases@latest
|
||||||
|
if: contains(matrix.name, 'windows-msvc-hunter')
|
||||||
|
with:
|
||||||
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
automatic_release_tag: "master"
|
||||||
|
prerelease: true
|
||||||
|
title: "AutoRelease"
|
||||||
|
files: |
|
||||||
|
build/bin/assimp*.exe
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
needs: [build]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
steps:
|
||||||
|
- id: create-release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
||||||
|
with:
|
||||||
|
tag_name: '${{github.ref}}'
|
||||||
|
release_name: 'Release ${{github.ref}}'
|
||||||
|
draft: false
|
||||||
|
prerelease: true
|
||||||
|
- run: |
|
||||||
|
echo '${{steps.create-release.outputs.upload_url}}' > release_upload_url.txt
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: create-release
|
||||||
|
path: release_upload_url.txt
|
||||||
|
|
||||||
|
upload-release:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, ubuntu-latest-clang++, ubuntu-gcc-hunter, macos-clang-hunter, windows-msvc-hunter]
|
||||||
|
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
||||||
|
include:
|
||||||
|
- name: windows-latest-cl.exe
|
||||||
|
os: windows-latest
|
||||||
|
cxx: cl.exe
|
||||||
|
cc: cl.exe
|
||||||
|
- name: ubuntu-latest-clang++
|
||||||
|
os: ubuntu-latest
|
||||||
|
cxx: clang++
|
||||||
|
cc: clang
|
||||||
|
- name: macos-latest-clang++
|
||||||
|
os: macos-latest
|
||||||
|
cxx: clang++
|
||||||
|
cc: clang
|
||||||
|
- name: ubuntu-latest-g++
|
||||||
|
os: ubuntu-latest
|
||||||
|
cxx: g++
|
||||||
|
cc: gcc
|
||||||
|
- name: ubuntu-gcc-hunter
|
||||||
|
os: ubuntu-latest
|
||||||
|
toolchain: ninja-gcc-cxx17-fpic
|
||||||
|
- name: macos-clang-hunter
|
||||||
|
os: macos-latest
|
||||||
|
toolchain: ninja-clang-cxx17-fpic
|
||||||
|
- name: windows-msvc-hunter
|
||||||
|
os: windows-latest
|
||||||
|
toolchain: ninja-vs-win64-cxx17
|
||||||
|
|
||||||
|
needs: [create-release]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
steps:
|
||||||
|
- uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
name: create-release
|
||||||
|
- id: upload-url
|
||||||
|
run: |
|
||||||
|
echo "url=$(cat create-release/release_upload_url.txt)" >> $GITHUB_OUTPUT
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}'
|
||||||
|
- uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
*.zip
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
name: CIFuzz
|
||||||
|
on: [pull_request]
|
||||||
|
jobs:
|
||||||
|
Fuzzing:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Build Fuzzers
|
||||||
|
id: build
|
||||||
|
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||||
|
with:
|
||||||
|
oss-fuzz-project-name: 'assimp'
|
||||||
|
dry-run: false
|
||||||
|
language: c++
|
||||||
|
- name: Run Fuzzers
|
||||||
|
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||||
|
with:
|
||||||
|
oss-fuzz-project-name: 'assimp'
|
||||||
|
fuzz-seconds: 300
|
||||||
|
dry-run: false
|
||||||
|
language: c++
|
||||||
|
- name: Upload Crash
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: failure() && steps.build.outcome == 'success'
|
||||||
|
with:
|
||||||
|
name: artifacts
|
||||||
|
path: ./out/artifacts
|
|
@ -0,0 +1,51 @@
|
||||||
|
name: Build Windows Installer
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build the Inno Setup Installer
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: lukka/get-cmake@latest
|
||||||
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
|
||||||
|
- name: Cache DX SDK
|
||||||
|
id: dxcache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: '${{ github.workspace }}/DX_SDK'
|
||||||
|
key: ${{ runner.os }}-DX_SDK
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-DX_SDK
|
||||||
|
|
||||||
|
- name: Download DXSetup
|
||||||
|
run: |
|
||||||
|
curl -s -o DXSDK_Jun10.exe --location https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
|
||||||
|
cmd.exe /c start /wait .\DXSDK_Jun10.exe /U /O /F /S /P "${{ github.workspace }}\DX_SDK"
|
||||||
|
|
||||||
|
- name: Set Windows specific CMake arguments
|
||||||
|
id: windows_extra_cmake_args
|
||||||
|
run: echo "::set-output name=args::-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1 -DASSIMP_BUILD_ZLIB=1"
|
||||||
|
|
||||||
|
- name: configure and build
|
||||||
|
uses: lukka/run-cmake@v3
|
||||||
|
env:
|
||||||
|
DXSDK_DIR: '${{ github.workspace }}/DX_SDK'
|
||||||
|
|
||||||
|
with:
|
||||||
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
||||||
|
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release ${{ steps.windows_extra_cmake_args.outputs.args }} ${{ steps.hunter_extra_cmake_args.outputs.args }}'
|
||||||
|
buildWithCMakeArgs: '--parallel 24 -v'
|
||||||
|
buildDirectory: '${{ github.workspace }}/build/'
|
||||||
|
|
||||||
|
- name: Compile .ISS to .EXE Installer
|
||||||
|
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
|
||||||
|
with:
|
||||||
|
path: packaging/windows-innosetup/script_x64.iss
|
||||||
|
options: /O+
|
|
@ -6,12 +6,15 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job1:
|
job1:
|
||||||
name: adress-sanitizer
|
name: adress-sanitizer
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- uses: lukka/get-cmake@latest
|
- uses: lukka/get-cmake@latest
|
||||||
- uses: lukka/set-shell-env@v1
|
- uses: lukka/set-shell-env@v1
|
||||||
with:
|
with:
|
||||||
|
@ -19,7 +22,7 @@ jobs:
|
||||||
CC: clang
|
CC: clang
|
||||||
|
|
||||||
- name: configure and build
|
- name: configure and build
|
||||||
uses: lukka/run-cmake@v2
|
uses: lukka/run-cmake@v3
|
||||||
with:
|
with:
|
||||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
||||||
|
@ -35,7 +38,7 @@ jobs:
|
||||||
name: undefined-behavior-sanitizer
|
name: undefined-behavior-sanitizer
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- uses: lukka/get-cmake@latest
|
- uses: lukka/get-cmake@latest
|
||||||
- uses: lukka/set-shell-env@v1
|
- uses: lukka/set-shell-env@v1
|
||||||
with:
|
with:
|
||||||
|
@ -43,7 +46,7 @@ jobs:
|
||||||
CC: clang
|
CC: clang
|
||||||
|
|
||||||
- name: configure and build
|
- name: configure and build
|
||||||
uses: lukka/run-cmake@v2
|
uses: lukka/run-cmake@v3
|
||||||
with:
|
with:
|
||||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
||||||
|
@ -54,3 +57,13 @@ jobs:
|
||||||
- name: test
|
- name: test
|
||||||
run: cd build/bin && ./unit
|
run: cd build/bin && ./unit
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
job3:
|
||||||
|
name: printf-sanitizer
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: run scan_printf script
|
||||||
|
run: ./scripts/scan_printf.sh
|
||||||
|
shell: bash
|
||||||
|
|
|
@ -18,11 +18,14 @@ build
|
||||||
*.VC.db-wal
|
*.VC.db-wal
|
||||||
*.VC.opendb
|
*.VC.opendb
|
||||||
*.ipch
|
*.ipch
|
||||||
|
.vs/
|
||||||
|
out/
|
||||||
|
CMakeSettings.json
|
||||||
|
|
||||||
# Output
|
# Output
|
||||||
bin/
|
bin/
|
||||||
lib/
|
lib/
|
||||||
|
x64/
|
||||||
# QtCreator
|
# QtCreator
|
||||||
CMakeLists.txt.user
|
CMakeLists.txt.user
|
||||||
|
|
||||||
|
@ -91,6 +94,7 @@ test/gtest/src/gtest-stamp/gtest-gitinfo.txt
|
||||||
test/gtest/src/gtest-stamp/gtest-gitclone-lastrun.txt
|
test/gtest/src/gtest-stamp/gtest-gitclone-lastrun.txt
|
||||||
Assimp.opensdf
|
Assimp.opensdf
|
||||||
contrib/zlib/CTestTestfile.cmake
|
contrib/zlib/CTestTestfile.cmake
|
||||||
|
contrib/zlib/Debug/zlibstaticd.pdb
|
||||||
ipch/assimp_viewer-44bbbcd1/assimp_viewerd-ccc45335.ipch
|
ipch/assimp_viewer-44bbbcd1/assimp_viewerd-ccc45335.ipch
|
||||||
bin64/assimp-vc140-mt.dll
|
bin64/assimp-vc140-mt.dll
|
||||||
bin64/assimp-vc140-mtd.dll
|
bin64/assimp-vc140-mtd.dll
|
||||||
|
@ -113,3 +117,10 @@ tools/assimp_qt_viewer/moc_glview.cpp_parameters
|
||||||
tools/assimp_qt_viewer/moc_mainwindow.cpp
|
tools/assimp_qt_viewer/moc_mainwindow.cpp
|
||||||
tools/assimp_qt_viewer/moc_mainwindow.cpp_parameters
|
tools/assimp_qt_viewer/moc_mainwindow.cpp_parameters
|
||||||
tools/assimp_qt_viewer/ui_mainwindow.h
|
tools/assimp_qt_viewer/ui_mainwindow.h
|
||||||
|
|
||||||
|
#Generated directory
|
||||||
|
generated/*
|
||||||
|
|
||||||
|
# 3rd party cloned repos/tarballs etc
|
||||||
|
# tinyusdz repo, automatically cloned via CMake
|
||||||
|
contrib/tinyusdz/autoclone
|
||||||
|
|
67
.travis.sh
67
.travis.sh
|
@ -1,67 +0,0 @@
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
#Open Asset Import Library (assimp)
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Copyright (c) 2006-2020, assimp team
|
|
||||||
#
|
|
||||||
# License see LICENSE file
|
|
||||||
#
|
|
||||||
function generate() {
|
|
||||||
OPTIONS="-DASSIMP_WERROR=ON"
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_NO_EXPORT=NO"
|
|
||||||
|
|
||||||
if [ "$DISABLE_EXPORTERS" = "YES" ] ; then
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_NO_EXPORT=YES"
|
|
||||||
else
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_NO_EXPORT=NO"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$SHARED_BUILD" = "ON" ] ; then
|
|
||||||
OPTIONS="$OPTIONS -DBUILD_SHARED_LIBS=ON"
|
|
||||||
else
|
|
||||||
OPTIONS="$OPTIONS -DBUILD_SHARED_LIBS=OFF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ENABLE_COVERALLS" = "ON" ] ; then
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_COVERALLS=ON"
|
|
||||||
else
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_COVERALLS=OFF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ASAN" = "ON" ] ; then
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_ASAN=ON"
|
|
||||||
else
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_ASAN=OFF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$UBSAN" = "ON" ] ; then
|
|
||||||
OPTIONS="$OPTIONS -DASSIMP_UBSAN=ON"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmake -G "Unix Makefiles" $OPTIONS
|
|
||||||
}
|
|
||||||
# build and run unittests, if not android
|
|
||||||
if [ $ANDROID ]; then
|
|
||||||
ant -v -Dmy.dir=${TRAVIS_BUILD_DIR} -f ${TRAVIS_BUILD_DIR}/port/jassimp/build.xml ndk-jni
|
|
||||||
fi
|
|
||||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
|
||||||
if [ $ANALYZE = "ON" ] ; then
|
|
||||||
if [ "$CC" = "clang" ]; then
|
|
||||||
scan-build cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_TESTS=OFF
|
|
||||||
scan-build --status-bugs make -j2
|
|
||||||
else
|
|
||||||
cppcheck --version
|
|
||||||
generate \
|
|
||||||
&& cppcheck --error-exitcode=1 -j2 -Iinclude -Icode code 2> cppcheck.txt
|
|
||||||
if [ -s cppcheck.txt ]; then
|
|
||||||
cat cppcheck.txt
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
generate \
|
|
||||||
&& make -j4 \
|
|
||||||
&& sudo make install \
|
|
||||||
&& sudo ldconfig \
|
|
||||||
&& (cd test/unit; ../../bin/unit)
|
|
||||||
fi
|
|
||||||
fi
|
|
78
.travis.yml
78
.travis.yml
|
@ -1,78 +0,0 @@
|
||||||
sudo: required
|
|
||||||
language: cpp
|
|
||||||
|
|
||||||
cache: ccache
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq && sudo apt-get install cmake cppcheck && sudo apt-get install cmake python3 && sudo apt-get install -qq freeglut3-dev libxmu-dev libxi-dev ; echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- ; fi
|
|
||||||
- 'if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
|
||||||
if brew ls --versions cmake > /dev/null; then
|
|
||||||
echo cmake already installed.;
|
|
||||||
else
|
|
||||||
brew install cmake;
|
|
||||||
fi;
|
|
||||||
brew install python3;
|
|
||||||
brew install homebrew/x11/freeglut;
|
|
||||||
fi'
|
|
||||||
- echo -e "#ifndef A_R_H_INC\n#define A_R_H_INC\n#define GitVersion ${TRAVIS_JOB_ID}\n#define GitBranch \"${TRAVIS_BRANCH}\"\n#endif // A_R_H_INC" > revision.h
|
|
||||||
# install latest LCOV (1.9 was failing)
|
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ${TRAVIS_BUILD_DIR} && wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz && tar xf lcov_1.11.orig.tar.gz && sudo make -C lcov-1.11/ install && gem install coveralls-lcov && lcov --version && g++ --version ; fi
|
|
||||||
|
|
||||||
os:
|
|
||||||
- linux
|
|
||||||
|
|
||||||
compiler:
|
|
||||||
- gcc
|
|
||||||
- clang
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: "lZ7pHQvl5dpZWzBQAaIMf0wqrvtcZ4wiZKeIZjf83TEsflW8+z0uTpIuN30ZV6Glth/Sq1OhLnTP5+N57fZU/1ebA5twHdvP4bS5CIUUg71/CXQZNl36xeaqvxsG/xRrdpKOsPdjAOsQ9KPTQulsX43XDLS7CasMiLvYOpqKcPc="
|
|
||||||
- PV=r8e PLATF=linux-x86_64 NDK_HOME=${TRAVIS_BUILD_DIR}/android-ndk-${PV} PATH=${PATH}:${NDK_HOME}
|
|
||||||
|
|
||||||
git:
|
|
||||||
depth: 1
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ASAN=ON
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: UBSAN=ON
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: SHARED_BUILD=ON
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ANALYZE=ON
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ENABLE_COVERALLS=ON
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: SHARED_BUILD=ON
|
|
||||||
|
|
||||||
install:
|
|
||||||
- if [ $ANDROID ]; then wget -c http://dl.google.com/android/ndk/android-ndk-${PV}-${PLATF}.tar.bz2 && tar xf android-ndk-${PV}-${PLATF}.tar.bz2 ; fi
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
cmake . -DASSIMP_ENABLE_BOOST_WORKAROUND=YES
|
|
||||||
|
|
||||||
script:
|
|
||||||
- export COVERALLS_SERVICE_NAME=travis-ci
|
|
||||||
- export COVERALLS_REPO_TOKEN=abc12345
|
|
||||||
- . ./.travis.sh
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ${TRAVIS_BUILD_DIR} && lcov --directory . --capture --output-file coverage.info && lcov --remove coverage.info '/usr/*' 'contrib/*' 'test/*' --output-file coverage.info && lcov --list coverage.info && coveralls-lcov --source-encoding=ISO-8859-1 --repo-token=${COVERALLS_TOKEN} coverage.info ; fi
|
|
||||||
|
|
||||||
addons:
|
|
||||||
coverity_scan:
|
|
||||||
project:
|
|
||||||
name: "assimp/assimp"
|
|
||||||
notification_email: kim.kulling@googlemail.com
|
|
||||||
build_command_prepend: "cmake ./"
|
|
||||||
build_command: "make -j4"
|
|
||||||
branch_pattern: coverity_scan
|
|
|
@ -1,3 +0,0 @@
|
||||||
set(ASSIMP_INCLUDE_DIRS
|
|
||||||
"@PROJECT_SOURCE_DIR@"
|
|
||||||
"@PROJECT_BINARY_DIR@")
|
|
|
@ -1,11 +0,0 @@
|
||||||
set(ASSIMP_PACKAGE_VERSION "@ASSIMP_SOVERSION@")
|
|
||||||
|
|
||||||
# Check whether the requested PACKAGE_FIND_VERSION is compatible
|
|
||||||
if("${ASSIMP_PACKAGE_VERSION}" VERSION_LESS "${ASSIMP_PACKAGE_FIND_VERSION}")
|
|
||||||
set(ASSIMP_PACKAGE_VERSION_COMPATIBLE FALSE)
|
|
||||||
else()
|
|
||||||
set(ASSIMP_PACKAGE_VERSION_COMPATIBLE TRUE)
|
|
||||||
if ("${ASSIMP_PACKAGE_VERSION}" VERSION_EQUAL "${ASSIMP_PACKAGE_FIND_VERSION}")
|
|
||||||
set(ASSIMP_PACKAGE_VERSION_EXACT TRUE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
|
@ -10,16 +10,15 @@
|
||||||
:: Also see: https://github.com/assimp/assimp/pull/2646
|
:: Also see: https://github.com/assimp/assimp/pull/2646
|
||||||
|
|
||||||
SET SOURCE_DIR=.
|
SET SOURCE_DIR=.
|
||||||
|
SET GENERATOR=Visual Studio 16 2019
|
||||||
|
|
||||||
:: For generators see "cmake --help"
|
SET BINARIES_DIR="./build/Win32"
|
||||||
SET GENERATOR=Visual Studio 15 2017
|
cmake . -G "%GENERATOR%" -A Win32 -S %SOURCE_DIR% -B %BINARIES_DIR%
|
||||||
|
cmake --build %BINARIES_DIR% --config debug
|
||||||
SET BINARIES_DIR="./BINARIES/Win32"
|
|
||||||
cmake CMakeLists.txt -G "%GENERATOR%" -S %SOURCE_DIR% -B %BINARIES_DIR%
|
|
||||||
cmake --build %BINARIES_DIR% --config release
|
cmake --build %BINARIES_DIR% --config release
|
||||||
|
|
||||||
SET BINARIES_DIR="./BINARIES/x64"
|
SET BINARIES_DIR="./build/x64"
|
||||||
cmake CMakeLists.txt -G "%GENERATOR% Win64" -S %SOURCE_DIR% -B %BINARIES_DIR%
|
cmake . -G "%GENERATOR%" -A x64 -S %SOURCE_DIR% -B %BINARIES_DIR%
|
||||||
cmake --build %BINARIES_DIR% --config debug
|
cmake --build %BINARIES_DIR% --config debug
|
||||||
cmake --build %BINARIES_DIR% --config release
|
cmake --build %BINARIES_DIR% --config release
|
||||||
|
|
||||||
|
|
81
Build.md
81
Build.md
|
@ -1,20 +1,33 @@
|
||||||
# Build Instructions
|
# Build / Install Instructions
|
||||||
|
|
||||||
## Build on all platforms using vcpkg
|
## Install on all platforms using vcpkg
|
||||||
You can download and install assimp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
|
You can download and install assimp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/Microsoft/vcpkg.git
|
git clone https://github.com/Microsoft/vcpkg.git
|
||||||
cd vcpkg
|
cd vcpkg
|
||||||
./bootstrap-vcpkg.sh
|
./bootstrap-vcpkg.sh
|
||||||
./vcpkg integrate install
|
./vcpkg integrate install
|
||||||
vcpkg install assimp
|
./vcpkg install assimp
|
||||||
```
|
```
|
||||||
The assimp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
The assimp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||||
|
|
||||||
|
## Install on Ubuntu
|
||||||
|
You can install the Asset-Importer-Lib via apt:
|
||||||
|
```
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install libassimp-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Install pyassimp
|
||||||
|
You need to have pip installed:
|
||||||
|
```
|
||||||
|
pip install pyassimp
|
||||||
|
```
|
||||||
|
|
||||||
## Manual build instructions
|
## Manual build instructions
|
||||||
|
|
||||||
### Install CMake
|
### Install CMake
|
||||||
Asset-Importer-Lib can be build for a lot of different platforms. We are using cmake to generate the build environment for these via cmake. So you have to make sure that you have a working cmake-installation on your system. You can download it at https://cmake.org/ or for linux install it via
|
Asset-Importer-Lib can be built for a lot of different platforms. We are using cmake to generate the build environment for these via cmake. So you have to make sure that you have a working cmake-installation on your system. You can download it at https://cmake.org/ or for linux install it via
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install cmake
|
sudo apt-get install cmake
|
||||||
```
|
```
|
||||||
|
@ -24,15 +37,22 @@ Make sure you have a working git-installation. Open a command prompt and clone t
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/assimp/assimp.git
|
git clone https://github.com/assimp/assimp.git
|
||||||
```
|
```
|
||||||
|
### Build from source:
|
||||||
|
```bash
|
||||||
|
cd assimp
|
||||||
|
cmake CMakeLists.txt
|
||||||
|
cmake --build .
|
||||||
|
```
|
||||||
|
Note that by default this builds a shared library into the `bin` directory. If you want to build it as a static library see the build options at the bottom of this file.
|
||||||
|
|
||||||
### Build instructions for Windows with Visual-Studio
|
### Build instructions for Windows with Visual-Studio
|
||||||
|
|
||||||
First you have to install Visual-Studio on your windows-system. You can get the Community-Version for free here: https://visualstudio.microsoft.com/de/downloads/
|
First, you have to install Visual-Studio on your windows-system. You can get the Community-Version for free here: https://visualstudio.microsoft.com/de/downloads/
|
||||||
To generate the build environment for your IDE open a command prompt, navigate to your repo and type:
|
To generate the build environment for your IDE open a command prompt, navigate to your repo and type:
|
||||||
```bash
|
```bash
|
||||||
cmake CMakeLists.txt
|
cmake CMakeLists.txt
|
||||||
```
|
```
|
||||||
This will generate the project files for the visual studio. All dependencies used to build Asset-IMporter-Lib shall be part of the repo. If you want to use you own zlib.installation this is possible as well. Check the options for it.
|
This will generate the project files for the visual studio. All dependencies used to build Asset-Importer-Lib shall be part of the repo. If you want to use you own zlib installation this is possible as well. Check the options for it.
|
||||||
|
|
||||||
### Build instructions for Windows with UWP
|
### Build instructions for Windows with UWP
|
||||||
See <https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app>
|
See <https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app>
|
||||||
|
@ -44,9 +64,9 @@ Open a terminal and got to your repository. You can generate the makefiles and b
|
||||||
cmake CMakeLists.txt
|
cmake CMakeLists.txt
|
||||||
make -j4
|
make -j4
|
||||||
```
|
```
|
||||||
The option -j descripes the number of parallel processes for the build. In this case make will try to use 4 cores for the build.
|
The option -j describes the number of parallel processes for the build. In this case make will try to use 4 cores for the build.
|
||||||
|
|
||||||
If you want to use a IDE for linux you can try QTCreator for instance.
|
If you want to use an IDE for linux you can try QTCreator for instance.
|
||||||
|
|
||||||
### Build instructions for MinGW
|
### Build instructions for MinGW
|
||||||
Older versions of MinGW's compiler (e.g. 5.1.0) do not support the -mbig_obj flag
|
Older versions of MinGW's compiler (e.g. 5.1.0) do not support the -mbig_obj flag
|
||||||
|
@ -66,23 +86,28 @@ Besides the toolchain, compilation should be the same as for Linux / Unix.
|
||||||
|
|
||||||
### CMake build options
|
### CMake build options
|
||||||
The cmake-build-environment provides options to configure the build. The following options can be used:
|
The cmake-build-environment provides options to configure the build. The following options can be used:
|
||||||
- **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib.
|
- **ASSIMP_HUNTER_ENABLED (default OFF)**: Enable Hunter package manager support.
|
||||||
- **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle
|
- **BUILD_SHARED_LIBS (default ON)**: Generation of shared libs (dll for windows, so for Linux). Set this to OFF to get a static lib.
|
||||||
- **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values.
|
- **ASSIMP_BUILD_FRAMEWORK (default OFF, MacOnly)**: Build package as Mac OS X Framework bundle.
|
||||||
- **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets
|
- **ASSIMP_DOUBLE_PRECISION (default OFF)**: All data will be stored as double values.
|
||||||
- **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active
|
- **ASSIMP_OPT_BUILD_PACKAGES (default OFF)**: Set to ON to generate CPack configuration files and packaging targets.
|
||||||
- **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality
|
- **ASSIMP_ANDROID_JNIIOSYSTEM (default OFF)**: Android JNI IOSystem support is active.
|
||||||
- **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib
|
- **ASSIMP_NO_EXPORT (default OFF)**: Disable Assimp's export functionality.
|
||||||
- **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library.
|
- **ASSIMP_BUILD_ZLIB (default OFF)**: Build our own zlib.
|
||||||
- **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut).
|
- **ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT (default ON)**: Build Assimp with all exporters enabled.
|
||||||
- **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library.
|
- **ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT (default ON)**: Build Assimp with all importers enabled.
|
||||||
- **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage.
|
- **ASSIMP_BUILD_ASSIMP_TOOLS (default OFF)**: If the supplementary tools for Assimp are built in addition to the library.
|
||||||
- **ASSIMP_ERROR_MAX( default OFF)**: Enable all warnings.
|
- **ASSIMP_BUILD_SAMPLES (default OFF)**: If the official samples are built as well (needs Glut).
|
||||||
- **ASSIMP_WERROR( default OFF )**: Treat warnings as errors.
|
- **ASSIMP_BUILD_TESTS (default ON)**: If the test suite for Assimp is built in addition to the library.
|
||||||
- **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer.
|
- **ASSIMP_COVERALLS (default OFF)**: Enable this to measure test coverage.
|
||||||
- **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer.
|
- **ASSIMP_INSTALL (default ON)**: Install Assimp library. Disable this if you want to use Assimp as a submodule.
|
||||||
- **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library.
|
- **ASSIMP_WARNINGS_AS_ERRORS (default ON)**: Treat all warnings as errors.
|
||||||
- **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen.
|
- **ASSIMP_ASAN (default OFF)**: Enable AddressSanitizer.
|
||||||
- **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names
|
- **ASSIMP_UBSAN (default OFF)**: Enable Undefined Behavior sanitizer.
|
||||||
- **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash.
|
- **ASSIMP_BUILD_DOCS (default OFF)**: Build documentation using Doxygen. OBSOLETE, see https://github.com/assimp/assimp-docs
|
||||||
- **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files.
|
- **ASSIMP_INJECT_DEBUG_POSTFIX (default ON)**: Inject debug postfix in .a/.so/.lib/.dll lib names
|
||||||
|
- **ASSIMP_IGNORE_GIT_HASH (default OFF)**: Don't call git to get the hash.
|
||||||
|
- **ASSIMP_INSTALL_PDB (default ON)**: Install MSVC debug files.
|
||||||
|
- **USE_STATIC_CRT (default OFF)**: Link against the static MSVC runtime libraries.
|
||||||
|
- **ASSIMP_BUILD_DRACO (default OFF)**: Build Draco libraries. Primarily for glTF.
|
||||||
|
- **ASSIMP_BUILD_ASSIMP_VIEW (default ON, if DirectX found, OFF otherwise)**: Build Assimp view tool (requires DirectX).
|
||||||
|
|
560
CMakeLists.txt
560
CMakeLists.txt
|
@ -1,6 +1,6 @@
|
||||||
# Open Asset Import Library (assimp)
|
# Open Asset Import Library (assimp)
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Copyright (c) 2006-2020, assimp team
|
# Copyright (c) 2006-2024, assimp team
|
||||||
#
|
#
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
|
@ -34,24 +34,44 @@
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
SET(CMAKE_POLICY_DEFAULT_CMP0012 NEW)
|
||||||
SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
|
SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
|
||||||
|
SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW)
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )
|
CMAKE_MINIMUM_REQUIRED( VERSION 3.22 )
|
||||||
|
|
||||||
|
# Experimental USD importer: disabled, need to opt-in
|
||||||
|
# Note: assimp github PR automatic checks will fail the PR due to compiler warnings in
|
||||||
|
# the external, 3rd party tinyusdz code which isn't technically part of the PR since it's
|
||||||
|
# auto-cloned during build; so MUST disable the feature or the PR will be rejected
|
||||||
|
option(ASSIMP_BUILD_USD_IMPORTER "Enable USD file import" off)
|
||||||
|
option(ASSIMP_BUILD_USD_VERBOSE_LOGS "Enable verbose USD import debug logging" off)
|
||||||
|
option(ASSIMP_BUILD_USE_CCACHE "Use ccache to speed up compilation." on)
|
||||||
|
|
||||||
|
if(ASSIMP_BUILD_USE_CCACHE)
|
||||||
|
find_program(CCACHE_PATH ccache)
|
||||||
|
if (CCACHE_PATH)
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PATH})
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_PATH})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Disabled importers: m3d for 5.1 or later
|
||||||
|
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER)
|
||||||
|
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER)
|
||||||
# Toggles the use of the hunter package manager
|
# Toggles the use of the hunter package manager
|
||||||
option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF)
|
option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF)
|
||||||
|
|
||||||
IF(ASSIMP_HUNTER_ENABLED)
|
IF(ASSIMP_HUNTER_ENABLED)
|
||||||
include("cmake/HunterGate.cmake")
|
include("cmake-modules/HunterGate.cmake")
|
||||||
HunterGate(
|
HunterGate(
|
||||||
URL "https://github.com/ruslo/hunter/archive/v0.23.176.tar.gz"
|
URL "https://github.com/cpp-pm/hunter/archive/v0.25.5.tar.gz"
|
||||||
SHA1 "2e9ae973d028660b735ac4c6142725ca36a0048a"
|
SHA1 "a20151e4c0740ee7d0f9994476856d813cdead29"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_definitions(-DASSIMP_USE_HUNTER)
|
add_definitions(-DASSIMP_USE_HUNTER)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
PROJECT( Assimp VERSION 5.0.1 )
|
PROJECT(Assimp VERSION 5.4.3)
|
||||||
|
|
||||||
# All supported options ###############################################
|
# All supported options ###############################################
|
||||||
|
|
||||||
|
@ -59,7 +79,6 @@ OPTION( BUILD_SHARED_LIBS
|
||||||
"Build package with shared libraries."
|
"Build package with shared libraries."
|
||||||
ON
|
ON
|
||||||
)
|
)
|
||||||
|
|
||||||
OPTION( ASSIMP_BUILD_FRAMEWORK
|
OPTION( ASSIMP_BUILD_FRAMEWORK
|
||||||
"Build package as Mac OS X Framework bundle."
|
"Build package as Mac OS X Framework bundle."
|
||||||
OFF
|
OFF
|
||||||
|
@ -80,13 +99,9 @@ OPTION( ASSIMP_NO_EXPORT
|
||||||
"Disable Assimp's export functionality."
|
"Disable Assimp's export functionality."
|
||||||
OFF
|
OFF
|
||||||
)
|
)
|
||||||
OPTION( ASSIMP_BUILD_ZLIB
|
|
||||||
"Build your own zlib"
|
|
||||||
OFF
|
|
||||||
)
|
|
||||||
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
|
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
|
||||||
"If the supplementary tools for Assimp are built in addition to the library."
|
"If the supplementary tools for Assimp are built in addition to the library."
|
||||||
ON
|
OFF
|
||||||
)
|
)
|
||||||
OPTION ( ASSIMP_BUILD_SAMPLES
|
OPTION ( ASSIMP_BUILD_SAMPLES
|
||||||
"If the official samples are built as well (needs Glut)."
|
"If the official samples are built as well (needs Glut)."
|
||||||
|
@ -104,9 +119,9 @@ OPTION( ASSIMP_INSTALL
|
||||||
"Disable this if you want to use assimp as a submodule."
|
"Disable this if you want to use assimp as a submodule."
|
||||||
ON
|
ON
|
||||||
)
|
)
|
||||||
OPTION ( ASSIMP_ERROR_MAX
|
OPTION ( ASSIMP_WARNINGS_AS_ERRORS
|
||||||
"Enable all warnings."
|
"Treat all warnings as errors."
|
||||||
OFF
|
ON
|
||||||
)
|
)
|
||||||
OPTION ( ASSIMP_ASAN
|
OPTION ( ASSIMP_ASAN
|
||||||
"Enable AddressSanitizer."
|
"Enable AddressSanitizer."
|
||||||
|
@ -116,10 +131,6 @@ OPTION ( ASSIMP_UBSAN
|
||||||
"Enable Undefined Behavior sanitizer."
|
"Enable Undefined Behavior sanitizer."
|
||||||
OFF
|
OFF
|
||||||
)
|
)
|
||||||
OPTION ( ASSIMP_SYSTEM_IRRXML
|
|
||||||
"Use system installed Irrlicht/IrrXML library."
|
|
||||||
OFF
|
|
||||||
)
|
|
||||||
OPTION ( ASSIMP_BUILD_DOCS
|
OPTION ( ASSIMP_BUILD_DOCS
|
||||||
"Build documentation using Doxygen."
|
"Build documentation using Doxygen."
|
||||||
OFF
|
OFF
|
||||||
|
@ -134,10 +145,46 @@ OPTION ( ASSIMP_IGNORE_GIT_HASH
|
||||||
OFF
|
OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
IF ( WIN32 )
|
IF (WIN32)
|
||||||
OPTION ( ASSIMP_BUILD_ASSIMP_VIEW
|
OPTION( ASSIMP_BUILD_ZLIB
|
||||||
"If the Assimp view tool is built. (requires DirectX)"
|
"Build your zlib"
|
||||||
OFF )
|
ON
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
OPTION( ASSIMP_BUILD_ZLIB
|
||||||
|
"Build your zlib"
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF (WIN32)
|
||||||
|
# Use a subset of Windows.h
|
||||||
|
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
|
OPTION( ASSIMP_INSTALL_PDB
|
||||||
|
"Create MSVC debug symbol files and add to Install target."
|
||||||
|
ON )
|
||||||
|
IF(NOT (MSVC_VERSION LESS 1900))
|
||||||
|
# Multibyte character set has been deprecated since at least MSVC2015 (possibly earlier)
|
||||||
|
ADD_DEFINITIONS( -DUNICODE -D_UNICODE )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Link statically against c/c++ lib to avoid missing redistributable such as
|
||||||
|
# "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users
|
||||||
|
# a choice to opt for the shared runtime if they want.
|
||||||
|
option(USE_STATIC_CRT "Link against the static runtime libraries." OFF)
|
||||||
|
|
||||||
|
# The CMAKE_CXX_FLAGS vars can be overridden by some Visual Studio generators, so we use an alternative
|
||||||
|
# global method here:
|
||||||
|
if (${USE_STATIC_CRT})
|
||||||
|
add_compile_options(
|
||||||
|
$<$<CONFIG:>:/MT>
|
||||||
|
$<$<CONFIG:Debug>:/MTd>
|
||||||
|
$<$<CONFIG:Release>:/MT>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (IOS AND NOT ASSIMP_HUNTER_ENABLED)
|
IF (IOS AND NOT ASSIMP_HUNTER_ENABLED)
|
||||||
|
@ -147,21 +194,6 @@ IF (IOS AND NOT ASSIMP_HUNTER_ENABLED)
|
||||||
ADD_DEFINITIONS(-DENABLE_BITCODE)
|
ADD_DEFINITIONS(-DENABLE_BITCODE)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
# Use subset of Windows.h
|
|
||||||
if (WIN32)
|
|
||||||
ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
IF(MSVC)
|
|
||||||
OPTION( ASSIMP_INSTALL_PDB
|
|
||||||
"Install MSVC debug files."
|
|
||||||
ON
|
|
||||||
)
|
|
||||||
IF(NOT (MSVC_VERSION LESS 1900))
|
|
||||||
# Multibyte character set is deprecated since at least MSVC2015 (possibly earlier)
|
|
||||||
ADD_DEFINITIONS( -DUNICODE -D_UNICODE )
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (ASSIMP_BUILD_FRAMEWORK)
|
IF (ASSIMP_BUILD_FRAMEWORK)
|
||||||
SET (BUILD_SHARED_LIBS ON)
|
SET (BUILD_SHARED_LIBS ON)
|
||||||
|
@ -171,6 +203,7 @@ ENDIF()
|
||||||
IF(NOT BUILD_SHARED_LIBS)
|
IF(NOT BUILD_SHARED_LIBS)
|
||||||
MESSAGE(STATUS "Shared libraries disabled")
|
MESSAGE(STATUS "Shared libraries disabled")
|
||||||
SET(LINK_SEARCH_START_STATIC TRUE)
|
SET(LINK_SEARCH_START_STATIC TRUE)
|
||||||
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "Shared libraries enabled")
|
MESSAGE(STATUS "Shared libraries enabled")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -183,10 +216,9 @@ SET (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VER
|
||||||
SET (ASSIMP_SOVERSION 5)
|
SET (ASSIMP_SOVERSION 5)
|
||||||
|
|
||||||
SET( ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources" )
|
SET( ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources" )
|
||||||
if(NOT ASSIMP_HUNTER_ENABLED)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
# Enable C++11 support globally
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set_property( GLOBAL PROPERTY CXX_STANDARD 11 )
|
set(CMAKE_C_STANDARD 99)
|
||||||
endif()
|
|
||||||
|
|
||||||
IF(NOT ASSIMP_IGNORE_GIT_HASH)
|
IF(NOT ASSIMP_IGNORE_GIT_HASH)
|
||||||
# Get the current working branch
|
# Get the current working branch
|
||||||
|
@ -213,19 +245,9 @@ IF(NOT GIT_COMMIT_HASH)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(ASSIMP_DOUBLE_PRECISION)
|
IF(ASSIMP_DOUBLE_PRECISION)
|
||||||
ADD_DEFINITIONS(-DASSIMP_DOUBLE_PRECISION)
|
ADD_DEFINITIONS(-DASSIMP_DOUBLE_PRECISION)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
CONFIGURE_FILE(
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/revision.h.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/revision.h
|
|
||||||
)
|
|
||||||
|
|
||||||
CONFIGURE_FILE(
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/include/assimp/config.h
|
|
||||||
)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES( BEFORE
|
INCLUDE_DIRECTORIES( BEFORE
|
||||||
./
|
./
|
||||||
code/
|
code/
|
||||||
|
@ -243,104 +265,146 @@ SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
|
||||||
IF( UNIX )
|
IF( UNIX )
|
||||||
# Use GNUInstallDirs for Unix predefined directories
|
# Use GNUInstallDirs for Unix predefined directories
|
||||||
INCLUDE(GNUInstallDirs)
|
INCLUDE(GNUInstallDirs)
|
||||||
|
# Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit Linux
|
||||||
|
IF(NOT ${OPERATING_SYSTEM} MATCHES "Android")
|
||||||
|
IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit Linux
|
||||||
|
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 )
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Grouped compiler settings ########################################
|
# Grouped compiler settings ########################################
|
||||||
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
|
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT MINGW AND NOT HAIKU)
|
||||||
IF(NOT ASSIMP_HUNTER_ENABLED)
|
IF(NOT ASSIMP_HUNTER_ENABLED)
|
||||||
SET(CMAKE_CXX_STANDARD 11)
|
|
||||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 13)
|
||||||
|
MESSAGE(STATUS "GCC13 detected disabling \"-Wdangling-reference\" in Cpp files as it appears to be a false positive")
|
||||||
|
ADD_COMPILE_OPTIONS("$<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference>")
|
||||||
|
ENDIF()
|
||||||
# hide all not-exported symbols
|
# hide all not-exported symbols
|
||||||
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
|
IF(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" )
|
||||||
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
SET(CMAKE_CXX_FLAGS "-mxgot -fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
|
||||||
SET(LIBSTDC++_LIBRARIES -lstdc++)
|
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
||||||
|
SET(LIBSTDC++_LIBRARIES -lstdc++)
|
||||||
|
ELSE()
|
||||||
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
|
||||||
|
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
||||||
|
SET(LIBSTDC++_LIBRARIES -lstdc++)
|
||||||
|
ENDIF()
|
||||||
ELSEIF(MSVC)
|
ELSEIF(MSVC)
|
||||||
# enable multi-core compilation with MSVC
|
# enable multi-core compilation with MSVC
|
||||||
ADD_COMPILE_OPTIONS(/MP /bigobj /W4 /WX )
|
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) # clang-cl
|
||||||
|
ADD_COMPILE_OPTIONS(/bigobj)
|
||||||
|
ELSE() # msvc
|
||||||
|
ADD_COMPILE_OPTIONS(/MP /bigobj)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# disable "elements of array '' will be default initialized" warning on MSVC2013
|
# disable "elements of array '' will be default initialized" warning on MSVC2013
|
||||||
IF(MSVC12)
|
IF(MSVC12)
|
||||||
ADD_COMPILE_OPTIONS(/wd4351)
|
ADD_COMPILE_OPTIONS(/wd4351)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
# supress warning for double to float conversion if Double precision is activated
|
||||||
|
ADD_COMPILE_OPTIONS(/wd4244)
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
|
||||||
ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
|
# Allow user to disable PDBs
|
||||||
|
if(ASSIMP_INSTALL_PDB)
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||||
|
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")
|
||||||
|
elseif((GENERATOR_IS_MULTI_CONFIG) OR (CMAKE_BUILD_TYPE MATCHES Release))
|
||||||
|
message("-- MSVC PDB generation disabled. Release binary will not be debuggable.")
|
||||||
|
endif()
|
||||||
|
# Source code is encoded in UTF-8
|
||||||
|
ADD_COMPILE_OPTIONS(/source-charset:utf-8)
|
||||||
|
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
IF(NOT ASSIMP_HUNTER_ENABLED)
|
IF(NOT ASSIMP_HUNTER_ENABLED)
|
||||||
SET(CMAKE_CXX_STANDARD 11)
|
|
||||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" )
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" )
|
||||||
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
||||||
ELSEIF( CMAKE_COMPILER_IS_MINGW )
|
ELSEIF( MINGW )
|
||||||
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
||||||
message(FATAL_ERROR "MinGW is too old to be supported. Please update MinGW and try again.")
|
message(FATAL_ERROR "MinGW is too old to be supported. Please update MinGW and try again.")
|
||||||
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
|
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
|
||||||
message(WARNING "MinGW is old, if you experience errors, update MinGW.")
|
message(WARNING "MinGW is old, if you experience errors, update MinGW.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT ASSIMP_HUNTER_ENABLED)
|
IF(NOT ASSIMP_HUNTER_ENABLED)
|
||||||
SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
SET(CMAKE_CXX_FLAGS "-std=gnu++17 ${CMAKE_CXX_FLAGS}")
|
||||||
SET(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
|
SET(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long -Wa,-mbig-obj -O3 ${CMAKE_CXX_FLAGS}")
|
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wno-dangling-reference -Wall -Wno-long-long -Wa,-mbig-obj -g ${CMAKE_CXX_FLAGS}")
|
||||||
ADD_DEFINITIONS( -U__STRICT_ANSI__ )
|
ELSE()
|
||||||
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wno-dangling-reference -Wall -Wno-long-long -Wa,-mbig-obj -O3 ${CMAKE_CXX_FLAGS}")
|
||||||
|
ENDIF()
|
||||||
|
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF ( IOS AND NOT ASSIMP_HUNTER_ENABLED)
|
IF ( IOS AND NOT ASSIMP_HUNTER_ENABLED)
|
||||||
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode -Og")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode -Og")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -Og")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -Og")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode -O3")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode -O3")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -O3")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -O3")
|
||||||
# Experimental for pdb generation
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (ASSIMP_COVERALLS)
|
IF (ASSIMP_COVERALLS)
|
||||||
MESSAGE(STATUS "Coveralls enabled")
|
MESSAGE(STATUS "Coveralls enabled")
|
||||||
|
|
||||||
INCLUDE(Coveralls)
|
INCLUDE(Coveralls)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (ASSIMP_ERROR_MAX)
|
|
||||||
MESSAGE(STATUS "Turning on all warnings")
|
|
||||||
IF (MSVC)
|
|
||||||
ADD_COMPILE_OPTIONS(/W4) # NB: there is a /Wall option, pedantic mode
|
|
||||||
ELSE()
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (ASSIMP_ASAN)
|
IF (ASSIMP_ASAN)
|
||||||
MESSAGE(STATUS "AddressSanitizer enabled")
|
MESSAGE(STATUS "AddressSanitizer enabled")
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (ASSIMP_UBSAN)
|
IF (ASSIMP_UBSAN)
|
||||||
MESSAGE(STATUS "Undefined Behavior sanitizer enabled")
|
MESSAGE(STATUS "Undefined Behavior sanitizer enabled")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined,shift,shift-exponent,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr,pointer-overflow,builtin -fno-sanitize-recover=all")
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined,shift,shift-exponent,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr,pointer-overflow,builtin -fno-sanitize-recover=all")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
INCLUDE (FindPkgMacros)
|
INCLUDE (FindPkgMacros)
|
||||||
INCLUDE (PrecompiledHeader)
|
INCLUDE (PrecompiledHeader)
|
||||||
|
|
||||||
# If this is an in-source build (CMAKE_SOURCE_DIR == CMAKE_BINARY_DIR),
|
# Set Assimp project output directory variables.
|
||||||
# write the library/executable files to the respective directories in the
|
# Will respect top-level CMAKE_*_OUTPUT_DIRECTORY variables if any are set.
|
||||||
# source tree. During an out-of-source build, however, do not litter this
|
IF(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||||
# directory, since that is probably what the user wanted to avoid.
|
SET(ASSIMP_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" CACHE STRING "Path for runtime output files")
|
||||||
IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
|
||||||
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
|
||||||
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
|
||||||
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
SET(ASSIMP_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} CACHE STRING "Path for runtime output files")
|
||||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
ENDIF()
|
||||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
|
||||||
ENDIF ()
|
IF(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||||
|
SET(ASSIMP_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" CACHE STRING "Path for library output files")
|
||||||
|
ELSE()
|
||||||
|
SET(ASSIMP_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CACHE STRING "Path for runtime output files")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||||
|
SET(ASSIMP_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib" CACHE STRING "Path for library output files")
|
||||||
|
ELSE()
|
||||||
|
SET(ASSIMP_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} CACHE STRING "Path for runtime output files")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Macro used to set the output directories of a target to the
|
||||||
|
# respective Assimp output directories.
|
||||||
|
MACRO(TARGET_USE_COMMON_OUTPUT_DIRECTORY target)
|
||||||
|
set_target_properties(${target} PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${ASSIMP_RUNTIME_OUTPUT_DIRECTORY}
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${ASSIMP_LIBRARY_OUTPUT_DIRECTORY}
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${ASSIMP_ARCHIVE_OUTPUT_DIRECTORY}
|
||||||
|
)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG)
|
get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
|
||||||
|
@ -351,110 +415,85 @@ ELSE()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Only generate this target if no higher-level project already has
|
# Only generate this target if no higher-level project already has
|
||||||
IF (NOT TARGET uninstall)
|
IF (NOT TARGET uninstall AND ASSIMP_INSTALL)
|
||||||
# add make uninstall capability
|
# add make uninstall capability
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
||||||
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF( UNIX )
|
||||||
|
# Use GNUInstallDirs for Unix predefined directories
|
||||||
|
INCLUDE(GNUInstallDirs)
|
||||||
|
|
||||||
|
SET( ASSIMP_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
SET( ASSIMP_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
SET( ASSIMP_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
|
||||||
|
ELSE()
|
||||||
|
# Cache these to allow the user to override them on non-Unix platforms
|
||||||
|
SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING
|
||||||
|
"Path the built library files are installed to." )
|
||||||
|
SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING
|
||||||
|
"Path the header files are installed to." )
|
||||||
|
SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING
|
||||||
|
"Path the tool executables are installed to." )
|
||||||
|
|
||||||
|
SET(CMAKE_INSTALL_FULL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_INCLUDE_INSTALL_DIR})
|
||||||
|
SET(CMAKE_INSTALL_FULL_LIBDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR})
|
||||||
|
SET(CMAKE_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_BIN_INSTALL_DIR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
||||||
|
|
||||||
IF(ASSIMP_HUNTER_ENABLED)
|
IF(ASSIMP_HUNTER_ENABLED)
|
||||||
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
|
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
|
||||||
set(INCLUDE_INSTALL_DIR "include")
|
set(CMAKE_CONFIG_TEMPLATE_FILE "cmake-modules/assimp-hunter-config.cmake.in")
|
||||||
|
set(NAMESPACE "${PROJECT_NAME}::")
|
||||||
set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
||||||
|
|
||||||
# Configuration
|
|
||||||
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||||
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
|
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
|
||||||
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
|
ELSE()
|
||||||
set(NAMESPACE "${PROJECT_NAME}::")
|
set(CONFIG_INSTALL_DIR "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}")
|
||||||
|
set(CMAKE_CONFIG_TEMPLATE_FILE "cmake-modules/assimp-plain-config.cmake.in")
|
||||||
|
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
|
||||||
|
set(NAMESPACE "${PROJECT_NAME_LOWERCASE}::")
|
||||||
|
set(TARGETS_EXPORT_NAME "${PROJECT_NAME_LOWERCASE}Targets")
|
||||||
|
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME_LOWERCASE}ConfigVersion.cmake")
|
||||||
|
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME_LOWERCASE}Config.cmake")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Include module with fuction 'write_basic_package_version_file'
|
set(INCLUDE_INSTALL_DIR "include")
|
||||||
include(CMakePackageConfigHelpers)
|
|
||||||
|
|
||||||
# Note: PROJECT_VERSION is used as a VERSION
|
# Include module with fuction 'write_basic_package_version_file'
|
||||||
write_basic_package_version_file("${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
# Use variables:
|
# Note: PROJECT_VERSION is used as a VERSION
|
||||||
# * TARGETS_EXPORT_NAME
|
write_basic_package_version_file("${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion)
|
||||||
# * PROJECT_NAME
|
|
||||||
configure_package_config_file(
|
|
||||||
"cmake/assimp-hunter-config.cmake.in"
|
|
||||||
"${PROJECT_CONFIG}"
|
|
||||||
INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
configure_package_config_file(
|
||||||
|
${CMAKE_CONFIG_TEMPLATE_FILE}
|
||||||
|
"${PROJECT_CONFIG}"
|
||||||
|
INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(ASSIMP_INSTALL)
|
||||||
install(
|
install(
|
||||||
FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
|
FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
|
||||||
DESTINATION "${CONFIG_INSTALL_DIR}"
|
DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||||
|
COMPONENT ${LIBASSIMP-DEV_COMPONENT}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
NAMESPACE "${NAMESPACE}"
|
NAMESPACE "${NAMESPACE}"
|
||||||
DESTINATION "${CONFIG_INSTALL_DIR}"
|
DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||||
|
COMPONENT ${LIBASSIMP-DEV_COMPONENT}
|
||||||
)
|
)
|
||||||
ELSE()
|
endif()
|
||||||
# cmake configuration files
|
|
||||||
if(${BUILD_SHARED_LIBS})
|
|
||||||
set(BUILD_LIB_TYPE SHARED)
|
|
||||||
else()
|
|
||||||
set(BUILD_LIB_TYPE STATIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
IF( UNIX )
|
|
||||||
# Use GNUInstallDirs for Unix predefined directories
|
|
||||||
INCLUDE(GNUInstallDirs)
|
|
||||||
|
|
||||||
SET( ASSIMP_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
SET( ASSIMP_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
|
|
||||||
SET( ASSIMP_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
|
|
||||||
ELSE()
|
|
||||||
# Cache these to allow the user to override them on non-Unix platforms
|
|
||||||
SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING
|
|
||||||
"Path the built library files are installed to." )
|
|
||||||
SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING
|
|
||||||
"Path the header files are installed to." )
|
|
||||||
SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING
|
|
||||||
"Path the tool executables are installed to." )
|
|
||||||
|
|
||||||
SET(CMAKE_INSTALL_FULL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_INCLUDE_INSTALL_DIR})
|
|
||||||
SET(CMAKE_INSTALL_FULL_LIBDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR})
|
|
||||||
SET(CMAKE_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_BIN_INSTALL_DIR})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE)
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE)
|
|
||||||
IF (is_multi_config)
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
|
|
||||||
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
|
|
||||||
ELSEIF (CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-debug.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake" @ONLY IMMEDIATE)
|
|
||||||
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-debug.cmake")
|
|
||||||
ELSE()
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets-release.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake" @ONLY IMMEDIATE)
|
|
||||||
SET(PACKAGE_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets-release.cmake")
|
|
||||||
ENDIF()
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
|
|
||||||
#we should generated these scripts after CMake VERSION 3.0.2 using export(EXPORT ...) and write_basic_package_version_file(...)
|
|
||||||
INSTALL(FILES
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
|
|
||||||
${PACKAGE_TARGETS_FILE}
|
|
||||||
DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF( ASSIMP_BUILD_DOCS )
|
IF( ASSIMP_BUILD_DOCS )
|
||||||
ADD_SUBDIRECTORY(doc)
|
ADD_SUBDIRECTORY(doc)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Look for system installed irrXML
|
|
||||||
IF ( ASSIMP_SYSTEM_IRRXML )
|
|
||||||
FIND_PACKAGE( IrrXML REQUIRED )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# Search for external dependencies, and build them from source if not found
|
# Search for external dependencies, and build them from source if not found
|
||||||
# Search for zlib
|
# Search for zlib
|
||||||
IF(ASSIMP_HUNTER_ENABLED)
|
IF(ASSIMP_HUNTER_ENABLED)
|
||||||
|
@ -466,11 +505,21 @@ IF(ASSIMP_HUNTER_ENABLED)
|
||||||
set(ZLIB_LIBRARIES ZLIB::zlib)
|
set(ZLIB_LIBRARIES ZLIB::zlib)
|
||||||
set(ASSIMP_BUILD_MINIZIP TRUE)
|
set(ASSIMP_BUILD_MINIZIP TRUE)
|
||||||
ELSE()
|
ELSE()
|
||||||
|
# If the zlib is already found outside, add an export in case assimpTargets can't find it.
|
||||||
|
IF( ZLIB_FOUND AND ASSIMP_INSTALL)
|
||||||
|
INSTALL( TARGETS zlib zlibstatic
|
||||||
|
EXPORT "${TARGETS_EXPORT_NAME}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF ( NOT ASSIMP_BUILD_ZLIB )
|
IF ( NOT ASSIMP_BUILD_ZLIB )
|
||||||
FIND_PACKAGE(ZLIB)
|
FIND_PACKAGE(ZLIB)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF( NOT ZLIB_FOUND )
|
IF ( NOT ZLIB_FOUND AND NOT ASSIMP_BUILD_ZLIB )
|
||||||
|
message( FATAL_ERROR
|
||||||
|
"Build configured with -DASSIMP_BUILD_ZLIB=OFF but unable to find zlib"
|
||||||
|
)
|
||||||
|
ELSEIF( NOT ZLIB_FOUND )
|
||||||
MESSAGE(STATUS "compiling zlib from sources")
|
MESSAGE(STATUS "compiling zlib from sources")
|
||||||
INCLUDE(CheckIncludeFile)
|
INCLUDE(CheckIncludeFile)
|
||||||
INCLUDE(CheckTypeSize)
|
INCLUDE(CheckTypeSize)
|
||||||
|
@ -535,15 +584,19 @@ ENDIF()
|
||||||
MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER )
|
MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER )
|
||||||
|
|
||||||
SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL
|
SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL
|
||||||
"Build the C4D importer, which relies on the non-free Melange SDK."
|
"Build the C4D importer, which relies on the non-free Cineware SDK."
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
IF ( MSVC )
|
SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Cineware/includes")
|
||||||
SET(C4D_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/includes")
|
|
||||||
|
|
||||||
|
IF (WIN32)
|
||||||
# pick the correct prebuilt library
|
# pick the correct prebuilt library
|
||||||
IF(MSVC15)
|
IF(MSVC143)
|
||||||
|
SET(C4D_LIB_POSTFIX "_2022")
|
||||||
|
ELSEIF(MSV142)
|
||||||
|
SET(C4D_LIB_POSTFIX "_2019")
|
||||||
|
ELSEIF(MSVC15)
|
||||||
SET(C4D_LIB_POSTFIX "_2017")
|
SET(C4D_LIB_POSTFIX "_2017")
|
||||||
ELSEIF(MSVC14)
|
ELSEIF(MSVC14)
|
||||||
SET(C4D_LIB_POSTFIX "_2015")
|
SET(C4D_LIB_POSTFIX "_2015")
|
||||||
|
@ -555,50 +608,162 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||||
SET(C4D_LIB_POSTFIX "_2010")
|
SET(C4D_LIB_POSTFIX "_2010")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE( FATAL_ERROR
|
MESSAGE( FATAL_ERROR
|
||||||
"C4D is currently only supported with MSVC 10, 11, 12, 14"
|
"C4D for Windows is currently only supported with MSVC 10, 11, 12, 14, 14.2, 14.3"
|
||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Melange/libraries/win")
|
SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Cineware/libraries/win")
|
||||||
|
|
||||||
SET(C4D_DEBUG_LIBRARIES
|
SET(C4D_DEBUG_LIBRARIES
|
||||||
"${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_debug.lib"
|
"${C4D_LIB_BASE_PATH}/cinewarelib${C4D_LIB_POSTFIX}/cinewarelib_debug.lib"
|
||||||
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib"
|
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_debug.lib"
|
||||||
)
|
)
|
||||||
SET(C4D_RELEASE_LIBRARIES
|
SET(C4D_RELEASE_LIBRARIES
|
||||||
"${C4D_LIB_BASE_PATH}/melangelib${C4D_LIB_POSTFIX}/melangelib_release.lib"
|
"${C4D_LIB_BASE_PATH}/cinewarelib${C4D_LIB_POSTFIX}/cinewarelib_release.lib"
|
||||||
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib"
|
"${C4D_LIB_BASE_PATH}/jpeglib${C4D_LIB_POSTFIX}/jpeglib_release.lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
# winsock and winmm are necessary dependencies of melange (this is undocumented, but true.)
|
# winsock and winmm are necessary (and undocumented) dependencies of Cineware SDK because
|
||||||
|
# it can be used to communicate with a running Cinema 4D instance
|
||||||
SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib)
|
SET(C4D_EXTRA_LIBRARIES WSock32.lib Winmm.lib)
|
||||||
|
ELSEIF (APPLE)
|
||||||
|
SET(C4D_LIB_BASE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/contrib/Cineware/libraries/osx")
|
||||||
|
|
||||||
|
SET(C4D_DEBUG_LIBRARIES
|
||||||
|
"${C4D_LIB_BASE_PATH}/debug/libcinewarelib.a"
|
||||||
|
"${C4D_LIB_BASE_PATH}/debug/libjpeglib.a"
|
||||||
|
)
|
||||||
|
SET(C4D_RELEASE_LIBRARIES
|
||||||
|
"${C4D_LIB_BASE_PATH}/release/libcinewarelib.a"
|
||||||
|
"${C4D_LIB_BASE_PATH}/release/libjpeglib.a"
|
||||||
|
)
|
||||||
ELSE ()
|
ELSE ()
|
||||||
MESSAGE( FATAL_ERROR
|
MESSAGE( FATAL_ERROR
|
||||||
"C4D is currently only available on Windows with melange SDK installed in contrib/Melange"
|
"C4D is currently only available on Windows and macOS with Cineware SDK installed in contrib/Cineware"
|
||||||
)
|
)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ELSE ()
|
ELSE ()
|
||||||
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER )
|
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER )
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF(NOT ASSIMP_HUNTER_ENABLED)
|
if(ASSIMP_BUILD_DRACO_STATIC)
|
||||||
ADD_SUBDIRECTORY(contrib)
|
set(ASSIMP_BUILD_DRACO ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Draco requires cmake 3.12
|
||||||
|
IF (DEFINED CMAKE_VERSION AND "${CMAKE_VERSION}" VERSION_LESS "3.12")
|
||||||
|
message(NOTICE "draco requires cmake 3.12 or newer, cmake is ${CMAKE_VERSION} . Draco is disabled")
|
||||||
|
SET ( ASSIMP_BUILD_DRACO OFF CACHE BOOL "Disabled: Draco requires newer cmake" FORCE )
|
||||||
|
ELSE()
|
||||||
|
OPTION ( ASSIMP_BUILD_DRACO "If the Draco libraries are to be built. Primarily for glTF" OFF )
|
||||||
|
IF ( ASSIMP_BUILD_DRACO )
|
||||||
|
# Primarily for glTF v2
|
||||||
|
# Enable Draco glTF feature set
|
||||||
|
set(DRACO_GLTF_BITSTREAM ON CACHE BOOL "" FORCE)
|
||||||
|
# Disable unnecessary or omitted components
|
||||||
|
set(DRACO_JS_GLUE OFF CACHE BOOL "" FORCE)
|
||||||
|
set(DRACO_WASM OFF CACHE BOOL "" FORCE)
|
||||||
|
set(DRACO_MAYA_PLUGIN OFF CACHE BOOL "" FORCE)
|
||||||
|
set(DRACO_UNITY_PLUGIN OFF CACHE BOOL "" FORCE)
|
||||||
|
set(DRACO_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
IF(ASSIMP_HUNTER_ENABLED)
|
||||||
|
hunter_add_package(draco)
|
||||||
|
find_package(draco CONFIG REQUIRED)
|
||||||
|
set(draco_LIBRARIES draco::draco)
|
||||||
|
ELSE()
|
||||||
|
# Draco 1.4.1 has many warnings and will not build with /WX or -Werror
|
||||||
|
# See https://github.com/google/draco/issues/672
|
||||||
|
# and https://github.com/google/draco/issues/673
|
||||||
|
IF(MSVC)
|
||||||
|
set(DRACO_CXX_FLAGS "/W0")
|
||||||
|
ELSE()
|
||||||
|
list(APPEND DRACO_CXX_FLAGS
|
||||||
|
"-Wno-bool-compare"
|
||||||
|
"-Wno-comment"
|
||||||
|
"-Wno-maybe-uninitialized"
|
||||||
|
"-Wno-sign-compare"
|
||||||
|
"-Wno-unused-local-typedefs"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT ASSIMP_BUILD_DRACO_STATIC)
|
||||||
|
# Draco 1.4.1 does not explicitly export any symbols under GCC/clang
|
||||||
|
list(APPEND DRACO_CXX_FLAGS
|
||||||
|
"-fvisibility=default"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Don't build or install all of Draco by default
|
||||||
|
ADD_SUBDIRECTORY( "contrib/draco" EXCLUDE_FROM_ALL )
|
||||||
|
|
||||||
|
if(ASSIMP_BUILD_DRACO_STATIC)
|
||||||
|
set_property(DIRECTORY "contrib/draco" PROPERTY BUILD_SHARED_LIBS OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MSVC OR WIN32)
|
||||||
|
set(draco_LIBRARIES "draco")
|
||||||
|
else()
|
||||||
|
if(ASSIMP_BUILD_DRACO_STATIC)
|
||||||
|
set(draco_LIBRARIES "draco_static")
|
||||||
|
else()
|
||||||
|
set(draco_LIBRARIES "draco_shared")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Don't build the draco command-line tools by default
|
||||||
|
set_target_properties(draco_encoder draco_decoder PROPERTIES
|
||||||
|
EXCLUDE_FROM_ALL TRUE
|
||||||
|
EXCLUDE_FROM_DEFAULT_BUILD TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Do build the draco shared library
|
||||||
|
set_target_properties(${draco_LIBRARIES} PROPERTIES
|
||||||
|
EXCLUDE_FROM_ALL FALSE
|
||||||
|
EXCLUDE_FROM_DEFAULT_BUILD FALSE
|
||||||
|
)
|
||||||
|
|
||||||
|
TARGET_USE_COMMON_OUTPUT_DIRECTORY(${draco_LIBRARIES})
|
||||||
|
TARGET_USE_COMMON_OUTPUT_DIRECTORY(draco_encoder)
|
||||||
|
TARGET_USE_COMMON_OUTPUT_DIRECTORY(draco_decoder)
|
||||||
|
|
||||||
|
set(draco_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/contrib/draco/src")
|
||||||
|
|
||||||
|
# This is probably wrong
|
||||||
|
if (ASSIMP_INSTALL)
|
||||||
|
INSTALL( TARGETS ${draco_LIBRARIES}
|
||||||
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
|
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
|
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
|
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||||
|
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||||
|
COMPONENT ${LIBASSIMP_COMPONENT}
|
||||||
|
INCLUDES DESTINATION include
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# Main assimp code
|
||||||
ADD_SUBDIRECTORY( code/ )
|
ADD_SUBDIRECTORY( code/ )
|
||||||
|
|
||||||
IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||||
# The viewer for windows only
|
# The viewer for windows only
|
||||||
IF ( WIN32 )
|
IF (WIN32)
|
||||||
OPTION ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" OFF )
|
FIND_PACKAGE(DirectX)
|
||||||
|
OPTION ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" ${DirectX_FOUND} )
|
||||||
IF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
IF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
||||||
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
ELSE()
|
||||||
|
MESSAGE("Building Assimp Viewer only supported on Windows.")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
# The command line tool
|
# The command line tool
|
||||||
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ( ASSIMP_BUILD_SAMPLES)
|
IF ( ASSIMP_BUILD_SAMPLES )
|
||||||
SET( SAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/samples )
|
SET( SAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/samples )
|
||||||
SET( SAMPLES_SHARED_CODE_DIR ${SAMPLES_DIR}/SharedCode )
|
SET( SAMPLES_SHARED_CODE_DIR ${SAMPLES_DIR}/SharedCode )
|
||||||
IF ( WIN32 )
|
IF ( WIN32 )
|
||||||
|
@ -612,12 +777,22 @@ IF ( ASSIMP_BUILD_TESTS )
|
||||||
ADD_SUBDIRECTORY( test/ )
|
ADD_SUBDIRECTORY( test/ )
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
# Generate a pkg-config .pc for the Assimp library.
|
# Generate a pkg-config .pc, revision.h, and config.h for the Assimp library.
|
||||||
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
|
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
|
||||||
IF ( ASSIMP_INSTALL )
|
IF ( ASSIMP_INSTALL )
|
||||||
INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
CONFIGURE_FILE(
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/include/assimp/revision.h.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/include/assimp/revision.h
|
||||||
|
)
|
||||||
|
|
||||||
|
CONFIGURE_FILE(
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/include/assimp/config.h.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/include/assimp/config.h
|
||||||
|
)
|
||||||
|
|
||||||
IF ( ASSIMP_INSTALL )
|
IF ( ASSIMP_INSTALL )
|
||||||
IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
|
IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
|
||||||
# Packing information
|
# Packing information
|
||||||
|
@ -651,7 +826,7 @@ IF ( ASSIMP_INSTALL )
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "libs" )
|
SET(CPACK_DEBIAN_PACKAGE_SECTION "libs" )
|
||||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_COMPONENTS_ALL}")
|
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_COMPONENTS_ALL}")
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS)
|
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS)
|
||||||
SET(cPACK_DEBIAN_PACKAGE_NAME "assimp")
|
SET(CPACK_DEBIAN_PACKAGE_NAME "assimp")
|
||||||
SET(CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES contrib/gtest contrib/zlib workspaces test doc obj samples packaging)
|
SET(CPACK_DEBIAN_PACKAGE_REMOVE_SOURCE_FILES contrib/gtest contrib/zlib workspaces test doc obj samples packaging)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SOURCE_COPY svn export --force)
|
SET(CPACK_DEBIAN_PACKAGE_SOURCE_COPY svn export --force)
|
||||||
SET(CPACK_DEBIAN_CHANGELOG)
|
SET(CPACK_DEBIAN_CHANGELOG)
|
||||||
|
@ -679,7 +854,8 @@ if(WIN32)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(MSVC_TOOLSET_VERSION)
|
IF(MSVC_TOOLSET_VERSION)
|
||||||
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
|
SET(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
|
||||||
|
SET(ASSIMP_MSVC_VERSION ${MSVC_PREFIX})
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(MSVC12)
|
IF(MSVC12)
|
||||||
SET(ASSIMP_MSVC_VERSION "vc120")
|
SET(ASSIMP_MSVC_VERSION "vc120")
|
||||||
|
@ -687,6 +863,10 @@ if(WIN32)
|
||||||
SET(ASSIMP_MSVC_VERSION "vc140")
|
SET(ASSIMP_MSVC_VERSION "vc140")
|
||||||
ELSEIF(MSVC15)
|
ELSEIF(MSVC15)
|
||||||
SET(ASSIMP_MSVC_VERSION "vc141")
|
SET(ASSIMP_MSVC_VERSION "vc141")
|
||||||
|
ELSEIF(MSV142)
|
||||||
|
SET(ASSIMP_MSVC_VERSION "vc142")
|
||||||
|
ELSEIF(MSVC143)
|
||||||
|
SET(ASSIMP_MSVC_VERSION "vc143")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
|
@ -0,0 +1,22 @@
|
||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install --no-install-recommends -y ninja-build \
|
||||||
|
git cmake build-essential software-properties-common
|
||||||
|
|
||||||
|
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update
|
||||||
|
|
||||||
|
WORKDIR /opt
|
||||||
|
RUN apt install zlib1g-dev
|
||||||
|
|
||||||
|
# Build Assimp
|
||||||
|
RUN git clone https://github.com/assimp/assimp.git /opt/assimp
|
||||||
|
|
||||||
|
WORKDIR /opt/assimp
|
||||||
|
|
||||||
|
RUN git checkout master \
|
||||||
|
&& mkdir build && cd build && \
|
||||||
|
cmake -G 'Ninja' \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DASSIMP_BUILD_ASSIMP_TOOLS=ON \
|
||||||
|
.. && \
|
||||||
|
ninja -j4 && ninja install
|
37
INSTALL
37
INSTALL
|
@ -8,43 +8,10 @@ Getting the documentation
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
A regularly-updated copy is available at
|
A regularly-updated copy is available at
|
||||||
http://assimp.sourceforge.net/lib_html/index.html
|
https://assimp-docs.readthedocs.io/en/latest/
|
||||||
|
|
||||||
A CHM file is included in the SVN repos: ./doc/AssimpDoc_Html/AssimpDoc.chm.
|
|
||||||
To build the doxygen documentation on your own, follow these steps:
|
|
||||||
|
|
||||||
a) download & install latest doxygen
|
|
||||||
b) make sure doxygen is in the executable search path
|
|
||||||
c) navigate to ./doc
|
|
||||||
d) and run 'doxygen'
|
|
||||||
|
|
||||||
Open the generated HTML (AssimpDoc_Html/index.html) in the browser of your choice.
|
|
||||||
Windows only: To generate the CHM doc, install 'Microsoft HTML Workshop'
|
|
||||||
and configure the path to it in the DOXYFILE first.
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Building Assimp
|
Building Assimp
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
More detailed build instructions can be found in the documentation,
|
Just check the build-instructions which you can find here: https://github.com/assimp/assimp/blob/master/Build.md
|
||||||
this section is just for the inpatient among you.
|
|
||||||
|
|
||||||
CMake is the preferred build system for Assimp. The minimum required version
|
|
||||||
is 2.6. If you don't have it yet, downloads for CMake can be found on
|
|
||||||
http://www.cmake.org/.
|
|
||||||
|
|
||||||
For Unix:
|
|
||||||
|
|
||||||
1. mkdir build && cd build
|
|
||||||
2. cmake .. -G 'Unix Makefiles'
|
|
||||||
3. make -j4
|
|
||||||
|
|
||||||
For Windows:
|
|
||||||
1. Open a command prompt
|
|
||||||
2. mkdir build
|
|
||||||
3. cd build
|
|
||||||
4. cmake ..
|
|
||||||
5. cmake --build .
|
|
||||||
|
|
||||||
For iOS:
|
|
||||||
Just check the following project, which deploys a compiler toolchain for different iOS-versions: https://github.com/assimp/assimp/tree/master/port/iOS
|
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2021, assimp team
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
|
175
Readme.md
175
Readme.md
|
@ -1,180 +1,82 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
==================================
|
==================================
|
||||||
A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data.
|
|
||||||
|
Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.
|
||||||
|
|
||||||
### Current project status ###
|
### Current project status ###
|
||||||
[![Financial Contributors on Open Collective](https://opencollective.com/assimp/all/badge.svg?label=financial+contributors)](https://opencollective.com/assimp)
|
[![Financial Contributors on Open Collective](https://opencollective.com/assimp/all/badge.svg?label=financial+contributors)](https://opencollective.com/assimp)
|
||||||
![C/C++ CI](https://github.com/assimp/assimp/workflows/C/C++%20CI/badge.svg)
|
![C/C++ CI](https://github.com/assimp/assimp/workflows/C/C++%20CI/badge.svg)
|
||||||
[![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp)
|
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9973693b7bdd4543b07084d5d9cf4745)](https://www.codacy.com/gh/assimp/assimp/dashboard?utm_source=github.com&utm_medium=referral&utm_content=assimp/assimp&utm_campaign=Badge_Grade)
|
||||||
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp)
|
|
||||||
<a href="https://scan.coverity.com/projects/5607">
|
|
||||||
<img alt="Coverity Scan Build Status"
|
|
||||||
src="https://scan.coverity.com/projects/5607/badge.svg"/>
|
|
||||||
</a>
|
|
||||||
[![Coverage Status](https://coveralls.io/repos/github/assimp/assimp/badge.svg?branch=master)](https://coveralls.io/github/assimp/assimp?branch=master)
|
|
||||||
[![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Average time to resolve an issue")
|
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Average time to resolve an issue")
|
||||||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5be56faac64f46fc941ac890fb4febef)](https://www.codacy.com/app/kimkulling/assimp?utm_source=github.com&utm_medium=referral&utm_content=assimp/assimp&utm_campaign=Badge_Grade)
|
[![Percentage of issues still open](http://isitmaintained.com/badge/open/assimp/assimp.svg)](http://isitmaintained.com/project/assimp/assimp "Percentage of issues still open")
|
||||||
[![Total alerts](https://img.shields.io/lgtm/alerts/g/assimp/assimp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/assimp/assimp/alerts/)
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS.
|
APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS.
|
||||||
|
Additionally, assimp features various __mesh post-processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more.
|
||||||
|
|
||||||
[Check the latest doc](https://assimp-docs.readthedocs.io/en/latest/).
|
### Documentation ###
|
||||||
|
Read [our latest documentation](https://assimp-docs.readthedocs.io/en/latest/).
|
||||||
|
|
||||||
Additionally, assimp features various __mesh post processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more.
|
### Pre-built binaries ###
|
||||||
|
Download binaries from [our Itchi Projectspace](https://kimkulling.itch.io/the-asset-importer-lib).
|
||||||
|
|
||||||
This is the development repo containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [Github Assimp Releases](https://github.com/assimp/assimp/releases).
|
### Test data ###
|
||||||
|
Clone [our model database](https://github.com/assimp/assimp-mdb).
|
||||||
|
|
||||||
Monthly donations via Patreon:
|
### Communities ###
|
||||||
<br>[![Patreon](https://cloud.githubusercontent.com/assets/8225057/5990484/70413560-a9ab-11e4-8942-1a63607c0b00.png)](http://www.patreon.com/assimp)
|
- Ask questions at [the Assimp Discussion Board](https://github.com/assimp/assimp/discussions).
|
||||||
|
- Find us on [https://discord.gg/s9KJfaem](https://discord.gg/kKazXMXDy2)
|
||||||
<br>
|
- Ask [the Assimp community on Reddit](https://www.reddit.com/r/Assimp/).
|
||||||
|
- Ask on [StackOverflow with the assimp-tag](http://stackoverflow.com/questions/tagged/assimp?sort=newest).
|
||||||
One-off donations via PayPal:
|
- Nothing has worked? File a question or an issue-report at [The Assimp-Issue Tracker](https://github.com/assimp/assimp/issues)
|
||||||
<br>[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4)
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
Please check our Wiki as well: https://github.com/assimp/assimp/wiki
|
|
||||||
|
|
||||||
If you want to check our Model-Database, use the following repo: https://github.com/assimp/assimp-mdb
|
|
||||||
|
|
||||||
#### Supported file formats ####
|
#### Supported file formats ####
|
||||||
|
See [the complete list of supported formats](https://github.com/assimp/assimp/blob/master/doc/Fileformats.md).
|
||||||
__Importers__:
|
|
||||||
|
|
||||||
- 3D
|
|
||||||
- [3DS](https://en.wikipedia.org/wiki/.3ds)
|
|
||||||
- [3MF](https://en.wikipedia.org/wiki/3D_Manufacturing_Format)
|
|
||||||
- AC
|
|
||||||
- [AC3D](https://en.wikipedia.org/wiki/AC3D)
|
|
||||||
- ACC
|
|
||||||
- AMJ
|
|
||||||
- ASE
|
|
||||||
- ASK
|
|
||||||
- B3D
|
|
||||||
- [BLEND](https://en.wikipedia.org/wiki/.blend_(file_format))
|
|
||||||
- [BVH](https://en.wikipedia.org/wiki/Biovision_Hierarchy)
|
|
||||||
- CMS
|
|
||||||
- COB
|
|
||||||
- [DAE/Collada](https://en.wikipedia.org/wiki/COLLADA)
|
|
||||||
- [DXF](https://en.wikipedia.org/wiki/AutoCAD_DXF)
|
|
||||||
- ENFF
|
|
||||||
- [FBX](https://en.wikipedia.org/wiki/FBX)
|
|
||||||
- [glTF 1.0](https://en.wikipedia.org/wiki/GlTF#glTF_1.0) + GLB
|
|
||||||
- [glTF 2.0](https://en.wikipedia.org/wiki/GlTF#glTF_2.0):
|
|
||||||
At the moment for glTF2.0 the following extensions are supported:
|
|
||||||
+ KHR_lights_punctual ( 5.0 )
|
|
||||||
+ KHR_materials_pbrSpecularGlossiness ( 5.0 )
|
|
||||||
+ KHR_materials_unlit ( 5.0 )
|
|
||||||
+ KHR_texture_transform ( 5.1 under test )
|
|
||||||
- HMB
|
|
||||||
- IFC-STEP
|
|
||||||
- IRR / IRRMESH
|
|
||||||
- [LWO](https://en.wikipedia.org/wiki/LightWave_3D)
|
|
||||||
- LWS
|
|
||||||
- LXO
|
|
||||||
- [M3D](https://bztsrc.gitlab.io/model3d)
|
|
||||||
- MD2
|
|
||||||
- MD3
|
|
||||||
- MD5
|
|
||||||
- MDC
|
|
||||||
- MDL
|
|
||||||
- MESH / MESH.XML
|
|
||||||
- MOT
|
|
||||||
- MS3D
|
|
||||||
- NDO
|
|
||||||
- NFF
|
|
||||||
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
|
|
||||||
- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format))
|
|
||||||
- [OGEX](https://en.wikipedia.org/wiki/Open_Game_Engine_Exchange)
|
|
||||||
- [PLY](https://en.wikipedia.org/wiki/PLY_(file_format))
|
|
||||||
- PMX
|
|
||||||
- PRJ
|
|
||||||
- Q3O
|
|
||||||
- Q3S
|
|
||||||
- RAW
|
|
||||||
- SCN
|
|
||||||
- SIB
|
|
||||||
- SMD
|
|
||||||
- [STP](https://en.wikipedia.org/wiki/ISO_10303-21)
|
|
||||||
- [STL](https://en.wikipedia.org/wiki/STL_(file_format))
|
|
||||||
- TER
|
|
||||||
- UC
|
|
||||||
- VTA
|
|
||||||
- X
|
|
||||||
- [X3D](https://en.wikipedia.org/wiki/X3D)
|
|
||||||
- XGL
|
|
||||||
- ZGL
|
|
||||||
|
|
||||||
Additionally, some formats are supported by dependency on non-free code or external SDKs (not built by default):
|
|
||||||
|
|
||||||
- [C4D](https://en.wikipedia.org/wiki/Cinema_4D) (https://github.com/assimp/assimp/wiki/Cinema4D-&-Melange) IMporting geometry + node hierarchy are currently supported
|
|
||||||
|
|
||||||
__Exporters__:
|
|
||||||
|
|
||||||
- DAE (Collada)
|
|
||||||
- STL
|
|
||||||
- OBJ
|
|
||||||
- PLY
|
|
||||||
- X
|
|
||||||
- 3DS
|
|
||||||
- JSON (for WebGl, via https://github.com/acgessler/assimp2json)
|
|
||||||
- ASSBIN
|
|
||||||
- STEP
|
|
||||||
- glTF 1.0 (partial)
|
|
||||||
- glTF 2.0 (partial)
|
|
||||||
- 3MF ( experimental )
|
|
||||||
- FBX ( experimental )
|
|
||||||
|
|
||||||
### Building ###
|
### Building ###
|
||||||
Take a look into the https://github.com/assimp/assimp/blob/master/Build.md file. We are available in vcpkg, and our build system is CMake; if you used CMake before there is a good chance you know what to do.
|
Start by reading [our build instructions](https://github.com/assimp/assimp/blob/master/Build.md). We are available in vcpkg, and our build system is CMake; if you used CMake before there is a good chance you know what to do.
|
||||||
|
|
||||||
### Ports ###
|
### Ports ###
|
||||||
* [Android](port/AndroidJNI/README.md)
|
* [Android](port/AndroidJNI/README.md)
|
||||||
* [Python](port/PyAssimp/README.md)
|
* [Python](port/PyAssimp/README.md)
|
||||||
* [.NET](https://github.com/assimp/assimp-net)
|
* [.NET](https://bitbucket.org/Starnick/assimpnet/src/master/)
|
||||||
* [Pascal](port/AssimpPascal/Readme.md)
|
* [Pascal](port/AssimpPascal/Readme.md)
|
||||||
* [Javascript (Alpha)](https://github.com/makc/assimp2json)
|
* [Javascript (Alpha)](https://github.com/makc/assimp2json)
|
||||||
* [Unity 3d Plugin](https://www.assetstore.unity3d.com/en/#!/content/91777)
|
* [Javascript/Node.js Interface](https://github.com/kovacsv/assimpjs)
|
||||||
|
* [Unity 3d Plugin](https://ricardoreis.net/trilib-2/)
|
||||||
|
* [Unreal Engine Plugin](https://github.com/irajsb/UE4_Assimp/)
|
||||||
* [JVM](https://github.com/kotlin-graphics/assimp) Full jvm port (current [status](https://github.com/kotlin-graphics/assimp/wiki/Status))
|
* [JVM](https://github.com/kotlin-graphics/assimp) Full jvm port (current [status](https://github.com/kotlin-graphics/assimp/wiki/Status))
|
||||||
* [HAXE-Port](https://github.com/longde123/assimp-haxe) The Assimp-HAXE-port.
|
* [HAXE-Port](https://github.com/longde123/assimp-haxe) The Assimp-HAXE-port.
|
||||||
|
* [Rust](https://github.com/jkvargas/russimp)
|
||||||
|
|
||||||
### Other tools ###
|
### Other tools ###
|
||||||
[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.
|
[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.
|
||||||
|
[Assimp-Viewer](https://github.com/assimp/assimp_view) is an experimental implementation for an Asset-Viewer based on ImGUI and Assimp (experimental).
|
||||||
|
|
||||||
#### Repository structure ####
|
#### Repository structure ####
|
||||||
Open Asset Import Library is implemented in C++. The directory structure looks like:
|
Open Asset Import Library is implemented in C++. The directory structure looks like this:
|
||||||
|
|
||||||
/code Source code
|
/code Source code
|
||||||
/contrib Third-party libraries
|
/contrib Third-party libraries
|
||||||
/doc Documentation (doxysource and pre-compiled docs)
|
/doc Documentation (doxysource and pre-compiled docs)
|
||||||
|
/fuzz Contains the test code for the Google Fuzzer project
|
||||||
/include Public header C and C++ header files
|
/include Public header C and C++ header files
|
||||||
/scripts Scripts used to generate the loading code for some formats
|
/scripts Scripts are used to generate the loading code for some formats
|
||||||
/port Ports to other languages and scripts to maintain those.
|
/port Ports to other languages and scripts to maintain those.
|
||||||
/test Unit- and regression tests, test suite of models
|
/test Unit- and regression tests, test suite of models
|
||||||
/tools Tools (old assimp viewer, command line `assimp`)
|
/tools Tools (old assimp viewer, command line `assimp`)
|
||||||
/samples A small number of samples to illustrate possible
|
/samples A small number of samples to illustrate possible use cases for Assimp
|
||||||
use cases for Assimp
|
|
||||||
|
|
||||||
The source code is organized in the following way:
|
The source code is organized in the following way:
|
||||||
|
|
||||||
code/Common The base implementation for importers and the infrastructure
|
code/Common The base implementation for importers and the infrastructure
|
||||||
code/PostProcessing The post-processing steps
|
code/CApi Special implementations which are only used for the C-API
|
||||||
code/<FormatName> Implementation for import and export for the format
|
code/Geometry A collection of geometry tools
|
||||||
|
code/Material The material system
|
||||||
### Where to get help ###
|
code/PBR An exporter for physical-based models
|
||||||
For more information, visit [our website](http://assimp.org/). Or check out the `./doc`- folder, which contains the official documentation in HTML format.
|
code/PostProcessing The post-processing steps
|
||||||
(CHMs for Windows are included in some release packages and should be located right here in the root folder).
|
code/AssetLib/<FormatName> Implementation for import and export of the format
|
||||||
|
|
||||||
If the docs don't solve your problem, ask on [StackOverflow](http://stackoverflow.com/questions/tagged/assimp?sort=newest). If you think you found a bug, please open an issue on Github.
|
|
||||||
|
|
||||||
For development discussions, there is also a (very low-volume) mailing list, _assimp-discussions_
|
|
||||||
[(subscribe here)]( https://lists.sourceforge.net/lists/listinfo/assimp-discussions)
|
|
||||||
|
|
||||||
Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export.
|
|
||||||
|
|
||||||
And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br>
|
|
||||||
|
|
||||||
### Contributing ###
|
### Contributing ###
|
||||||
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
|
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
|
||||||
|
@ -196,6 +98,7 @@ Become a financial contributor and help us sustain our community. [[Contribute](
|
||||||
|
|
||||||
<a href="https://opencollective.com/assimp"><img src="https://opencollective.com/assimp/individuals.svg?width=890"></a>
|
<a href="https://opencollective.com/assimp"><img src="https://opencollective.com/assimp/individuals.svg?width=890"></a>
|
||||||
|
|
||||||
|
|
||||||
#### Organizations
|
#### Organizations
|
||||||
|
|
||||||
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/assimp/contribute)]
|
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/assimp/contribute)]
|
||||||
|
@ -210,4 +113,4 @@ and don't sue us if our code doesn't work. Note that, unlike LGPLed code, you ma
|
||||||
For the legal details, see the `LICENSE` file.
|
For the legal details, see the `LICENSE` file.
|
||||||
|
|
||||||
### Why this name ###
|
### Why this name ###
|
||||||
Sorry, we're germans :-), no english native speakers ...
|
Sorry, we're germans :-), no English native speakers ...
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Use this section to tell people about which versions of your project are
|
||||||
|
currently being supported with security updates.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 5.2.4 | :white_check_mark: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
If you have found any security vulnerability you can contact us via
|
||||||
|
kim.kulling@googlemail.com
|
||||||
|
|
81
appveyor.yml
81
appveyor.yml
|
@ -1,81 +0,0 @@
|
||||||
# AppVeyor file
|
|
||||||
# http://www.appveyor.com/docs/appveyor-yml
|
|
||||||
|
|
||||||
# clone directory
|
|
||||||
clone_folder: c:\projects\assimp
|
|
||||||
|
|
||||||
clone_depth: 1
|
|
||||||
|
|
||||||
# branches to build
|
|
||||||
branches:
|
|
||||||
# whitelist
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
fast_finish: true
|
|
||||||
|
|
||||||
image:
|
|
||||||
- Visual Studio 2013
|
|
||||||
#- Visual Studio 2015
|
|
||||||
#- Visual Studio 2017
|
|
||||||
- Visual Studio 2019
|
|
||||||
#- MinGW
|
|
||||||
|
|
||||||
platform:
|
|
||||||
- Win32
|
|
||||||
- x64
|
|
||||||
|
|
||||||
configuration: Release
|
|
||||||
|
|
||||||
install:
|
|
||||||
- set PATH=C:\Ruby24-x64\bin;%PATH%
|
|
||||||
- set CMAKE_DEFINES -DASSIMP_WERROR=ON
|
|
||||||
- if [%COMPILER%]==[MinGW] set PATH=C:\MinGW\bin;%PATH%
|
|
||||||
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" set CMAKE_GENERATOR_NAME=Visual Studio 12 2013
|
|
||||||
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015
|
|
||||||
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" set CMAKE_GENERATOR_NAME=Visual Studio 15 2017
|
|
||||||
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" set CMAKE_GENERATOR_NAME=Visual Studio 16 2019
|
|
||||||
- cmake %CMAKE_DEFINES% -G "%CMAKE_GENERATOR_NAME%" -A %platform% .
|
|
||||||
# Rename sh.exe as sh.exe in PATH interferes with MinGW - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015
|
|
||||||
|
|
||||||
- rename "C:\Program Files\Git\usr\bin\sh.exe" "sh2.exe"
|
|
||||||
- set PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5"
|
|
||||||
- ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/5/7/b/57b2947c-7221-4f33-b35e-2fc78cb10df4/vc_redist.x64.exe -OutFile .\packaging\windows-innosetup\vc_redist.x64.exe
|
|
||||||
- ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/1/d/8/1d8137db-b5bb-4925-8c5d-927424a2e4de/vc_redist.x86.exe -OutFile .\packaging\windows-innosetup\vc_redist.x86.exe
|
|
||||||
|
|
||||||
cache:
|
|
||||||
- code\assimp.dir\%CONFIGURATION%
|
|
||||||
- contrib\zlib\zlibstatic.dir\%CONFIGURATION%
|
|
||||||
- contrib\zlib\zlib.dir\%CONFIGURATION%
|
|
||||||
- tools\assimp_cmd\assimp_cmd.dir\%CONFIGURATION%
|
|
||||||
- tools\assimp_view\assimp_viewer.dir\%CONFIGURATION%
|
|
||||||
- test\unit.dir\%CONFIGURATION%
|
|
||||||
- bin\.mtime_cache
|
|
||||||
|
|
||||||
before_build:
|
|
||||||
- echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS%
|
|
||||||
- ruby scripts\AppVeyor\mtime_cache -g scripts\AppVeyor\cacheglobs.txt -c bin\.mtime_cache\cache.json
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
cmake --build . --config Release -- /maxcpucount:2
|
|
||||||
|
|
||||||
after_build:
|
|
||||||
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (
|
|
||||||
if "%platform%"=="x64" (
|
|
||||||
iscc packaging\windows-innosetup\script_x64.iss
|
|
||||||
) else (
|
|
||||||
iscc packaging\windows-innosetup\script_x86.iss
|
|
||||||
)
|
|
||||||
)
|
|
||||||
- 7z a assimp.7z bin\%CONFIGURATION%\* lib\%CONFIGURATION%\*
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
- cmd: bin\%CONFIGURATION%\unit.exe --gtest_output=xml:testout.xml
|
|
||||||
|
|
||||||
on_finish:
|
|
||||||
- ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\testout.xml))
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
- path: assimp.7z
|
|
||||||
name: assimp_lib
|
|
|
@ -1,48 +0,0 @@
|
||||||
# Open Asset Import Library (assimp)
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# Copyright (c) 2006-2020, assimp team
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use of this software in source and binary forms,
|
|
||||||
# with or without modification, are permitted provided that the
|
|
||||||
# following conditions are met:
|
|
||||||
#
|
|
||||||
# * Redistributions of source code must retain the above
|
|
||||||
# copyright notice, this list of conditions and the
|
|
||||||
# following disclaimer.
|
|
||||||
#
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the
|
|
||||||
# following disclaimer in the documentation and/or other
|
|
||||||
# materials provided with the distribution.
|
|
||||||
#
|
|
||||||
# * Neither the name of the assimp team, nor the names of its
|
|
||||||
# contributors may be used to endorse or promote products
|
|
||||||
# derived from this software without specific prior
|
|
||||||
# written permission of the assimp team.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
#----------------------------------------------------------------------
|
|
||||||
set( PACKAGE_VERSION "@ASSIMP_VERSION@" )
|
|
||||||
if( "${PACKAGE_FIND_VERSION}" VERSION_EQUAL "@ASSIMP_VERSION@")
|
|
||||||
set(PACKAGE_VERSION_EXACT 1)
|
|
||||||
endif()
|
|
||||||
if( "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@ASSIMP_VERSION@" )
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE 1)
|
|
||||||
elseif( "${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@ASSIMP_VERSION_MAJOR@" )
|
|
||||||
# for now backward compatible if minor version is less
|
|
||||||
if( ${PACKAGE_FIND_VERSION_MINOR} LESS @ASSIMP_VERSION_MINOR@ )
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE 1)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set( ASSIMP_STATIC_LIB "@ASSIMP_BUILD_STATIC_LIB@")
|
|
|
@ -1 +0,0 @@
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/assimpTargets.cmake)
|
|
|
@ -1,126 +0,0 @@
|
||||||
#----------------------------------------------------------------
|
|
||||||
# Generated CMake target import file for configuration "Debug".
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
|
|
||||||
# Commands may need to know the format version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
||||||
|
|
||||||
set(ASSIMP_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
|
||||||
|
|
||||||
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
if(MSVC_TOOLSET_VERSION)
|
|
||||||
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
|
|
||||||
else()
|
|
||||||
if( MSVC70 OR MSVC71 )
|
|
||||||
set(MSVC_PREFIX "vc70")
|
|
||||||
elseif( MSVC80 )
|
|
||||||
set(MSVC_PREFIX "vc80")
|
|
||||||
elseif( MSVC90 )
|
|
||||||
set(MSVC_PREFIX "vc90")
|
|
||||||
elseif( MSVC10 )
|
|
||||||
set(MSVC_PREFIX "vc100")
|
|
||||||
elseif( MSVC11 )
|
|
||||||
set(MSVC_PREFIX "vc110")
|
|
||||||
elseif( MSVC12 )
|
|
||||||
set(MSVC_PREFIX "vc120")
|
|
||||||
elseif( MSVC_VERSION LESS 1910)
|
|
||||||
set(MSVC_PREFIX "vc140")
|
|
||||||
elseif( MSVC_VERSION LESS 1920)
|
|
||||||
set(MSVC_PREFIX "vc141")
|
|
||||||
elseif( MSVC_VERSION LESS 1930)
|
|
||||||
set(MSVC_PREFIX "vc142")
|
|
||||||
else()
|
|
||||||
set(MSVC_PREFIX "vc150")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" )
|
|
||||||
|
|
||||||
if(ASSIMP_BUILD_SHARED_LIBS)
|
|
||||||
set(sharedLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
|
|
||||||
set(importLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_IMPORT_LIBRARY_SUFFIX@")
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Debug"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_IMPLIB_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}"
|
|
||||||
IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}")
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}" )
|
|
||||||
else()
|
|
||||||
set(staticLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@")
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Debug"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else()
|
|
||||||
set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@" CACHE STRING "the suffix for the assimp libraries" )
|
|
||||||
if(ASSIMP_BUILD_SHARED_LIBS)
|
|
||||||
if(WIN32)
|
|
||||||
# Handle MinGW compiler.
|
|
||||||
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@")
|
|
||||||
elseif(APPLE)
|
|
||||||
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@.@ASSIMP_VERSION_MAJOR@@CMAKE_SHARED_LIBRARY_SUFFIX@")
|
|
||||||
else()
|
|
||||||
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Debug"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_SONAME_DEBUG "${sharedLibraryName}"
|
|
||||||
IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" )
|
|
||||||
else()
|
|
||||||
set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@")
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Debug"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" )
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Commands beyond this point should not need to know the version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
|
|
||||||
get_filename_component(ASSIMP_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" REALPATH)
|
|
||||||
set( ASSIMP_CXX_FLAGS ) # dynamically linked library
|
|
||||||
set( ASSIMP_LINK_FLAGS "" )
|
|
||||||
set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_LIB_INSTALL_DIR@")
|
|
||||||
set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_INCLUDE_INSTALL_DIR@")
|
|
||||||
if(ASSIMP_BUILD_SHARED_LIBS)
|
|
||||||
set( ASSIMP_LIBRARIES ${sharedLibraryName})
|
|
||||||
else()
|
|
||||||
set( ASSIMP_LIBRARIES ${staticLibraryName})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# for compatibility with pkg-config
|
|
||||||
set(ASSIMP_CFLAGS_OTHER "${ASSIMP_CXX_FLAGS}")
|
|
||||||
set(ASSIMP_LDFLAGS_OTHER "${ASSIMP_LINK_FLAGS}")
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
ASSIMP_ROOT_DIR
|
|
||||||
ASSIMP_CXX_FLAGS
|
|
||||||
ASSIMP_LINK_FLAGS
|
|
||||||
ASSIMP_INCLUDE_DIRS
|
|
||||||
ASSIMP_LIBRARIES
|
|
||||||
ASSIMP_CFLAGS_OTHER
|
|
||||||
ASSIMP_LDFLAGS_OTHER
|
|
||||||
ASSIMP_LIBRARY_SUFFIX
|
|
||||||
ASSIMP_BUILD_SHARED_LIBS
|
|
||||||
)
|
|
|
@ -1,127 +0,0 @@
|
||||||
#----------------------------------------------------------------
|
|
||||||
# Generated CMake target import file for configuration "Release".
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
|
|
||||||
# Commands may need to know the format version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
||||||
|
|
||||||
set(ASSIMP_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
|
||||||
|
|
||||||
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
if(MSVC_TOOLSET_VERSION)
|
|
||||||
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
|
|
||||||
else()
|
|
||||||
if( MSVC70 OR MSVC71 )
|
|
||||||
set(MSVC_PREFIX "vc70")
|
|
||||||
elseif( MSVC80 )
|
|
||||||
set(MSVC_PREFIX "vc80")
|
|
||||||
elseif( MSVC90 )
|
|
||||||
set(MSVC_PREFIX "vc90")
|
|
||||||
elseif( MSVC10 )
|
|
||||||
set(MSVC_PREFIX "vc100")
|
|
||||||
elseif( MSVC11 )
|
|
||||||
set(MSVC_PREFIX "vc110")
|
|
||||||
elseif( MSVC12 )
|
|
||||||
set(MSVC_PREFIX "vc120")
|
|
||||||
elseif( MSVC_VERSION LESS 1910)
|
|
||||||
set(MSVC_PREFIX "vc140")
|
|
||||||
elseif( MSVC_VERSION LESS 1920)
|
|
||||||
set(MSVC_PREFIX "vc141")
|
|
||||||
elseif( MSVC_VERSION LESS 1930)
|
|
||||||
set(MSVC_PREFIX "vc142")
|
|
||||||
else()
|
|
||||||
set(MSVC_PREFIX "vc150")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" )
|
|
||||||
|
|
||||||
if(ASSIMP_BUILD_SHARED_LIBS)
|
|
||||||
set(sharedLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@")
|
|
||||||
set(importLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_IMPORT_LIBRARY_SUFFIX@")
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Release"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_IMPLIB_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}"
|
|
||||||
IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}")
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}" )
|
|
||||||
else()
|
|
||||||
set(staticLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@")
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Release"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else()
|
|
||||||
set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@" CACHE STRING "the suffix for the assimp libraries" )
|
|
||||||
if(ASSIMP_BUILD_SHARED_LIBS)
|
|
||||||
if(WIN32)
|
|
||||||
# Handle MinGW compiler.
|
|
||||||
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@")
|
|
||||||
elseif(APPLE)
|
|
||||||
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}.@ASSIMP_VERSION_MAJOR@@CMAKE_SHARED_LIBRARY_SUFFIX@")
|
|
||||||
else()
|
|
||||||
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Release"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_SONAME_RELEASE "${sharedLibraryName}"
|
|
||||||
IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" )
|
|
||||||
else()
|
|
||||||
set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@")
|
|
||||||
|
|
||||||
# Import target "assimp::assimp" for configuration "Release"
|
|
||||||
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
|
|
||||||
)
|
|
||||||
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
|
|
||||||
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" )
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Commands beyond this point should not need to know the version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
|
|
||||||
get_filename_component(ASSIMP_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" REALPATH)
|
|
||||||
|
|
||||||
set( ASSIMP_CXX_FLAGS ) # dynamically linked library
|
|
||||||
set( ASSIMP_LINK_FLAGS "" )
|
|
||||||
set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_LIB_INSTALL_DIR@")
|
|
||||||
set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_INCLUDE_INSTALL_DIR@")
|
|
||||||
if(ASSIMP_BUILD_SHARED_LIBS)
|
|
||||||
set( ASSIMP_LIBRARIES ${sharedLibraryName})
|
|
||||||
else()
|
|
||||||
set( ASSIMP_LIBRARIES ${staticLibraryName})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# for compatibility with pkg-config
|
|
||||||
set(ASSIMP_CFLAGS_OTHER "${ASSIMP_CXX_FLAGS}")
|
|
||||||
set(ASSIMP_LDFLAGS_OTHER "${ASSIMP_LINK_FLAGS}")
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
ASSIMP_ROOT_DIR
|
|
||||||
ASSIMP_CXX_FLAGS
|
|
||||||
ASSIMP_LINK_FLAGS
|
|
||||||
ASSIMP_INCLUDE_DIRS
|
|
||||||
ASSIMP_LIBRARIES
|
|
||||||
ASSIMP_CFLAGS_OTHER
|
|
||||||
ASSIMP_LDFLAGS_OTHER
|
|
||||||
ASSIMP_LIBRARY_SUFFIX
|
|
||||||
ASSIMP_BUILD_SHARED_LIBS
|
|
||||||
)
|
|
|
@ -1,91 +0,0 @@
|
||||||
# Generated by CMake
|
|
||||||
|
|
||||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
|
|
||||||
message(FATAL_ERROR "CMake >= 2.6.0 required")
|
|
||||||
endif()
|
|
||||||
cmake_policy(PUSH)
|
|
||||||
cmake_policy(VERSION 2.6)
|
|
||||||
# Required for the evaluation of "if(@BUILD_SHARED_LIBS@)" below to function
|
|
||||||
cmake_policy(SET CMP0012 NEW)
|
|
||||||
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
# Generated CMake target import file.
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
|
|
||||||
# Commands may need to know the format version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
||||||
|
|
||||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
|
||||||
set(_targetsDefined)
|
|
||||||
set(_targetsNotDefined)
|
|
||||||
set(_expectedTargets)
|
|
||||||
foreach(_expectedTarget assimp::assimp)
|
|
||||||
list(APPEND _expectedTargets ${_expectedTarget})
|
|
||||||
if(NOT TARGET ${_expectedTarget})
|
|
||||||
list(APPEND _targetsNotDefined ${_expectedTarget})
|
|
||||||
endif()
|
|
||||||
if(TARGET ${_expectedTarget})
|
|
||||||
list(APPEND _targetsDefined ${_expectedTarget})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
|
|
||||||
unset(_targetsDefined)
|
|
||||||
unset(_targetsNotDefined)
|
|
||||||
unset(_expectedTargets)
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
cmake_policy(POP)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
if(NOT "${_targetsDefined}" STREQUAL "")
|
|
||||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
|
|
||||||
endif()
|
|
||||||
unset(_targetsDefined)
|
|
||||||
unset(_targetsNotDefined)
|
|
||||||
unset(_expectedTargets)
|
|
||||||
|
|
||||||
# Create imported target assimp::assimp
|
|
||||||
add_library(assimp::assimp @BUILD_LIB_TYPE@ IMPORTED)
|
|
||||||
|
|
||||||
set_target_properties(assimp::assimp PROPERTIES
|
|
||||||
COMPATIBLE_INTERFACE_STRING "assimp_MAJOR_VERSION"
|
|
||||||
INTERFACE_assimp_MAJOR_VERSION "1"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "@CMAKE_INSTALL_FULL_INCLUDEDIR@"
|
|
||||||
#INTERFACE_LINK_LIBRARIES "TxtUtils::TxtUtils;MealyMachine::MealyMachine"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
|
||||||
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Load information for each installed configuration.
|
|
||||||
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
||||||
file(GLOB CONFIG_FILES "${_DIR}/assimpTargets-*.cmake")
|
|
||||||
foreach(f ${CONFIG_FILES})
|
|
||||||
include(${f})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Loop over all imported files and verify that they actually exist
|
|
||||||
foreach(target ${_IMPORT_CHECK_TARGETS} )
|
|
||||||
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
|
|
||||||
if(NOT EXISTS "${file}" )
|
|
||||||
message(FATAL_ERROR "The imported target \"${target}\" references the file
|
|
||||||
\"${file}\"
|
|
||||||
but this file does not exist. Possible reasons include:
|
|
||||||
* The file was deleted, renamed, or moved to another location.
|
|
||||||
* An install or uninstall procedure did not complete successfully.
|
|
||||||
* The installation package was faulty and contained
|
|
||||||
\"${CMAKE_CURRENT_LIST_FILE}\"
|
|
||||||
but not all the files it references.
|
|
||||||
")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
unset(_IMPORT_CHECK_FILES_FOR_${target})
|
|
||||||
endforeach()
|
|
||||||
unset(_IMPORT_CHECK_TARGETS)
|
|
||||||
|
|
||||||
# This file does not depend on other imported targets which have
|
|
||||||
# been exported from the same project but in a separate export set.
|
|
||||||
|
|
||||||
# Commands beyond this point should not need to know the version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
cmake_policy(POP)
|
|
|
@ -55,7 +55,7 @@ if(WIN32) # The only platform it makes sense to check for DirectX SDK
|
||||||
endif(CMAKE_CL_64)
|
endif(CMAKE_CL_64)
|
||||||
find_library(DirectX_LIBRARY NAMES d3d9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
find_library(DirectX_LIBRARY NAMES d3d9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
||||||
find_library(DirectX_D3DX9_LIBRARY NAMES d3dx9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
find_library(DirectX_D3DX9_LIBRARY NAMES d3dx9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
||||||
find_library(DirectX_DXERR_LIBRARY NAMES DxErr HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
find_library(DirectX_DXERR_LIBRARY NAMES DxErr DxErr9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
||||||
find_library(DirectX_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
find_library(DirectX_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Find IrrXMl from irrlicht project
|
|
||||||
#
|
|
||||||
# Find LibIrrXML headers and library
|
|
||||||
#
|
|
||||||
# IRRXML_FOUND - IrrXML found
|
|
||||||
# IRRXML_INCLUDE_DIR - Headers location
|
|
||||||
# IRRXML_LIBRARY - IrrXML main library
|
|
||||||
|
|
||||||
find_path(IRRXML_INCLUDE_DIR irrXML.h
|
|
||||||
PATH_SUFFIXES include/irrlicht include/irrxml)
|
|
||||||
find_library(IRRXML_LIBRARY IrrXML)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(IrrXML REQUIRED_VARS IRRXML_INCLUDE_DIR IRRXML_LIBRARY)
|
|
||||||
|
|
||||||
|
|
||||||
mark_as_advanced(IRRXML_INCLUDE_DIR IRRXML_LIBRARY)
|
|
|
@ -54,7 +54,7 @@ macro(clear_if_changed TESTVAR)
|
||||||
set(${var} "NOTFOUND" CACHE STRING "x" FORCE)
|
set(${var} "NOTFOUND" CACHE STRING "x" FORCE)
|
||||||
endforeach(var)
|
endforeach(var)
|
||||||
endif ()
|
endif ()
|
||||||
set(${TESTVAR}_INT_CHECK ${${TESTVAR}} CACHE INTERNAL "x" FORCE)
|
set(${TESTVAR}_INT_CHECK "${${TESTVAR}}" CACHE INTERNAL "x" FORCE)
|
||||||
endmacro(clear_if_changed)
|
endmacro(clear_if_changed)
|
||||||
|
|
||||||
# Try to get some hints from pkg-config, if available
|
# Try to get some hints from pkg-config, if available
|
||||||
|
|
|
@ -16,5 +16,5 @@ set(RT_LIBRARIES ${RT_LIBRARY})
|
||||||
# handle the QUIETLY and REQUIRED arguments and set
|
# handle the QUIETLY and REQUIRED arguments and set
|
||||||
# RT_FOUND to TRUE if all listed variables are TRUE
|
# RT_FOUND to TRUE if all listed variables are TRUE
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(rt DEFAULT_MSG RT_LIBRARY)
|
find_package_handle_standard_args(RT DEFAULT_MSG RT_LIBRARY)
|
||||||
mark_as_advanced(RT_LIBRARY)
|
mark_as_advanced(RT_LIBRARY)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2013-2018, Ruslan Baratov
|
# Copyright (c) 2013-2019, Ruslan Baratov
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -22,45 +22,16 @@
|
||||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
# This is a gate file to Hunter package manager.
|
|
||||||
# Include this file using `include` command and add package you need, example:
|
|
||||||
#
|
|
||||||
# cmake_minimum_required(VERSION 3.2)
|
|
||||||
#
|
|
||||||
# include("cmake/HunterGate.cmake")
|
|
||||||
# HunterGate(
|
|
||||||
# URL "https://github.com/path/to/hunter/archive.tar.gz"
|
|
||||||
# SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d"
|
|
||||||
# )
|
|
||||||
#
|
|
||||||
# project(MyProject)
|
|
||||||
#
|
|
||||||
# hunter_add_package(Foo)
|
|
||||||
# hunter_add_package(Boo COMPONENTS Bar Baz)
|
|
||||||
#
|
|
||||||
# Projects:
|
|
||||||
# * https://github.com/hunter-packages/gate/
|
|
||||||
# * https://github.com/ruslo/hunter
|
|
||||||
|
|
||||||
option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
|
option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
|
||||||
|
|
||||||
if(HUNTER_ENABLED)
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.2")
|
|
||||||
message(
|
|
||||||
FATAL_ERROR
|
|
||||||
"At least CMake version 3.2 required for Hunter dependency management."
|
|
||||||
" Update CMake or set HUNTER_ENABLED to OFF."
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(CMakeParseArguments) # cmake_parse_arguments
|
include(CMakeParseArguments) # cmake_parse_arguments
|
||||||
|
|
||||||
option(HUNTER_STATUS_PRINT "Print working status" ON)
|
option(HUNTER_STATUS_PRINT "Print working status" ON)
|
||||||
option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
|
option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
|
||||||
option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON)
|
option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON)
|
||||||
|
|
||||||
set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki")
|
set(HUNTER_ERROR_PAGE "https://docs.hunter.sh/en/latest/reference/errors")
|
||||||
|
|
||||||
function(hunter_gate_status_print)
|
function(hunter_gate_status_print)
|
||||||
if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
|
if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
|
||||||
|
@ -79,9 +50,9 @@ function(hunter_gate_status_debug)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(hunter_gate_wiki wiki_page)
|
function(hunter_gate_error_page error_page)
|
||||||
message("------------------------------ WIKI -------------------------------")
|
message("------------------------------ ERROR ------------------------------")
|
||||||
message(" ${HUNTER_WIKI}/${wiki_page}")
|
message(" ${HUNTER_ERROR_PAGE}/${error_page}.html")
|
||||||
message("-------------------------------------------------------------------")
|
message("-------------------------------------------------------------------")
|
||||||
message("")
|
message("")
|
||||||
message(FATAL_ERROR "")
|
message(FATAL_ERROR "")
|
||||||
|
@ -94,14 +65,13 @@ function(hunter_gate_internal_error)
|
||||||
endforeach()
|
endforeach()
|
||||||
message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
|
message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
|
||||||
message("")
|
message("")
|
||||||
hunter_gate_wiki("error.internal")
|
hunter_gate_error_page("error.internal")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(hunter_gate_fatal_error)
|
function(hunter_gate_fatal_error)
|
||||||
cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
|
cmake_parse_arguments(hunter "" "ERROR_PAGE" "" "${ARGV}")
|
||||||
string(COMPARE EQUAL "${hunter_WIKI}" "" have_no_wiki)
|
if("${hunter_ERROR_PAGE}" STREQUAL "")
|
||||||
if(have_no_wiki)
|
hunter_gate_internal_error("Expected ERROR_PAGE")
|
||||||
hunter_gate_internal_error("Expected wiki")
|
|
||||||
endif()
|
endif()
|
||||||
message("")
|
message("")
|
||||||
foreach(x ${hunter_UNPARSED_ARGUMENTS})
|
foreach(x ${hunter_UNPARSED_ARGUMENTS})
|
||||||
|
@ -109,11 +79,11 @@ function(hunter_gate_fatal_error)
|
||||||
endforeach()
|
endforeach()
|
||||||
message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
|
message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
|
||||||
message("")
|
message("")
|
||||||
hunter_gate_wiki("${hunter_WIKI}")
|
hunter_gate_error_page("${hunter_ERROR_PAGE}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(hunter_gate_user_error)
|
function(hunter_gate_user_error)
|
||||||
hunter_gate_fatal_error(${ARGV} WIKI "error.incorrect.input.data")
|
hunter_gate_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(hunter_gate_self root version sha1 result)
|
function(hunter_gate_self root version sha1 result)
|
||||||
|
@ -195,7 +165,7 @@ function(hunter_gate_detect_root)
|
||||||
|
|
||||||
hunter_gate_fatal_error(
|
hunter_gate_fatal_error(
|
||||||
"Can't detect HUNTER_ROOT"
|
"Can't detect HUNTER_ROOT"
|
||||||
WIKI "error.detect.hunter.root"
|
ERROR_PAGE "error.detect.hunter.root"
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
@ -214,7 +184,7 @@ function(hunter_gate_download dir)
|
||||||
"Settings:"
|
"Settings:"
|
||||||
" HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
|
" HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
|
||||||
" HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
|
" HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
|
||||||
WIKI "error.run.install"
|
ERROR_PAGE "error.run.install"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
string(COMPARE EQUAL "${dir}" "" is_bad)
|
string(COMPARE EQUAL "${dir}" "" is_bad)
|
||||||
|
@ -400,7 +370,7 @@ macro(HunterGate)
|
||||||
hunter_gate_fatal_error(
|
hunter_gate_fatal_error(
|
||||||
"Please set HunterGate *before* 'project' command. "
|
"Please set HunterGate *before* 'project' command. "
|
||||||
"Detected project: ${PROJECT_NAME}"
|
"Detected project: ${PROJECT_NAME}"
|
||||||
WIKI "error.huntergate.before.project"
|
ERROR_PAGE "error.huntergate.before.project"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -470,7 +440,7 @@ macro(HunterGate)
|
||||||
"HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
|
"HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
|
||||||
"Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
|
"Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
|
||||||
"(Use at your own risk!)"
|
"(Use at your own risk!)"
|
||||||
WIKI "error.spaces.in.hunter.root"
|
ERROR_PAGE "error.spaces.in.hunter.root"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
|
@ -0,0 +1,19 @@
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
find_package(RapidJSON CONFIG REQUIRED)
|
||||||
|
find_package(ZLIB CONFIG REQUIRED)
|
||||||
|
find_package(utf8cpp CONFIG REQUIRED)
|
||||||
|
find_package(minizip CONFIG REQUIRED)
|
||||||
|
find_package(openddlparser CONFIG REQUIRED)
|
||||||
|
find_package(poly2tri CONFIG REQUIRED)
|
||||||
|
find_package(polyclipping CONFIG REQUIRED)
|
||||||
|
find_package(zip CONFIG REQUIRED)
|
||||||
|
find_package(pugixml CONFIG REQUIRED)
|
||||||
|
find_package(stb CONFIG REQUIRED)
|
||||||
|
|
||||||
|
if(@ASSIMP_BUILD_DRACO@)
|
||||||
|
find_package(draco CONFIG REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||||
|
check_required_components("@PROJECT_NAME@")
|
|
@ -0,0 +1,9 @@
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||||
|
|
||||||
|
set(ASSIMP_ROOT_DIR ${PACKAGE_PREFIX_DIR})
|
||||||
|
set(ASSIMP_LIBRARIES assimp::assimp)
|
||||||
|
set(ASSIMP_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
||||||
|
get_property(ASSIMP_INCLUDE_DIRS TARGET assimp::assimp PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
set(ASSIMP_LIBRARY_DIRS "")
|
|
@ -1,14 +0,0 @@
|
||||||
@PACKAGE_INIT@
|
|
||||||
|
|
||||||
find_package(RapidJSON CONFIG REQUIRED)
|
|
||||||
find_package(ZLIB CONFIG REQUIRED)
|
|
||||||
find_package(utf8 CONFIG REQUIRED)
|
|
||||||
find_package(irrXML CONFIG REQUIRED)
|
|
||||||
find_package(minizip CONFIG REQUIRED)
|
|
||||||
find_package(openddlparser CONFIG REQUIRED)
|
|
||||||
find_package(poly2tri CONFIG REQUIRED)
|
|
||||||
find_package(polyclipping CONFIG REQUIRED)
|
|
||||||
find_package(zip CONFIG REQUIRED)
|
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
|
||||||
check_required_components("@PROJECT_NAME@")
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -52,9 +52,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
|
|
||||||
static const unsigned int NotSet = 0xcdcdcdcd;
|
static constexpr unsigned int NotSet = 0xcdcdcdcd;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Setup final material indices, generae a default material if necessary
|
// Setup final material indices, generae a default material if necessary
|
||||||
|
@ -68,8 +68,8 @@ void Discreet3DSImporter::ReplaceDefaultMaterial() {
|
||||||
unsigned int idx(NotSet);
|
unsigned int idx(NotSet);
|
||||||
for (unsigned int i = 0; i < mScene->mMaterials.size(); ++i) {
|
for (unsigned int i = 0; i < mScene->mMaterials.size(); ++i) {
|
||||||
std::string s = mScene->mMaterials[i].mName;
|
std::string s = mScene->mMaterials[i].mName;
|
||||||
for (std::string::iterator it = s.begin(); it != s.end(); ++it) {
|
for (char &it : s) {
|
||||||
*it = static_cast<char>(::tolower(*it));
|
it = static_cast<char>(::tolower(static_cast<unsigned char>(it)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (std::string::npos == s.find("default")) continue;
|
if (std::string::npos == s.find("default")) continue;
|
||||||
|
@ -79,12 +79,7 @@ void Discreet3DSImporter::ReplaceDefaultMaterial() {
|
||||||
mScene->mMaterials[i].mDiffuse.r !=
|
mScene->mMaterials[i].mDiffuse.r !=
|
||||||
mScene->mMaterials[i].mDiffuse.b) continue;
|
mScene->mMaterials[i].mDiffuse.b) continue;
|
||||||
|
|
||||||
if (mScene->mMaterials[i].sTexDiffuse.mMapName.length() != 0 ||
|
if (ContainsTextures(i)) {
|
||||||
mScene->mMaterials[i].sTexBump.mMapName.length() != 0 ||
|
|
||||||
mScene->mMaterials[i].sTexOpacity.mMapName.length() != 0 ||
|
|
||||||
mScene->mMaterials[i].sTexEmissive.mMapName.length() != 0 ||
|
|
||||||
mScene->mMaterials[i].sTexSpecular.mMapName.length() != 0 ||
|
|
||||||
mScene->mMaterials[i].sTexShininess.mMapName.length() != 0) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
idx = i;
|
idx = i;
|
||||||
|
@ -212,7 +207,7 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material &oldMat,
|
||||||
mat.AddProperty(&tex, AI_MATKEY_GLOBAL_BACKGROUND_IMAGE);
|
mat.AddProperty(&tex, AI_MATKEY_GLOBAL_BACKGROUND_IMAGE);
|
||||||
|
|
||||||
// Be sure this is only done for the first material
|
// Be sure this is only done for the first material
|
||||||
mBackgroundImage = std::string("");
|
mBackgroundImage = std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
// At first add the base ambient color of the scene to the material
|
// At first add the base ambient color of the scene to the material
|
||||||
|
@ -267,6 +262,7 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material &oldMat,
|
||||||
unsigned int iWire = 1;
|
unsigned int iWire = 1;
|
||||||
mat.AddProperty<int>((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME);
|
mat.AddProperty<int>((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME);
|
||||||
}
|
}
|
||||||
|
[[fallthrough]];
|
||||||
|
|
||||||
case D3DS::Discreet3DS::Gouraud:
|
case D3DS::Discreet3DS::Gouraud:
|
||||||
eShading = aiShadingMode_Gouraud;
|
eShading = aiShadingMode_Gouraud;
|
||||||
|
@ -597,7 +593,7 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene *pcSOut, aiNode *pcOut,
|
||||||
|
|
||||||
// Cameras or lights define their transformation in their parent node and in the
|
// Cameras or lights define their transformation in their parent node and in the
|
||||||
// corresponding light or camera chunks. However, we read and process the latter
|
// corresponding light or camera chunks. However, we read and process the latter
|
||||||
// to to be able to return valid cameras/lights even if no scenegraph is given.
|
// to be able to return valid cameras/lights even if no scenegraph is given.
|
||||||
for (unsigned int n = 0; n < pcSOut->mNumCameras; ++n) {
|
for (unsigned int n = 0; n < pcSOut->mNumCameras; ++n) {
|
||||||
if (pcSOut->mCameras[n]->mName == pcOut->mName) {
|
if (pcSOut->mCameras[n]->mName == pcOut->mName) {
|
||||||
pcSOut->mCameras[n]->mLookAt = aiVector3D(0.f, 0.f, 1.f);
|
pcSOut->mCameras[n]->mLookAt = aiVector3D(0.f, 0.f, 1.f);
|
||||||
|
@ -647,11 +643,17 @@ void Discreet3DSImporter::AddNodeToGraph(aiScene *pcSOut, aiNode *pcOut,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate storage for children
|
// Allocate storage for children
|
||||||
pcOut->mNumChildren = (unsigned int)pcIn->mChildren.size();
|
const unsigned int size = static_cast<unsigned int>(pcIn->mChildren.size());
|
||||||
|
|
||||||
|
pcOut->mNumChildren = size;
|
||||||
|
if (size == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pcOut->mChildren = new aiNode *[pcIn->mChildren.size()];
|
pcOut->mChildren = new aiNode *[pcIn->mChildren.size()];
|
||||||
|
|
||||||
// Recursively process all children
|
// Recursively process all children
|
||||||
const unsigned int size = static_cast<unsigned int>(pcIn->mChildren.size());
|
|
||||||
for (unsigned int i = 0; i < size; ++i) {
|
for (unsigned int i = 0; i < size; ++i) {
|
||||||
pcOut->mChildren[i] = new aiNode();
|
pcOut->mChildren[i] = new aiNode();
|
||||||
pcOut->mChildren[i]->mParent = pcOut;
|
pcOut->mChildren[i]->mParent = pcOut;
|
||||||
|
@ -713,7 +715,7 @@ void Discreet3DSImporter::GenerateNodeGraph(aiScene *pcOut) {
|
||||||
pcNode->mNumMeshes = 1;
|
pcNode->mNumMeshes = 1;
|
||||||
|
|
||||||
// Build a name for the node
|
// Build a name for the node
|
||||||
pcNode->mName.length = ai_snprintf(pcNode->mName.data, MAXLEN, "3DSMesh_%u", i);
|
pcNode->mName.length = ai_snprintf(pcNode->mName.data, AI_MAXLEN, "3DSMesh_%u", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build dummy nodes for all cameras
|
// Build dummy nodes for all cameras
|
||||||
|
@ -809,4 +811,6 @@ void Discreet3DSImporter::ConvertScene(aiScene *pcOut) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -52,12 +52,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <assimp/StringComparison.h>
|
#include <assimp/StringComparison.h>
|
||||||
#include <assimp/DefaultLogger.hpp>
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include <assimp/Exporter.hpp>
|
#include <assimp/Exporter.hpp>
|
||||||
|
#include <assimp/Exceptional.h>
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
using namespace D3DS;
|
using namespace D3DS;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -102,13 +103,14 @@ private:
|
||||||
// preserves the mesh's given name if it has one. |index| is the index
|
// preserves the mesh's given name if it has one. |index| is the index
|
||||||
// of the mesh in |aiScene::mMeshes|.
|
// of the mesh in |aiScene::mMeshes|.
|
||||||
std::string GetMeshName(const aiMesh &mesh, unsigned int index, const aiNode &node) {
|
std::string GetMeshName(const aiMesh &mesh, unsigned int index, const aiNode &node) {
|
||||||
static const std::string underscore = "_";
|
static const char underscore = '_';
|
||||||
char postfix[10] = { 0 };
|
char postfix[10] = { 0 };
|
||||||
ASSIMP_itoa10(postfix, index);
|
ASSIMP_itoa10(postfix, index);
|
||||||
|
|
||||||
std::string result = node.mName.C_Str();
|
std::string result = node.mName.C_Str();
|
||||||
if (mesh.mName.length > 0) {
|
if (mesh.mName.length > 0) {
|
||||||
result += underscore + mesh.mName.C_Str();
|
result += underscore;
|
||||||
|
result += mesh.mName.C_Str();
|
||||||
}
|
}
|
||||||
return result + underscore + postfix;
|
return result + underscore + postfix;
|
||||||
}
|
}
|
||||||
|
@ -208,9 +210,7 @@ Discreet3DSExporter::Discreet3DSExporter(std::shared_ptr<IOStream> &outfile, con
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Discreet3DSExporter::~Discreet3DSExporter() {
|
Discreet3DSExporter::~Discreet3DSExporter() = default;
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
int Discreet3DSExporter::WriteHierarchy(const aiNode &node, int seq, int sibling_level) {
|
int Discreet3DSExporter::WriteHierarchy(const aiNode &node, int seq, int sibling_level) {
|
||||||
|
@ -296,6 +296,12 @@ void Discreet3DSExporter::WriteMaterials() {
|
||||||
WriteColor(color);
|
WriteColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float f;
|
||||||
|
if (mat.Get(AI_MATKEY_OPACITY, f) == AI_SUCCESS) {
|
||||||
|
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_TRANSPARENCY);
|
||||||
|
WritePercentChunk(1.0f - f);
|
||||||
|
}
|
||||||
|
|
||||||
if (mat.Get(AI_MATKEY_COLOR_EMISSIVE, color) == AI_SUCCESS) {
|
if (mat.Get(AI_MATKEY_COLOR_EMISSIVE, color) == AI_SUCCESS) {
|
||||||
ChunkWriter curChunk(writer, Discreet3DS::CHUNK_MAT_SELF_ILLUM);
|
ChunkWriter curChunk(writer, Discreet3DS::CHUNK_MAT_SELF_ILLUM);
|
||||||
WriteColor(color);
|
WriteColor(color);
|
||||||
|
@ -323,6 +329,7 @@ void Discreet3DSExporter::WriteMaterials() {
|
||||||
case aiShadingMode_Blinn:
|
case aiShadingMode_Blinn:
|
||||||
case aiShadingMode_CookTorrance:
|
case aiShadingMode_CookTorrance:
|
||||||
case aiShadingMode_Fresnel:
|
case aiShadingMode_Fresnel:
|
||||||
|
case aiShadingMode_PBR_BRDF: // Possibly should be Discreet3DS::Metal in some cases but this is undocumented
|
||||||
shading_mode_out = Discreet3DS::Phong;
|
shading_mode_out = Discreet3DS::Phong;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -333,7 +340,6 @@ void Discreet3DSExporter::WriteMaterials() {
|
||||||
writer.PutU2(static_cast<uint16_t>(shading_mode_out));
|
writer.PutU2(static_cast<uint16_t>(shading_mode_out));
|
||||||
}
|
}
|
||||||
|
|
||||||
float f;
|
|
||||||
if (mat.Get(AI_MATKEY_SHININESS, f) == AI_SUCCESS) {
|
if (mat.Get(AI_MATKEY_SHININESS, f) == AI_SUCCESS) {
|
||||||
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_SHININESS);
|
ChunkWriter chunk(writer, Discreet3DS::CHUNK_MAT_SHININESS);
|
||||||
WritePercentChunk(f);
|
WritePercentChunk(f);
|
||||||
|
@ -350,7 +356,10 @@ void Discreet3DSExporter::WriteMaterials() {
|
||||||
writer.PutI2(1);
|
writer.PutI2(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteTexture(mat, aiTextureType_DIFFUSE, Discreet3DS::CHUNK_MAT_TEXTURE);
|
// Fallback to BASE_COLOR if no DIFFUSE
|
||||||
|
if (!WriteTexture(mat, aiTextureType_DIFFUSE, Discreet3DS::CHUNK_MAT_TEXTURE))
|
||||||
|
WriteTexture(mat, aiTextureType_BASE_COLOR, Discreet3DS::CHUNK_MAT_TEXTURE);
|
||||||
|
|
||||||
WriteTexture(mat, aiTextureType_HEIGHT, Discreet3DS::CHUNK_MAT_BUMPMAP);
|
WriteTexture(mat, aiTextureType_HEIGHT, Discreet3DS::CHUNK_MAT_BUMPMAP);
|
||||||
WriteTexture(mat, aiTextureType_OPACITY, Discreet3DS::CHUNK_MAT_OPACMAP);
|
WriteTexture(mat, aiTextureType_OPACITY, Discreet3DS::CHUNK_MAT_OPACMAP);
|
||||||
WriteTexture(mat, aiTextureType_SHININESS, Discreet3DS::CHUNK_MAT_MAT_SHINMAP);
|
WriteTexture(mat, aiTextureType_SHININESS, Discreet3DS::CHUNK_MAT_MAT_SHINMAP);
|
||||||
|
@ -361,20 +370,21 @@ void Discreet3DSExporter::WriteMaterials() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Discreet3DSExporter::WriteTexture(const aiMaterial &mat, aiTextureType type, uint16_t chunk_flags) {
|
// returns true if the texture existed
|
||||||
|
bool Discreet3DSExporter::WriteTexture(const aiMaterial &mat, aiTextureType type, uint16_t chunk_flags) {
|
||||||
aiString path;
|
aiString path;
|
||||||
aiTextureMapMode map_mode[2] = {
|
aiTextureMapMode map_mode[2] = {
|
||||||
aiTextureMapMode_Wrap, aiTextureMapMode_Wrap
|
aiTextureMapMode_Wrap, aiTextureMapMode_Wrap
|
||||||
};
|
};
|
||||||
ai_real blend = 1.0;
|
ai_real blend = 1.0;
|
||||||
if (mat.GetTexture(type, 0, &path, NULL, NULL, &blend, NULL, map_mode) != AI_SUCCESS || !path.length) {
|
if (mat.GetTexture(type, 0, &path, nullptr, nullptr, &blend, nullptr, map_mode) != AI_SUCCESS || !path.length) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: handle embedded textures properly
|
// TODO: handle embedded textures properly
|
||||||
if (path.data[0] == '*') {
|
if (path.data[0] == '*') {
|
||||||
ASSIMP_LOG_ERROR("Ignoring embedded texture for export: " + std::string(path.C_Str()));
|
ASSIMP_LOG_ERROR("Ignoring embedded texture for export: ", path.C_Str());
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChunkWriter chunk(writer, chunk_flags);
|
ChunkWriter chunk(writer, chunk_flags);
|
||||||
|
@ -396,6 +406,7 @@ void Discreet3DSExporter::WriteTexture(const aiMaterial &mat, aiTextureType type
|
||||||
writer.PutU2(val);
|
writer.PutU2(val);
|
||||||
}
|
}
|
||||||
// TODO: export texture transformation (i.e. UV offset, scale, rotation)
|
// TODO: export texture transformation (i.e. UV offset, scale, rotation)
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -439,7 +450,7 @@ void Discreet3DSExporter::WriteMeshes() {
|
||||||
const uint16_t count = static_cast<uint16_t>(mesh.mNumVertices);
|
const uint16_t count = static_cast<uint16_t>(mesh.mNumVertices);
|
||||||
writer.PutU2(count);
|
writer.PutU2(count);
|
||||||
for (unsigned int i = 0; i < mesh.mNumVertices; ++i) {
|
for (unsigned int i = 0; i < mesh.mNumVertices; ++i) {
|
||||||
const aiVector3D &v = trafo * mesh.mVertices[i];
|
const aiVector3D &v = mesh.mVertices[i];
|
||||||
writer.PutF4(v.x);
|
writer.PutF4(v.x);
|
||||||
writer.PutF4(v.y);
|
writer.PutF4(v.y);
|
||||||
writer.PutF4(v.z);
|
writer.PutF4(v.z);
|
||||||
|
@ -501,11 +512,16 @@ void Discreet3DSExporter::WriteMeshes() {
|
||||||
// Transformation matrix by which the mesh vertices have been pre-transformed with.
|
// Transformation matrix by which the mesh vertices have been pre-transformed with.
|
||||||
{
|
{
|
||||||
ChunkWriter curChunk(writer, Discreet3DS::CHUNK_TRMATRIX);
|
ChunkWriter curChunk(writer, Discreet3DS::CHUNK_TRMATRIX);
|
||||||
for (unsigned int r = 0; r < 4; ++r) {
|
// Store rotation 3x3 matrix row wise
|
||||||
|
for (unsigned int r = 0; r < 3; ++r) {
|
||||||
for (unsigned int c = 0; c < 3; ++c) {
|
for (unsigned int c = 0; c < 3; ++c) {
|
||||||
writer.PutF4(trafo[r][c]);
|
writer.PutF4(trafo[r][c]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Store translation sub vector column wise
|
||||||
|
for (unsigned int r = 0; r < 3; ++r) {
|
||||||
|
writer.PutF4(trafo[r][3]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -57,8 +56,7 @@ struct aiNode;
|
||||||
struct aiMaterial;
|
struct aiMaterial;
|
||||||
struct aiMesh;
|
struct aiMesh;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp {
|
||||||
{
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +71,7 @@ public:
|
||||||
private:
|
private:
|
||||||
void WriteMeshes();
|
void WriteMeshes();
|
||||||
void WriteMaterials();
|
void WriteMaterials();
|
||||||
void WriteTexture(const aiMaterial& mat, aiTextureType type, uint16_t chunk_flags);
|
bool WriteTexture(const aiMaterial& mat, aiTextureType type, uint16_t chunk_flags);
|
||||||
void WriteFaceMaterialChunk(const aiMesh& mesh);
|
void WriteFaceMaterialChunk(const aiMesh& mesh);
|
||||||
int WriteHierarchy(const aiNode& node, int level, int sibling_level);
|
int WriteHierarchy(const aiNode& node, int level, int sibling_level);
|
||||||
void WriteString(const std::string& s);
|
void WriteString(const std::string& s);
|
||||||
|
@ -88,7 +86,7 @@ private:
|
||||||
|
|
||||||
std::map<const aiNode*, aiMatrix4x4> trafos;
|
std::map<const aiNode*, aiMatrix4x4> trafos;
|
||||||
|
|
||||||
typedef std::multimap<const aiNode*, unsigned int> MeshesByNodeMap;
|
using MeshesByNodeMap = std::multimap<const aiNode*, unsigned int>;
|
||||||
MeshesByNodeMap meshes;
|
MeshesByNodeMap meshes;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <assimp/light.h>
|
#include <assimp/light.h>
|
||||||
#include <assimp/material.h>
|
#include <assimp/material.h>
|
||||||
#include <assimp/qnan.h>
|
#include <assimp/qnan.h>
|
||||||
#include <stdio.h> //sprintf
|
#include <cstdio> //sprintf
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace D3DS {
|
namespace D3DS {
|
||||||
|
@ -61,20 +61,10 @@ namespace D3DS {
|
||||||
#include <assimp/Compiler/pushpack1.h>
|
#include <assimp/Compiler/pushpack1.h>
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Discreet3DS class: Helper class for loading 3ds files. Defines chunks
|
/** Defines chunks and data structures.
|
||||||
* and data structures.
|
|
||||||
*/
|
*/
|
||||||
class Discreet3DS {
|
namespace Discreet3DS {
|
||||||
private:
|
|
||||||
Discreet3DS() AI_NO_EXCEPT {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
~Discreet3DS() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
//! data structure for a single chunk in a .3ds file
|
//! data structure for a single chunk in a .3ds file
|
||||||
struct Chunk {
|
struct Chunk {
|
||||||
uint16_t Flag;
|
uint16_t Flag;
|
||||||
|
@ -269,7 +259,7 @@ public:
|
||||||
// Specifies the file name of a texture
|
// Specifies the file name of a texture
|
||||||
CHUNK_MAPFILE = 0xA300,
|
CHUNK_MAPFILE = 0xA300,
|
||||||
|
|
||||||
// Specifies whether a materail requires two-sided rendering
|
// Specifies whether a material requires two-sided rendering
|
||||||
CHUNK_MAT_TWO_SIDE = 0xA081,
|
CHUNK_MAT_TWO_SIDE = 0xA081,
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
|
|
||||||
|
@ -314,16 +304,17 @@ public:
|
||||||
// camera sub-chunks
|
// camera sub-chunks
|
||||||
CHUNK_CAM_RANGES = 0x4720
|
CHUNK_CAM_RANGES = 0x4720
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure representing a 3ds mesh face */
|
/** Helper structure representing a 3ds mesh face */
|
||||||
struct Face : public FaceWithSmoothingGroup {
|
struct Face : public FaceWithSmoothingGroup {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4315)
|
#pragma warning(disable : 4315)
|
||||||
#endif
|
#endif // _MSC_VER
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure representing a texture */
|
/** Helper structure representing a texture */
|
||||||
|
@ -331,7 +322,6 @@ struct Texture {
|
||||||
//! Default constructor
|
//! Default constructor
|
||||||
Texture() AI_NO_EXCEPT
|
Texture() AI_NO_EXCEPT
|
||||||
: mTextureBlend(0.0f),
|
: mTextureBlend(0.0f),
|
||||||
mMapName(),
|
|
||||||
mOffsetU(0.0),
|
mOffsetU(0.0),
|
||||||
mOffsetV(0.0),
|
mOffsetV(0.0),
|
||||||
mScaleU(1.0),
|
mScaleU(1.0),
|
||||||
|
@ -343,51 +333,11 @@ struct Texture {
|
||||||
mTextureBlend = get_qnan();
|
mTextureBlend = get_qnan();
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture(const Texture &other) :
|
Texture(const Texture &other) = default;
|
||||||
mTextureBlend(other.mTextureBlend),
|
|
||||||
mMapName(other.mMapName),
|
|
||||||
mOffsetU(other.mOffsetU),
|
|
||||||
mOffsetV(other.mOffsetV),
|
|
||||||
mScaleU(other.mScaleU),
|
|
||||||
mScaleV(other.mScaleV),
|
|
||||||
mRotation(other.mRotation),
|
|
||||||
mMapMode(other.mMapMode),
|
|
||||||
bPrivate(other.bPrivate),
|
|
||||||
iUVSrc(other.iUVSrc) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
Texture(Texture &&other) AI_NO_EXCEPT : mTextureBlend(std::move(other.mTextureBlend)),
|
Texture(Texture &&other) AI_NO_EXCEPT = default;
|
||||||
mMapName(std::move(other.mMapName)),
|
|
||||||
mOffsetU(std::move(other.mOffsetU)),
|
|
||||||
mOffsetV(std::move(other.mOffsetV)),
|
|
||||||
mScaleU(std::move(other.mScaleU)),
|
|
||||||
mScaleV(std::move(other.mScaleV)),
|
|
||||||
mRotation(std::move(other.mRotation)),
|
|
||||||
mMapMode(std::move(other.mMapMode)),
|
|
||||||
bPrivate(std::move(other.bPrivate)),
|
|
||||||
iUVSrc(std::move(other.iUVSrc)) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
Texture &operator=(Texture &&other) AI_NO_EXCEPT {
|
Texture &operator=(Texture &&other) AI_NO_EXCEPT = default;
|
||||||
if (this == &other) {
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
mTextureBlend = std::move(other.mTextureBlend);
|
|
||||||
mMapName = std::move(other.mMapName);
|
|
||||||
mOffsetU = std::move(other.mOffsetU);
|
|
||||||
mOffsetV = std::move(other.mOffsetV);
|
|
||||||
mScaleU = std::move(other.mScaleU);
|
|
||||||
mScaleV = std::move(other.mScaleV);
|
|
||||||
mRotation = std::move(other.mRotation);
|
|
||||||
mMapMode = std::move(other.mMapMode);
|
|
||||||
bPrivate = std::move(other.bPrivate);
|
|
||||||
iUVSrc = std::move(other.iUVSrc);
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Specifies the blend factor for the texture
|
//! Specifies the blend factor for the texture
|
||||||
ai_real mTextureBlend;
|
ai_real mTextureBlend;
|
||||||
|
@ -412,13 +362,16 @@ struct Texture {
|
||||||
|
|
||||||
#include <assimp/Compiler/poppack1.h>
|
#include <assimp/Compiler/poppack1.h>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif // _MSC_VER
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure representing a 3ds material */
|
/** Helper structure representing a 3ds material */
|
||||||
struct Material {
|
struct Material {
|
||||||
//! Default constructor has been deleted
|
//! Default constructor has been deleted
|
||||||
Material() :
|
Material() :
|
||||||
mName(),
|
mName(),
|
||||||
mDiffuse(ai_real(0.6), ai_real(0.6), ai_real(0.6)),
|
mDiffuse(0.6f, 0.6f, 0.6f),
|
||||||
mSpecularExponent(ai_real(0.0)),
|
mSpecularExponent(ai_real(0.0)),
|
||||||
mShininessStrength(ai_real(1.0)),
|
mShininessStrength(ai_real(1.0)),
|
||||||
mShading(Discreet3DS::Gouraud),
|
mShading(Discreet3DS::Gouraud),
|
||||||
|
@ -431,7 +384,7 @@ struct Material {
|
||||||
//! Constructor with explicit name
|
//! Constructor with explicit name
|
||||||
explicit Material(const std::string &name) :
|
explicit Material(const std::string &name) :
|
||||||
mName(name),
|
mName(name),
|
||||||
mDiffuse(ai_real(0.6), ai_real(0.6), ai_real(0.6)),
|
mDiffuse(0.6f, 0.6f, 0.6f),
|
||||||
mSpecularExponent(ai_real(0.0)),
|
mSpecularExponent(ai_real(0.0)),
|
||||||
mShininessStrength(ai_real(1.0)),
|
mShininessStrength(ai_real(1.0)),
|
||||||
mShading(Discreet3DS::Gouraud),
|
mShading(Discreet3DS::Gouraud),
|
||||||
|
@ -441,85 +394,9 @@ struct Material {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
Material(const Material &other) :
|
Material(const Material &other) = default;
|
||||||
mName(other.mName),
|
|
||||||
mDiffuse(other.mDiffuse),
|
|
||||||
mSpecularExponent(other.mSpecularExponent),
|
|
||||||
mShininessStrength(other.mShininessStrength),
|
|
||||||
mSpecular(other.mSpecular),
|
|
||||||
mAmbient(other.mAmbient),
|
|
||||||
mShading(other.mShading),
|
|
||||||
mTransparency(other.mTransparency),
|
|
||||||
sTexDiffuse(other.sTexDiffuse),
|
|
||||||
sTexOpacity(other.sTexOpacity),
|
|
||||||
sTexSpecular(other.sTexSpecular),
|
|
||||||
sTexReflective(other.sTexReflective),
|
|
||||||
sTexBump(other.sTexBump),
|
|
||||||
sTexEmissive(other.sTexEmissive),
|
|
||||||
sTexShininess(other.sTexShininess),
|
|
||||||
mBumpHeight(other.mBumpHeight),
|
|
||||||
mEmissive(other.mEmissive),
|
|
||||||
sTexAmbient(other.sTexAmbient),
|
|
||||||
mTwoSided(other.mTwoSided) {
|
|
||||||
// empty
|
|
||||||
|
|
||||||
}
|
virtual ~Material() = default;
|
||||||
|
|
||||||
//! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
|
|
||||||
Material(Material &&other) AI_NO_EXCEPT :
|
|
||||||
mName(std::move(other.mName)),
|
|
||||||
mDiffuse(std::move(other.mDiffuse)),
|
|
||||||
mSpecularExponent(std::move(other.mSpecularExponent)),
|
|
||||||
mShininessStrength(std::move(other.mShininessStrength)),
|
|
||||||
mSpecular(std::move(other.mSpecular)),
|
|
||||||
mAmbient(std::move(other.mAmbient)),
|
|
||||||
mShading(std::move(other.mShading)),
|
|
||||||
mTransparency(std::move(other.mTransparency)),
|
|
||||||
sTexDiffuse(std::move(other.sTexDiffuse)),
|
|
||||||
sTexOpacity(std::move(other.sTexOpacity)),
|
|
||||||
sTexSpecular(std::move(other.sTexSpecular)),
|
|
||||||
sTexReflective(std::move(other.sTexReflective)),
|
|
||||||
sTexBump(std::move(other.sTexBump)),
|
|
||||||
sTexEmissive(std::move(other.sTexEmissive)),
|
|
||||||
sTexShininess(std::move(other.sTexShininess)),
|
|
||||||
mBumpHeight(std::move(other.mBumpHeight)),
|
|
||||||
mEmissive(std::move(other.mEmissive)),
|
|
||||||
sTexAmbient(std::move(other.sTexAmbient)),
|
|
||||||
mTwoSided(std::move(other.mTwoSided)) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
Material &operator=(Material &&other) AI_NO_EXCEPT {
|
|
||||||
if (this == &other) {
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
mName = std::move(other.mName);
|
|
||||||
mDiffuse = std::move(other.mDiffuse);
|
|
||||||
mSpecularExponent = std::move(other.mSpecularExponent);
|
|
||||||
mShininessStrength = std::move(other.mShininessStrength),
|
|
||||||
mSpecular = std::move(other.mSpecular);
|
|
||||||
mAmbient = std::move(other.mAmbient);
|
|
||||||
mShading = std::move(other.mShading);
|
|
||||||
mTransparency = std::move(other.mTransparency);
|
|
||||||
sTexDiffuse = std::move(other.sTexDiffuse);
|
|
||||||
sTexOpacity = std::move(other.sTexOpacity);
|
|
||||||
sTexSpecular = std::move(other.sTexSpecular);
|
|
||||||
sTexReflective = std::move(other.sTexReflective);
|
|
||||||
sTexBump = std::move(other.sTexBump);
|
|
||||||
sTexEmissive = std::move(other.sTexEmissive);
|
|
||||||
sTexShininess = std::move(other.sTexShininess);
|
|
||||||
mBumpHeight = std::move(other.mBumpHeight);
|
|
||||||
mEmissive = std::move(other.mEmissive);
|
|
||||||
sTexAmbient = std::move(other.sTexAmbient);
|
|
||||||
mTwoSided = std::move(other.mTwoSided);
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~Material() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Name of the material
|
//! Name of the material
|
||||||
std::string mName;
|
std::string mName;
|
||||||
|
@ -615,7 +492,12 @@ struct Node {
|
||||||
Node() = delete;
|
Node() = delete;
|
||||||
|
|
||||||
explicit Node(const std::string &name) :
|
explicit Node(const std::string &name) :
|
||||||
mParent(NULL), mName(name), mInstanceNumber(0), mHierarchyPos(0), mHierarchyIndex(0), mInstanceCount(1) {
|
mParent(nullptr),
|
||||||
|
mName(name),
|
||||||
|
mInstanceNumber(0),
|
||||||
|
mHierarchyPos(0),
|
||||||
|
mHierarchyIndex(0),
|
||||||
|
mInstanceCount(1) {
|
||||||
aRotationKeys.reserve(20);
|
aRotationKeys.reserve(20);
|
||||||
aPositionKeys.reserve(20);
|
aPositionKeys.reserve(20);
|
||||||
aScalingKeys.reserve(20);
|
aScalingKeys.reserve(20);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <assimp/DefaultLogger.hpp>
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
static constexpr aiImporterDesc desc = {
|
||||||
"Discreet 3DS Importer",
|
"Discreet 3DS Importer",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -103,28 +103,11 @@ Discreet3DSImporter::Discreet3DSImporter() :
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Destructor, private as well
|
|
||||||
Discreet3DSImporter::~Discreet3DSImporter() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Returns whether the class can handle the format of the given file.
|
// Returns whether the class can handle the format of the given file.
|
||||||
bool Discreet3DSImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const {
|
bool Discreet3DSImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
||||||
std::string extension = GetExtension(pFile);
|
static const uint16_t token[] = { 0x4d4d, 0x3dc2 /*, 0x3daa */ };
|
||||||
if (extension == "3ds" || extension == "prj") {
|
return CheckMagicToken(pIOHandler, pFile, token, AI_COUNT_OF(token), 0, sizeof token[0]);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!extension.length() || checkSig) {
|
|
||||||
uint16_t token[3];
|
|
||||||
token[0] = 0x4d4d;
|
|
||||||
token[1] = 0x3dc2;
|
|
||||||
//token[2] = 0x3daa;
|
|
||||||
return CheckMagicToken(pIOHandler, pFile, token, 2, 0, 2);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -143,11 +126,17 @@ void Discreet3DSImporter::SetupProperties(const Importer * /*pImp*/) {
|
||||||
// Imports the given file into the given scene structure.
|
// Imports the given file into the given scene structure.
|
||||||
void Discreet3DSImporter::InternReadFile(const std::string &pFile,
|
void Discreet3DSImporter::InternReadFile(const std::string &pFile,
|
||||||
aiScene *pScene, IOSystem *pIOHandler) {
|
aiScene *pScene, IOSystem *pIOHandler) {
|
||||||
StreamReaderLE theStream(pIOHandler->Open(pFile, "rb"));
|
|
||||||
|
auto theFile = pIOHandler->Open(pFile, "rb");
|
||||||
|
if (!theFile) {
|
||||||
|
throw DeadlyImportError("3DS: Could not open ", pFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamReaderLE theStream(theFile);
|
||||||
|
|
||||||
// We should have at least one chunk
|
// We should have at least one chunk
|
||||||
if (theStream.GetRemainingSize() < 16) {
|
if (theStream.GetRemainingSize() < 16) {
|
||||||
throw DeadlyImportError("3DS file is either empty or corrupt: " + pFile);
|
throw DeadlyImportError("3DS file is either empty or corrupt: ", pFile);
|
||||||
}
|
}
|
||||||
this->stream = &theStream;
|
this->stream = &theStream;
|
||||||
|
|
||||||
|
@ -164,7 +153,7 @@ void Discreet3DSImporter::InternReadFile(const std::string &pFile,
|
||||||
mRootNode->mHierarchyIndex = -1;
|
mRootNode->mHierarchyIndex = -1;
|
||||||
mRootNode->mParent = nullptr;
|
mRootNode->mParent = nullptr;
|
||||||
mMasterScale = 1.0f;
|
mMasterScale = 1.0f;
|
||||||
mBackgroundImage = "";
|
mBackgroundImage = std::string();
|
||||||
bHasBG = false;
|
bHasBG = false;
|
||||||
bIsPrj = false;
|
bIsPrj = false;
|
||||||
|
|
||||||
|
@ -178,7 +167,7 @@ void Discreet3DSImporter::InternReadFile(const std::string &pFile,
|
||||||
// file.
|
// file.
|
||||||
for (auto &mesh : mScene->mMeshes) {
|
for (auto &mesh : mScene->mMeshes) {
|
||||||
if (mesh.mFaces.size() > 0 && mesh.mPositions.size() == 0) {
|
if (mesh.mFaces.size() > 0 && mesh.mPositions.size() == 0) {
|
||||||
throw DeadlyImportError("3DS file contains faces but no vertices: " + pFile);
|
throw DeadlyImportError("3DS file contains faces but no vertices: ", pFile);
|
||||||
}
|
}
|
||||||
CheckIndices(mesh);
|
CheckIndices(mesh);
|
||||||
MakeUnique(mesh);
|
MakeUnique(mesh);
|
||||||
|
@ -266,14 +255,22 @@ void Discreet3DSImporter::ParseMainChunk() {
|
||||||
|
|
||||||
case Discreet3DS::CHUNK_PRJ:
|
case Discreet3DS::CHUNK_PRJ:
|
||||||
bIsPrj = true;
|
bIsPrj = true;
|
||||||
|
break;
|
||||||
case Discreet3DS::CHUNK_MAIN:
|
case Discreet3DS::CHUNK_MAIN:
|
||||||
ParseEditorChunk();
|
ParseEditorChunk();
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
ASSIMP_3DS_END_CHUNK();
|
ASSIMP_3DS_END_CHUNK();
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunreachable-code-return"
|
||||||
|
#endif
|
||||||
// recursively continue processing this hierarchy level
|
// recursively continue processing this hierarchy level
|
||||||
return ParseMainChunk();
|
return ParseMainChunk();
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -298,7 +295,7 @@ void Discreet3DSImporter::ParseEditorChunk() {
|
||||||
// print the version number
|
// print the version number
|
||||||
char buff[10];
|
char buff[10];
|
||||||
ASSIMP_itoa10(buff, stream->GetI2());
|
ASSIMP_itoa10(buff, stream->GetI2());
|
||||||
ASSIMP_LOG_INFO_F(std::string("3DS file format version: "), buff);
|
ASSIMP_LOG_INFO("3DS file format version: ", buff);
|
||||||
} break;
|
} break;
|
||||||
};
|
};
|
||||||
ASSIMP_3DS_END_CHUNK();
|
ASSIMP_3DS_END_CHUNK();
|
||||||
|
@ -323,7 +320,7 @@ void Discreet3DSImporter::ParseObjectChunk() {
|
||||||
case Discreet3DS::CHUNK_MAT_MATERIAL:
|
case Discreet3DS::CHUNK_MAT_MATERIAL:
|
||||||
|
|
||||||
// Add a new material to the list
|
// Add a new material to the list
|
||||||
mScene->mMaterials.push_back(D3DS::Material(std::string("UNNAMED_" + to_string(mScene->mMaterials.size()))));
|
mScene->mMaterials.emplace_back(std::string("UNNAMED_" + ai_to_string(mScene->mMaterials.size())));
|
||||||
ParseMaterialChunk();
|
ParseMaterialChunk();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -368,13 +365,13 @@ void Discreet3DSImporter::ParseChunk(const char *name, unsigned int num) {
|
||||||
// IMPLEMENTATION NOTE;
|
// IMPLEMENTATION NOTE;
|
||||||
// Cameras or lights define their transformation in their parent node and in the
|
// Cameras or lights define their transformation in their parent node and in the
|
||||||
// corresponding light or camera chunks. However, we read and process the latter
|
// corresponding light or camera chunks. However, we read and process the latter
|
||||||
// to to be able to return valid cameras/lights even if no scenegraph is given.
|
// to be able to return valid cameras/lights even if no scenegraph is given.
|
||||||
|
|
||||||
// get chunk type
|
// get chunk type
|
||||||
switch (chunk.Flag) {
|
switch (chunk.Flag) {
|
||||||
case Discreet3DS::CHUNK_TRIMESH: {
|
case Discreet3DS::CHUNK_TRIMESH: {
|
||||||
// this starts a new triangle mesh
|
// this starts a new triangle mesh
|
||||||
mScene->mMeshes.push_back(D3DS::Mesh(std::string(name, num)));
|
mScene->mMeshes.emplace_back(std::string(name, num));
|
||||||
|
|
||||||
// Read mesh chunks
|
// Read mesh chunks
|
||||||
ParseMeshChunk();
|
ParseMeshChunk();
|
||||||
|
@ -442,7 +439,7 @@ void Discreet3DSImporter::ParseChunk(const char *name, unsigned int num) {
|
||||||
// Read the lense angle
|
// Read the lense angle
|
||||||
camera->mHorizontalFOV = AI_DEG_TO_RAD(stream->GetF4());
|
camera->mHorizontalFOV = AI_DEG_TO_RAD(stream->GetF4());
|
||||||
if (camera->mHorizontalFOV < 0.001f) {
|
if (camera->mHorizontalFOV < 0.001f) {
|
||||||
camera->mHorizontalFOV = AI_DEG_TO_RAD(45.f);
|
camera->mHorizontalFOV = float(AI_DEG_TO_RAD(45.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now check for further subchunks
|
// Now check for further subchunks
|
||||||
|
@ -927,7 +924,7 @@ void Discreet3DSImporter::ParseFaceChunk() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0xcdcdcdcd == idx) {
|
if (0xcdcdcdcd == idx) {
|
||||||
ASSIMP_LOG_ERROR_F("3DS: Unknown material: ", sz);
|
ASSIMP_LOG_ERROR("3DS: Unknown material: ", sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now continue and read all material indices
|
// Now continue and read all material indices
|
||||||
|
@ -1003,7 +1000,7 @@ void Discreet3DSImporter::ParseMeshChunk() {
|
||||||
mMesh.mFaces.reserve(num);
|
mMesh.mFaces.reserve(num);
|
||||||
while (num-- > 0) {
|
while (num-- > 0) {
|
||||||
// 3DS faces are ALWAYS triangles
|
// 3DS faces are ALWAYS triangles
|
||||||
mMesh.mFaces.push_back(D3DS::Face());
|
mMesh.mFaces.emplace_back();
|
||||||
D3DS::Face &sFace = mMesh.mFaces.back();
|
D3DS::Face &sFace = mMesh.mFaces.back();
|
||||||
|
|
||||||
sFace.mIndices[0] = (uint16_t)stream->GetI2();
|
sFace.mIndices[0] = (uint16_t)stream->GetI2();
|
||||||
|
@ -1288,7 +1285,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D *out, bool acceptPercent) {
|
||||||
switch (chunk.Flag) {
|
switch (chunk.Flag) {
|
||||||
case Discreet3DS::CHUNK_LINRGBF:
|
case Discreet3DS::CHUNK_LINRGBF:
|
||||||
bGamma = true;
|
bGamma = true;
|
||||||
|
// fallthrough
|
||||||
case Discreet3DS::CHUNK_RGBF:
|
case Discreet3DS::CHUNK_RGBF:
|
||||||
if (sizeof(float) * 3 > diff) {
|
if (sizeof(float) * 3 > diff) {
|
||||||
*out = clrError;
|
*out = clrError;
|
||||||
|
@ -1301,6 +1298,7 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D *out, bool acceptPercent) {
|
||||||
|
|
||||||
case Discreet3DS::CHUNK_LINRGBB:
|
case Discreet3DS::CHUNK_LINRGBB:
|
||||||
bGamma = true;
|
bGamma = true;
|
||||||
|
// fallthrough
|
||||||
case Discreet3DS::CHUNK_RGBB: {
|
case Discreet3DS::CHUNK_RGBB: {
|
||||||
if (sizeof(char) * 3 > diff) {
|
if (sizeof(char) * 3 > diff) {
|
||||||
*out = clrError;
|
*out = clrError;
|
||||||
|
@ -1337,4 +1335,6 @@ void Discreet3DSImporter::ParseColorChunk(aiColor3D *out, bool acceptPercent) {
|
||||||
(void)bGamma;
|
(void)bGamma;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -46,11 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef AI_3DSIMPORTER_H_INC
|
#ifndef AI_3DSIMPORTER_H_INC
|
||||||
#define AI_3DSIMPORTER_H_INC
|
#define AI_3DSIMPORTER_H_INC
|
||||||
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
#include <assimp/BaseImporter.h>
|
#include <assimp/BaseImporter.h>
|
||||||
#include <assimp/types.h>
|
#include <assimp/types.h>
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
|
||||||
|
|
||||||
#include "3DSHelper.h"
|
#include "3DSHelper.h"
|
||||||
#include <assimp/StreamReader.h>
|
#include <assimp/StreamReader.h>
|
||||||
|
@ -59,7 +59,6 @@ struct aiNode;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
|
||||||
using namespace D3DS;
|
using namespace D3DS;
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
|
@ -68,21 +67,21 @@ using namespace D3DS;
|
||||||
class Discreet3DSImporter : public BaseImporter {
|
class Discreet3DSImporter : public BaseImporter {
|
||||||
public:
|
public:
|
||||||
Discreet3DSImporter();
|
Discreet3DSImporter();
|
||||||
~Discreet3DSImporter();
|
~Discreet3DSImporter() override = default;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Returns whether the class can handle the format of the given file.
|
/** Returns whether the class can handle the format of the given file.
|
||||||
* See BaseImporter::CanRead() for details.
|
* See BaseImporter::CanRead() for details.
|
||||||
*/
|
*/
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||||
bool checkSig) const;
|
bool checkSig) const override;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called prior to ReadFile().
|
/** Called prior to ReadFile().
|
||||||
* The function is a request to the importer to update its configuration
|
* The function is a request to the importer to update its configuration
|
||||||
* basing on the Importer's configuration property list.
|
* basing on the Importer's configuration property list.
|
||||||
*/
|
*/
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -90,14 +89,14 @@ protected:
|
||||||
/** Return importer meta information.
|
/** Return importer meta information.
|
||||||
* See #BaseImporter::GetInfo for the details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
const aiImporterDesc* GetInfo () const;
|
const aiImporterDesc* GetInfo () const override;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details
|
* See BaseImporter::InternReadFile() for details
|
||||||
*/
|
*/
|
||||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||||
IOSystem* pIOHandler);
|
IOSystem* pIOHandler) override;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Converts a temporary material to the outer representation
|
/** Converts a temporary material to the outer representation
|
||||||
|
@ -208,6 +207,15 @@ protected:
|
||||||
*/
|
*/
|
||||||
void ReplaceDefaultMaterial();
|
void ReplaceDefaultMaterial();
|
||||||
|
|
||||||
|
bool ContainsTextures(unsigned int i) const {
|
||||||
|
return !mScene->mMaterials[i].sTexDiffuse.mMapName.empty() ||
|
||||||
|
!mScene->mMaterials[i].sTexBump.mMapName.empty() ||
|
||||||
|
!mScene->mMaterials[i].sTexOpacity.mMapName.empty() ||
|
||||||
|
!mScene->mMaterials[i].sTexEmissive.mMapName.empty() ||
|
||||||
|
!mScene->mMaterials[i].sTexSpecular.mMapName.empty() ||
|
||||||
|
!mScene->mMaterials[i].sTexShininess.mMapName.empty() ;
|
||||||
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Convert the whole scene
|
/** Convert the whole scene
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,179 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (assimp)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the
|
||||||
|
following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the assimp team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the assimp team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <assimp/vector3.h>
|
||||||
|
#include <assimp/matrix4x4.h>
|
||||||
|
#include <assimp/ParsingUtils.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
struct aiMaterial;
|
||||||
|
struct aiMesh;
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
namespace D3MF {
|
||||||
|
|
||||||
|
enum class ResourceType {
|
||||||
|
RT_Object,
|
||||||
|
RT_BaseMaterials,
|
||||||
|
RT_EmbeddedTexture2D,
|
||||||
|
RT_Texture2DGroup,
|
||||||
|
RT_ColorGroup,
|
||||||
|
RT_Unknown
|
||||||
|
}; // To be extended with other resource types (eg. material extension resources like Texture2d, Texture2dGroup...)
|
||||||
|
|
||||||
|
class Resource {
|
||||||
|
public:
|
||||||
|
int mId;
|
||||||
|
|
||||||
|
Resource(int id) :
|
||||||
|
mId(id) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~Resource() = default;
|
||||||
|
|
||||||
|
virtual ResourceType getType() const {
|
||||||
|
return ResourceType::RT_Unknown;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class EmbeddedTexture : public Resource {
|
||||||
|
public:
|
||||||
|
std::string mPath;
|
||||||
|
std::string mContentType;
|
||||||
|
std::string mTilestyleU;
|
||||||
|
std::string mTilestyleV;
|
||||||
|
std::vector<char> mBuffer;
|
||||||
|
|
||||||
|
EmbeddedTexture(int id) :
|
||||||
|
Resource(id),
|
||||||
|
mPath(),
|
||||||
|
mContentType(),
|
||||||
|
mTilestyleU(),
|
||||||
|
mTilestyleV() {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
~EmbeddedTexture() override = default;
|
||||||
|
|
||||||
|
ResourceType getType() const override {
|
||||||
|
return ResourceType::RT_EmbeddedTexture2D;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Texture2DGroup : public Resource {
|
||||||
|
public:
|
||||||
|
std::vector<aiVector2D> mTex2dCoords;
|
||||||
|
int mTexId;
|
||||||
|
Texture2DGroup(int id) :
|
||||||
|
Resource(id),
|
||||||
|
mTexId(-1) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
~Texture2DGroup() override = default;
|
||||||
|
|
||||||
|
ResourceType getType() const override {
|
||||||
|
return ResourceType::RT_Texture2DGroup;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class ColorGroup : public Resource {
|
||||||
|
public:
|
||||||
|
std::vector<aiColor4D> mColors;
|
||||||
|
ColorGroup(int id) :
|
||||||
|
Resource(id){
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
~ColorGroup() override = default;
|
||||||
|
|
||||||
|
ResourceType getType() const override {
|
||||||
|
return ResourceType::RT_ColorGroup;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class BaseMaterials : public Resource {
|
||||||
|
public:
|
||||||
|
std::vector<unsigned int> mMaterialIndex;
|
||||||
|
|
||||||
|
BaseMaterials(int id) :
|
||||||
|
Resource(id),
|
||||||
|
mMaterialIndex() {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
~BaseMaterials() override = default;
|
||||||
|
|
||||||
|
ResourceType getType() const override {
|
||||||
|
return ResourceType::RT_BaseMaterials;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Component {
|
||||||
|
int mObjectId;
|
||||||
|
aiMatrix4x4 mTransformation;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Object : public Resource {
|
||||||
|
public:
|
||||||
|
std::vector<aiMesh *> mMeshes;
|
||||||
|
std::vector<unsigned int> mMeshIndex;
|
||||||
|
std::vector<Component> mComponents;
|
||||||
|
std::string mName;
|
||||||
|
|
||||||
|
Object(int id) :
|
||||||
|
Resource(id),
|
||||||
|
mName(std::string("Object_") + ai_to_string(id)) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
|
~Object() override = default;
|
||||||
|
|
||||||
|
ResourceType getType() const override {
|
||||||
|
return ResourceType::RT_Object;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace D3MF
|
||||||
|
} // namespace Assimp
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -45,59 +44,80 @@ namespace Assimp {
|
||||||
namespace D3MF {
|
namespace D3MF {
|
||||||
|
|
||||||
namespace XmlTag {
|
namespace XmlTag {
|
||||||
|
// Root tag
|
||||||
|
const char* const RootTag = "3MF";
|
||||||
|
|
||||||
// Meta-data
|
// Meta-data
|
||||||
static const std::string meta = "metadata";
|
const char* const meta = "metadata";
|
||||||
static const std::string meta_name = "name";
|
const char* const meta_name = "name";
|
||||||
|
|
||||||
// Model-data specific tags
|
// Model-data specific tags
|
||||||
static const std::string model = "model";
|
const char* const model = "model";
|
||||||
static const std::string model_unit = "unit";
|
const char* const model_unit = "unit";
|
||||||
static const std::string metadata = "metadata";
|
const char* const metadata = "metadata";
|
||||||
static const std::string resources = "resources";
|
const char* const resources = "resources";
|
||||||
static const std::string object = "object";
|
const char* const object = "object";
|
||||||
static const std::string mesh = "mesh";
|
const char* const mesh = "mesh";
|
||||||
static const std::string vertices = "vertices";
|
const char* const components = "components";
|
||||||
static const std::string vertex = "vertex";
|
const char* const component = "component";
|
||||||
static const std::string triangles = "triangles";
|
const char* const vertices = "vertices";
|
||||||
static const std::string triangle = "triangle";
|
const char* const vertex = "vertex";
|
||||||
static const std::string x = "x";
|
const char* const triangles = "triangles";
|
||||||
static const std::string y = "y";
|
const char* const triangle = "triangle";
|
||||||
static const std::string z = "z";
|
const char* const x = "x";
|
||||||
static const std::string v1 = "v1";
|
const char* const y = "y";
|
||||||
static const std::string v2 = "v2";
|
const char* const z = "z";
|
||||||
static const std::string v3 = "v3";
|
const char* const v1 = "v1";
|
||||||
static const std::string id = "id";
|
const char* const v2 = "v2";
|
||||||
static const std::string pid = "pid";
|
const char* const v3 = "v3";
|
||||||
static const std::string p1 = "p1";
|
const char* const id = "id";
|
||||||
static const std::string name = "name";
|
const char* const pid = "pid";
|
||||||
static const std::string type = "type";
|
const char* const pindex = "pindex";
|
||||||
static const std::string build = "build";
|
const char* const p1 = "p1";
|
||||||
static const std::string item = "item";
|
const char *const p2 = "p2";
|
||||||
static const std::string objectid = "objectid";
|
const char *const p3 = "p3";
|
||||||
static const std::string transform = "transform";
|
const char* const name = "name";
|
||||||
|
const char* const type = "type";
|
||||||
|
const char* const build = "build";
|
||||||
|
const char* const item = "item";
|
||||||
|
const char* const objectid = "objectid";
|
||||||
|
const char* const transform = "transform";
|
||||||
|
const char *const path = "path";
|
||||||
|
|
||||||
// Material definitions
|
// Material definitions
|
||||||
static const std::string basematerials = "basematerials";
|
const char* const basematerials = "basematerials";
|
||||||
static const std::string basematerials_id = "id";
|
const char* const basematerials_base = "base";
|
||||||
static const std::string basematerials_base = "base";
|
const char* const basematerials_name = "name";
|
||||||
static const std::string basematerials_name = "name";
|
const char* const basematerials_displaycolor = "displaycolor";
|
||||||
static const std::string basematerials_displaycolor = "displaycolor";
|
const char* const texture_2d = "m:texture2d";
|
||||||
|
const char *const texture_group = "m:texture2dgroup";
|
||||||
|
const char *const texture_content_type = "contenttype";
|
||||||
|
const char *const texture_tilestyleu = "tilestyleu";
|
||||||
|
const char *const texture_tilestylev = "tilestylev";
|
||||||
|
const char *const texture_2d_coord = "m:tex2coord";
|
||||||
|
const char *const texture_cuurd_u = "u";
|
||||||
|
const char *const texture_cuurd_v = "v";
|
||||||
|
|
||||||
|
// vertex color definitions
|
||||||
|
const char *const colorgroup = "m:colorgroup";
|
||||||
|
const char *const color_item = "m:color";
|
||||||
|
const char *const color_vaule = "color";
|
||||||
|
|
||||||
// Meta info tags
|
// Meta info tags
|
||||||
static const std::string CONTENT_TYPES_ARCHIVE = "[Content_Types].xml";
|
const char* const CONTENT_TYPES_ARCHIVE = "[Content_Types].xml";
|
||||||
static const std::string ROOT_RELATIONSHIPS_ARCHIVE = "_rels/.rels";
|
const char* const ROOT_RELATIONSHIPS_ARCHIVE = "_rels/.rels";
|
||||||
static const std::string SCHEMA_CONTENTTYPES = "http://schemas.openxmlformats.org/package/2006/content-types";
|
const char* const SCHEMA_CONTENTTYPES = "http://schemas.openxmlformats.org/package/2006/content-types";
|
||||||
static const std::string SCHEMA_RELATIONSHIPS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
const char* const SCHEMA_RELATIONSHIPS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
||||||
static const std::string RELS_RELATIONSHIP_CONTAINER = "Relationships";
|
const char* const RELS_RELATIONSHIP_CONTAINER = "Relationships";
|
||||||
static const std::string RELS_RELATIONSHIP_NODE = "Relationship";
|
const char* const RELS_RELATIONSHIP_NODE = "Relationship";
|
||||||
static const std::string RELS_ATTRIB_TARGET = "Target";
|
const char* const RELS_ATTRIB_TARGET = "Target";
|
||||||
static const std::string RELS_ATTRIB_TYPE = "Type";
|
const char* const RELS_ATTRIB_TYPE = "Type";
|
||||||
static const std::string RELS_ATTRIB_ID = "Id";
|
const char* const RELS_ATTRIB_ID = "Id";
|
||||||
static const std::string PACKAGE_START_PART_RELATIONSHIP_TYPE = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel";
|
const char* const PACKAGE_START_PART_RELATIONSHIP_TYPE = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel";
|
||||||
static const std::string PACKAGE_PRINT_TICKET_RELATIONSHIP_TYPE = "http://schemas.microsoft.com/3dmanufacturing/2013/01/printticket";
|
const char* const PACKAGE_PRINT_TICKET_RELATIONSHIP_TYPE = "http://schemas.microsoft.com/3dmanufacturing/2013/01/printticket";
|
||||||
static const std::string PACKAGE_TEXTURE_RELATIONSHIP_TYPE = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dtexture";
|
const char* const PACKAGE_TEXTURE_RELATIONSHIP_TYPE = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dtexture";
|
||||||
static const std::string PACKAGE_CORE_PROPERTIES_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
const char* const PACKAGE_CORE_PROPERTIES_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||||
static const std::string PACKAGE_THUMBNAIL_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail";
|
const char* const PACKAGE_THUMBNAIL_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Namespace D3MF
|
} // Namespace D3MF
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -84,7 +83,7 @@ void ExportScene3MF(const char *pFile, IOSystem *pIOSystem, const aiScene *pScen
|
||||||
namespace D3MF {
|
namespace D3MF {
|
||||||
|
|
||||||
D3MFExporter::D3MFExporter(const char *pFile, const aiScene *pScene) :
|
D3MFExporter::D3MFExporter(const char *pFile, const aiScene *pScene) :
|
||||||
mArchiveName(pFile), m_zipArchive(nullptr), mScene(pScene), mModelOutput(), mRelOutput(), mContentOutput(), mBuildItems(), mRelations() {
|
mArchiveName(pFile), m_zipArchive(nullptr), mScene(pScene) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +137,7 @@ bool D3MFExporter::exportContentTypes() {
|
||||||
mContentOutput << std::endl;
|
mContentOutput << std::endl;
|
||||||
mContentOutput << "</Types>";
|
mContentOutput << "</Types>";
|
||||||
mContentOutput << std::endl;
|
mContentOutput << std::endl;
|
||||||
exportContentTyp(XmlTag::CONTENT_TYPES_ARCHIVE);
|
zipContentType(XmlTag::CONTENT_TYPES_ARCHIVE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -163,7 +162,7 @@ bool D3MFExporter::exportRelations() {
|
||||||
mRelOutput << "</Relationships>";
|
mRelOutput << "</Relationships>";
|
||||||
mRelOutput << std::endl;
|
mRelOutput << std::endl;
|
||||||
|
|
||||||
writeRelInfoToFile("_rels", ".rels");
|
zipRelInfo("_rels", ".rels");
|
||||||
mRelOutput.flush();
|
mRelOutput.flush();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -197,7 +196,7 @@ bool D3MFExporter::export3DModel() {
|
||||||
info->type = XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE;
|
info->type = XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE;
|
||||||
mRelations.push_back(info);
|
mRelations.push_back(info);
|
||||||
|
|
||||||
writeModelToArchive("3D", "3DModel.model");
|
zipModel("3D", "3DModel.model");
|
||||||
mModelOutput.flush();
|
mModelOutput.flush();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -238,7 +237,7 @@ void D3MFExporter::writeBaseMaterials() {
|
||||||
aiMaterial *mat = mScene->mMaterials[i];
|
aiMaterial *mat = mScene->mMaterials[i];
|
||||||
aiString name;
|
aiString name;
|
||||||
if (mat->Get(AI_MATKEY_NAME, name) != aiReturn_SUCCESS) {
|
if (mat->Get(AI_MATKEY_NAME, name) != aiReturn_SUCCESS) {
|
||||||
strName = "basemat_" + to_string(i);
|
strName = "basemat_" + ai_to_string(i);
|
||||||
} else {
|
} else {
|
||||||
strName = name.C_Str();
|
strName = name.C_Str();
|
||||||
}
|
}
|
||||||
|
@ -249,22 +248,22 @@ void D3MFExporter::writeBaseMaterials() {
|
||||||
// rgbs %
|
// rgbs %
|
||||||
if (color.r <= 1 && color.g <= 1 && color.b <= 1 && color.a <= 1) {
|
if (color.r <= 1 && color.g <= 1 && color.b <= 1 && color.a <= 1) {
|
||||||
|
|
||||||
hexDiffuseColor = Rgba2Hex(
|
hexDiffuseColor = ai_rgba2hex(
|
||||||
(int)((ai_real)color.r) * 255,
|
(int)(((ai_real)color.r) * 255),
|
||||||
(int)((ai_real)color.g) * 255,
|
(int)(((ai_real)color.g) * 255),
|
||||||
(int)((ai_real)color.b) * 255,
|
(int)(((ai_real)color.b) * 255),
|
||||||
(int)((ai_real)color.a) * 255,
|
(int)(((ai_real)color.a) * 255),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
hexDiffuseColor = "#";
|
hexDiffuseColor = "#";
|
||||||
tmp = DecimalToHexa((ai_real)color.r);
|
tmp = ai_decimal_to_hexa((ai_real)color.r);
|
||||||
hexDiffuseColor += tmp;
|
hexDiffuseColor += tmp;
|
||||||
tmp = DecimalToHexa((ai_real)color.g);
|
tmp = ai_decimal_to_hexa((ai_real)color.g);
|
||||||
hexDiffuseColor += tmp;
|
hexDiffuseColor += tmp;
|
||||||
tmp = DecimalToHexa((ai_real)color.b);
|
tmp = ai_decimal_to_hexa((ai_real)color.b);
|
||||||
hexDiffuseColor += tmp;
|
hexDiffuseColor += tmp;
|
||||||
tmp = DecimalToHexa((ai_real)color.a);
|
tmp = ai_decimal_to_hexa((ai_real)color.a);
|
||||||
hexDiffuseColor += tmp;
|
hexDiffuseColor += tmp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -308,18 +307,26 @@ void D3MFExporter::writeMesh(aiMesh *mesh) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mModelOutput << "<" << XmlTag::mesh << ">" << std::endl;
|
mModelOutput << "<"
|
||||||
mModelOutput << "<" << XmlTag::vertices << ">" << std::endl;
|
<< XmlTag::mesh
|
||||||
|
<< ">" << "\n";
|
||||||
|
mModelOutput << "<"
|
||||||
|
<< XmlTag::vertices
|
||||||
|
<< ">" << "\n";
|
||||||
for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
|
for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
|
||||||
writeVertex(mesh->mVertices[i]);
|
writeVertex(mesh->mVertices[i]);
|
||||||
}
|
}
|
||||||
mModelOutput << "</" << XmlTag::vertices << ">" << std::endl;
|
mModelOutput << "</"
|
||||||
|
<< XmlTag::vertices << ">"
|
||||||
|
<< "\n";
|
||||||
|
|
||||||
const unsigned int matIdx(mesh->mMaterialIndex);
|
const unsigned int matIdx(mesh->mMaterialIndex);
|
||||||
|
|
||||||
writeFaces(mesh, matIdx);
|
writeFaces(mesh, matIdx);
|
||||||
|
|
||||||
mModelOutput << "</" << XmlTag::mesh << ">" << std::endl;
|
mModelOutput << "</"
|
||||||
|
<< XmlTag::mesh << ">"
|
||||||
|
<< "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFExporter::writeVertex(const aiVector3D &pos) {
|
void D3MFExporter::writeVertex(const aiVector3D &pos) {
|
||||||
|
@ -335,65 +342,57 @@ void D3MFExporter::writeFaces(aiMesh *mesh, unsigned int matIdx) {
|
||||||
if (!mesh->HasFaces()) {
|
if (!mesh->HasFaces()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mModelOutput << "<" << XmlTag::triangles << ">" << std::endl;
|
mModelOutput << "<"
|
||||||
|
<< XmlTag::triangles << ">"
|
||||||
|
<< "\n";
|
||||||
for (unsigned int i = 0; i < mesh->mNumFaces; ++i) {
|
for (unsigned int i = 0; i < mesh->mNumFaces; ++i) {
|
||||||
aiFace ¤tFace = mesh->mFaces[i];
|
aiFace ¤tFace = mesh->mFaces[i];
|
||||||
mModelOutput << "<" << XmlTag::triangle << " v1=\"" << currentFace.mIndices[0] << "\" v2=\""
|
mModelOutput << "<" << XmlTag::triangle << " v1=\"" << currentFace.mIndices[0] << "\" v2=\""
|
||||||
<< currentFace.mIndices[1] << "\" v3=\"" << currentFace.mIndices[2]
|
<< currentFace.mIndices[1] << "\" v3=\"" << currentFace.mIndices[2]
|
||||||
<< "\" pid=\"1\" p1=\"" + to_string(matIdx) + "\" />";
|
<< "\" pid=\"1\" p1=\"" + ai_to_string(matIdx) + "\" />";
|
||||||
mModelOutput << std::endl;
|
mModelOutput << "\n";
|
||||||
}
|
}
|
||||||
mModelOutput << "</" << XmlTag::triangles << ">";
|
mModelOutput << "</"
|
||||||
mModelOutput << std::endl;
|
<< XmlTag::triangles
|
||||||
|
<< ">";
|
||||||
|
mModelOutput << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFExporter::writeBuild() {
|
void D3MFExporter::writeBuild() {
|
||||||
mModelOutput << "<" << XmlTag::build << ">" << std::endl;
|
mModelOutput << "<"
|
||||||
|
<< XmlTag::build
|
||||||
|
<< ">"
|
||||||
|
<< "\n";
|
||||||
|
|
||||||
for (size_t i = 0; i < mBuildItems.size(); ++i) {
|
for (size_t i = 0; i < mBuildItems.size(); ++i) {
|
||||||
mModelOutput << "<" << XmlTag::item << " objectid=\"" << i + 2 << "\"/>";
|
mModelOutput << "<" << XmlTag::item << " objectid=\"" << i + 2 << "\"/>";
|
||||||
mModelOutput << std::endl;
|
mModelOutput << "\n";
|
||||||
}
|
}
|
||||||
mModelOutput << "</" << XmlTag::build << ">";
|
mModelOutput << "</" << XmlTag::build << ">";
|
||||||
mModelOutput << std::endl;
|
mModelOutput << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFExporter::exportContentTyp(const std::string &filename) {
|
void D3MFExporter::zipContentType(const std::string &filename) {
|
||||||
if (nullptr == m_zipArchive) {
|
addFileInZip(filename, mContentOutput.str());
|
||||||
throw DeadlyExportError("3MF-Export: Zip archive not valid, nullptr.");
|
|
||||||
}
|
|
||||||
const std::string entry = filename;
|
|
||||||
zip_entry_open(m_zipArchive, entry.c_str());
|
|
||||||
|
|
||||||
const std::string &exportTxt(mContentOutput.str());
|
|
||||||
zip_entry_write(m_zipArchive, exportTxt.c_str(), exportTxt.size());
|
|
||||||
|
|
||||||
zip_entry_close(m_zipArchive);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFExporter::writeModelToArchive(const std::string &folder, const std::string &modelName) {
|
void D3MFExporter::zipModel(const std::string &folder, const std::string &modelName) {
|
||||||
if (nullptr == m_zipArchive) {
|
|
||||||
throw DeadlyExportError("3MF-Export: Zip archive not valid, nullptr.");
|
|
||||||
}
|
|
||||||
const std::string entry = folder + "/" + modelName;
|
const std::string entry = folder + "/" + modelName;
|
||||||
zip_entry_open(m_zipArchive, entry.c_str());
|
addFileInZip(entry, mModelOutput.str());
|
||||||
|
|
||||||
const std::string &exportTxt(mModelOutput.str());
|
|
||||||
zip_entry_write(m_zipArchive, exportTxt.c_str(), exportTxt.size());
|
|
||||||
|
|
||||||
zip_entry_close(m_zipArchive);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFExporter::writeRelInfoToFile(const std::string &folder, const std::string &relName) {
|
void D3MFExporter::zipRelInfo(const std::string &folder, const std::string &relName) {
|
||||||
|
const std::string entry = folder + "/" + relName;
|
||||||
|
addFileInZip(entry, mRelOutput.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
void D3MFExporter::addFileInZip(const std::string& entry, const std::string& content) {
|
||||||
if (nullptr == m_zipArchive) {
|
if (nullptr == m_zipArchive) {
|
||||||
throw DeadlyExportError("3MF-Export: Zip archive not valid, nullptr.");
|
throw DeadlyExportError("3MF-Export: Zip archive not valid, nullptr.");
|
||||||
}
|
}
|
||||||
const std::string entry = folder + "/" + relName;
|
|
||||||
zip_entry_open(m_zipArchive, entry.c_str());
|
zip_entry_open(m_zipArchive, entry.c_str());
|
||||||
|
zip_entry_write(m_zipArchive, content.c_str(), content.size());
|
||||||
const std::string &exportTxt(mRelOutput.str());
|
|
||||||
zip_entry_write(m_zipArchive, exportTxt.c_str(), exportTxt.size());
|
|
||||||
|
|
||||||
zip_entry_close(m_zipArchive);
|
zip_entry_close(m_zipArchive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -41,6 +40,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
#ifndef ASSIMP_BUILD_NO_3MF_EXPORTER
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -59,8 +61,6 @@ class IOStream;
|
||||||
|
|
||||||
namespace D3MF {
|
namespace D3MF {
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_EXPORT
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3MF_EXPORTER
|
|
||||||
|
|
||||||
struct OpcPackageRelationship;
|
struct OpcPackageRelationship;
|
||||||
|
|
||||||
|
@ -83,9 +83,12 @@ protected:
|
||||||
void writeVertex( const aiVector3D &pos );
|
void writeVertex( const aiVector3D &pos );
|
||||||
void writeFaces( aiMesh *mesh, unsigned int matIdx );
|
void writeFaces( aiMesh *mesh, unsigned int matIdx );
|
||||||
void writeBuild();
|
void writeBuild();
|
||||||
void exportContentTyp( const std::string &filename );
|
|
||||||
void writeModelToArchive( const std::string &folder, const std::string &modelName );
|
// Zip the data
|
||||||
void writeRelInfoToFile( const std::string &folder, const std::string &relName );
|
void zipContentType( const std::string &filename );
|
||||||
|
void zipModel( const std::string &folder, const std::string &modelName );
|
||||||
|
void zipRelInfo( const std::string &folder, const std::string &relName );
|
||||||
|
void addFileInZip( const std::string &entry, const std::string &content );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mArchiveName;
|
std::string mArchiveName;
|
||||||
|
@ -98,9 +101,11 @@ private:
|
||||||
std::vector<OpcPackageRelationship*> mRelations;
|
std::vector<OpcPackageRelationship*> mRelations;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ASSIMP_BUILD_NO_3MF_EXPORTER
|
|
||||||
#endif // ASSIMP_BUILD_NO_EXPORT
|
|
||||||
|
|
||||||
} // Namespace D3MF
|
} // Namespace D3MF
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
||||||
|
#endif // ASSIMP_BUILD_NO_3MF_EXPORTER
|
||||||
|
#endif // ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,381 +42,33 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
||||||
|
|
||||||
#include "D3MFImporter.h"
|
#include "D3MFImporter.h"
|
||||||
|
#include "3MFXmlTags.h"
|
||||||
|
#include "D3MFOpcPackage.h"
|
||||||
|
#include "XmlSerializer.h"
|
||||||
|
|
||||||
#include <assimp/StringComparison.h>
|
#include <assimp/StringComparison.h>
|
||||||
#include <assimp/StringUtils.h>
|
#include <assimp/StringUtils.h>
|
||||||
|
#include <assimp/XmlParser.h>
|
||||||
#include <assimp/ZipArchiveIOSystem.h>
|
#include <assimp/ZipArchiveIOSystem.h>
|
||||||
#include <assimp/importerdesc.h>
|
#include <assimp/importerdesc.h>
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#include <assimp/DefaultLogger.hpp>
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
|
#include <assimp/fast_atof.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "3MFXmlTags.h"
|
|
||||||
#include "D3MFOpcPackage.h"
|
|
||||||
#include <assimp/fast_atof.h>
|
|
||||||
#include <assimp/irrXMLWrapper.h>
|
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace D3MF {
|
|
||||||
|
|
||||||
class XmlSerializer {
|
using namespace D3MF;
|
||||||
public:
|
|
||||||
using MatArray = std::vector<aiMaterial *>;
|
|
||||||
using MatId2MatArray = std::map<unsigned int, std::vector<unsigned int>>;
|
|
||||||
|
|
||||||
XmlSerializer(XmlReader *xmlReader) :
|
static constexpr aiImporterDesc desc = {
|
||||||
mMeshes(),
|
|
||||||
mMatArray(),
|
|
||||||
mActiveMatGroup(99999999),
|
|
||||||
mMatId2MatArray(),
|
|
||||||
xmlReader(xmlReader) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
~XmlSerializer() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImportXml(aiScene *scene) {
|
|
||||||
if (nullptr == scene) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
scene->mRootNode = new aiNode();
|
|
||||||
std::vector<aiNode *> children;
|
|
||||||
|
|
||||||
std::string nodeName;
|
|
||||||
while (ReadToEndElement(D3MF::XmlTag::model)) {
|
|
||||||
nodeName = xmlReader->getNodeName();
|
|
||||||
if (nodeName == D3MF::XmlTag::object) {
|
|
||||||
children.push_back(ReadObject(scene));
|
|
||||||
} else if (nodeName == D3MF::XmlTag::build) {
|
|
||||||
//
|
|
||||||
} else if (nodeName == D3MF::XmlTag::basematerials) {
|
|
||||||
ReadBaseMaterials();
|
|
||||||
} else if (nodeName == D3MF::XmlTag::meta) {
|
|
||||||
ReadMetadata();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scene->mRootNode->mName.length == 0) {
|
|
||||||
scene->mRootNode->mName.Set("3MF");
|
|
||||||
}
|
|
||||||
|
|
||||||
// import the metadata
|
|
||||||
if (!mMetaData.empty()) {
|
|
||||||
const size_t numMeta(mMetaData.size());
|
|
||||||
scene->mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(numMeta));
|
|
||||||
for (size_t i = 0; i < numMeta; ++i) {
|
|
||||||
aiString val(mMetaData[i].value);
|
|
||||||
scene->mMetaData->Set(static_cast<unsigned int>(i), mMetaData[i].name, val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// import the meshes
|
|
||||||
scene->mNumMeshes = static_cast<unsigned int>(mMeshes.size());
|
|
||||||
scene->mMeshes = new aiMesh *[scene->mNumMeshes]();
|
|
||||||
std::copy(mMeshes.begin(), mMeshes.end(), scene->mMeshes);
|
|
||||||
|
|
||||||
// import the materials
|
|
||||||
scene->mNumMaterials = static_cast<unsigned int>(mMatArray.size());
|
|
||||||
if (0 != scene->mNumMaterials) {
|
|
||||||
scene->mMaterials = new aiMaterial *[scene->mNumMaterials];
|
|
||||||
std::copy(mMatArray.begin(), mMatArray.end(), scene->mMaterials);
|
|
||||||
}
|
|
||||||
|
|
||||||
// create the scenegraph
|
|
||||||
scene->mRootNode->mNumChildren = static_cast<unsigned int>(children.size());
|
|
||||||
scene->mRootNode->mChildren = new aiNode *[scene->mRootNode->mNumChildren]();
|
|
||||||
std::copy(children.begin(), children.end(), scene->mRootNode->mChildren);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
aiNode *ReadObject(aiScene *scene) {
|
|
||||||
std::unique_ptr<aiNode> node(new aiNode());
|
|
||||||
|
|
||||||
std::vector<unsigned long> meshIds;
|
|
||||||
|
|
||||||
const char *attrib(nullptr);
|
|
||||||
std::string name, type;
|
|
||||||
attrib = xmlReader->getAttributeValue(D3MF::XmlTag::id.c_str());
|
|
||||||
if (nullptr != attrib) {
|
|
||||||
name = attrib;
|
|
||||||
}
|
|
||||||
attrib = xmlReader->getAttributeValue(D3MF::XmlTag::type.c_str());
|
|
||||||
if (nullptr != attrib) {
|
|
||||||
type = attrib;
|
|
||||||
}
|
|
||||||
|
|
||||||
node->mParent = scene->mRootNode;
|
|
||||||
node->mName.Set(name);
|
|
||||||
|
|
||||||
size_t meshIdx = mMeshes.size();
|
|
||||||
|
|
||||||
while (ReadToEndElement(D3MF::XmlTag::object)) {
|
|
||||||
if (xmlReader->getNodeName() == D3MF::XmlTag::mesh) {
|
|
||||||
auto mesh = ReadMesh();
|
|
||||||
|
|
||||||
mesh->mName.Set(name);
|
|
||||||
mMeshes.push_back(mesh);
|
|
||||||
meshIds.push_back(static_cast<unsigned long>(meshIdx));
|
|
||||||
++meshIdx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
node->mNumMeshes = static_cast<unsigned int>(meshIds.size());
|
|
||||||
|
|
||||||
node->mMeshes = new unsigned int[node->mNumMeshes];
|
|
||||||
|
|
||||||
std::copy(meshIds.begin(), meshIds.end(), node->mMeshes);
|
|
||||||
|
|
||||||
return node.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
aiMesh *ReadMesh() {
|
|
||||||
aiMesh *mesh = new aiMesh();
|
|
||||||
while (ReadToEndElement(D3MF::XmlTag::mesh)) {
|
|
||||||
if (xmlReader->getNodeName() == D3MF::XmlTag::vertices) {
|
|
||||||
ImportVertices(mesh);
|
|
||||||
} else if (xmlReader->getNodeName() == D3MF::XmlTag::triangles) {
|
|
||||||
ImportTriangles(mesh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return mesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadMetadata() {
|
|
||||||
const std::string name = xmlReader->getAttributeValue(D3MF::XmlTag::meta_name.c_str());
|
|
||||||
xmlReader->read();
|
|
||||||
const std::string value = xmlReader->getNodeData();
|
|
||||||
|
|
||||||
if (name.empty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MetaEntry entry;
|
|
||||||
entry.name = name;
|
|
||||||
entry.value = value;
|
|
||||||
mMetaData.push_back(entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImportVertices(aiMesh *mesh) {
|
|
||||||
std::vector<aiVector3D> vertices;
|
|
||||||
while (ReadToEndElement(D3MF::XmlTag::vertices)) {
|
|
||||||
if (xmlReader->getNodeName() == D3MF::XmlTag::vertex) {
|
|
||||||
vertices.push_back(ReadVertex());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mesh->mNumVertices = static_cast<unsigned int>(vertices.size());
|
|
||||||
mesh->mVertices = new aiVector3D[mesh->mNumVertices];
|
|
||||||
|
|
||||||
std::copy(vertices.begin(), vertices.end(), mesh->mVertices);
|
|
||||||
}
|
|
||||||
|
|
||||||
aiVector3D ReadVertex() {
|
|
||||||
aiVector3D vertex;
|
|
||||||
|
|
||||||
vertex.x = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::x.c_str()), nullptr);
|
|
||||||
vertex.y = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::y.c_str()), nullptr);
|
|
||||||
vertex.z = ai_strtof(xmlReader->getAttributeValue(D3MF::XmlTag::z.c_str()), nullptr);
|
|
||||||
|
|
||||||
return vertex;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImportTriangles(aiMesh *mesh) {
|
|
||||||
std::vector<aiFace> faces;
|
|
||||||
|
|
||||||
while (ReadToEndElement(D3MF::XmlTag::triangles)) {
|
|
||||||
const std::string nodeName(xmlReader->getNodeName());
|
|
||||||
if (xmlReader->getNodeName() == D3MF::XmlTag::triangle) {
|
|
||||||
faces.push_back(ReadTriangle());
|
|
||||||
const char *pidToken(xmlReader->getAttributeValue(D3MF::XmlTag::p1.c_str()));
|
|
||||||
if (nullptr != pidToken) {
|
|
||||||
int matIdx(std::atoi(pidToken));
|
|
||||||
mesh->mMaterialIndex = matIdx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mesh->mNumFaces = static_cast<unsigned int>(faces.size());
|
|
||||||
mesh->mFaces = new aiFace[mesh->mNumFaces];
|
|
||||||
mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
|
|
||||||
|
|
||||||
std::copy(faces.begin(), faces.end(), mesh->mFaces);
|
|
||||||
}
|
|
||||||
|
|
||||||
aiFace ReadTriangle() {
|
|
||||||
aiFace face;
|
|
||||||
|
|
||||||
face.mNumIndices = 3;
|
|
||||||
face.mIndices = new unsigned int[face.mNumIndices];
|
|
||||||
face.mIndices[0] = static_cast<unsigned int>(std::atoi(xmlReader->getAttributeValue(D3MF::XmlTag::v1.c_str())));
|
|
||||||
face.mIndices[1] = static_cast<unsigned int>(std::atoi(xmlReader->getAttributeValue(D3MF::XmlTag::v2.c_str())));
|
|
||||||
face.mIndices[2] = static_cast<unsigned int>(std::atoi(xmlReader->getAttributeValue(D3MF::XmlTag::v3.c_str())));
|
|
||||||
|
|
||||||
return face;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReadBaseMaterials() {
|
|
||||||
std::vector<unsigned int> MatIdArray;
|
|
||||||
const char *baseMaterialId(xmlReader->getAttributeValue(D3MF::XmlTag::basematerials_id.c_str()));
|
|
||||||
if (nullptr != baseMaterialId) {
|
|
||||||
unsigned int id = std::atoi(baseMaterialId);
|
|
||||||
const size_t newMatIdx(mMatArray.size());
|
|
||||||
if (id != mActiveMatGroup) {
|
|
||||||
mActiveMatGroup = id;
|
|
||||||
MatId2MatArray::const_iterator it(mMatId2MatArray.find(id));
|
|
||||||
if (mMatId2MatArray.end() == it) {
|
|
||||||
MatIdArray.clear();
|
|
||||||
mMatId2MatArray[id] = MatIdArray;
|
|
||||||
} else {
|
|
||||||
MatIdArray = it->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MatIdArray.push_back(static_cast<unsigned int>(newMatIdx));
|
|
||||||
mMatId2MatArray[mActiveMatGroup] = MatIdArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (ReadToEndElement(D3MF::XmlTag::basematerials)) {
|
|
||||||
mMatArray.push_back(readMaterialDef());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool parseColor(const char *color, aiColor4D &diffuse) {
|
|
||||||
if (nullptr == color) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//format of the color string: #RRGGBBAA or #RRGGBB (3MF Core chapter 5.1.1)
|
|
||||||
const size_t len(strlen(color));
|
|
||||||
if (9 != len && 7 != len) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *buf(color);
|
|
||||||
if ('#' != *buf) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
++buf;
|
|
||||||
char comp[3] = { 0, 0, '\0' };
|
|
||||||
|
|
||||||
comp[0] = *buf;
|
|
||||||
++buf;
|
|
||||||
comp[1] = *buf;
|
|
||||||
++buf;
|
|
||||||
diffuse.r = static_cast<ai_real>(strtol(comp, NULL, 16)) / ai_real(255.0);
|
|
||||||
|
|
||||||
comp[0] = *buf;
|
|
||||||
++buf;
|
|
||||||
comp[1] = *buf;
|
|
||||||
++buf;
|
|
||||||
diffuse.g = static_cast<ai_real>(strtol(comp, NULL, 16)) / ai_real(255.0);
|
|
||||||
|
|
||||||
comp[0] = *buf;
|
|
||||||
++buf;
|
|
||||||
comp[1] = *buf;
|
|
||||||
++buf;
|
|
||||||
diffuse.b = static_cast<ai_real>(strtol(comp, NULL, 16)) / ai_real(255.0);
|
|
||||||
|
|
||||||
if (7 == len)
|
|
||||||
return true;
|
|
||||||
comp[0] = *buf;
|
|
||||||
++buf;
|
|
||||||
comp[1] = *buf;
|
|
||||||
++buf;
|
|
||||||
diffuse.a = static_cast<ai_real>(strtol(comp, NULL, 16)) / ai_real(255.0);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void assignDiffuseColor(aiMaterial *mat) {
|
|
||||||
const char *color = xmlReader->getAttributeValue(D3MF::XmlTag::basematerials_displaycolor.c_str());
|
|
||||||
aiColor4D diffuse;
|
|
||||||
if (parseColor(color, diffuse)) {
|
|
||||||
mat->AddProperty<aiColor4D>(&diffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aiMaterial *readMaterialDef() {
|
|
||||||
aiMaterial *mat(nullptr);
|
|
||||||
const char *name(nullptr);
|
|
||||||
const std::string nodeName(xmlReader->getNodeName());
|
|
||||||
if (nodeName == D3MF::XmlTag::basematerials_base) {
|
|
||||||
name = xmlReader->getAttributeValue(D3MF::XmlTag::basematerials_name.c_str());
|
|
||||||
std::string stdMatName;
|
|
||||||
aiString matName;
|
|
||||||
std::string strId(to_string(mActiveMatGroup));
|
|
||||||
stdMatName += "id";
|
|
||||||
stdMatName += strId;
|
|
||||||
stdMatName += "_";
|
|
||||||
if (nullptr != name) {
|
|
||||||
stdMatName += std::string(name);
|
|
||||||
} else {
|
|
||||||
stdMatName += "basemat";
|
|
||||||
}
|
|
||||||
matName.Set(stdMatName);
|
|
||||||
|
|
||||||
mat = new aiMaterial;
|
|
||||||
mat->AddProperty(&matName, AI_MATKEY_NAME);
|
|
||||||
|
|
||||||
assignDiffuseColor(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
return mat;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool ReadToStartElement(const std::string &startTag) {
|
|
||||||
while (xmlReader->read()) {
|
|
||||||
const std::string &nodeName(xmlReader->getNodeName());
|
|
||||||
if (xmlReader->getNodeType() == irr::io::EXN_ELEMENT && nodeName == startTag) {
|
|
||||||
return true;
|
|
||||||
} else if (xmlReader->getNodeType() == irr::io::EXN_ELEMENT_END && nodeName == startTag) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ReadToEndElement(const std::string &closeTag) {
|
|
||||||
while (xmlReader->read()) {
|
|
||||||
const std::string &nodeName(xmlReader->getNodeName());
|
|
||||||
if (xmlReader->getNodeType() == irr::io::EXN_ELEMENT) {
|
|
||||||
return true;
|
|
||||||
} else if (xmlReader->getNodeType() == irr::io::EXN_ELEMENT_END && nodeName == closeTag) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ASSIMP_LOG_ERROR("unexpected EOF, expected closing <" + closeTag + "> tag");
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
struct MetaEntry {
|
|
||||||
std::string name;
|
|
||||||
std::string value;
|
|
||||||
};
|
|
||||||
std::vector<MetaEntry> mMetaData;
|
|
||||||
std::vector<aiMesh *> mMeshes;
|
|
||||||
MatArray mMatArray;
|
|
||||||
unsigned int mActiveMatGroup;
|
|
||||||
MatId2MatArray mMatId2MatArray;
|
|
||||||
XmlReader *xmlReader;
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace D3MF
|
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
|
||||||
"3mf Importer",
|
"3mf Importer",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -430,34 +81,20 @@ static const aiImporterDesc desc = {
|
||||||
"3mf"
|
"3mf"
|
||||||
};
|
};
|
||||||
|
|
||||||
D3MFImporter::D3MFImporter() :
|
bool D3MFImporter::CanRead(const std::string &filename, IOSystem *pIOHandler, bool ) const {
|
||||||
BaseImporter() {
|
if (!ZipArchiveIOSystem::isZipArchive(pIOHandler, filename)) {
|
||||||
// empty
|
return false;
|
||||||
}
|
}
|
||||||
|
static const char *const ModelRef = "3D/3dmodel.model";
|
||||||
D3MFImporter::~D3MFImporter() {
|
ZipArchiveIOSystem archive(pIOHandler, filename);
|
||||||
// empty
|
if (!archive.Exists(ModelRef)) {
|
||||||
}
|
return false;
|
||||||
|
|
||||||
bool D3MFImporter::CanRead(const std::string &filename, IOSystem *pIOHandler, bool checkSig) const {
|
|
||||||
const std::string extension(GetExtension(filename));
|
|
||||||
if (extension == desc.mFileExtensions) {
|
|
||||||
return true;
|
|
||||||
} else if (!extension.length() || checkSig) {
|
|
||||||
if (nullptr == pIOHandler) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!ZipArchiveIOSystem::isZipArchive(pIOHandler, filename)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
D3MF::D3MFOpcPackage opcPackage(pIOHandler, filename);
|
|
||||||
return opcPackage.validate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFImporter::SetupProperties(const Importer * /*pImp*/) {
|
void D3MFImporter::SetupProperties(const Importer*) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,14 +103,22 @@ const aiImporterDesc *D3MFImporter::GetInfo() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3MFImporter::InternReadFile(const std::string &filename, aiScene *pScene, IOSystem *pIOHandler) {
|
void D3MFImporter::InternReadFile(const std::string &filename, aiScene *pScene, IOSystem *pIOHandler) {
|
||||||
D3MF::D3MFOpcPackage opcPackage(pIOHandler, filename);
|
D3MFOpcPackage opcPackage(pIOHandler, filename);
|
||||||
|
|
||||||
std::unique_ptr<CIrrXML_IOStreamReader> xmlStream(new CIrrXML_IOStreamReader(opcPackage.RootStream()));
|
XmlParser xmlParser;
|
||||||
std::unique_ptr<D3MF::XmlReader> xmlReader(irr::io::createIrrXMLReader(xmlStream.get()));
|
if (xmlParser.parse(opcPackage.RootStream())) {
|
||||||
|
XmlSerializer xmlSerializer(&xmlParser);
|
||||||
|
xmlSerializer.ImportXml(pScene);
|
||||||
|
|
||||||
D3MF::XmlSerializer xmlSerializer(xmlReader.get());
|
const std::vector<aiTexture*> &tex = opcPackage.GetEmbeddedTextures();
|
||||||
|
if (!tex.empty()) {
|
||||||
xmlSerializer.ImportXml(pScene);
|
pScene->mNumTextures = static_cast<unsigned int>(tex.size());
|
||||||
|
pScene->mTextures = new aiTexture *[pScene->mNumTextures];
|
||||||
|
for (unsigned int i = 0; i < pScene->mNumTextures; ++i) {
|
||||||
|
pScene->mTextures[i] = tex[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,23 +42,50 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef AI_D3MFLOADER_H_INCLUDED
|
#ifndef AI_D3MFLOADER_H_INCLUDED
|
||||||
#define AI_D3MFLOADER_H_INCLUDED
|
#define AI_D3MFLOADER_H_INCLUDED
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
||||||
|
|
||||||
#include <assimp/BaseImporter.h>
|
#include <assimp/BaseImporter.h>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
/// @brief The 3MF-importer class.
|
||||||
|
///
|
||||||
|
/// Implements the basic topology import and embedded textures.
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
class D3MFImporter : public BaseImporter {
|
class D3MFImporter : public BaseImporter {
|
||||||
public:
|
public:
|
||||||
// BaseImporter interface
|
/// @brief The default class constructor.
|
||||||
D3MFImporter();
|
D3MFImporter() = default;
|
||||||
~D3MFImporter();
|
|
||||||
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const;
|
/// @brief The class destructor.
|
||||||
void SetupProperties(const Importer *pImp);
|
~D3MFImporter() override = default;
|
||||||
const aiImporterDesc *GetInfo() const;
|
|
||||||
|
/// @brief Performs the data format detection.
|
||||||
|
/// @param pFile The filename to check.
|
||||||
|
/// @param pIOHandler The used IO-System.
|
||||||
|
/// @param checkSig true for signature checking.
|
||||||
|
/// @return true for can be loaded, false for not.
|
||||||
|
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const override;
|
||||||
|
|
||||||
|
/// @brief Not used
|
||||||
|
/// @param pImp Not used
|
||||||
|
void SetupProperties(const Importer *pImp) override;
|
||||||
|
|
||||||
|
/// @brief The importer description getter.
|
||||||
|
/// @return The info
|
||||||
|
const aiImporterDesc *GetInfo() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler);
|
/// @brief Internal read function, performs the file parsing.
|
||||||
|
/// @param pFile The filename
|
||||||
|
/// @param pScene The scene to load in.
|
||||||
|
/// @param pIOHandler The io-system
|
||||||
|
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
||||||
|
#endif // #ifndef ASSIMP_BUILD_NO_3MF_IMPORTER
|
||||||
|
|
||||||
#endif // AI_D3MFLOADER_H_INCLUDED
|
#endif // AI_D3MFLOADER_H_INCLUDED
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -44,106 +43,122 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "D3MFOpcPackage.h"
|
#include "D3MFOpcPackage.h"
|
||||||
#include <assimp/Exceptional.h>
|
#include <assimp/Exceptional.h>
|
||||||
|
#include <assimp/XmlParser.h>
|
||||||
|
#include <assimp/ZipArchiveIOSystem.h>
|
||||||
|
#include <assimp/ai_assert.h>
|
||||||
|
#include <assimp/DefaultLogger.hpp>
|
||||||
#include <assimp/IOStream.hpp>
|
#include <assimp/IOStream.hpp>
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <assimp/DefaultLogger.hpp>
|
#include <assimp/texture.h>
|
||||||
#include <assimp/ai_assert.h>
|
#include "3MFXmlTags.h"
|
||||||
#include <assimp/ZipArchiveIOSystem.h>
|
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "3MFXmlTags.h"
|
#include <cstdlib>
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
namespace D3MF {
|
namespace D3MF {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
typedef std::shared_ptr<OpcPackageRelationship> OpcPackageRelationshipPtr;
|
using OpcPackageRelationshipPtr = std::shared_ptr<OpcPackageRelationship>;
|
||||||
|
|
||||||
class OpcPackageRelationshipReader {
|
class OpcPackageRelationshipReader {
|
||||||
public:
|
public:
|
||||||
OpcPackageRelationshipReader(XmlReader* xmlReader) {
|
OpcPackageRelationshipReader(XmlParser &parser) :
|
||||||
while(xmlReader->read()) {
|
mRelations() {
|
||||||
if(xmlReader->getNodeType() == irr::io::EXN_ELEMENT &&
|
XmlNode root = parser.getRootNode();
|
||||||
xmlReader->getNodeName() == XmlTag::RELS_RELATIONSHIP_CONTAINER)
|
ParseRootNode(root);
|
||||||
{
|
}
|
||||||
ParseRootNode(xmlReader);
|
|
||||||
|
void ParseRootNode(XmlNode &node) {
|
||||||
|
ParseAttributes(node);
|
||||||
|
for (XmlNode currentNode = node.first_child(); currentNode; currentNode = currentNode.next_sibling()) {
|
||||||
|
std::string name = currentNode.name();
|
||||||
|
if (name == "Relationships") {
|
||||||
|
ParseRelationsNode(currentNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParseRootNode(XmlReader* xmlReader)
|
void ParseAttributes(XmlNode & /*node*/) {
|
||||||
{
|
|
||||||
ParseAttributes(xmlReader);
|
|
||||||
|
|
||||||
while(xmlReader->read())
|
|
||||||
{
|
|
||||||
if(xmlReader->getNodeType() == irr::io::EXN_ELEMENT &&
|
|
||||||
xmlReader->getNodeName() == XmlTag::RELS_RELATIONSHIP_NODE)
|
|
||||||
{
|
|
||||||
ParseChildNode(xmlReader);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ParseAttributes(XmlReader*) {
|
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
bool validateRels( OpcPackageRelationshipPtr &relPtr ) {
|
bool validateRels(OpcPackageRelationshipPtr &relPtr) {
|
||||||
if ( relPtr->id.empty() || relPtr->type.empty() || relPtr->target.empty() ) {
|
if (relPtr->id.empty() || relPtr->type.empty() || relPtr->target.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ParseRelationsNode(XmlNode &node) {
|
||||||
|
if (node.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (XmlNode currentNode = node.first_child(); currentNode; currentNode = currentNode.next_sibling()) {
|
||||||
|
const std::string name = currentNode.name();
|
||||||
|
if (name == "Relationship") {
|
||||||
|
OpcPackageRelationshipPtr relPtr(new OpcPackageRelationship());
|
||||||
|
relPtr->id = currentNode.attribute(XmlTag::RELS_ATTRIB_ID).as_string();
|
||||||
|
relPtr->type = currentNode.attribute(XmlTag::RELS_ATTRIB_TYPE).as_string();
|
||||||
|
relPtr->target = currentNode.attribute(XmlTag::RELS_ATTRIB_TARGET).as_string();
|
||||||
|
if (validateRels(relPtr)) {
|
||||||
|
mRelations.push_back(relPtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<OpcPackageRelationshipPtr> mRelations;
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool IsEmbeddedTexture( const std::string &filename ) {
|
||||||
|
const std::string extension = BaseImporter::GetExtension(filename);
|
||||||
|
if (extension == "jpg" || extension == "png" || extension == "jpeg") {
|
||||||
|
std::string::size_type pos = filename.find("thumbnail");
|
||||||
|
if (pos != std::string::npos) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParseChildNode(XmlReader* xmlReader) {
|
return false;
|
||||||
OpcPackageRelationshipPtr relPtr(new OpcPackageRelationship());
|
}
|
||||||
|
|
||||||
relPtr->id = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_ID.c_str());
|
|
||||||
relPtr->type = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_TYPE.c_str());
|
|
||||||
relPtr->target = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_TARGET.c_str());
|
|
||||||
if ( validateRels( relPtr ) ) {
|
|
||||||
m_relationShips.push_back( relPtr );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<OpcPackageRelationshipPtr> m_relationShips;
|
|
||||||
};
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
D3MFOpcPackage::D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile)
|
D3MFOpcPackage::D3MFOpcPackage(IOSystem *pIOHandler, const std::string &rFile) :
|
||||||
: mRootStream(nullptr)
|
mRootStream(nullptr),
|
||||||
, mZipArchive() {
|
mZipArchive() {
|
||||||
mZipArchive.reset( new ZipArchiveIOSystem( pIOHandler, rFile ) );
|
mZipArchive = new ZipArchiveIOSystem(pIOHandler, rFile);
|
||||||
if(!mZipArchive->isOpen()) {
|
if (!mZipArchive->isOpen()) {
|
||||||
throw DeadlyImportError("Failed to open file " + rFile+ ".");
|
throw DeadlyImportError("Failed to open file ", rFile, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> fileList;
|
std::vector<std::string> fileList;
|
||||||
mZipArchive->getFileList(fileList);
|
mZipArchive->getFileList(fileList);
|
||||||
|
|
||||||
for (auto& file: fileList) {
|
for (auto &file : fileList) {
|
||||||
if(file == D3MF::XmlTag::ROOT_RELATIONSHIPS_ARCHIVE) {
|
if (file == D3MF::XmlTag::ROOT_RELATIONSHIPS_ARCHIVE) {
|
||||||
//PkgRelationshipReader pkgRelReader(file, archive);
|
if (!mZipArchive->Exists(file.c_str())) {
|
||||||
ai_assert(mZipArchive->Exists(file.c_str()));
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
IOStream *fileStream = mZipArchive->Open(file.c_str());
|
IOStream *fileStream = mZipArchive->Open(file.c_str());
|
||||||
|
if (nullptr == fileStream) {
|
||||||
ai_assert(fileStream != nullptr);
|
ASSIMP_LOG_ERROR("Filestream is nullptr.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
std::string rootFile = ReadPackageRootRelationship(fileStream);
|
std::string rootFile = ReadPackageRootRelationship(fileStream);
|
||||||
if ( rootFile.size() > 0 && rootFile[ 0 ] == '/' ) {
|
if (!rootFile.empty() && rootFile[0] == '/') {
|
||||||
rootFile = rootFile.substr( 1 );
|
rootFile = rootFile.substr(1);
|
||||||
if ( rootFile[ 0 ] == '/' ) {
|
if (rootFile[0] == '/') {
|
||||||
// deal with zip-bug
|
// deal with zip-bug
|
||||||
rootFile = rootFile.substr( 1 );
|
rootFile = rootFile.substr(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,55 +167,89 @@ D3MFOpcPackage::D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile)
|
||||||
mZipArchive->Close(fileStream);
|
mZipArchive->Close(fileStream);
|
||||||
|
|
||||||
mRootStream = mZipArchive->Open(rootFile.c_str());
|
mRootStream = mZipArchive->Open(rootFile.c_str());
|
||||||
ai_assert( mRootStream != nullptr );
|
ai_assert(mRootStream != nullptr);
|
||||||
if ( nullptr == mRootStream ) {
|
if (nullptr == mRootStream) {
|
||||||
throw DeadlyExportError( "Cannot open root-file in archive : " + rootFile );
|
throw DeadlyImportError("Cannot open root-file in archive : " + rootFile);
|
||||||
}
|
}
|
||||||
|
} else if (file == D3MF::XmlTag::CONTENT_TYPES_ARCHIVE) {
|
||||||
} else if( file == D3MF::XmlTag::CONTENT_TYPES_ARCHIVE) {
|
ASSIMP_LOG_WARN("Ignored file of unsupported type CONTENT_TYPES_ARCHIVES", file);
|
||||||
ASSIMP_LOG_WARN_F("Ignored file of unsupported type CONTENT_TYPES_ARCHIVES",file);
|
} else if (IsEmbeddedTexture(file)) {
|
||||||
|
IOStream *fileStream = mZipArchive->Open(file.c_str());
|
||||||
|
LoadEmbeddedTextures(fileStream, file);
|
||||||
|
mZipArchive->Close(fileStream);
|
||||||
} else {
|
} else {
|
||||||
ASSIMP_LOG_WARN_F("Ignored file of unknown type: ",file);
|
ASSIMP_LOG_WARN("Ignored file of unknown type: ", file);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
D3MFOpcPackage::~D3MFOpcPackage() {
|
D3MFOpcPackage::~D3MFOpcPackage() {
|
||||||
mZipArchive->Close(mRootStream);
|
mZipArchive->Close(mRootStream);
|
||||||
|
delete mZipArchive;
|
||||||
}
|
}
|
||||||
|
|
||||||
IOStream* D3MFOpcPackage::RootStream() const {
|
IOStream *D3MFOpcPackage::RootStream() const {
|
||||||
return mRootStream;
|
return mRootStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const std::string ModelRef = "3D/3dmodel.model";
|
const std::vector<aiTexture *> &D3MFOpcPackage::GetEmbeddedTextures() const {
|
||||||
|
return mEmbeddedTextures;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *const ModelRef = "3D/3dmodel.model";
|
||||||
|
|
||||||
bool D3MFOpcPackage::validate() {
|
bool D3MFOpcPackage::validate() {
|
||||||
if ( nullptr == mRootStream || nullptr == mZipArchive ) {
|
if (nullptr == mRootStream || nullptr == mZipArchive) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mZipArchive->Exists( ModelRef.c_str() );
|
return mZipArchive->Exists(ModelRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string D3MFOpcPackage::ReadPackageRootRelationship(IOStream* stream) {
|
std::string D3MFOpcPackage::ReadPackageRootRelationship(IOStream *stream) {
|
||||||
std::unique_ptr<CIrrXML_IOStreamReader> xmlStream(new CIrrXML_IOStreamReader(stream));
|
XmlParser xmlParser;
|
||||||
std::unique_ptr<XmlReader> xml(irr::io::createIrrXMLReader(xmlStream.get()));
|
if (!xmlParser.parse(stream)) {
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
OpcPackageRelationshipReader reader(xml.get());
|
OpcPackageRelationshipReader reader(xmlParser);
|
||||||
|
|
||||||
auto itr = std::find_if(reader.m_relationShips.begin(), reader.m_relationShips.end(), [](const OpcPackageRelationshipPtr& rel){
|
auto itr = std::find_if(reader.mRelations.begin(), reader.mRelations.end(), [](const OpcPackageRelationshipPtr &rel) {
|
||||||
return rel->type == XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE;
|
return rel->type == XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE;
|
||||||
});
|
});
|
||||||
|
|
||||||
if ( itr == reader.m_relationShips.end() ) {
|
if (itr == reader.mRelations.end()) {
|
||||||
throw DeadlyImportError( "Cannot find " + XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE );
|
throw DeadlyImportError("Cannot find ", XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (*itr)->target;
|
return (*itr)->target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void D3MFOpcPackage::LoadEmbeddedTextures(IOStream *fileStream, const std::string &filename) {
|
||||||
|
if (nullptr == fileStream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const size_t size = fileStream->FileSize();
|
||||||
|
if (0 == size) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char *data = new unsigned char[size];
|
||||||
|
fileStream->Read(data, 1, size);
|
||||||
|
aiTexture *texture = new aiTexture;
|
||||||
|
std::string embName = "*" + filename;
|
||||||
|
texture->mFilename.Set(embName.c_str());
|
||||||
|
texture->mWidth = static_cast<unsigned int>(size);
|
||||||
|
texture->mHeight = 0;
|
||||||
|
texture->achFormatHint[0] = 'p';
|
||||||
|
texture->achFormatHint[1] = 'n';
|
||||||
|
texture->achFormatHint[2] = 'g';
|
||||||
|
texture->achFormatHint[3] = '\0';
|
||||||
|
texture->pcData = (aiTexel*) data;
|
||||||
|
mEmbeddedTextures.emplace_back(texture);
|
||||||
|
}
|
||||||
|
|
||||||
} // Namespace D3MF
|
} // Namespace D3MF
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,19 +42,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef D3MFOPCPACKAGE_H
|
#ifndef D3MFOPCPACKAGE_H
|
||||||
#define D3MFOPCPACKAGE_H
|
#define D3MFOPCPACKAGE_H
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <assimp/irrXMLWrapper.h>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
struct aiTexture;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
class ZipArchiveIOSystem;
|
|
||||||
|
class ZipArchiveIOSystem;
|
||||||
|
|
||||||
namespace D3MF {
|
namespace D3MF {
|
||||||
|
|
||||||
using XmlReader = irr::io::IrrXMLReader ;
|
|
||||||
using XmlReaderPtr = std::shared_ptr<XmlReader> ;
|
|
||||||
|
|
||||||
struct OpcPackageRelationship {
|
struct OpcPackageRelationship {
|
||||||
std::string id;
|
std::string id;
|
||||||
std::string type;
|
std::string type;
|
||||||
|
@ -64,20 +62,23 @@ struct OpcPackageRelationship {
|
||||||
|
|
||||||
class D3MFOpcPackage {
|
class D3MFOpcPackage {
|
||||||
public:
|
public:
|
||||||
D3MFOpcPackage( IOSystem* pIOHandler, const std::string& rFile );
|
D3MFOpcPackage( IOSystem* pIOHandler, const std::string& file );
|
||||||
~D3MFOpcPackage();
|
~D3MFOpcPackage();
|
||||||
IOStream* RootStream() const;
|
IOStream* RootStream() const;
|
||||||
bool validate();
|
bool validate();
|
||||||
|
const std::vector<aiTexture*> &GetEmbeddedTextures() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string ReadPackageRootRelationship(IOStream* stream);
|
std::string ReadPackageRootRelationship(IOStream* stream);
|
||||||
|
void LoadEmbeddedTextures(IOStream *fileStream, const std::string &filename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IOStream* mRootStream;
|
IOStream* mRootStream;
|
||||||
std::unique_ptr<ZipArchiveIOSystem> mZipArchive;
|
ZipArchiveIOSystem *mZipArchive;
|
||||||
|
std::vector<aiTexture *> mEmbeddedTextures;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace D3MF
|
} // namespace D3MF
|
||||||
} // Namespace Assimp
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // D3MFOPCPACKAGE_H
|
#endif // D3MFOPCPACKAGE_H
|
||||||
|
|
|
@ -0,0 +1,724 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (assimp)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the
|
||||||
|
following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the assimp team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the assimp team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#include "XmlSerializer.h"
|
||||||
|
#include "D3MFOpcPackage.h"
|
||||||
|
#include "3MFXmlTags.h"
|
||||||
|
#include "3MFTypes.h"
|
||||||
|
#include <assimp/scene.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
namespace D3MF {
|
||||||
|
|
||||||
|
static constexpr int IdNotSet = -1;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
static constexpr size_t ColRGBA_Len = 9;
|
||||||
|
static constexpr size_t ColRGB_Len = 7;
|
||||||
|
|
||||||
|
// format of the color string: #RRGGBBAA or #RRGGBB (3MF Core chapter 5.1.1)
|
||||||
|
bool validateColorString(const std::string color) {
|
||||||
|
const size_t len = color.size();
|
||||||
|
if (ColRGBA_Len != len && ColRGB_Len != len) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
aiFace ReadTriangle(XmlNode &node, int &texId0, int &texId1, int &texId2) {
|
||||||
|
aiFace face;
|
||||||
|
|
||||||
|
face.mNumIndices = 3;
|
||||||
|
face.mIndices = new unsigned int[face.mNumIndices];
|
||||||
|
face.mIndices[0] = static_cast<unsigned int>(std::atoi(node.attribute(XmlTag::v1).as_string()));
|
||||||
|
face.mIndices[1] = static_cast<unsigned int>(std::atoi(node.attribute(XmlTag::v2).as_string()));
|
||||||
|
face.mIndices[2] = static_cast<unsigned int>(std::atoi(node.attribute(XmlTag::v3).as_string()));
|
||||||
|
|
||||||
|
texId0 = texId1 = texId2 = IdNotSet;
|
||||||
|
XmlParser::getIntAttribute(node, XmlTag::p1, texId0);
|
||||||
|
XmlParser::getIntAttribute(node, XmlTag::p2, texId1);
|
||||||
|
XmlParser::getIntAttribute(node, XmlTag::p3, texId2);
|
||||||
|
|
||||||
|
return face;
|
||||||
|
}
|
||||||
|
|
||||||
|
aiVector3D ReadVertex(XmlNode &node) {
|
||||||
|
aiVector3D vertex;
|
||||||
|
vertex.x = ai_strtof(node.attribute(XmlTag::x).as_string(), nullptr);
|
||||||
|
vertex.y = ai_strtof(node.attribute(XmlTag::y).as_string(), nullptr);
|
||||||
|
vertex.z = ai_strtof(node.attribute(XmlTag::z).as_string(), nullptr);
|
||||||
|
|
||||||
|
return vertex;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getNodeAttribute(const XmlNode &node, const std::string &attribute, std::string &value) {
|
||||||
|
pugi::xml_attribute objectAttribute = node.attribute(attribute.c_str());
|
||||||
|
if (!objectAttribute.empty()) {
|
||||||
|
value = objectAttribute.as_string();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getNodeAttribute(const XmlNode &node, const std::string &attribute, int &value) {
|
||||||
|
std::string strValue;
|
||||||
|
const bool ret = getNodeAttribute(node, attribute, strValue);
|
||||||
|
if (ret) {
|
||||||
|
value = std::atoi(strValue.c_str());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
aiMatrix4x4 parseTransformMatrix(const std::string& matrixStr) {
|
||||||
|
// split the string
|
||||||
|
std::vector<float> numbers;
|
||||||
|
std::string currentNumber;
|
||||||
|
for (char c : matrixStr) {
|
||||||
|
if (c == ' ') {
|
||||||
|
if (!currentNumber.empty()) {
|
||||||
|
float f = std::stof(currentNumber);
|
||||||
|
numbers.push_back(f);
|
||||||
|
currentNumber.clear();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentNumber.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!currentNumber.empty()) {
|
||||||
|
const float f = std::stof(currentNumber);
|
||||||
|
numbers.push_back(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
aiMatrix4x4 transformMatrix;
|
||||||
|
transformMatrix.a1 = numbers[0];
|
||||||
|
transformMatrix.b1 = numbers[1];
|
||||||
|
transformMatrix.c1 = numbers[2];
|
||||||
|
transformMatrix.d1 = 0;
|
||||||
|
|
||||||
|
transformMatrix.a2 = numbers[3];
|
||||||
|
transformMatrix.b2 = numbers[4];
|
||||||
|
transformMatrix.c2 = numbers[5];
|
||||||
|
transformMatrix.d2 = 0;
|
||||||
|
|
||||||
|
transformMatrix.a3 = numbers[6];
|
||||||
|
transformMatrix.b3 = numbers[7];
|
||||||
|
transformMatrix.c3 = numbers[8];
|
||||||
|
transformMatrix.d3 = 0;
|
||||||
|
|
||||||
|
transformMatrix.a4 = numbers[9];
|
||||||
|
transformMatrix.b4 = numbers[10];
|
||||||
|
transformMatrix.c4 = numbers[11];
|
||||||
|
transformMatrix.d4 = 1;
|
||||||
|
|
||||||
|
return transformMatrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool parseColor(const std::string &color, aiColor4D &diffuse) {
|
||||||
|
if (color.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!validateColorString(color)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('#' != color[0]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
char r[3] = { color[1], color[2], '\0' };
|
||||||
|
diffuse.r = static_cast<ai_real>(strtol(r, nullptr, 16)) / ai_real(255.0);
|
||||||
|
|
||||||
|
char g[3] = { color[3], color[4], '\0' };
|
||||||
|
diffuse.g = static_cast<ai_real>(strtol(g, nullptr, 16)) / ai_real(255.0);
|
||||||
|
|
||||||
|
char b[3] = { color[5], color[6], '\0' };
|
||||||
|
diffuse.b = static_cast<ai_real>(strtol(b, nullptr, 16)) / ai_real(255.0);
|
||||||
|
const size_t len = color.size();
|
||||||
|
if (ColRGB_Len == len) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
char a[3] = { color[7], color[8], '\0' };
|
||||||
|
diffuse.a = static_cast<ai_real>(strtol(a, nullptr, 16)) / ai_real(255.0);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void assignDiffuseColor(XmlNode &node, aiMaterial *mat) {
|
||||||
|
const char *color = node.attribute(XmlTag::basematerials_displaycolor).as_string();
|
||||||
|
aiColor4D diffuse;
|
||||||
|
if (parseColor(color, diffuse)) {
|
||||||
|
mat->AddProperty<aiColor4D>(&diffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
XmlSerializer::XmlSerializer(XmlParser *xmlParser) :
|
||||||
|
mResourcesDictionnary(),
|
||||||
|
mMeshCount(0),
|
||||||
|
mXmlParser(xmlParser) {
|
||||||
|
ai_assert(nullptr != xmlParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlSerializer::~XmlSerializer() {
|
||||||
|
for (auto &it : mResourcesDictionnary) {
|
||||||
|
delete it.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ImportXml(aiScene *scene) {
|
||||||
|
if (nullptr == scene) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scene->mRootNode = new aiNode(XmlTag::RootTag);
|
||||||
|
XmlNode node = mXmlParser->getRootNode().child(XmlTag::model);
|
||||||
|
if (node.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlNode resNode = node.child(XmlTag::resources);
|
||||||
|
for (auto ¤tNode : resNode.children()) {
|
||||||
|
const std::string currentNodeName = currentNode.name();
|
||||||
|
if (currentNodeName == XmlTag::texture_2d) {
|
||||||
|
ReadEmbeddecTexture(currentNode);
|
||||||
|
} else if (currentNodeName == XmlTag::texture_group) {
|
||||||
|
ReadTextureGroup(currentNode);
|
||||||
|
} else if (currentNodeName == XmlTag::object) {
|
||||||
|
ReadObject(currentNode);
|
||||||
|
} else if (currentNodeName == XmlTag::basematerials) {
|
||||||
|
ReadBaseMaterials(currentNode);
|
||||||
|
} else if (currentNodeName == XmlTag::meta) {
|
||||||
|
ReadMetadata(currentNode);
|
||||||
|
} else if (currentNodeName == XmlTag::colorgroup) {
|
||||||
|
ReadColorGroup(currentNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StoreMaterialsInScene(scene);
|
||||||
|
XmlNode buildNode = node.child(XmlTag::build);
|
||||||
|
if (buildNode.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto ¤tNode : buildNode.children()) {
|
||||||
|
const std::string currentNodeName = currentNode.name();
|
||||||
|
if (currentNodeName == XmlTag::item) {
|
||||||
|
int objectId = IdNotSet;
|
||||||
|
std::string transformationMatrixStr;
|
||||||
|
aiMatrix4x4 transformationMatrix;
|
||||||
|
getNodeAttribute(currentNode, D3MF::XmlTag::objectid, objectId);
|
||||||
|
bool hasTransform = getNodeAttribute(currentNode, D3MF::XmlTag::transform, transformationMatrixStr);
|
||||||
|
|
||||||
|
auto it = mResourcesDictionnary.find(objectId);
|
||||||
|
if (it != mResourcesDictionnary.end() && it->second->getType() == ResourceType::RT_Object) {
|
||||||
|
Object *obj = static_cast<Object *>(it->second);
|
||||||
|
if (hasTransform) {
|
||||||
|
transformationMatrix = parseTransformMatrix(transformationMatrixStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
addObjectToNode(scene->mRootNode, obj, transformationMatrix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// import the metadata
|
||||||
|
if (!mMetaData.empty()) {
|
||||||
|
const size_t numMeta = mMetaData.size();
|
||||||
|
scene->mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(numMeta));
|
||||||
|
for (size_t i = 0; i < numMeta; ++i) {
|
||||||
|
aiString val(mMetaData[i].value);
|
||||||
|
scene->mMetaData->Set(static_cast<unsigned int>(i), mMetaData[i].name, val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// import the meshes, materials are already stored
|
||||||
|
scene->mNumMeshes = static_cast<unsigned int>(mMeshCount);
|
||||||
|
if (scene->mNumMeshes != 0) {
|
||||||
|
scene->mMeshes = new aiMesh *[scene->mNumMeshes]();
|
||||||
|
for (auto &it : mResourcesDictionnary) {
|
||||||
|
if (it.second->getType() == ResourceType::RT_Object) {
|
||||||
|
Object *obj = static_cast<Object *>(it.second);
|
||||||
|
ai_assert(nullptr != obj);
|
||||||
|
for (unsigned int i = 0; i < obj->mMeshes.size(); ++i) {
|
||||||
|
scene->mMeshes[obj->mMeshIndex[i]] = obj->mMeshes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::addObjectToNode(aiNode *parent, Object *obj, aiMatrix4x4 nodeTransform) {
|
||||||
|
ai_assert(nullptr != obj);
|
||||||
|
|
||||||
|
aiNode *sceneNode = new aiNode(obj->mName);
|
||||||
|
sceneNode->mNumMeshes = static_cast<unsigned int>(obj->mMeshes.size());
|
||||||
|
sceneNode->mMeshes = new unsigned int[sceneNode->mNumMeshes];
|
||||||
|
std::copy(obj->mMeshIndex.begin(), obj->mMeshIndex.end(), sceneNode->mMeshes);
|
||||||
|
|
||||||
|
sceneNode->mTransformation = nodeTransform;
|
||||||
|
if (nullptr != parent) {
|
||||||
|
parent->addChildren(1, &sceneNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Assimp::D3MF::Component c : obj->mComponents) {
|
||||||
|
auto it = mResourcesDictionnary.find(c.mObjectId);
|
||||||
|
if (it != mResourcesDictionnary.end() && it->second->getType() == ResourceType::RT_Object) {
|
||||||
|
addObjectToNode(sceneNode, static_cast<Object *>(it->second), c.mTransformation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadObject(XmlNode &node) {
|
||||||
|
int id = IdNotSet, pid = IdNotSet, pindex = IdNotSet;
|
||||||
|
bool hasId = getNodeAttribute(node, XmlTag::id, id);
|
||||||
|
if (!hasId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hasPid = getNodeAttribute(node, XmlTag::pid, pid);
|
||||||
|
bool hasPindex = getNodeAttribute(node, XmlTag::pindex, pindex);
|
||||||
|
|
||||||
|
Object *obj = new Object(id);
|
||||||
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == D3MF::XmlTag::mesh) {
|
||||||
|
auto mesh = ReadMesh(currentNode);
|
||||||
|
mesh->mName.Set(ai_to_string(id));
|
||||||
|
|
||||||
|
if (hasPid) {
|
||||||
|
auto it = mResourcesDictionnary.find(pid);
|
||||||
|
if (hasPindex && it != mResourcesDictionnary.end()) {
|
||||||
|
if (it->second->getType() == ResourceType::RT_BaseMaterials) {
|
||||||
|
BaseMaterials *materials = static_cast<BaseMaterials *>(it->second);
|
||||||
|
mesh->mMaterialIndex = materials->mMaterialIndex[pindex];
|
||||||
|
} else if (it->second->getType() == ResourceType::RT_Texture2DGroup) {
|
||||||
|
Texture2DGroup *group = static_cast<Texture2DGroup *>(it->second);
|
||||||
|
if (mesh->mTextureCoords[0] == nullptr) {
|
||||||
|
mesh->mNumUVComponents[0] = 2;
|
||||||
|
for (unsigned int i = 1; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
|
||||||
|
mesh->mNumUVComponents[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string name = ai_to_string(group->mTexId);
|
||||||
|
for (size_t i = 0; i < mMaterials.size(); ++i) {
|
||||||
|
if (name == mMaterials[i]->GetName().C_Str()) {
|
||||||
|
mesh->mMaterialIndex = static_cast<unsigned int>(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
|
||||||
|
for (unsigned int vertex_idx = 0; vertex_idx < mesh->mNumVertices; vertex_idx++) {
|
||||||
|
mesh->mTextureCoords[0][vertex_idx] =
|
||||||
|
aiVector3D(group->mTex2dCoords[pindex].x, group->mTex2dCoords[pindex].y, 0.0f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (unsigned int vertex_idx = 0; vertex_idx < mesh->mNumVertices; vertex_idx++) {
|
||||||
|
if (mesh->mTextureCoords[0][vertex_idx].z < 0) {
|
||||||
|
// use default
|
||||||
|
mesh->mTextureCoords[0][vertex_idx] =
|
||||||
|
aiVector3D(group->mTex2dCoords[pindex].x, group->mTex2dCoords[pindex].y, 0.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if (it->second->getType() == ResourceType::RT_ColorGroup) {
|
||||||
|
if (mesh->mColors[0] == nullptr) {
|
||||||
|
mesh->mColors[0] = new aiColor4D[mesh->mNumVertices];
|
||||||
|
|
||||||
|
ColorGroup *group = static_cast<ColorGroup *>(it->second);
|
||||||
|
for (unsigned int vertex_idx = 0; vertex_idx < mesh->mNumVertices; vertex_idx++) {
|
||||||
|
mesh->mColors[0][vertex_idx] = group->mColors[pindex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
obj->mMeshes.push_back(mesh);
|
||||||
|
obj->mMeshIndex.push_back(mMeshCount);
|
||||||
|
mMeshCount++;
|
||||||
|
} else if (currentName == D3MF::XmlTag::components) {
|
||||||
|
for (XmlNode ¤tSubNode : currentNode.children()) {
|
||||||
|
const std::string subNodeName = currentSubNode.name();
|
||||||
|
if (subNodeName == D3MF::XmlTag::component) {
|
||||||
|
int objectId = IdNotSet;
|
||||||
|
std::string componentTransformStr;
|
||||||
|
aiMatrix4x4 componentTransform;
|
||||||
|
if (getNodeAttribute(currentSubNode, D3MF::XmlTag::transform, componentTransformStr)) {
|
||||||
|
componentTransform = parseTransformMatrix(componentTransformStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getNodeAttribute(currentSubNode, D3MF::XmlTag::objectid, objectId)) {
|
||||||
|
obj->mComponents.push_back({ objectId, componentTransform });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mResourcesDictionnary.insert(std::make_pair(id, obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
aiMesh *XmlSerializer::ReadMesh(XmlNode &node) {
|
||||||
|
if (node.empty()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
aiMesh *mesh = new aiMesh();
|
||||||
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == XmlTag::vertices) {
|
||||||
|
ImportVertices(currentNode, mesh);
|
||||||
|
} else if (currentName == XmlTag::triangles) {
|
||||||
|
ImportTriangles(currentNode, mesh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadMetadata(XmlNode &node) {
|
||||||
|
pugi::xml_attribute attribute = node.attribute(D3MF::XmlTag::meta_name);
|
||||||
|
const std::string name = attribute.as_string();
|
||||||
|
const std::string value = node.value();
|
||||||
|
if (name.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MetaEntry entry;
|
||||||
|
entry.name = name;
|
||||||
|
entry.value = value;
|
||||||
|
mMetaData.push_back(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ImportVertices(XmlNode &node, aiMesh *mesh) {
|
||||||
|
ai_assert(nullptr != mesh);
|
||||||
|
|
||||||
|
std::vector<aiVector3D> vertices;
|
||||||
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == XmlTag::vertex) {
|
||||||
|
vertices.push_back(ReadVertex(currentNode));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh->mNumVertices = static_cast<unsigned int>(vertices.size());
|
||||||
|
mesh->mVertices = new aiVector3D[mesh->mNumVertices];
|
||||||
|
std::copy(vertices.begin(), vertices.end(), mesh->mVertices);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ImportTriangles(XmlNode &node, aiMesh *mesh) {
|
||||||
|
std::vector<aiFace> faces;
|
||||||
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == XmlTag::triangle) {
|
||||||
|
int pid = IdNotSet;
|
||||||
|
bool hasPid = getNodeAttribute(currentNode, D3MF::XmlTag::pid, pid);
|
||||||
|
|
||||||
|
int pindex[3];
|
||||||
|
aiFace face = ReadTriangle(currentNode, pindex[0], pindex[1], pindex[2]);
|
||||||
|
if (hasPid && (pindex[0] != IdNotSet || pindex[1] != IdNotSet || pindex[2] != IdNotSet)) {
|
||||||
|
auto it = mResourcesDictionnary.find(pid);
|
||||||
|
if (it != mResourcesDictionnary.end()) {
|
||||||
|
if (it->second->getType() == ResourceType::RT_BaseMaterials) {
|
||||||
|
BaseMaterials *baseMaterials = static_cast<BaseMaterials *>(it->second);
|
||||||
|
|
||||||
|
auto update_material = [&](int idx) {
|
||||||
|
if (pindex[idx] != IdNotSet) {
|
||||||
|
mesh->mMaterialIndex = baseMaterials->mMaterialIndex[pindex[idx]];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
update_material(0);
|
||||||
|
update_material(1);
|
||||||
|
update_material(2);
|
||||||
|
|
||||||
|
} else if (it->second->getType() == ResourceType::RT_Texture2DGroup) {
|
||||||
|
// Load texture coordinates into mesh, when any
|
||||||
|
Texture2DGroup *group = static_cast<Texture2DGroup *>(it->second); // fix bug
|
||||||
|
if (mesh->mTextureCoords[0] == nullptr) {
|
||||||
|
mesh->mNumUVComponents[0] = 2;
|
||||||
|
for (unsigned int i = 1; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
|
||||||
|
mesh->mNumUVComponents[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string name = ai_to_string(group->mTexId);
|
||||||
|
for (size_t i = 0; i < mMaterials.size(); ++i) {
|
||||||
|
if (name == mMaterials[i]->GetName().C_Str()) {
|
||||||
|
mesh->mMaterialIndex = static_cast<unsigned int>(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
|
||||||
|
for (unsigned int vertex_index = 0; vertex_index < mesh->mNumVertices; vertex_index++) {
|
||||||
|
mesh->mTextureCoords[0][vertex_index].z = IdNotSet;//mark not set
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto update_texture = [&](int idx) {
|
||||||
|
if (pindex[idx] != IdNotSet) {
|
||||||
|
size_t vertex_index = face.mIndices[idx];
|
||||||
|
mesh->mTextureCoords[0][vertex_index] =
|
||||||
|
aiVector3D(group->mTex2dCoords[pindex[idx]].x, group->mTex2dCoords[pindex[idx]].y, 0.0f);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
update_texture(0);
|
||||||
|
update_texture(1);
|
||||||
|
update_texture(2);
|
||||||
|
|
||||||
|
} else if (it->second->getType() == ResourceType::RT_ColorGroup) {
|
||||||
|
// Load vertex color into mesh, when any
|
||||||
|
ColorGroup *group = static_cast<ColorGroup *>(it->second);
|
||||||
|
if (mesh->mColors[0] == nullptr) {
|
||||||
|
mesh->mColors[0] = new aiColor4D[mesh->mNumVertices];
|
||||||
|
}
|
||||||
|
|
||||||
|
auto update_color = [&](int idx) {
|
||||||
|
if (pindex[idx] != IdNotSet) {
|
||||||
|
size_t vertex_index = face.mIndices[idx];
|
||||||
|
mesh->mColors[0][vertex_index] = group->mColors[pindex[idx]];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
update_color(0);
|
||||||
|
update_color(1);
|
||||||
|
update_color(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
faces.push_back(face);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh->mNumFaces = static_cast<unsigned int>(faces.size());
|
||||||
|
mesh->mFaces = new aiFace[mesh->mNumFaces];
|
||||||
|
mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
|
||||||
|
|
||||||
|
std::copy(faces.begin(), faces.end(), mesh->mFaces);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadBaseMaterials(XmlNode &node) {
|
||||||
|
int id = IdNotSet;
|
||||||
|
if (getNodeAttribute(node, D3MF::XmlTag::id, id)) {
|
||||||
|
BaseMaterials *baseMaterials = new BaseMaterials(id);
|
||||||
|
|
||||||
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == XmlTag::basematerials_base) {
|
||||||
|
baseMaterials->mMaterialIndex.push_back(static_cast<unsigned int>(mMaterials.size()));
|
||||||
|
mMaterials.push_back(readMaterialDef(currentNode, id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mResourcesDictionnary.insert(std::make_pair(id, baseMaterials));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadEmbeddecTexture(XmlNode &node) {
|
||||||
|
if (node.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string value;
|
||||||
|
EmbeddedTexture *tex2D = nullptr;
|
||||||
|
if (XmlParser::getStdStrAttribute(node, XmlTag::id, value)) {
|
||||||
|
tex2D = new EmbeddedTexture(atoi(value.c_str()));
|
||||||
|
}
|
||||||
|
if (nullptr == tex2D) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (XmlParser::getStdStrAttribute(node, XmlTag::path, value)) {
|
||||||
|
tex2D->mPath = value;
|
||||||
|
}
|
||||||
|
if (XmlParser::getStdStrAttribute(node, XmlTag::texture_content_type, value)) {
|
||||||
|
tex2D->mContentType = value;
|
||||||
|
}
|
||||||
|
if (XmlParser::getStdStrAttribute(node, XmlTag::texture_tilestyleu, value)) {
|
||||||
|
tex2D->mTilestyleU = value;
|
||||||
|
}
|
||||||
|
if (XmlParser::getStdStrAttribute(node, XmlTag::texture_tilestylev, value)) {
|
||||||
|
tex2D->mTilestyleV = value;
|
||||||
|
}
|
||||||
|
mEmbeddedTextures.emplace_back(tex2D);
|
||||||
|
StoreEmbeddedTexture(tex2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::StoreEmbeddedTexture(EmbeddedTexture *tex) {
|
||||||
|
aiMaterial *mat = new aiMaterial;
|
||||||
|
aiString s;
|
||||||
|
s.Set(ai_to_string(tex->mId).c_str());
|
||||||
|
mat->AddProperty(&s, AI_MATKEY_NAME);
|
||||||
|
const std::string name = "*" + tex->mPath;
|
||||||
|
s.Set(name);
|
||||||
|
mat->AddProperty(&s, AI_MATKEY_TEXTURE_DIFFUSE(0));
|
||||||
|
|
||||||
|
aiColor3D col;
|
||||||
|
mat->AddProperty<aiColor3D>(&col, 1, AI_MATKEY_COLOR_DIFFUSE);
|
||||||
|
mat->AddProperty<aiColor3D>(&col, 1, AI_MATKEY_COLOR_AMBIENT);
|
||||||
|
mat->AddProperty<aiColor3D>(&col, 1, AI_MATKEY_COLOR_EMISSIVE);
|
||||||
|
mat->AddProperty<aiColor3D>(&col, 1, AI_MATKEY_COLOR_SPECULAR);
|
||||||
|
mMaterials.emplace_back(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadTextureCoords2D(XmlNode &node, Texture2DGroup *tex2DGroup) {
|
||||||
|
if (node.empty() || nullptr == tex2DGroup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int id = IdNotSet;
|
||||||
|
if (XmlParser::getIntAttribute(node, "texid", id)) {
|
||||||
|
tex2DGroup->mTexId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
double value = 0.0;
|
||||||
|
for (XmlNode currentNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
aiVector2D texCoord;
|
||||||
|
if (currentName == XmlTag::texture_2d_coord) {
|
||||||
|
XmlParser::getDoubleAttribute(currentNode, XmlTag::texture_cuurd_u, value);
|
||||||
|
texCoord.x = (ai_real)value;
|
||||||
|
XmlParser::getDoubleAttribute(currentNode, XmlTag::texture_cuurd_v, value);
|
||||||
|
texCoord.y = (ai_real)value;
|
||||||
|
tex2DGroup->mTex2dCoords.push_back(texCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadTextureGroup(XmlNode &node) {
|
||||||
|
if (node.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int id = IdNotSet;
|
||||||
|
if (!XmlParser::getIntAttribute(node, XmlTag::id, id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Texture2DGroup *group = new Texture2DGroup(id);
|
||||||
|
ReadTextureCoords2D(node, group);
|
||||||
|
mResourcesDictionnary.insert(std::make_pair(id, group));
|
||||||
|
}
|
||||||
|
|
||||||
|
aiMaterial *XmlSerializer::readMaterialDef(XmlNode &node, unsigned int basematerialsId) {
|
||||||
|
aiMaterial *material = new aiMaterial();
|
||||||
|
material->mNumProperties = 0;
|
||||||
|
std::string name;
|
||||||
|
bool hasName = getNodeAttribute(node, D3MF::XmlTag::basematerials_name, name);
|
||||||
|
|
||||||
|
std::string stdMaterialName;
|
||||||
|
const std::string strId(ai_to_string(basematerialsId));
|
||||||
|
stdMaterialName += "id";
|
||||||
|
stdMaterialName += strId;
|
||||||
|
stdMaterialName += "_";
|
||||||
|
if (hasName) {
|
||||||
|
stdMaterialName += name;
|
||||||
|
} else {
|
||||||
|
stdMaterialName += "basemat_";
|
||||||
|
stdMaterialName += ai_to_string(mMaterials.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
aiString assimpMaterialName(stdMaterialName);
|
||||||
|
material->AddProperty(&assimpMaterialName, AI_MATKEY_NAME);
|
||||||
|
|
||||||
|
assignDiffuseColor(node, material);
|
||||||
|
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadColor(XmlNode &node, ColorGroup *colorGroup) {
|
||||||
|
if (node.empty() || nullptr == colorGroup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (XmlNode currentNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == XmlTag::color_item) {
|
||||||
|
const char *color = currentNode.attribute(XmlTag::color_vaule).as_string();
|
||||||
|
aiColor4D color_value;
|
||||||
|
if (parseColor(color, color_value)) {
|
||||||
|
colorGroup->mColors.push_back(color_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::ReadColorGroup(XmlNode &node) {
|
||||||
|
if (node.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int id = IdNotSet;
|
||||||
|
if (!XmlParser::getIntAttribute(node, XmlTag::id, id)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorGroup *group = new ColorGroup(id);
|
||||||
|
ReadColor(node, group);
|
||||||
|
mResourcesDictionnary.insert(std::make_pair(id, group));
|
||||||
|
}
|
||||||
|
|
||||||
|
void XmlSerializer::StoreMaterialsInScene(aiScene *scene) {
|
||||||
|
if (nullptr == scene) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scene->mNumMaterials = static_cast<unsigned int>(mMaterials.size());
|
||||||
|
if (scene->mNumMaterials == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scene->mMaterials = new aiMaterial *[scene->mNumMaterials];
|
||||||
|
for (size_t i = 0; i < mMaterials.size(); ++i) {
|
||||||
|
scene->mMaterials[i] = mMaterials[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace D3MF
|
||||||
|
} // namespace Assimp
|
|
@ -0,0 +1,99 @@
|
||||||
|
/*
|
||||||
|
Open Asset Import Library (assimp)
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
with or without modification, are permitted provided that the
|
||||||
|
following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the
|
||||||
|
following disclaimer in the documentation and/or other
|
||||||
|
materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the assimp team, nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of the assimp team.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <assimp/XmlParser.h>
|
||||||
|
#include <assimp/mesh.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
struct aiNode;
|
||||||
|
struct aiMesh;
|
||||||
|
struct aiMaterial;
|
||||||
|
|
||||||
|
namespace Assimp {
|
||||||
|
namespace D3MF {
|
||||||
|
|
||||||
|
class Resource;
|
||||||
|
class D3MFOpcPackage;
|
||||||
|
class Object;
|
||||||
|
class Texture2DGroup;
|
||||||
|
class EmbeddedTexture;
|
||||||
|
class ColorGroup;
|
||||||
|
|
||||||
|
class XmlSerializer {
|
||||||
|
public:
|
||||||
|
XmlSerializer(XmlParser *xmlParser);
|
||||||
|
~XmlSerializer();
|
||||||
|
void ImportXml(aiScene *scene);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void addObjectToNode(aiNode *parent, Object *obj, aiMatrix4x4 nodeTransform);
|
||||||
|
void ReadObject(XmlNode &node);
|
||||||
|
aiMesh *ReadMesh(XmlNode &node);
|
||||||
|
void ReadMetadata(XmlNode &node);
|
||||||
|
void ImportVertices(XmlNode &node, aiMesh *mesh);
|
||||||
|
void ImportTriangles(XmlNode &node, aiMesh *mesh);
|
||||||
|
void ReadBaseMaterials(XmlNode &node);
|
||||||
|
void ReadEmbeddecTexture(XmlNode &node);
|
||||||
|
void StoreEmbeddedTexture(EmbeddedTexture *tex);
|
||||||
|
void ReadTextureCoords2D(XmlNode &node, Texture2DGroup *tex2DGroup);
|
||||||
|
void ReadTextureGroup(XmlNode &node);
|
||||||
|
aiMaterial *readMaterialDef(XmlNode &node, unsigned int basematerialsId);
|
||||||
|
void StoreMaterialsInScene(aiScene *scene);
|
||||||
|
void ReadColorGroup(XmlNode &node);
|
||||||
|
void ReadColor(XmlNode &node, ColorGroup *colorGroup);
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct MetaEntry {
|
||||||
|
std::string name;
|
||||||
|
std::string value;
|
||||||
|
};
|
||||||
|
std::vector<MetaEntry> mMetaData;
|
||||||
|
std::vector<EmbeddedTexture *> mEmbeddedTextures;
|
||||||
|
std::vector<aiMaterial *> mMaterials;
|
||||||
|
std::map<unsigned int, Resource *> mResourcesDictionnary;
|
||||||
|
unsigned int mMeshCount;
|
||||||
|
XmlParser *mXmlParser;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace D3MF
|
||||||
|
} // namespace Assimp
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <assimp/Importer.hpp>
|
#include <assimp/Importer.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
static constexpr aiImporterDesc desc = {
|
||||||
"AC3D Importer",
|
"AC3D Importer",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -77,8 +77,8 @@ static const aiImporterDesc desc = {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// skip to the next token
|
// skip to the next token
|
||||||
inline const char *AcSkipToNextToken(const char *buffer) {
|
inline const char *AcSkipToNextToken(const char *buffer, const char *end) {
|
||||||
if (!SkipSpaces(&buffer)) {
|
if (!SkipSpaces(&buffer, end)) {
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL");
|
||||||
}
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
|
@ -86,13 +86,13 @@ inline const char *AcSkipToNextToken(const char *buffer) {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// read a string (may be enclosed in double quotation marks). buffer must point to "
|
// read a string (may be enclosed in double quotation marks). buffer must point to "
|
||||||
inline const char *AcGetString(const char *buffer, std::string &out) {
|
inline const char *AcGetString(const char *buffer, const char *end, std::string &out) {
|
||||||
if (*buffer == '\0') {
|
if (*buffer == '\0') {
|
||||||
throw DeadlyImportError("AC3D: Unexpected EOF in string");
|
throw DeadlyImportError("AC3D: Unexpected EOF in string");
|
||||||
}
|
}
|
||||||
++buffer;
|
++buffer;
|
||||||
const char *sz = buffer;
|
const char *sz = buffer;
|
||||||
while ('\"' != *buffer) {
|
while ('\"' != *buffer && buffer != end) {
|
||||||
if (IsLineEnd(*buffer)) {
|
if (IsLineEnd(*buffer)) {
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL in string");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF/EOL in string");
|
||||||
out = "ERROR";
|
out = "ERROR";
|
||||||
|
@ -112,17 +112,17 @@ inline const char *AcGetString(const char *buffer, std::string &out) {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// read 1 to n floats prefixed with an optional predefined identifier
|
// read 1 to n floats prefixed with an optional predefined identifier
|
||||||
template <class T>
|
template <class T>
|
||||||
inline const char *TAcCheckedLoadFloatArray(const char *buffer, const char *name, size_t name_length, size_t num, T *out) {
|
inline const char *TAcCheckedLoadFloatArray(const char *buffer, const char *end, const char *name, size_t name_length, size_t num, T *out) {
|
||||||
buffer = AcSkipToNextToken(buffer);
|
buffer = AcSkipToNextToken(buffer, end);
|
||||||
if (0 != name_length) {
|
if (0 != name_length) {
|
||||||
if (0 != strncmp(buffer, name, name_length) || !IsSpace(buffer[name_length])) {
|
if (0 != strncmp(buffer, name, name_length) || !IsSpace(buffer[name_length])) {
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpexted token. " + std::string(name) + " was expected.");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected token. ", name, " was expected.");
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
buffer += name_length + 1;
|
buffer += name_length + 1;
|
||||||
}
|
}
|
||||||
for (unsigned int _i = 0; _i < num; ++_i) {
|
for (unsigned int _i = 0; _i < num; ++_i) {
|
||||||
buffer = AcSkipToNextToken(buffer);
|
buffer = AcSkipToNextToken(buffer, end);
|
||||||
buffer = fast_atoreal_move<float>(buffer, ((float *)out)[_i]);
|
buffer = fast_atoreal_move<float>(buffer, ((float *)out)[_i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ inline const char *TAcCheckedLoadFloatArray(const char *buffer, const char *name
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
AC3DImporter::AC3DImporter() :
|
AC3DImporter::AC3DImporter() :
|
||||||
buffer(),
|
mBuffer(),
|
||||||
configSplitBFCull(),
|
configSplitBFCull(),
|
||||||
configEvalSubdivision(),
|
configEvalSubdivision(),
|
||||||
mNumMeshes(),
|
mNumMeshes(),
|
||||||
|
@ -146,24 +146,13 @@ AC3DImporter::AC3DImporter() :
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Destructor, private as well
|
// Destructor, private as well
|
||||||
AC3DImporter::~AC3DImporter() {
|
AC3DImporter::~AC3DImporter() = default;
|
||||||
// nothing to be done here
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Returns whether the class can handle the format of the given file.
|
// Returns whether the class can handle the format of the given file.
|
||||||
bool AC3DImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const {
|
bool AC3DImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
||||||
std::string extension = GetExtension(pFile);
|
static const uint32_t tokens[] = { AI_MAKE_MAGIC("AC3D") };
|
||||||
|
return CheckMagicToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
|
||||||
// fixme: are acc and ac3d *really* used? Some sources say they are
|
|
||||||
if (extension == "ac" || extension == "ac3d" || extension == "acc") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!extension.length() || checkSig) {
|
|
||||||
uint32_t token = AI_MAKE_MAGIC("AC3D");
|
|
||||||
return CheckMagicToken(pIOHandler, pFile, &token, 1, 0);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -175,25 +164,25 @@ const aiImporterDesc *AC3DImporter::GetInfo() const {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a pointer to the next line from the file
|
// Get a pointer to the next line from the file
|
||||||
bool AC3DImporter::GetNextLine() {
|
bool AC3DImporter::GetNextLine() {
|
||||||
SkipLine(&buffer);
|
SkipLine(&mBuffer.data, mBuffer.end);
|
||||||
return SkipSpaces(&buffer);
|
return SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Parse an object section in an AC file
|
// Parse an object section in an AC file
|
||||||
void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
|
bool AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
|
||||||
if (!TokenMatch(buffer, "OBJECT", 6))
|
if (!TokenMatch(mBuffer.data, "OBJECT", 6))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
|
|
||||||
++mNumMeshes;
|
++mNumMeshes;
|
||||||
|
|
||||||
objects.push_back(Object());
|
objects.emplace_back();
|
||||||
Object &obj = objects.back();
|
Object &obj = objects.back();
|
||||||
|
|
||||||
aiLight *light = nullptr;
|
aiLight *light = nullptr;
|
||||||
if (!ASSIMP_strincmp(buffer, "light", 5)) {
|
if (!ASSIMP_strincmp(mBuffer.data, "light", 5)) {
|
||||||
// This is a light source. Add it to the list
|
// This is a light source. Add it to the list
|
||||||
mLights->push_back(light = new aiLight());
|
mLights->push_back(light = new aiLight());
|
||||||
|
|
||||||
|
@ -204,65 +193,71 @@ void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
|
||||||
|
|
||||||
// Generate a default name for both the light source and the node
|
// Generate a default name for both the light source and the node
|
||||||
// FIXME - what's the right way to print a size_t? Is 'zu' universally available? stick with the safe version.
|
// FIXME - what's the right way to print a size_t? Is 'zu' universally available? stick with the safe version.
|
||||||
light->mName.length = ::ai_snprintf(light->mName.data, MAXLEN, "ACLight_%i", static_cast<unsigned int>(mLights->size()) - 1);
|
light->mName.length = ::ai_snprintf(light->mName.data, AI_MAXLEN, "ACLight_%i", static_cast<unsigned int>(mLights->size()) - 1);
|
||||||
obj.name = std::string(light->mName.data);
|
obj.name = std::string(light->mName.data);
|
||||||
|
|
||||||
ASSIMP_LOG_VERBOSE_DEBUG("AC3D: Light source encountered");
|
ASSIMP_LOG_VERBOSE_DEBUG("AC3D: Light source encountered");
|
||||||
obj.type = Object::Light;
|
obj.type = Object::Light;
|
||||||
} else if (!ASSIMP_strincmp(buffer, "group", 5)) {
|
} else if (!ASSIMP_strincmp(mBuffer.data, "group", 5)) {
|
||||||
obj.type = Object::Group;
|
obj.type = Object::Group;
|
||||||
} else if (!ASSIMP_strincmp(buffer, "world", 5)) {
|
} else if (!ASSIMP_strincmp(mBuffer.data, "world", 5)) {
|
||||||
obj.type = Object::World;
|
obj.type = Object::World;
|
||||||
} else
|
} else
|
||||||
obj.type = Object::Poly;
|
obj.type = Object::Poly;
|
||||||
while (GetNextLine()) {
|
while (GetNextLine()) {
|
||||||
if (TokenMatch(buffer, "kids", 4)) {
|
if (TokenMatch(mBuffer.data, "kids", 4)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
unsigned int num = strtoul10(buffer, &buffer);
|
unsigned int num = strtoul10(mBuffer.data, &mBuffer.data);
|
||||||
GetNextLine();
|
GetNextLine();
|
||||||
if (num) {
|
if (num) {
|
||||||
// load the children of this object recursively
|
// load the children of this object recursively
|
||||||
obj.children.reserve(num);
|
obj.children.reserve(num);
|
||||||
for (unsigned int i = 0; i < num; ++i)
|
for (unsigned int i = 0; i < num; ++i) {
|
||||||
LoadObjectSection(obj.children);
|
if (!LoadObjectSection(obj.children)) {
|
||||||
|
ASSIMP_LOG_WARN("AC3D: wrong number of kids");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return true;
|
||||||
} else if (TokenMatch(buffer, "name", 4)) {
|
} else if (TokenMatch(mBuffer.data, "name", 4)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.data);
|
||||||
buffer = AcGetString(buffer, obj.name);
|
mBuffer.data = AcGetString(mBuffer.data, mBuffer.end, obj.name);
|
||||||
|
|
||||||
// If this is a light source, we'll also need to store
|
// If this is a light source, we'll also need to store
|
||||||
// the name of the node in it.
|
// the name of the node in it.
|
||||||
if (light) {
|
if (light) {
|
||||||
light->mName.Set(obj.name);
|
light->mName.Set(obj.name);
|
||||||
}
|
}
|
||||||
} else if (TokenMatch(buffer, "texture", 7)) {
|
} else if (TokenMatch(mBuffer.data, "texture", 7)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
buffer = AcGetString(buffer, obj.texture);
|
std::string texture;
|
||||||
} else if (TokenMatch(buffer, "texrep", 6)) {
|
mBuffer.data = AcGetString(mBuffer.data, mBuffer.end, texture);
|
||||||
SkipSpaces(&buffer);
|
obj.textures.push_back(texture);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 2, &obj.texRepeat);
|
} else if (TokenMatch(mBuffer.data, "texrep", 6)) {
|
||||||
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "", 0, 2, &obj.texRepeat);
|
||||||
if (!obj.texRepeat.x || !obj.texRepeat.y)
|
if (!obj.texRepeat.x || !obj.texRepeat.y)
|
||||||
obj.texRepeat = aiVector2D(1.f, 1.f);
|
obj.texRepeat = aiVector2D(1.f, 1.f);
|
||||||
} else if (TokenMatch(buffer, "texoff", 6)) {
|
} else if (TokenMatch(mBuffer.data, "texoff", 6)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 2, &obj.texOffset);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "", 0, 2, &obj.texOffset);
|
||||||
} else if (TokenMatch(buffer, "rot", 3)) {
|
} else if (TokenMatch(mBuffer.data, "rot", 3)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 9, &obj.rotation);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "", 0, 9, &obj.rotation);
|
||||||
} else if (TokenMatch(buffer, "loc", 3)) {
|
} else if (TokenMatch(mBuffer.data, "loc", 3)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 3, &obj.translation);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "", 0, 3, &obj.translation);
|
||||||
} else if (TokenMatch(buffer, "subdiv", 6)) {
|
} else if (TokenMatch(mBuffer.data, "subdiv", 6)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
obj.subDiv = strtoul10(buffer, &buffer);
|
obj.subDiv = strtoul10(mBuffer.data, &mBuffer.data);
|
||||||
} else if (TokenMatch(buffer, "crease", 6)) {
|
} else if (TokenMatch(mBuffer.data, "crease", 6)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
obj.crease = fast_atof(buffer);
|
obj.crease = fast_atof(mBuffer.data);
|
||||||
} else if (TokenMatch(buffer, "numvert", 7)) {
|
} else if (TokenMatch(mBuffer.data, "numvert", 7)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
|
|
||||||
unsigned int t = strtoul10(buffer, &buffer);
|
unsigned int t = strtoul10(mBuffer.data, &mBuffer.data);
|
||||||
if (t >= AI_MAX_ALLOC(aiVector3D)) {
|
if (t >= AI_MAX_ALLOC(aiVector3D)) {
|
||||||
throw DeadlyImportError("AC3D: Too many vertices, would run out of memory");
|
throw DeadlyImportError("AC3D: Too many vertices, would run out of memory");
|
||||||
}
|
}
|
||||||
|
@ -271,59 +266,59 @@ void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
|
||||||
if (!GetNextLine()) {
|
if (!GetNextLine()) {
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: not all vertices have been parsed yet");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: not all vertices have been parsed yet");
|
||||||
break;
|
break;
|
||||||
} else if (!IsNumeric(*buffer)) {
|
} else if (!IsNumeric(*mBuffer.data)) {
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpected token: not all vertices have been parsed yet");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected token: not all vertices have been parsed yet");
|
||||||
--buffer; // make sure the line is processed a second time
|
--mBuffer.data; // make sure the line is processed a second time
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
obj.vertices.push_back(aiVector3D());
|
obj.vertices.emplace_back();
|
||||||
aiVector3D &v = obj.vertices.back();
|
aiVector3D &v = obj.vertices.back();
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 3, &v.x);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "", 0, 3, &v.x);
|
||||||
}
|
}
|
||||||
} else if (TokenMatch(buffer, "numsurf", 7)) {
|
} else if (TokenMatch(mBuffer.data, "numsurf", 7)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
|
|
||||||
bool Q3DWorkAround = false;
|
bool Q3DWorkAround = false;
|
||||||
|
|
||||||
const unsigned int t = strtoul10(buffer, &buffer);
|
const unsigned int t = strtoul10(mBuffer.data, &mBuffer.data);
|
||||||
obj.surfaces.reserve(t);
|
obj.surfaces.reserve(t);
|
||||||
for (unsigned int i = 0; i < t; ++i) {
|
for (unsigned int i = 0; i < t; ++i) {
|
||||||
GetNextLine();
|
GetNextLine();
|
||||||
if (!TokenMatch(buffer, "SURF", 4)) {
|
if (!TokenMatch(mBuffer.data, "SURF", 4)) {
|
||||||
// FIX: this can occur for some files - Quick 3D for
|
// FIX: this can occur for some files - Quick 3D for
|
||||||
// example writes no surf chunks
|
// example writes no surf chunks
|
||||||
if (!Q3DWorkAround) {
|
if (!Q3DWorkAround) {
|
||||||
ASSIMP_LOG_WARN("AC3D: SURF token was expected");
|
ASSIMP_LOG_WARN("AC3D: SURF token was expected");
|
||||||
ASSIMP_LOG_VERBOSE_DEBUG("Continuing with Quick3D Workaround enabled");
|
ASSIMP_LOG_VERBOSE_DEBUG("Continuing with Quick3D Workaround enabled");
|
||||||
}
|
}
|
||||||
--buffer; // make sure the line is processed a second time
|
--mBuffer.data; // make sure the line is processed a second time
|
||||||
// break; --- see fix notes above
|
// break; --- see fix notes above
|
||||||
|
|
||||||
Q3DWorkAround = true;
|
Q3DWorkAround = true;
|
||||||
}
|
}
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
obj.surfaces.push_back(Surface());
|
obj.surfaces.emplace_back();
|
||||||
Surface &surf = obj.surfaces.back();
|
Surface &surf = obj.surfaces.back();
|
||||||
surf.flags = strtoul_cppstyle(buffer);
|
surf.flags = strtoul_cppstyle(mBuffer.data);
|
||||||
|
|
||||||
while (1) {
|
while (true) {
|
||||||
if (!GetNextLine()) {
|
if (!GetNextLine()) {
|
||||||
throw DeadlyImportError("AC3D: Unexpected EOF: surface is incomplete");
|
throw DeadlyImportError("AC3D: Unexpected EOF: surface is incomplete");
|
||||||
}
|
}
|
||||||
if (TokenMatch(buffer, "mat", 3)) {
|
if (TokenMatch(mBuffer.data, "mat", 3)) {
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
surf.mat = strtoul10(buffer);
|
surf.mat = strtoul10(mBuffer.data);
|
||||||
} else if (TokenMatch(buffer, "refs", 4)) {
|
} else if (TokenMatch(mBuffer.data, "refs", 4)) {
|
||||||
// --- see fix notes above
|
// --- see fix notes above
|
||||||
if (Q3DWorkAround) {
|
if (Q3DWorkAround) {
|
||||||
if (!surf.entries.empty()) {
|
if (!surf.entries.empty()) {
|
||||||
buffer -= 6;
|
mBuffer.data -= 6;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
const unsigned int m = strtoul10(buffer);
|
const unsigned int m = strtoul10(mBuffer.data);
|
||||||
surf.entries.reserve(m);
|
surf.entries.reserve(m);
|
||||||
|
|
||||||
obj.numRefs += m;
|
obj.numRefs += m;
|
||||||
|
@ -333,15 +328,15 @@ void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: surface references are incomplete");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: surface references are incomplete");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
surf.entries.push_back(Surface::SurfaceEntry());
|
surf.entries.emplace_back();
|
||||||
Surface::SurfaceEntry &entry = surf.entries.back();
|
Surface::SurfaceEntry &entry = surf.entries.back();
|
||||||
|
|
||||||
entry.first = strtoul10(buffer, &buffer);
|
entry.first = strtoul10(mBuffer.data, &mBuffer.data);
|
||||||
SkipSpaces(&buffer);
|
SkipSpaces(&mBuffer.data, mBuffer.end);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "", 0, 2, &entry.second);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "", 0, 2, &entry.second);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
--buffer; // make sure the line is processed a second time
|
--mBuffer.data; // make sure the line is processed a second time
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,6 +344,7 @@ void AC3DImporter::LoadObjectSection(std::vector<Object> &objects) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: \'kids\' line was expected");
|
ASSIMP_LOG_ERROR("AC3D: Unexpected EOF: \'kids\' line was expected");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -362,8 +358,8 @@ void AC3DImporter::ConvertMaterial(const Object &object,
|
||||||
s.Set(matSrc.name);
|
s.Set(matSrc.name);
|
||||||
matDest.AddProperty(&s, AI_MATKEY_NAME);
|
matDest.AddProperty(&s, AI_MATKEY_NAME);
|
||||||
}
|
}
|
||||||
if (object.texture.length()) {
|
if (!object.textures.empty()) {
|
||||||
s.Set(object.texture);
|
s.Set(object.textures[0]);
|
||||||
matDest.AddProperty(&s, AI_MATKEY_TEXTURE_DIFFUSE(0));
|
matDest.AddProperty(&s, AI_MATKEY_TEXTURE_DIFFUSE(0));
|
||||||
|
|
||||||
// UV transformation
|
// UV transformation
|
||||||
|
@ -454,7 +450,7 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
idx = 0;
|
idx = 0;
|
||||||
}
|
}
|
||||||
if ((*it).entries.empty()) {
|
if ((*it).entries.empty()) {
|
||||||
ASSIMP_LOG_WARN("AC3D: surface her zero vertex references");
|
ASSIMP_LOG_WARN("AC3D: surface has zero vertex references");
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate all vertex indices to make sure we won't crash here
|
// validate all vertex indices to make sure we won't crash here
|
||||||
|
@ -471,26 +467,32 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
++node->mNumMeshes;
|
++node->mNumMeshes;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ((*it).flags & 0xf) {
|
switch ((*it).GetType()) {
|
||||||
// closed line
|
case Surface::ClosedLine: // closed line
|
||||||
case 0x1:
|
needMat[idx].first += static_cast<unsigned int>((*it).entries.size());
|
||||||
needMat[idx].first += (unsigned int)(*it).entries.size();
|
needMat[idx].second += static_cast<unsigned int>((*it).entries.size() << 1u);
|
||||||
needMat[idx].second += (unsigned int)(*it).entries.size() << 1u;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// unclosed line
|
// unclosed line
|
||||||
case 0x2:
|
case Surface::OpenLine:
|
||||||
needMat[idx].first += (unsigned int)(*it).entries.size() - 1;
|
needMat[idx].first += static_cast<unsigned int>((*it).entries.size() - 1);
|
||||||
needMat[idx].second += ((unsigned int)(*it).entries.size() - 1) << 1u;
|
needMat[idx].second += static_cast<unsigned int>(((*it).entries.size() - 1) << 1u);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// 0 == polygon, else unknown
|
// triangle strip
|
||||||
default:
|
case Surface::TriangleStrip:
|
||||||
if ((*it).flags & 0xf) {
|
needMat[idx].first += (unsigned int)(*it).entries.size() - 2;
|
||||||
ASSIMP_LOG_WARN("AC3D: The type flag of a surface is unknown");
|
needMat[idx].second += ((unsigned int)(*it).entries.size() - 2) * 3;
|
||||||
(*it).flags &= ~(0xf);
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Coerce unknowns to a polygon and warn
|
||||||
|
ASSIMP_LOG_WARN("AC3D: The type flag of a surface is unknown: ", (*it).flags);
|
||||||
|
(*it).flags &= ~(Surface::Mask);
|
||||||
|
// fallthrough
|
||||||
|
|
||||||
|
// polygon
|
||||||
|
case Surface::Polygon:
|
||||||
// the number of faces increments by one, the number
|
// the number of faces increments by one, the number
|
||||||
// of vertices by surface.numref.
|
// of vertices by surface.numref.
|
||||||
needMat[idx].first++;
|
needMat[idx].first++;
|
||||||
|
@ -536,7 +538,7 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
// allocate UV coordinates, but only if the texture name for the
|
// allocate UV coordinates, but only if the texture name for the
|
||||||
// surface is not empty
|
// surface is not empty
|
||||||
aiVector3D *uv = nullptr;
|
aiVector3D *uv = nullptr;
|
||||||
if (object.texture.length()) {
|
if (!object.textures.empty()) {
|
||||||
uv = mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
|
uv = mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
|
||||||
mesh->mNumUVComponents[0] = 2;
|
mesh->mNumUVComponents[0] = 2;
|
||||||
}
|
}
|
||||||
|
@ -546,8 +548,8 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
const Surface &src = *it;
|
const Surface &src = *it;
|
||||||
|
|
||||||
// closed polygon
|
// closed polygon
|
||||||
unsigned int type = (*it).flags & 0xf;
|
uint8_t type = (*it).GetType();
|
||||||
if (!type) {
|
if (type == Surface::Polygon) {
|
||||||
aiFace &face = *faces++;
|
aiFace &face = *faces++;
|
||||||
face.mNumIndices = (unsigned int)src.entries.size();
|
face.mNumIndices = (unsigned int)src.entries.size();
|
||||||
if (0 != face.mNumIndices) {
|
if (0 != face.mNumIndices) {
|
||||||
|
@ -570,13 +572,62 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (type == Surface::TriangleStrip) {
|
||||||
|
for (unsigned int i = 0; i < (unsigned int)src.entries.size() - 2; ++i) {
|
||||||
|
const Surface::SurfaceEntry &entry1 = src.entries[i];
|
||||||
|
const Surface::SurfaceEntry &entry2 = src.entries[i + 1];
|
||||||
|
const Surface::SurfaceEntry &entry3 = src.entries[i + 2];
|
||||||
|
|
||||||
|
aiFace &face = *faces++;
|
||||||
|
face.mNumIndices = 3;
|
||||||
|
face.mIndices = new unsigned int[face.mNumIndices];
|
||||||
|
face.mIndices[0] = cur++;
|
||||||
|
face.mIndices[1] = cur++;
|
||||||
|
face.mIndices[2] = cur++;
|
||||||
|
if (!(i & 1)) {
|
||||||
|
*vertices++ = object.vertices[entry1.first] + object.translation;
|
||||||
|
if (uv) {
|
||||||
|
uv->x = entry1.second.x;
|
||||||
|
uv->y = entry1.second.y;
|
||||||
|
++uv;
|
||||||
|
}
|
||||||
|
*vertices++ = object.vertices[entry2.first] + object.translation;
|
||||||
|
if (uv) {
|
||||||
|
uv->x = entry2.second.x;
|
||||||
|
uv->y = entry2.second.y;
|
||||||
|
++uv;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*vertices++ = object.vertices[entry2.first] + object.translation;
|
||||||
|
if (uv) {
|
||||||
|
uv->x = entry2.second.x;
|
||||||
|
uv->y = entry2.second.y;
|
||||||
|
++uv;
|
||||||
|
}
|
||||||
|
*vertices++ = object.vertices[entry1.first] + object.translation;
|
||||||
|
if (uv) {
|
||||||
|
uv->x = entry1.second.x;
|
||||||
|
uv->y = entry1.second.y;
|
||||||
|
++uv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (static_cast<unsigned>(vertices - mesh->mVertices) >= mesh->mNumVertices) {
|
||||||
|
throw DeadlyImportError("AC3D: Invalid number of vertices");
|
||||||
|
}
|
||||||
|
*vertices++ = object.vertices[entry3.first] + object.translation;
|
||||||
|
if (uv) {
|
||||||
|
uv->x = entry3.second.x;
|
||||||
|
uv->y = entry3.second.y;
|
||||||
|
++uv;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
it2 = (*it).entries.begin();
|
it2 = (*it).entries.begin();
|
||||||
|
|
||||||
// either a closed or an unclosed line
|
// either a closed or an unclosed line
|
||||||
unsigned int tmp = (unsigned int)(*it).entries.size();
|
unsigned int tmp = (unsigned int)(*it).entries.size();
|
||||||
if (0x2 == type) --tmp;
|
if (Surface::OpenLine == type) --tmp;
|
||||||
for (unsigned int m = 0; m < tmp; ++m) {
|
for (unsigned int m = 0; m < tmp; ++m) {
|
||||||
aiFace &face = *faces++;
|
aiFace &face = *faces++;
|
||||||
|
|
||||||
|
@ -599,7 +650,7 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
++uv;
|
++uv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0x1 == type && tmp - 1 == m) {
|
if (Surface::ClosedLine == type && tmp - 1 == m) {
|
||||||
// if this is a closed line repeat its beginning now
|
// if this is a closed line repeat its beginning now
|
||||||
it2 = (*it).entries.begin();
|
it2 = (*it).entries.begin();
|
||||||
} else
|
} else
|
||||||
|
@ -625,15 +676,15 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
if (object.subDiv) {
|
if (object.subDiv) {
|
||||||
if (configEvalSubdivision) {
|
if (configEvalSubdivision) {
|
||||||
std::unique_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
|
std::unique_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
|
||||||
ASSIMP_LOG_INFO("AC3D: Evaluating subdivision surface: " + object.name);
|
ASSIMP_LOG_INFO("AC3D: Evaluating subdivision surface: ", object.name);
|
||||||
|
|
||||||
std::vector<aiMesh *> cpy(meshes.size() - oldm, NULL);
|
std::vector<aiMesh *> cpy(meshes.size() - oldm, nullptr);
|
||||||
div->Subdivide(&meshes[oldm], cpy.size(), &cpy.front(), object.subDiv, true);
|
div->Subdivide(&meshes[oldm], cpy.size(), &cpy.front(), object.subDiv, true);
|
||||||
std::copy(cpy.begin(), cpy.end(), meshes.begin() + oldm);
|
std::copy(cpy.begin(), cpy.end(), meshes.begin() + oldm);
|
||||||
|
|
||||||
// previous meshes are deleted vy Subdivide().
|
// previous meshes are deleted vy Subdivide().
|
||||||
} else {
|
} else {
|
||||||
ASSIMP_LOG_INFO("AC3D: Letting the subdivision surface untouched due to my configuration: " + object.name);
|
ASSIMP_LOG_INFO("AC3D: Letting the subdivision surface untouched due to my configuration: ", object.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -645,18 +696,18 @@ aiNode *AC3DImporter::ConvertObjectSection(Object &object,
|
||||||
// generate a name depending on the type of the node
|
// generate a name depending on the type of the node
|
||||||
switch (object.type) {
|
switch (object.type) {
|
||||||
case Object::Group:
|
case Object::Group:
|
||||||
node->mName.length = ::ai_snprintf(node->mName.data, MAXLEN, "ACGroup_%i", mGroupsCounter++);
|
node->mName.length = ::ai_snprintf(node->mName.data, AI_MAXLEN, "ACGroup_%i", mGroupsCounter++);
|
||||||
break;
|
break;
|
||||||
case Object::Poly:
|
case Object::Poly:
|
||||||
node->mName.length = ::ai_snprintf(node->mName.data, MAXLEN, "ACPoly_%i", mPolysCounter++);
|
node->mName.length = ::ai_snprintf(node->mName.data, AI_MAXLEN, "ACPoly_%i", mPolysCounter++);
|
||||||
break;
|
break;
|
||||||
case Object::Light:
|
case Object::Light:
|
||||||
node->mName.length = ::ai_snprintf(node->mName.data, MAXLEN, "ACLight_%i", mLightsCounter++);
|
node->mName.length = ::ai_snprintf(node->mName.data, AI_MAXLEN, "ACLight_%i", mLightsCounter++);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// there shouldn't be more than one world, but we don't care
|
// there shouldn't be more than one world, but we don't care
|
||||||
case Object::World:
|
case Object::World:
|
||||||
node->mName.length = ::ai_snprintf(node->mName.data, MAXLEN, "ACWorld_%i", mWorldsCounter++);
|
node->mName.length = ::ai_snprintf(node->mName.data, AI_MAXLEN, "ACWorld_%i", mWorldsCounter++);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -696,28 +747,29 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
|
||||||
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
|
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
|
||||||
|
|
||||||
// Check whether we can read from the file
|
// Check whether we can read from the file
|
||||||
if (file.get() == nullptr) {
|
if (file == nullptr) {
|
||||||
throw DeadlyImportError("Failed to open AC3D file " + pFile + ".");
|
throw DeadlyImportError("Failed to open AC3D file ", pFile, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate storage and copy the contents of the file to a memory buffer
|
// allocate storage and copy the contents of the file to a memory buffer
|
||||||
std::vector<char> mBuffer2;
|
std::vector<char> mBuffer2;
|
||||||
TextFileToBuffer(file.get(), mBuffer2);
|
TextFileToBuffer(file.get(), mBuffer2);
|
||||||
|
|
||||||
buffer = &mBuffer2[0];
|
mBuffer.data = &mBuffer2[0];
|
||||||
|
mBuffer.end = &mBuffer2[0] + mBuffer2.size();
|
||||||
mNumMeshes = 0;
|
mNumMeshes = 0;
|
||||||
|
|
||||||
mLightsCounter = mPolysCounter = mWorldsCounter = mGroupsCounter = 0;
|
mLightsCounter = mPolysCounter = mWorldsCounter = mGroupsCounter = 0;
|
||||||
|
|
||||||
if (::strncmp(buffer, "AC3D", 4)) {
|
if (::strncmp(mBuffer.data, "AC3D", 4)) {
|
||||||
throw DeadlyImportError("AC3D: No valid AC3D file, magic sequence not found");
|
throw DeadlyImportError("AC3D: No valid AC3D file, magic sequence not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
// print the file format version to the console
|
// print the file format version to the console
|
||||||
unsigned int version = HexDigitToDecimal(buffer[4]);
|
unsigned int version = HexDigitToDecimal(mBuffer.data[4]);
|
||||||
char msg[3];
|
char msg[3];
|
||||||
ASSIMP_itoa10(msg, 3, version);
|
ASSIMP_itoa10(msg, 3, version);
|
||||||
ASSIMP_LOG_INFO_F("AC3D file format version: ", msg);
|
ASSIMP_LOG_INFO("AC3D file format version: ", msg);
|
||||||
|
|
||||||
std::vector<Material> materials;
|
std::vector<Material> materials;
|
||||||
materials.reserve(5);
|
materials.reserve(5);
|
||||||
|
@ -729,35 +781,36 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
|
||||||
mLights = &lights;
|
mLights = &lights;
|
||||||
|
|
||||||
while (GetNextLine()) {
|
while (GetNextLine()) {
|
||||||
if (TokenMatch(buffer, "MATERIAL", 8)) {
|
if (TokenMatch(mBuffer.data, "MATERIAL", 8)) {
|
||||||
materials.push_back(Material());
|
materials.emplace_back();
|
||||||
Material &mat = materials.back();
|
Material &mat = materials.back();
|
||||||
|
|
||||||
// manually parse the material ... sscanf would use the buldin atof ...
|
// manually parse the material ... sscanf would use the buldin atof ...
|
||||||
// Format: (name) rgb %f %f %f amb %f %f %f emis %f %f %f spec %f %f %f shi %d trans %f
|
// Format: (name) rgb %f %f %f amb %f %f %f emis %f %f %f spec %f %f %f shi %d trans %f
|
||||||
|
|
||||||
buffer = AcSkipToNextToken(buffer);
|
mBuffer.data = AcSkipToNextToken(mBuffer.data, mBuffer.end);
|
||||||
if ('\"' == *buffer) {
|
if ('\"' == *mBuffer.data) {
|
||||||
buffer = AcGetString(buffer, mat.name);
|
mBuffer.data = AcGetString(mBuffer.data, mBuffer.end, mat.name);
|
||||||
buffer = AcSkipToNextToken(buffer);
|
mBuffer.data = AcSkipToNextToken(mBuffer.data, mBuffer.end);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "rgb", 3, 3, &mat.rgb);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "rgb", 3, 3, &mat.rgb);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "amb", 3, 3, &mat.amb);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "amb", 3, 3, &mat.amb);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "emis", 4, 3, &mat.emis);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "emis", 4, 3, &mat.emis);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "spec", 4, 3, &mat.spec);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "spec", 4, 3, &mat.spec);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "shi", 3, 1, &mat.shin);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "shi", 3, 1, &mat.shin);
|
||||||
buffer = TAcCheckedLoadFloatArray(buffer, "trans", 5, 1, &mat.trans);
|
mBuffer.data = TAcCheckedLoadFloatArray(mBuffer.data, mBuffer.end, "trans", 5, 1, &mat.trans);
|
||||||
|
} else {
|
||||||
|
LoadObjectSection(rootObjects);
|
||||||
}
|
}
|
||||||
LoadObjectSection(rootObjects);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rootObjects.empty() || !mNumMeshes) {
|
if (rootObjects.empty() || mNumMeshes == 0u) {
|
||||||
throw DeadlyImportError("AC3D: No meshes have been loaded");
|
throw DeadlyImportError("AC3D: No meshes have been loaded");
|
||||||
}
|
}
|
||||||
if (materials.empty()) {
|
if (materials.empty()) {
|
||||||
ASSIMP_LOG_WARN("AC3D: No material has been found");
|
ASSIMP_LOG_WARN("AC3D: No material has been found");
|
||||||
materials.push_back(Material());
|
materials.emplace_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
mNumMeshes += (mNumMeshes >> 2u) + 1;
|
mNumMeshes += (mNumMeshes >> 2u) + 1;
|
||||||
|
@ -768,7 +821,7 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
|
||||||
materials.reserve(mNumMeshes);
|
materials.reserve(mNumMeshes);
|
||||||
|
|
||||||
// generate a dummy root if there are multiple objects on the top layer
|
// generate a dummy root if there are multiple objects on the top layer
|
||||||
Object *root;
|
Object *root = nullptr;
|
||||||
if (1 == rootObjects.size())
|
if (1 == rootObjects.size())
|
||||||
root = &rootObjects[0];
|
root = &rootObjects[0];
|
||||||
else {
|
else {
|
||||||
|
@ -781,7 +834,7 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
|
||||||
delete root;
|
delete root;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!::strncmp(pScene->mRootNode->mName.data, "Node", 4)) {
|
if (::strncmp(pScene->mRootNode->mName.data, "Node", 4) == 0) {
|
||||||
pScene->mRootNode->mName.Set("<AC3DWorld>");
|
pScene->mRootNode->mName.Set("<AC3DWorld>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -800,10 +853,12 @@ void AC3DImporter::InternReadFile(const std::string &pFile,
|
||||||
|
|
||||||
// copy lights
|
// copy lights
|
||||||
pScene->mNumLights = (unsigned int)lights.size();
|
pScene->mNumLights = (unsigned int)lights.size();
|
||||||
if (lights.size()) {
|
if (!lights.empty()) {
|
||||||
pScene->mLights = new aiLight *[lights.size()];
|
pScene->mLights = new aiLight *[lights.size()];
|
||||||
::memcpy(pScene->mLights, &lights[0], lights.size() * sizeof(void *));
|
::memcpy(pScene->mLights, &lights[0], lights.size() * sizeof(void *));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif //!defined ASSIMP_BUILD_NO_AC_IMPORTER
|
#endif //!defined ASSIMP_BUILD_NO_AC_IMPORTER
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -64,12 +63,15 @@ namespace Assimp {
|
||||||
class AC3DImporter : public BaseImporter {
|
class AC3DImporter : public BaseImporter {
|
||||||
public:
|
public:
|
||||||
AC3DImporter();
|
AC3DImporter();
|
||||||
~AC3DImporter();
|
~AC3DImporter() override;
|
||||||
|
|
||||||
// Represents an AC3D material
|
// Represents an AC3D material
|
||||||
struct Material {
|
struct Material {
|
||||||
Material() :
|
Material() :
|
||||||
rgb(0.6f, 0.6f, 0.6f), spec(1.f, 1.f, 1.f), shin(0.f), trans(0.f) {}
|
rgb(0.6f, 0.6f, 0.6f),
|
||||||
|
spec(1.f, 1.f, 1.f),
|
||||||
|
shin(0.f),
|
||||||
|
trans(0.f) {}
|
||||||
|
|
||||||
// base color of the material
|
// base color of the material
|
||||||
aiColor3D rgb;
|
aiColor3D rgb;
|
||||||
|
@ -96,18 +98,42 @@ public:
|
||||||
// Represents an AC3D surface
|
// Represents an AC3D surface
|
||||||
struct Surface {
|
struct Surface {
|
||||||
Surface() :
|
Surface() :
|
||||||
mat(0), flags(0) {}
|
mat(0),
|
||||||
|
flags(0) {}
|
||||||
|
|
||||||
unsigned int mat, flags;
|
unsigned int mat, flags;
|
||||||
|
|
||||||
typedef std::pair<unsigned int, aiVector2D> SurfaceEntry;
|
typedef std::pair<unsigned int, aiVector2D> SurfaceEntry;
|
||||||
std::vector<SurfaceEntry> entries;
|
std::vector<SurfaceEntry> entries;
|
||||||
|
|
||||||
|
// Type is low nibble of flags
|
||||||
|
enum Type : uint8_t {
|
||||||
|
Polygon = 0x0,
|
||||||
|
ClosedLine = 0x1,
|
||||||
|
OpenLine = 0x2,
|
||||||
|
TriangleStrip = 0x4, // ACC extension (TORCS and Speed Dreams)
|
||||||
|
|
||||||
|
Mask = 0xf,
|
||||||
|
};
|
||||||
|
|
||||||
|
inline uint8_t GetType() const { return (flags & Mask); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Represents an AC3D object
|
// Represents an AC3D object
|
||||||
struct Object {
|
struct Object {
|
||||||
Object() :
|
Object() :
|
||||||
type(World), name(""), children(), texture(""), texRepeat(1.f, 1.f), texOffset(0.0f, 0.0f), rotation(), translation(), vertices(), surfaces(), numRefs(0), subDiv(0), crease() {}
|
type(World),
|
||||||
|
name(),
|
||||||
|
children(),
|
||||||
|
texRepeat(1.f, 1.f),
|
||||||
|
texOffset(0.0f, 0.0f),
|
||||||
|
rotation(),
|
||||||
|
translation(),
|
||||||
|
vertices(),
|
||||||
|
surfaces(),
|
||||||
|
numRefs(0),
|
||||||
|
subDiv(0),
|
||||||
|
crease() {}
|
||||||
|
|
||||||
// Type description
|
// Type description
|
||||||
enum Type {
|
enum Type {
|
||||||
|
@ -124,7 +150,8 @@ public:
|
||||||
std::vector<Object> children;
|
std::vector<Object> children;
|
||||||
|
|
||||||
// texture to be assigned to all surfaces of the object
|
// texture to be assigned to all surfaces of the object
|
||||||
std::string texture;
|
// the .acc format supports up to 4 textures
|
||||||
|
std::vector<std::string> textures;
|
||||||
|
|
||||||
// texture repat factors (scaling for all coordinates)
|
// texture repat factors (scaling for all coordinates)
|
||||||
aiVector2D texRepeat, texOffset;
|
aiVector2D texRepeat, texOffset;
|
||||||
|
@ -158,25 +185,25 @@ public:
|
||||||
* See BaseImporter::CanRead() for details.
|
* See BaseImporter::CanRead() for details.
|
||||||
*/
|
*/
|
||||||
bool CanRead(const std::string &pFile, IOSystem *pIOHandler,
|
bool CanRead(const std::string &pFile, IOSystem *pIOHandler,
|
||||||
bool checkSig) const;
|
bool checkSig) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Return importer meta information.
|
/** Return importer meta information.
|
||||||
* See #BaseImporter::GetInfo for the details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
const aiImporterDesc *GetInfo() const;
|
const aiImporterDesc *GetInfo() const override;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details*/
|
* See BaseImporter::InternReadFile() for details*/
|
||||||
void InternReadFile(const std::string &pFile, aiScene *pScene,
|
void InternReadFile(const std::string &pFile, aiScene *pScene,
|
||||||
IOSystem *pIOHandler);
|
IOSystem *pIOHandler) override;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called prior to ReadFile().
|
/** Called prior to ReadFile().
|
||||||
* The function is a request to the importer to update its configuration
|
* The function is a request to the importer to update its configuration
|
||||||
* basing on the Importer's configuration property list.*/
|
* basing on the Importer's configuration property list.*/
|
||||||
void SetupProperties(const Importer *pImp);
|
void SetupProperties(const Importer *pImp) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -189,7 +216,7 @@ private:
|
||||||
* load subobjects, the method returns after a 'kids 0' was
|
* load subobjects, the method returns after a 'kids 0' was
|
||||||
* encountered.
|
* encountered.
|
||||||
* @objects List of output objects*/
|
* @objects List of output objects*/
|
||||||
void LoadObjectSection(std::vector<Object> &objects);
|
bool LoadObjectSection(std::vector<Object> &objects);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Convert all objects into meshes and nodes.
|
/** Convert all objects into meshes and nodes.
|
||||||
|
@ -215,7 +242,7 @@ private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// points to the next data line
|
// points to the next data line
|
||||||
const char *buffer;
|
aiBuffer mBuffer;
|
||||||
|
|
||||||
// Configuration option: if enabled, up to two meshes
|
// Configuration option: if enabled, up to two meshes
|
||||||
// are generated per material: those faces who have
|
// are generated per material: those faces who have
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -41,28 +39,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// \file AMFImporter.cpp
|
|
||||||
/// \brief AMF-format files importer for Assimp: main algorithm implementation.
|
|
||||||
/// \date 2016
|
|
||||||
/// \author smal.root@gmail.com
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
|
||||||
|
|
||||||
// Header files, Assimp.
|
// Header files, Assimp.
|
||||||
#include "AMFImporter.hpp"
|
#include "AMFImporter.hpp"
|
||||||
#include "AMFImporter_Macro.hpp"
|
|
||||||
|
|
||||||
#include <assimp/DefaultIOSystem.h>
|
#include <assimp/DefaultIOSystem.h>
|
||||||
#include <assimp/fast_atof.h>
|
#include <assimp/fast_atof.h>
|
||||||
|
#include <assimp/StringUtils.h>
|
||||||
|
|
||||||
// Header files, stdlib.
|
// Header files, stdlib.
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
/// \var aiImporterDesc AMFImporter::Description
|
static constexpr aiImporterDesc Description = {
|
||||||
/// Conastant which hold importer description
|
|
||||||
const aiImporterDesc AMFImporter::Description = {
|
|
||||||
"Additive manufacturing file format(AMF) Importer",
|
"Additive manufacturing file format(AMF) Importer",
|
||||||
"smalcom",
|
"smalcom",
|
||||||
"",
|
"",
|
||||||
|
@ -82,7 +73,7 @@ void AMFImporter::Clear() {
|
||||||
mTexture_Converted.clear();
|
mTexture_Converted.clear();
|
||||||
// Delete all elements
|
// Delete all elements
|
||||||
if (!mNodeElement_List.empty()) {
|
if (!mNodeElement_List.empty()) {
|
||||||
for (CAMFImporter_NodeElement *ne : mNodeElement_List) {
|
for (AMFNodeElementBase *ne : mNodeElement_List) {
|
||||||
delete ne;
|
delete ne;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +81,14 @@ void AMFImporter::Clear() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AMFImporter::AMFImporter() AI_NO_EXCEPT :
|
||||||
|
mNodeElement_Cur(nullptr),
|
||||||
|
mXmlParser(nullptr) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
AMFImporter::~AMFImporter() {
|
AMFImporter::~AMFImporter() {
|
||||||
if (mReader != nullptr) delete mReader;
|
delete mXmlParser;
|
||||||
// Clear() is accounting if data already is deleted. So, just check again if all data is deleted.
|
// Clear() is accounting if data already is deleted. So, just check again if all data is deleted.
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
@ -100,10 +97,12 @@ AMFImporter::~AMFImporter() {
|
||||||
/************************************************************ Functions: find set ************************************************************/
|
/************************************************************ Functions: find set ************************************************************/
|
||||||
/*********************************************************************************************************************************************/
|
/*********************************************************************************************************************************************/
|
||||||
|
|
||||||
bool AMFImporter::Find_NodeElement(const std::string &pID, const CAMFImporter_NodeElement::EType pType, CAMFImporter_NodeElement **pNodeElement) const {
|
bool AMFImporter::Find_NodeElement(const std::string &pID, const AMFNodeElementBase::EType pType, AMFNodeElementBase **pNodeElement) const {
|
||||||
for (CAMFImporter_NodeElement *ne : mNodeElement_List) {
|
for (AMFNodeElementBase *ne : mNodeElement_List) {
|
||||||
if ((ne->ID == pID) && (ne->Type == pType)) {
|
if ((ne->ID == pID) && (ne->Type == pType)) {
|
||||||
if (pNodeElement != nullptr) *pNodeElement = ne;
|
if (pNodeElement != nullptr) {
|
||||||
|
*pNodeElement = ne;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -112,12 +111,13 @@ bool AMFImporter::Find_NodeElement(const std::string &pID, const CAMFImporter_No
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AMFImporter::Find_ConvertedNode(const std::string &pID, std::list<aiNode *> &pNodeList, aiNode **pNode) const {
|
bool AMFImporter::Find_ConvertedNode(const std::string &pID, NodeArray &nodeArray, aiNode **pNode) const {
|
||||||
aiString node_name(pID.c_str());
|
aiString node_name(pID.c_str());
|
||||||
|
for (aiNode *node : nodeArray) {
|
||||||
for (aiNode *node : pNodeList) {
|
|
||||||
if (node->mName == node_name) {
|
if (node->mName == node_name) {
|
||||||
if (pNode != nullptr) *pNode = node;
|
if (pNode != nullptr) {
|
||||||
|
*pNode = node;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,9 @@ bool AMFImporter::Find_ConvertedNode(const std::string &pID, std::list<aiNode *>
|
||||||
bool AMFImporter::Find_ConvertedMaterial(const std::string &pID, const SPP_Material **pConvertedMaterial) const {
|
bool AMFImporter::Find_ConvertedMaterial(const std::string &pID, const SPP_Material **pConvertedMaterial) const {
|
||||||
for (const SPP_Material &mat : mMaterial_Converted) {
|
for (const SPP_Material &mat : mMaterial_Converted) {
|
||||||
if (mat.ID == pID) {
|
if (mat.ID == pID) {
|
||||||
if (pConvertedMaterial != nullptr) *pConvertedMaterial = &mat;
|
if (pConvertedMaterial != nullptr) {
|
||||||
|
*pConvertedMaterial = &mat;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -142,174 +144,42 @@ bool AMFImporter::Find_ConvertedMaterial(const std::string &pID, const SPP_Mater
|
||||||
/************************************************************ Functions: throw set ***********************************************************/
|
/************************************************************ Functions: throw set ***********************************************************/
|
||||||
/*********************************************************************************************************************************************/
|
/*********************************************************************************************************************************************/
|
||||||
|
|
||||||
void AMFImporter::Throw_CloseNotFound(const std::string &pNode) {
|
void AMFImporter::Throw_CloseNotFound(const std::string &nodeName) {
|
||||||
throw DeadlyImportError("Close tag for node <" + pNode + "> not found. Seems file is corrupt.");
|
throw DeadlyImportError("Close tag for node <" + nodeName + "> not found. Seems file is corrupt.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Throw_IncorrectAttr(const std::string &pAttrName) {
|
void AMFImporter::Throw_IncorrectAttr(const std::string &nodeName, const std::string &attrName) {
|
||||||
throw DeadlyImportError("Node <" + std::string(mReader->getNodeName()) + "> has incorrect attribute \"" + pAttrName + "\".");
|
throw DeadlyImportError("Node <" + nodeName + "> has incorrect attribute \"" + attrName + "\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Throw_IncorrectAttrValue(const std::string &pAttrName) {
|
void AMFImporter::Throw_IncorrectAttrValue(const std::string &nodeName, const std::string &attrName) {
|
||||||
throw DeadlyImportError("Attribute \"" + pAttrName + "\" in node <" + std::string(mReader->getNodeName()) + "> has incorrect value.");
|
throw DeadlyImportError("Attribute \"" + attrName + "\" in node <" + nodeName + "> has incorrect value.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Throw_MoreThanOnceDefined(const std::string &pNodeType, const std::string &pDescription) {
|
void AMFImporter::Throw_MoreThanOnceDefined(const std::string &nodeName, const std::string &pNodeType, const std::string &pDescription) {
|
||||||
throw DeadlyImportError("\"" + pNodeType + "\" node can be used only once in " + mReader->getNodeName() + ". Description: " + pDescription);
|
throw DeadlyImportError("\"" + pNodeType + "\" node can be used only once in " + nodeName + ". Description: " + pDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Throw_ID_NotFound(const std::string &pID) const {
|
void AMFImporter::Throw_ID_NotFound(const std::string &pID) const {
|
||||||
throw DeadlyImportError("Not found node with name \"" + pID + "\".");
|
throw DeadlyImportError("Not found node with name \"", pID, "\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************************************************************************/
|
/*********************************************************************************************************************************************/
|
||||||
/************************************************************* Functions: XML set ************************************************************/
|
/************************************************************* Functions: XML set ************************************************************/
|
||||||
/*********************************************************************************************************************************************/
|
/*********************************************************************************************************************************************/
|
||||||
|
|
||||||
void AMFImporter::XML_CheckNode_MustHaveChildren() {
|
void AMFImporter::XML_CheckNode_MustHaveChildren(pugi::xml_node &node) {
|
||||||
if (mReader->isEmptyElement()) throw DeadlyImportError(std::string("Node <") + mReader->getNodeName() + "> must have children.");
|
if (node.children().begin() == node.children().end()) {
|
||||||
}
|
throw DeadlyImportError(std::string("Node <") + node.name() + "> must have children.");
|
||||||
|
|
||||||
void AMFImporter::XML_CheckNode_SkipUnsupported(const std::string &pParentNodeName) {
|
|
||||||
static const size_t Uns_Skip_Len = 3;
|
|
||||||
const char *Uns_Skip[Uns_Skip_Len] = { "composite", "edge", "normal" };
|
|
||||||
|
|
||||||
static bool skipped_before[Uns_Skip_Len] = { false, false, false };
|
|
||||||
|
|
||||||
std::string nn(mReader->getNodeName());
|
|
||||||
bool found = false;
|
|
||||||
bool close_found = false;
|
|
||||||
size_t sk_idx;
|
|
||||||
|
|
||||||
for (sk_idx = 0; sk_idx < Uns_Skip_Len; sk_idx++) {
|
|
||||||
if (nn != Uns_Skip[sk_idx]) continue;
|
|
||||||
|
|
||||||
found = true;
|
|
||||||
if (mReader->isEmptyElement()) {
|
|
||||||
close_found = true;
|
|
||||||
|
|
||||||
goto casu_cres;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (mReader->read()) {
|
|
||||||
if ((mReader->getNodeType() == irr::io::EXN_ELEMENT_END) && (nn == mReader->getNodeName())) {
|
|
||||||
close_found = true;
|
|
||||||
|
|
||||||
goto casu_cres;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // for(sk_idx = 0; sk_idx < Uns_Skip_Len; sk_idx++)
|
|
||||||
|
|
||||||
casu_cres:
|
|
||||||
|
|
||||||
if (!found) throw DeadlyImportError("Unknown node \"" + nn + "\" in " + pParentNodeName + ".");
|
|
||||||
if (!close_found) Throw_CloseNotFound(nn);
|
|
||||||
|
|
||||||
if (!skipped_before[sk_idx]) {
|
|
||||||
skipped_before[sk_idx] = true;
|
|
||||||
ASSIMP_LOG_WARN_F("Skipping node \"", nn, "\" in ", pParentNodeName, ".");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AMFImporter::XML_SearchNode(const std::string &pNodeName) {
|
bool AMFImporter::XML_SearchNode(const std::string &nodeName) {
|
||||||
while (mReader->read()) {
|
return nullptr != mXmlParser->findNode(nodeName);
|
||||||
if ((mReader->getNodeType() == irr::io::EXN_ELEMENT) && XML_CheckNode_NameEqual(pNodeName)) return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AMFImporter::XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx) {
|
|
||||||
std::string val(mReader->getAttributeValue(pAttrIdx));
|
|
||||||
|
|
||||||
if ((val == "false") || (val == "0"))
|
|
||||||
return false;
|
|
||||||
else if ((val == "true") || (val == "1"))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
throw DeadlyImportError("Bool attribute value can contain \"false\"/\"0\" or \"true\"/\"1\" not the \"" + val + "\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
float AMFImporter::XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx) {
|
|
||||||
std::string val;
|
|
||||||
float tvalf;
|
|
||||||
|
|
||||||
ParseHelper_FixTruncatedFloatString(mReader->getAttributeValue(pAttrIdx), val);
|
|
||||||
fast_atoreal_move(val.c_str(), tvalf, false);
|
|
||||||
|
|
||||||
return tvalf;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t AMFImporter::XML_ReadNode_GetAttrVal_AsU32(const int pAttrIdx) {
|
|
||||||
return strtoul10(mReader->getAttributeValue(pAttrIdx));
|
|
||||||
}
|
|
||||||
|
|
||||||
float AMFImporter::XML_ReadNode_GetVal_AsFloat() {
|
|
||||||
std::string val;
|
|
||||||
float tvalf;
|
|
||||||
|
|
||||||
if (!mReader->read()) throw DeadlyImportError("XML_ReadNode_GetVal_AsFloat. No data, seems file is corrupt.");
|
|
||||||
if (mReader->getNodeType() != irr::io::EXN_TEXT) throw DeadlyImportError("XML_ReadNode_GetVal_AsFloat. Invalid type of XML element, seems file is corrupt.");
|
|
||||||
|
|
||||||
ParseHelper_FixTruncatedFloatString(mReader->getNodeData(), val);
|
|
||||||
fast_atoreal_move(val.c_str(), tvalf, false);
|
|
||||||
|
|
||||||
return tvalf;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t AMFImporter::XML_ReadNode_GetVal_AsU32() {
|
|
||||||
if (!mReader->read()) throw DeadlyImportError("XML_ReadNode_GetVal_AsU32. No data, seems file is corrupt.");
|
|
||||||
if (mReader->getNodeType() != irr::io::EXN_TEXT) throw DeadlyImportError("XML_ReadNode_GetVal_AsU32. Invalid type of XML element, seems file is corrupt.");
|
|
||||||
|
|
||||||
return strtoul10(mReader->getNodeData());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMFImporter::XML_ReadNode_GetVal_AsString(std::string &pValue) {
|
|
||||||
if (!mReader->read()) throw DeadlyImportError("XML_ReadNode_GetVal_AsString. No data, seems file is corrupt.");
|
|
||||||
if (mReader->getNodeType() != irr::io::EXN_TEXT)
|
|
||||||
throw DeadlyImportError("XML_ReadNode_GetVal_AsString. Invalid type of XML element, seems file is corrupt.");
|
|
||||||
|
|
||||||
pValue = mReader->getNodeData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************************************************************************/
|
|
||||||
/************************************************************ Functions: parse set ***********************************************************/
|
|
||||||
/*********************************************************************************************************************************************/
|
|
||||||
|
|
||||||
void AMFImporter::ParseHelper_Node_Enter(CAMFImporter_NodeElement *pNode) {
|
|
||||||
mNodeElement_Cur->Child.push_back(pNode); // add new element to current element child list.
|
|
||||||
mNodeElement_Cur = pNode; // switch current element to new one.
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMFImporter::ParseHelper_Node_Exit() {
|
|
||||||
// check if we can walk up.
|
|
||||||
if (mNodeElement_Cur != nullptr) mNodeElement_Cur = mNodeElement_Cur->Parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMFImporter::ParseHelper_FixTruncatedFloatString(const char *pInStr, std::string &pOutString) {
|
|
||||||
size_t instr_len;
|
|
||||||
|
|
||||||
pOutString.clear();
|
|
||||||
instr_len = strlen(pInStr);
|
|
||||||
if (!instr_len) return;
|
|
||||||
|
|
||||||
pOutString.reserve(instr_len * 3 / 2);
|
|
||||||
// check and correct floats in format ".x". Must be "x.y".
|
|
||||||
if (pInStr[0] == '.') pOutString.push_back('0');
|
|
||||||
|
|
||||||
pOutString.push_back(pInStr[0]);
|
|
||||||
for (size_t ci = 1; ci < instr_len; ci++) {
|
|
||||||
if ((pInStr[ci] == '.') && ((pInStr[ci - 1] == ' ') || (pInStr[ci - 1] == '-') || (pInStr[ci - 1] == '+') || (pInStr[ci - 1] == '\t'))) {
|
|
||||||
pOutString.push_back('0');
|
|
||||||
pOutString.push_back('.');
|
|
||||||
} else {
|
|
||||||
pOutString.push_back(pInStr[ci]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ParseHelper_Decode_Base64_IsBase64(const char pChar) {
|
static bool ParseHelper_Decode_Base64_IsBase64(const char pChar) {
|
||||||
return (isalnum(pChar) || (pChar == '+') || (pChar == '/'));
|
return (isalnum((unsigned char)pChar) || (pChar == '+') || (pChar == '/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::ParseHelper_Decode_Base64(const std::string &pInputBase64, std::vector<uint8_t> &pOutputData) const {
|
void AMFImporter::ParseHelper_Decode_Base64(const std::string &pInputBase64, std::vector<uint8_t> &pOutputData) const {
|
||||||
|
@ -321,7 +191,10 @@ void AMFImporter::ParseHelper_Decode_Base64(const std::string &pInputBase64, std
|
||||||
uint8_t arr4[4], arr3[3];
|
uint8_t arr4[4], arr3[3];
|
||||||
|
|
||||||
// check input data
|
// check input data
|
||||||
if (pInputBase64.size() % 4) throw DeadlyImportError("Base64-encoded data must have size multiply of four.");
|
if (pInputBase64.size() % 4) {
|
||||||
|
throw DeadlyImportError("Base64-encoded data must have size multiply of four.");
|
||||||
|
}
|
||||||
|
|
||||||
// prepare output place
|
// prepare output place
|
||||||
pOutputData.clear();
|
pOutputData.clear();
|
||||||
pOutputData.reserve(pInputBase64.size() / 4 * 3);
|
pOutputData.reserve(pInputBase64.size() / 4 * 3);
|
||||||
|
@ -362,27 +235,34 @@ void AMFImporter::ParseHelper_Decode_Base64(const std::string &pInputBase64, std
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
|
void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
|
||||||
irr::io::IrrXMLReader *OldReader = mReader; // store current XMLreader.
|
|
||||||
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
|
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
|
||||||
|
|
||||||
// Check whether we can read from the file
|
// Check whether we can read from the file
|
||||||
if (file.get() == NULL) throw DeadlyImportError("Failed to open AMF file " + pFile + ".");
|
if (file == nullptr) {
|
||||||
|
throw DeadlyImportError("Failed to open AMF file ", pFile, ".");
|
||||||
|
}
|
||||||
|
|
||||||
// generate a XML reader for it
|
mXmlParser = new XmlParser();
|
||||||
std::unique_ptr<CIrrXML_IOStreamReader> mIOWrapper(new CIrrXML_IOStreamReader(file.get()));
|
if (!mXmlParser->parse(file.get())) {
|
||||||
mReader = irr::io::createIrrXMLReader(mIOWrapper.get());
|
delete mXmlParser;
|
||||||
if (!mReader) throw DeadlyImportError("Failed to create XML reader for file" + pFile + ".");
|
mXmlParser = nullptr;
|
||||||
//
|
throw DeadlyImportError("Failed to create XML reader for file ", pFile, ".");
|
||||||
// start reading
|
}
|
||||||
// search for root tag <amf>
|
|
||||||
if (XML_SearchNode("amf"))
|
// Start reading, search for root tag <amf>
|
||||||
ParseNode_Root();
|
if (!mXmlParser->hasNode("amf")) {
|
||||||
else
|
|
||||||
throw DeadlyImportError("Root node \"amf\" not found.");
|
throw DeadlyImportError("Root node \"amf\" not found.");
|
||||||
|
}
|
||||||
|
ParseNode_Root();
|
||||||
|
} // namespace Assimp
|
||||||
|
|
||||||
delete mReader;
|
void AMFImporter::ParseHelper_Node_Enter(AMFNodeElementBase *node) {
|
||||||
// restore old XMLreader
|
mNodeElement_Cur->Child.push_back(node); // add new element to current element child list.
|
||||||
mReader = OldReader;
|
mNodeElement_Cur = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AMFImporter::ParseHelper_Node_Exit() {
|
||||||
|
if (mNodeElement_Cur != nullptr) mNodeElement_Cur = mNodeElement_Cur->Parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <amf
|
// <amf
|
||||||
|
@ -393,54 +273,49 @@ void AMFImporter::ParseFile(const std::string &pFile, IOSystem *pIOHandler) {
|
||||||
// Root XML element.
|
// Root XML element.
|
||||||
// Multi elements - No.
|
// Multi elements - No.
|
||||||
void AMFImporter::ParseNode_Root() {
|
void AMFImporter::ParseNode_Root() {
|
||||||
std::string unit, version;
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement *ne(nullptr);
|
XmlNode *root = mXmlParser->findNode("amf");
|
||||||
|
if (nullptr == root) {
|
||||||
|
throw DeadlyImportError("Root node \"amf\" not found.");
|
||||||
|
}
|
||||||
|
XmlNode node = *root;
|
||||||
|
mUnit = ai_tolower(std::string(node.attribute("unit").as_string()));
|
||||||
|
|
||||||
|
mVersion = node.attribute("version").as_string();
|
||||||
|
|
||||||
// Read attributes for node <amf>.
|
// Read attributes for node <amf>.
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("unit", unit, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("version", version, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_LOOPEND_WSKIP;
|
|
||||||
|
|
||||||
// Check attributes
|
// Check attributes
|
||||||
if (!mUnit.empty()) {
|
if (!mUnit.empty()) {
|
||||||
if ((mUnit != "inch") && (mUnit != "millimeter") && (mUnit != "meter") && (mUnit != "feet") && (mUnit != "micron")) Throw_IncorrectAttrValue("unit");
|
if ((mUnit != "inch") && (mUnit != "millimeters") && (mUnit != "millimeter") && (mUnit != "meter") && (mUnit != "feet") && (mUnit != "micron")) {
|
||||||
|
Throw_IncorrectAttrValue("unit", mUnit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// create root node element.
|
// create root node element.
|
||||||
ne = new CAMFImporter_NodeElement_Root(nullptr);
|
ne = new AMFRoot(nullptr);
|
||||||
|
|
||||||
mNodeElement_Cur = ne; // set first "current" element
|
mNodeElement_Cur = ne; // set first "current" element
|
||||||
// and assign attribute's values
|
// and assign attribute's values
|
||||||
((CAMFImporter_NodeElement_Root *)ne)->Unit = unit;
|
((AMFRoot *)ne)->Unit = mUnit;
|
||||||
((CAMFImporter_NodeElement_Root *)ne)->Version = version;
|
((AMFRoot *)ne)->Version = mVersion;
|
||||||
|
|
||||||
// Check for child nodes
|
// Check for child nodes
|
||||||
if (!mReader->isEmptyElement()) {
|
for (XmlNode ¤tNode : node.children() ) {
|
||||||
MACRO_NODECHECK_LOOPBEGIN("amf");
|
const std::string currentName = currentNode.name();
|
||||||
if (XML_CheckNode_NameEqual("object")) {
|
if (currentName == "object") {
|
||||||
ParseNode_Object();
|
ParseNode_Object(currentNode);
|
||||||
continue;
|
} else if (currentName == "material") {
|
||||||
|
ParseNode_Material(currentNode);
|
||||||
|
} else if (currentName == "texture") {
|
||||||
|
ParseNode_Texture(currentNode);
|
||||||
|
} else if (currentName == "constellation") {
|
||||||
|
ParseNode_Constellation(currentNode);
|
||||||
|
} else if (currentName == "metadata") {
|
||||||
|
ParseNode_Metadata(currentNode);
|
||||||
}
|
}
|
||||||
if (XML_CheckNode_NameEqual("material")) {
|
mNodeElement_Cur = ne;
|
||||||
ParseNode_Material();
|
}
|
||||||
continue;
|
mNodeElement_Cur = ne; // force restore "current" element
|
||||||
}
|
|
||||||
if (XML_CheckNode_NameEqual("texture")) {
|
|
||||||
ParseNode_Texture();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (XML_CheckNode_NameEqual("constellation")) {
|
|
||||||
ParseNode_Constellation();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (XML_CheckNode_NameEqual("metadata")) {
|
|
||||||
ParseNode_Metadata();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
MACRO_NODECHECK_LOOPEND("amf");
|
|
||||||
mNodeElement_Cur = ne; // force restore "current" element
|
|
||||||
} // if(!mReader->isEmptyElement())
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne); // add to node element list because its a new object in graph.
|
mNodeElement_List.push_back(ne); // add to node element list because its a new object in graph.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,40 +326,34 @@ void AMFImporter::ParseNode_Root() {
|
||||||
// A collection of objects or constellations with specific relative locations.
|
// A collection of objects or constellations with specific relative locations.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <amf>.
|
// Parent element - <amf>.
|
||||||
void AMFImporter::ParseNode_Constellation() {
|
void AMFImporter::ParseNode_Constellation(XmlNode &node) {
|
||||||
std::string id;
|
std::string id;
|
||||||
CAMFImporter_NodeElement *ne(nullptr);
|
id = node.attribute("id").as_string();
|
||||||
|
|
||||||
// Read attributes for node <constellation>.
|
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
|
||||||
|
|
||||||
// create and if needed - define new grouping object.
|
// create and if needed - define new grouping object.
|
||||||
ne = new CAMFImporter_NodeElement_Constellation(mNodeElement_Cur);
|
AMFNodeElementBase *ne = new AMFConstellation(mNodeElement_Cur);
|
||||||
|
|
||||||
CAMFImporter_NodeElement_Constellation &als = *((CAMFImporter_NodeElement_Constellation *)ne); // alias for convenience
|
AMFConstellation &als = *((AMFConstellation *)ne); // alias for convenience
|
||||||
|
|
||||||
|
if (!id.empty()) {
|
||||||
|
als.ID = id;
|
||||||
|
}
|
||||||
|
|
||||||
if (!id.empty()) als.ID = id;
|
|
||||||
// Check for child nodes
|
// Check for child nodes
|
||||||
if (!mReader->isEmptyElement()) {
|
if (!node.empty()) {
|
||||||
ParseHelper_Node_Enter(ne);
|
ParseHelper_Node_Enter(ne);
|
||||||
MACRO_NODECHECK_LOOPBEGIN("constellation");
|
for (XmlNode currentNode = node.first_child(); currentNode; currentNode = currentNode.next_sibling()) {
|
||||||
if (XML_CheckNode_NameEqual("instance")) {
|
std::string name = currentNode.name();
|
||||||
ParseNode_Instance();
|
if (name == "instance") {
|
||||||
continue;
|
ParseNode_Instance(currentNode);
|
||||||
|
} else if (name == "metadata") {
|
||||||
|
ParseNode_Metadata(currentNode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (XML_CheckNode_NameEqual("metadata")) {
|
|
||||||
ParseNode_Metadata();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
MACRO_NODECHECK_LOOPEND("constellation");
|
|
||||||
ParseHelper_Node_Exit();
|
ParseHelper_Node_Exit();
|
||||||
} // if(!mReader->isEmptyElement())
|
} else {
|
||||||
else {
|
mNodeElement_Cur->Child.push_back(ne);
|
||||||
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
}
|
||||||
} // if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,47 +364,43 @@ void AMFImporter::ParseNode_Constellation() {
|
||||||
// A collection of objects or constellations with specific relative locations.
|
// A collection of objects or constellations with specific relative locations.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <amf>.
|
// Parent element - <amf>.
|
||||||
void AMFImporter::ParseNode_Instance() {
|
void AMFImporter::ParseNode_Instance(XmlNode &node) {
|
||||||
std::string objectid;
|
AMFNodeElementBase *ne(nullptr);
|
||||||
CAMFImporter_NodeElement *ne(nullptr);
|
|
||||||
|
|
||||||
// Read attributes for node <constellation>.
|
// Read attributes for node <constellation>.
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
std::string objectid = node.attribute("objectid").as_string();
|
||||||
MACRO_ATTRREAD_CHECK_RET("objectid", objectid, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
|
||||||
|
|
||||||
// used object id must be defined, check that.
|
// used object id must be defined, check that.
|
||||||
if (objectid.empty()) throw DeadlyImportError("\"objectid\" in <instance> must be defined.");
|
if (objectid.empty()) {
|
||||||
|
throw DeadlyImportError("\"objectid\" in <instance> must be defined.");
|
||||||
|
}
|
||||||
// create and define new grouping object.
|
// create and define new grouping object.
|
||||||
ne = new CAMFImporter_NodeElement_Instance(mNodeElement_Cur);
|
ne = new AMFInstance(mNodeElement_Cur);
|
||||||
|
AMFInstance &als = *((AMFInstance *)ne);
|
||||||
CAMFImporter_NodeElement_Instance &als = *((CAMFImporter_NodeElement_Instance *)ne); // alias for convenience
|
|
||||||
|
|
||||||
als.ObjectID = objectid;
|
als.ObjectID = objectid;
|
||||||
// Check for child nodes
|
|
||||||
if (!mReader->isEmptyElement()) {
|
|
||||||
bool read_flag[6] = { false, false, false, false, false, false };
|
|
||||||
|
|
||||||
als.Delta.Set(0, 0, 0);
|
if (!node.empty()) {
|
||||||
als.Rotation.Set(0, 0, 0);
|
|
||||||
ParseHelper_Node_Enter(ne);
|
ParseHelper_Node_Enter(ne);
|
||||||
MACRO_NODECHECK_LOOPBEGIN("instance");
|
for (auto ¤tNode : node.children()) {
|
||||||
MACRO_NODECHECK_READCOMP_F("deltax", read_flag[0], als.Delta.x);
|
const std::string ¤tName = currentNode.name();
|
||||||
MACRO_NODECHECK_READCOMP_F("deltay", read_flag[1], als.Delta.y);
|
if (currentName == "deltax") {
|
||||||
MACRO_NODECHECK_READCOMP_F("deltaz", read_flag[2], als.Delta.z);
|
XmlParser::getValueAsReal(currentNode, als.Delta.x);
|
||||||
MACRO_NODECHECK_READCOMP_F("rx", read_flag[3], als.Rotation.x);
|
} else if (currentName == "deltay") {
|
||||||
MACRO_NODECHECK_READCOMP_F("ry", read_flag[4], als.Rotation.y);
|
XmlParser::getValueAsReal(currentNode, als.Delta.y);
|
||||||
MACRO_NODECHECK_READCOMP_F("rz", read_flag[5], als.Rotation.z);
|
} else if (currentName == "deltaz") {
|
||||||
MACRO_NODECHECK_LOOPEND("instance");
|
XmlParser::getValueAsReal(currentNode, als.Delta.z);
|
||||||
|
} else if (currentName == "rx") {
|
||||||
|
XmlParser::getValueAsReal(currentNode, als.Delta.x);
|
||||||
|
} else if (currentName == "ry") {
|
||||||
|
XmlParser::getValueAsReal(currentNode, als.Delta.y);
|
||||||
|
} else if (currentName == "rz") {
|
||||||
|
XmlParser::getValueAsReal(currentNode, als.Delta.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
ParseHelper_Node_Exit();
|
ParseHelper_Node_Exit();
|
||||||
// also convert degrees to radians.
|
} else {
|
||||||
als.Rotation.x = AI_MATH_PI_F * als.Rotation.x / 180.0f;
|
mNodeElement_Cur->Child.push_back(ne);
|
||||||
als.Rotation.y = AI_MATH_PI_F * als.Rotation.y / 180.0f;
|
}
|
||||||
als.Rotation.z = AI_MATH_PI_F * als.Rotation.z / 180.0f;
|
|
||||||
} // if(!mReader->isEmptyElement())
|
|
||||||
else {
|
|
||||||
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
|
||||||
} // if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
}
|
}
|
||||||
|
@ -547,51 +412,38 @@ void AMFImporter::ParseNode_Instance() {
|
||||||
// An object definition.
|
// An object definition.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <amf>.
|
// Parent element - <amf>.
|
||||||
void AMFImporter::ParseNode_Object() {
|
void AMFImporter::ParseNode_Object(XmlNode &node) {
|
||||||
std::string id;
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement *ne(nullptr);
|
|
||||||
|
|
||||||
// Read attributes for node <object>.
|
// Read attributes for node <object>.
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
std::string id = node.attribute("id").as_string();
|
||||||
MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
|
||||||
|
|
||||||
// create and if needed - define new geometry object.
|
// create and if needed - define new geometry object.
|
||||||
ne = new CAMFImporter_NodeElement_Object(mNodeElement_Cur);
|
ne = new AMFObject(mNodeElement_Cur);
|
||||||
|
|
||||||
CAMFImporter_NodeElement_Object &als = *((CAMFImporter_NodeElement_Object *)ne); // alias for convenience
|
AMFObject &als = *((AMFObject *)ne); // alias for convenience
|
||||||
|
|
||||||
|
if (!id.empty()) {
|
||||||
|
als.ID = id;
|
||||||
|
}
|
||||||
|
|
||||||
if (!id.empty()) als.ID = id;
|
|
||||||
// Check for child nodes
|
// Check for child nodes
|
||||||
if (!mReader->isEmptyElement()) {
|
if (!node.empty()) {
|
||||||
bool col_read = false;
|
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
ParseHelper_Node_Enter(ne);
|
||||||
MACRO_NODECHECK_LOOPBEGIN("object");
|
for (auto ¤tNode : node.children()) {
|
||||||
if (XML_CheckNode_NameEqual("color")) {
|
const std::string ¤tName = currentNode.name();
|
||||||
// Check if color already defined for object.
|
if (currentName == "color") {
|
||||||
if (col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for <object>.");
|
ParseNode_Color(currentNode);
|
||||||
// read data and set flag about it
|
} else if (currentName == "mesh") {
|
||||||
ParseNode_Color();
|
ParseNode_Mesh(currentNode);
|
||||||
col_read = true;
|
} else if (currentName == "metadata") {
|
||||||
|
ParseNode_Metadata(currentNode);
|
||||||
continue;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XML_CheckNode_NameEqual("mesh")) {
|
|
||||||
ParseNode_Mesh();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (XML_CheckNode_NameEqual("metadata")) {
|
|
||||||
ParseNode_Metadata();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
MACRO_NODECHECK_LOOPEND("object");
|
|
||||||
ParseHelper_Node_Exit();
|
ParseHelper_Node_Exit();
|
||||||
} // if(!mReader->isEmptyElement())
|
} else {
|
||||||
else {
|
|
||||||
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
||||||
} // if(!mReader->isEmptyElement()) else
|
}
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
}
|
}
|
||||||
|
@ -614,46 +466,23 @@ void AMFImporter::ParseNode_Object() {
|
||||||
// "Revision" - specifies the revision of the entity
|
// "Revision" - specifies the revision of the entity
|
||||||
// "Tolerance" - specifies the desired manufacturing tolerance of the entity in entity's unit system
|
// "Tolerance" - specifies the desired manufacturing tolerance of the entity in entity's unit system
|
||||||
// "Volume" - specifies the total volume of the entity, in the entity's unit system, to be used for verification (object and volume only)
|
// "Volume" - specifies the total volume of the entity, in the entity's unit system, to be used for verification (object and volume only)
|
||||||
void AMFImporter::ParseNode_Metadata() {
|
void AMFImporter::ParseNode_Metadata(XmlNode &node) {
|
||||||
std::string type, value;
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement *ne(nullptr);
|
|
||||||
|
std::string type = node.attribute("type").as_string(), value;
|
||||||
|
XmlParser::getValueAsString(node, value);
|
||||||
|
|
||||||
// read attribute
|
// read attribute
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
ne = new AMFMetadata(mNodeElement_Cur);
|
||||||
MACRO_ATTRREAD_CHECK_RET("type", type, mReader->getAttributeValue);
|
((AMFMetadata *)ne)->Type = type;
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
((AMFMetadata *)ne)->Value = value;
|
||||||
// and value of node.
|
|
||||||
value = mReader->getNodeData();
|
|
||||||
// Create node element and assign read data.
|
|
||||||
ne = new CAMFImporter_NodeElement_Metadata(mNodeElement_Cur);
|
|
||||||
((CAMFImporter_NodeElement_Metadata *)ne)->Type = type;
|
|
||||||
((CAMFImporter_NodeElement_Metadata *)ne)->Value = value;
|
|
||||||
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
||||||
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************************************************************************/
|
bool AMFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*pCheckSig*/) const {
|
||||||
/******************************************************** Functions: BaseImporter set ********************************************************/
|
static const char *tokens[] = { "<amf" };
|
||||||
/*********************************************************************************************************************************************/
|
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
|
||||||
|
|
||||||
bool AMFImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool pCheckSig) const {
|
|
||||||
const std::string extension = GetExtension(pFile);
|
|
||||||
|
|
||||||
if (extension == "amf") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!extension.length() || pCheckSig) {
|
|
||||||
const char *tokens[] = { "<amf" };
|
|
||||||
|
|
||||||
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AMFImporter::GetExtensionList(std::set<std::string> &pExtensionList) {
|
|
||||||
pExtensionList.insert("amf");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const aiImporterDesc *AMFImporter::GetInfo() const {
|
const aiImporterDesc *AMFImporter::GetInfo() const {
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -54,11 +52,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "AMFImporter_Node.hpp"
|
#include "AMFImporter_Node.hpp"
|
||||||
|
|
||||||
// Header files, Assimp.
|
// Header files, Assimp.
|
||||||
#include <assimp/DefaultLogger.hpp>
|
|
||||||
#include <assimp/importerdesc.h>
|
|
||||||
#include "assimp/types.h"
|
#include "assimp/types.h"
|
||||||
#include <assimp/BaseImporter.h>
|
#include <assimp/BaseImporter.h>
|
||||||
#include <assimp/irrXMLWrapper.h>
|
#include <assimp/XmlParser.h>
|
||||||
|
#include <assimp/importerdesc.h>
|
||||||
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
||||||
// Header files, stdlib.
|
// Header files, stdlib.
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -100,23 +98,41 @@ namespace Assimp {
|
||||||
/// old - <map> and children <u1>, <u2>, <u3>, <v1>, <v2>, <v3>
|
/// old - <map> and children <u1>, <u2>, <u3>, <v1>, <v2>, <v3>
|
||||||
///
|
///
|
||||||
class AMFImporter : public BaseImporter {
|
class AMFImporter : public BaseImporter {
|
||||||
private:
|
using AMFMetaDataArray = std::vector<AMFMetadata *>;
|
||||||
struct SPP_Material;// forward declaration
|
using MeshArray = std::vector<aiMesh *>;
|
||||||
|
using NodeArray = std::vector<aiNode *>;
|
||||||
|
|
||||||
/// \struct SPP_Composite
|
public:
|
||||||
/// Data type for post-processing step. More suitable container for part of material's composition.
|
struct SPP_Material;
|
||||||
|
|
||||||
|
/// Data type for post-processing step. More suitable container for part of material's composition.
|
||||||
struct SPP_Composite {
|
struct SPP_Composite {
|
||||||
SPP_Material* Material;///< Pointer to material - part of composition.
|
SPP_Material *Material; ///< Pointer to material - part of composition.
|
||||||
std::string Formula;///< Formula for calculating ratio of \ref Material.
|
std::string Formula; ///< Formula for calculating ratio of \ref Material.
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Data type for post-processing step. More suitable container for texture.
|
||||||
|
struct SPP_Texture {
|
||||||
|
std::string ID;
|
||||||
|
size_t Width, Height, Depth;
|
||||||
|
bool Tiled;
|
||||||
|
char FormatHint[9]; // 8 for string + 1 for terminator.
|
||||||
|
uint8_t *Data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Data type for post-processing step. Contain face data.
|
||||||
|
struct SComplexFace {
|
||||||
|
aiFace Face; ///< Face vertices.
|
||||||
|
const AMFColor *Color; ///< Face color. Equal to nullptr if color is not set for the face.
|
||||||
|
const AMFTexMap *TexMap; ///< Face texture mapping data. Equal to nullptr if texture mapping is not set for the face.
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct SPP_Material
|
|
||||||
/// Data type for post-processing step. More suitable container for material.
|
/// Data type for post-processing step. More suitable container for material.
|
||||||
struct SPP_Material {
|
struct SPP_Material {
|
||||||
std::string ID;///< Material ID.
|
std::string ID; ///< Material ID.
|
||||||
std::list<CAMFImporter_NodeElement_Metadata*> Metadata;///< Metadata of material.
|
std::list<AMFMetadata *> Metadata; ///< Metadata of material.
|
||||||
CAMFImporter_NodeElement_Color* Color;///< Color of material.
|
AMFColor *Color; ///< Color of material.
|
||||||
std::list<SPP_Composite> Composition;///< List of child materials if current material is composition of few another.
|
std::list<SPP_Composite> Composition; ///< List of child materials if current material is composition of few another.
|
||||||
|
|
||||||
/// Return color calculated for specified coordinate.
|
/// Return color calculated for specified coordinate.
|
||||||
/// \param [in] pX - "x" coordinate.
|
/// \param [in] pX - "x" coordinate.
|
||||||
|
@ -126,307 +142,167 @@ private:
|
||||||
aiColor4D GetColor(const float pX, const float pY, const float pZ) const;
|
aiColor4D GetColor(const float pX, const float pY, const float pZ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Data type for post-processing step. More suitable container for texture.
|
/// Default constructor.
|
||||||
struct SPP_Texture {
|
AMFImporter() AI_NO_EXCEPT;
|
||||||
std::string ID;
|
|
||||||
size_t Width, Height, Depth;
|
|
||||||
bool Tiled;
|
|
||||||
char FormatHint[9];// 8 for string + 1 for terminator.
|
|
||||||
uint8_t *Data;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Data type for post-processing step. Contain face data.
|
/// Default destructor.
|
||||||
struct SComplexFace {
|
~AMFImporter() override;
|
||||||
aiFace Face;///< Face vertices.
|
|
||||||
const CAMFImporter_NodeElement_Color* Color;///< Face color. Equal to nullptr if color is not set for the face.
|
|
||||||
const CAMFImporter_NodeElement_TexMap* TexMap;///< Face texture mapping data. Equal to nullptr if texture mapping is not set for the face.
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Clear all temporary data.
|
/// Parse AMF file and fill scene graph. The function has no return value. Result can be found by analyzing the generated graph.
|
||||||
void Clear();
|
/// Also exception can be thrown if trouble will found.
|
||||||
|
/// \param [in] pFile - name of file to be parsed.
|
||||||
/***********************************************/
|
/// \param [in] pIOHandler - pointer to IO helper object.
|
||||||
/************* Functions: find set *************/
|
void ParseFile(const std::string &pFile, IOSystem *pIOHandler);
|
||||||
/***********************************************/
|
void ParseHelper_Node_Enter(AMFNodeElementBase *child);
|
||||||
|
void ParseHelper_Node_Exit();
|
||||||
/// Find specified node element in node elements list ( \ref mNodeElement_List).
|
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool pCheckSig) const override;
|
||||||
/// \param [in] pID - ID(name) of requested node element.
|
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) override;
|
||||||
/// \param [in] pType - type of node element.
|
const aiImporterDesc *GetInfo() const override;
|
||||||
/// \param [out] pNode - pointer to pointer to item found.
|
bool Find_NodeElement(const std::string &pID, const AMFNodeElementBase::EType pType, AMFNodeElementBase **pNodeElement) const;
|
||||||
/// \return true - if the node element is found, else - false.
|
bool Find_ConvertedNode(const std::string &pID, NodeArray &nodeArray, aiNode **pNode) const;
|
||||||
bool Find_NodeElement(const std::string& pID, const CAMFImporter_NodeElement::EType pType, CAMFImporter_NodeElement** pNodeElement) const;
|
bool Find_ConvertedMaterial(const std::string &pID, const SPP_Material **pConvertedMaterial) const;
|
||||||
|
AI_WONT_RETURN void Throw_CloseNotFound(const std::string &nodeName) AI_WONT_RETURN_SUFFIX;
|
||||||
/// Find requested aiNode in node list.
|
AI_WONT_RETURN void Throw_IncorrectAttr(const std::string &nodeName, const std::string &pAttrName) AI_WONT_RETURN_SUFFIX;
|
||||||
/// \param [in] pID - ID(name) of requested node.
|
AI_WONT_RETURN void Throw_IncorrectAttrValue(const std::string &nodeName, const std::string &pAttrName) AI_WONT_RETURN_SUFFIX;
|
||||||
/// \param [in] pNodeList - list of nodes where to find the node.
|
AI_WONT_RETURN void Throw_MoreThanOnceDefined(const std::string &nodeName, const std::string &pNodeType, const std::string &pDescription) AI_WONT_RETURN_SUFFIX;
|
||||||
/// \param [out] pNode - pointer to pointer to item found.
|
AI_WONT_RETURN void Throw_ID_NotFound(const std::string &pID) const AI_WONT_RETURN_SUFFIX;
|
||||||
/// \return true - if the node is found, else - false.
|
void XML_CheckNode_MustHaveChildren(pugi::xml_node &node);
|
||||||
bool Find_ConvertedNode(const std::string& pID, std::list<aiNode*>& pNodeList, aiNode** pNode) const;
|
bool XML_SearchNode(const std::string &nodeName);
|
||||||
|
AMFImporter(const AMFImporter &pScene) = delete;
|
||||||
/// Find material in list for converted materials. Use at postprocessing step.
|
AMFImporter &operator=(const AMFImporter &pScene) = delete;
|
||||||
/// \param [in] pID - material ID.
|
|
||||||
/// \param [out] pConvertedMaterial - pointer to found converted material (\ref SPP_Material).
|
|
||||||
/// \return true - if the material is found, else - false.
|
|
||||||
bool Find_ConvertedMaterial(const std::string& pID, const SPP_Material** pConvertedMaterial) const;
|
|
||||||
|
|
||||||
/// Find texture in list of converted textures. Use at postprocessing step,
|
|
||||||
/// \param [in] pID_R - ID of source "red" texture.
|
|
||||||
/// \param [in] pID_G - ID of source "green" texture.
|
|
||||||
/// \param [in] pID_B - ID of source "blue" texture.
|
|
||||||
/// \param [in] pID_A - ID of source "alpha" texture. Use empty string to find RGB-texture.
|
|
||||||
/// \param [out] pConvertedTextureIndex - pointer where index in list of found texture will be written. If equivalent to nullptr then nothing will be
|
|
||||||
/// written.
|
|
||||||
/// \return true - if the texture is found, else - false.
|
|
||||||
bool Find_ConvertedTexture(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A,
|
|
||||||
uint32_t* pConvertedTextureIndex = nullptr) const;
|
|
||||||
|
|
||||||
|
|
||||||
/// Get data stored in <vertices> and place it to arrays.
|
|
||||||
/// \param [in] pNodeElement - reference to node element which kept <object> data.
|
|
||||||
/// \param [in] pVertexCoordinateArray - reference to vertices coordinates kept in <vertices>.
|
|
||||||
/// \param [in] pVertexColorArray - reference to vertices colors for all <vertex's. If color for vertex is not set then corresponding member of array
|
|
||||||
/// contain nullptr.
|
|
||||||
void PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector<aiVector3D>& pVertexCoordinateArray,
|
|
||||||
std::vector<CAMFImporter_NodeElement_Color*>& pVertexColorArray) const;
|
|
||||||
|
|
||||||
/// Return converted texture ID which related to specified source textures ID's. If converted texture does not exist then it will be created and ID on new
|
|
||||||
/// converted texture will be returned. Conversion: set of textures from \ref CAMFImporter_NodeElement_Texture to one \ref SPP_Texture and place it
|
|
||||||
/// to converted textures list.
|
|
||||||
/// Any of source ID's can be absent(empty string) or even one ID only specified. But at least one ID must be specified.
|
|
||||||
/// \param [in] pID_R - ID of source "red" texture.
|
|
||||||
/// \param [in] pID_G - ID of source "green" texture.
|
|
||||||
/// \param [in] pID_B - ID of source "blue" texture.
|
|
||||||
/// \param [in] pID_A - ID of source "alpha" texture.
|
|
||||||
/// \return index of the texture in array of the converted textures.
|
|
||||||
size_t PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B, const std::string& pID_A);
|
|
||||||
|
|
||||||
/// Separate input list by texture IDs. This step is needed because aiMesh can contain mesh which is use only one texture (or set: diffuse, bump etc).
|
|
||||||
/// \param [in] pInputList - input list with faces. Some of them can contain color or texture mapping, or both of them, or nothing. Will be cleared after
|
|
||||||
/// processing.
|
|
||||||
/// \param [out] pOutputList_Separated - output list of the faces lists. Separated faces list by used texture IDs. Will be cleared before processing.
|
|
||||||
void PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace>& pInputList, std::list<std::list<SComplexFace> >& pOutputList_Separated);
|
|
||||||
|
|
||||||
/// Check if child elements of node element is metadata and add it to scene node.
|
|
||||||
/// \param [in] pMetadataList - reference to list with collected metadata.
|
|
||||||
/// \param [out] pSceneNode - scene node in which metadata will be added.
|
|
||||||
void Postprocess_AddMetadata(const std::list<CAMFImporter_NodeElement_Metadata*>& pMetadataList, aiNode& pSceneNode) const;
|
|
||||||
|
|
||||||
/// To create aiMesh and aiNode for it from <object>.
|
|
||||||
/// \param [in] pNodeElement - reference to node element which kept <object> data.
|
|
||||||
/// \param [out] pMeshList - reference to a list with all aiMesh of the scene.
|
|
||||||
/// \param [out] pSceneNode - pointer to place where new aiNode will be created.
|
|
||||||
void Postprocess_BuildNodeAndObject(const CAMFImporter_NodeElement_Object& pNodeElement, std::list<aiMesh*>& pMeshList, aiNode** pSceneNode);
|
|
||||||
|
|
||||||
/// Create mesh for every <volume> in <mesh>.
|
|
||||||
/// \param [in] pNodeElement - reference to node element which kept <mesh> data.
|
|
||||||
/// \param [in] pVertexCoordinateArray - reference to vertices coordinates for all <volume>'s.
|
|
||||||
/// \param [in] pVertexColorArray - reference to vertices colors for all <volume>'s. If color for vertex is not set then corresponding member of array
|
|
||||||
/// contain nullptr.
|
|
||||||
/// \param [in] pObjectColor - pointer to colors for <object>. If color is not set then argument contain nullptr.
|
|
||||||
/// \param [in] pMaterialList - reference to a list with defined materials.
|
|
||||||
/// \param [out] pMeshList - reference to a list with all aiMesh of the scene.
|
|
||||||
/// \param [out] pSceneNode - reference to aiNode which will own new aiMesh's.
|
|
||||||
void Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh& pNodeElement, const std::vector<aiVector3D>& pVertexCoordinateArray,
|
|
||||||
const std::vector<CAMFImporter_NodeElement_Color*>& pVertexColorArray, const CAMFImporter_NodeElement_Color* pObjectColor,
|
|
||||||
std::list<aiMesh*>& pMeshList, aiNode& pSceneNode);
|
|
||||||
|
|
||||||
/// Convert material from \ref CAMFImporter_NodeElement_Material to \ref SPP_Material.
|
|
||||||
/// \param [in] pMaterial - source CAMFImporter_NodeElement_Material.
|
|
||||||
void Postprocess_BuildMaterial(const CAMFImporter_NodeElement_Material& pMaterial);
|
|
||||||
|
|
||||||
/// Create and add to aiNode's list new part of scene graph defined by <constellation>.
|
|
||||||
/// \param [in] pConstellation - reference to <constellation> node.
|
|
||||||
/// \param [out] pNodeList - reference to aiNode's list.
|
|
||||||
void Postprocess_BuildConstellation(CAMFImporter_NodeElement_Constellation& pConstellation, std::list<aiNode*>& pNodeList) const;
|
|
||||||
|
|
||||||
/// Build Assimp scene graph in aiScene from collected data.
|
|
||||||
/// \param [out] pScene - pointer to aiScene where tree will be built.
|
|
||||||
void Postprocess_BuildScene(aiScene* pScene);
|
|
||||||
|
|
||||||
|
|
||||||
/// Call that function when close tag of node not found and exception must be raised.
|
|
||||||
/// E.g.:
|
|
||||||
/// <amf>
|
|
||||||
/// <object>
|
|
||||||
/// </amf> <!--- object not closed --->
|
|
||||||
/// \throw DeadlyImportError.
|
|
||||||
/// \param [in] pNode - node name in which exception happened.
|
|
||||||
void Throw_CloseNotFound(const std::string& pNode);
|
|
||||||
|
|
||||||
/// Call that function when attribute name is incorrect and exception must be raised.
|
|
||||||
/// \param [in] pAttrName - attribute name.
|
|
||||||
/// \throw DeadlyImportError.
|
|
||||||
void Throw_IncorrectAttr(const std::string& pAttrName);
|
|
||||||
|
|
||||||
/// Call that function when attribute value is incorrect and exception must be raised.
|
|
||||||
/// \param [in] pAttrName - attribute name.
|
|
||||||
/// \throw DeadlyImportError.
|
|
||||||
void Throw_IncorrectAttrValue(const std::string& pAttrName);
|
|
||||||
|
|
||||||
/// Call that function when some type of nodes are defined twice or more when must be used only once and exception must be raised.
|
|
||||||
/// E.g.:
|
|
||||||
/// <object>
|
|
||||||
/// <color>... <!--- color defined --->
|
|
||||||
/// <color>... <!--- color defined again --->
|
|
||||||
/// </object>
|
|
||||||
/// \throw DeadlyImportError.
|
|
||||||
/// \param [in] pNodeType - type of node which defined one more time.
|
|
||||||
/// \param [in] pDescription - message about error. E.g. what the node defined while exception raised.
|
|
||||||
void Throw_MoreThanOnceDefined(const std::string& pNodeType, const std::string& pDescription);
|
|
||||||
|
|
||||||
/// Call that function when referenced element ID are not found in graph and exception must be raised.
|
|
||||||
/// \param [in] pID - ID of of element which not found.
|
|
||||||
/// \throw DeadlyImportError.
|
|
||||||
void Throw_ID_NotFound(const std::string& pID) const;
|
|
||||||
|
|
||||||
/// Check if current node have children: <node>...</node>. If not then exception will throwed.
|
|
||||||
void XML_CheckNode_MustHaveChildren();
|
|
||||||
|
|
||||||
/// Check if current node name is equal to pNodeName.
|
|
||||||
/// \param [in] pNodeName - name for checking.
|
|
||||||
/// return true if current node name is equal to pNodeName, else - false.
|
|
||||||
bool XML_CheckNode_NameEqual(const std::string& pNodeName) { return mReader->getNodeName() == pNodeName; }
|
|
||||||
|
|
||||||
/// Skip unsupported node and report about that. Depend on node name can be skipped begin tag of node all whole node.
|
|
||||||
/// \param [in] pParentNodeName - parent node name. Used for reporting.
|
|
||||||
void XML_CheckNode_SkipUnsupported(const std::string& pParentNodeName);
|
|
||||||
|
|
||||||
/// Search for specified node in file. XML file read pointer(mReader) will point to found node or file end after search is end.
|
|
||||||
/// \param [in] pNodeName - requested node name.
|
|
||||||
/// return true - if node is found, else - false.
|
|
||||||
bool XML_SearchNode(const std::string& pNodeName);
|
|
||||||
|
|
||||||
/// Read attribute value.
|
|
||||||
/// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set).
|
|
||||||
/// \return read data.
|
|
||||||
bool XML_ReadNode_GetAttrVal_AsBool(const int pAttrIdx);
|
|
||||||
|
|
||||||
/// Read attribute value.
|
|
||||||
/// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set).
|
|
||||||
/// \return read data.
|
|
||||||
float XML_ReadNode_GetAttrVal_AsFloat(const int pAttrIdx);
|
|
||||||
|
|
||||||
/// Read attribute value.
|
|
||||||
/// \param [in] pAttrIdx - attribute index (\ref mReader->getAttribute* set).
|
|
||||||
/// \return read data.
|
|
||||||
uint32_t XML_ReadNode_GetAttrVal_AsU32(const int pAttrIdx);
|
|
||||||
|
|
||||||
/// Read node value.
|
|
||||||
/// \return read data.
|
|
||||||
float XML_ReadNode_GetVal_AsFloat();
|
|
||||||
|
|
||||||
/// Read node value.
|
|
||||||
/// \return read data.
|
|
||||||
uint32_t XML_ReadNode_GetVal_AsU32();
|
|
||||||
|
|
||||||
/// Read node value.
|
|
||||||
/// \return read data.
|
|
||||||
void XML_ReadNode_GetVal_AsString(std::string& pValue);
|
|
||||||
|
|
||||||
/// Make pNode as current and enter deeper for parsing child nodes. At end \ref ParseHelper_Node_Exit must be called.
|
|
||||||
/// \param [in] pNode - new current node.
|
|
||||||
void ParseHelper_Node_Enter(CAMFImporter_NodeElement* pNode);
|
|
||||||
|
|
||||||
/// This function must be called when exiting from grouping node. \ref ParseHelper_Group_Begin.
|
|
||||||
void ParseHelper_Node_Exit();
|
|
||||||
|
|
||||||
/// Attribute values of floating point types can take form ".x"(without leading zero). irrXMLReader can not read this form of values and it
|
|
||||||
/// must be converted to right form - "0.xxx".
|
|
||||||
/// \param [in] pInStr - pointer to input string which can contain incorrect form of values.
|
|
||||||
/// \param [out[ pOutString - output string with right form of values.
|
|
||||||
void ParseHelper_FixTruncatedFloatString(const char* pInStr, std::string& pOutString);
|
|
||||||
|
|
||||||
/// Decode Base64-encoded data.
|
|
||||||
/// \param [in] pInputBase64 - reference to input Base64-encoded string.
|
|
||||||
/// \param [out] pOutputData - reference to output array for decoded data.
|
|
||||||
void ParseHelper_Decode_Base64(const std::string& pInputBase64, std::vector<uint8_t>& pOutputData) const;
|
|
||||||
|
|
||||||
/// Parse <AMF> node of the file.
|
|
||||||
void ParseNode_Root();
|
|
||||||
|
|
||||||
/// Parse <constellation> node of the file.
|
|
||||||
void ParseNode_Constellation();
|
|
||||||
|
|
||||||
/// Parse <instance> node of the file.
|
|
||||||
void ParseNode_Instance();
|
|
||||||
|
|
||||||
/// Parse <material> node of the file.
|
|
||||||
void ParseNode_Material();
|
|
||||||
|
|
||||||
/// Parse <metadata> node.
|
|
||||||
void ParseNode_Metadata();
|
|
||||||
|
|
||||||
/// Parse <object> node of the file.
|
|
||||||
void ParseNode_Object();
|
|
||||||
|
|
||||||
/// Parse <texture> node of the file.
|
|
||||||
void ParseNode_Texture();
|
|
||||||
|
|
||||||
/// Parse <coordinates> node of the file.
|
|
||||||
void ParseNode_Coordinates();
|
|
||||||
|
|
||||||
/// Parse <edge> node of the file.
|
|
||||||
void ParseNode_Edge();
|
|
||||||
|
|
||||||
/// Parse <mesh> node of the file.
|
|
||||||
void ParseNode_Mesh();
|
|
||||||
|
|
||||||
/// Parse <triangle> node of the file.
|
|
||||||
void ParseNode_Triangle();
|
|
||||||
|
|
||||||
/// Parse <vertex> node of the file.
|
|
||||||
void ParseNode_Vertex();
|
|
||||||
|
|
||||||
/// Parse <vertices> node of the file.
|
|
||||||
void ParseNode_Vertices();
|
|
||||||
|
|
||||||
/// Parse <volume> node of the file.
|
|
||||||
void ParseNode_Volume();
|
|
||||||
|
|
||||||
/// Parse <color> node of the file.
|
|
||||||
void ParseNode_Color();
|
|
||||||
|
|
||||||
/// Parse <texmap> of <map> node of the file.
|
|
||||||
/// \param [in] pUseOldName - if true then use old name of node(and children) - <map>, instead of new name - <texmap>.
|
|
||||||
void ParseNode_TexMap(const bool pUseOldName = false);
|
|
||||||
|
|
||||||
public:
|
|
||||||
/// Default constructor.
|
|
||||||
AMFImporter() AI_NO_EXCEPT
|
|
||||||
: mNodeElement_Cur(nullptr)
|
|
||||||
, mReader(nullptr) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Default destructor.
|
|
||||||
~AMFImporter();
|
|
||||||
|
|
||||||
/// Parse AMF file and fill scene graph. The function has no return value. Result can be found by analyzing the generated graph.
|
|
||||||
/// Also exception can be thrown if trouble will found.
|
|
||||||
/// \param [in] pFile - name of file to be parsed.
|
|
||||||
/// \param [in] pIOHandler - pointer to IO helper object.
|
|
||||||
void ParseFile(const std::string& pFile, IOSystem* pIOHandler);
|
|
||||||
|
|
||||||
bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool pCheckSig) const;
|
|
||||||
void GetExtensionList(std::set<std::string>& pExtensionList);
|
|
||||||
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
|
||||||
const aiImporterDesc* GetInfo ()const;
|
|
||||||
|
|
||||||
AMFImporter(const AMFImporter& pScene) = delete;
|
|
||||||
AMFImporter& operator=(const AMFImporter& pScene) = delete;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const aiImporterDesc Description;
|
/// Clear all temporary data.
|
||||||
|
void Clear();
|
||||||
|
|
||||||
CAMFImporter_NodeElement* mNodeElement_Cur;///< Current element.
|
/// Get data stored in <vertices> and place it to arrays.
|
||||||
std::list<CAMFImporter_NodeElement*> mNodeElement_List;///< All elements of scene graph.
|
/// \param [in] pNodeElement - reference to node element which kept <object> data.
|
||||||
irr::io::IrrXMLReader* mReader;///< Pointer to XML-reader object
|
/// \param [in] pVertexCoordinateArray - reference to vertices coordinates kept in <vertices>.
|
||||||
|
/// \param [in] pVertexColorArray - reference to vertices colors for all <vertex's. If color for vertex is not set then corresponding member of array
|
||||||
|
/// contain nullptr.
|
||||||
|
void PostprocessHelper_CreateMeshDataArray(const AMFMesh &pNodeElement, std::vector<aiVector3D> &pVertexCoordinateArray,
|
||||||
|
std::vector<AMFColor *> &pVertexColorArray) const;
|
||||||
|
|
||||||
|
/// Return converted texture ID which related to specified source textures ID's. If converted texture does not exist then it will be created and ID on new
|
||||||
|
/// converted texture will be returned. Conversion: set of textures from \ref CAMFImporter_NodeElement_Texture to one \ref SPP_Texture and place it
|
||||||
|
/// to converted textures list.
|
||||||
|
/// Any of source ID's can be absent(empty string) or even one ID only specified. But at least one ID must be specified.
|
||||||
|
/// \param [in] pID_R - ID of source "red" texture.
|
||||||
|
/// \param [in] pID_G - ID of source "green" texture.
|
||||||
|
/// \param [in] pID_B - ID of source "blue" texture.
|
||||||
|
/// \param [in] pID_A - ID of source "alpha" texture.
|
||||||
|
/// \return index of the texture in array of the converted textures.
|
||||||
|
size_t PostprocessHelper_GetTextureID_Or_Create(const std::string &pID_R, const std::string &pID_G, const std::string &pID_B, const std::string &pID_A);
|
||||||
|
|
||||||
|
/// Separate input list by texture IDs. This step is needed because aiMesh can contain mesh which is use only one texture (or set: diffuse, bump etc).
|
||||||
|
/// \param [in] pInputList - input list with faces. Some of them can contain color or texture mapping, or both of them, or nothing. Will be cleared after
|
||||||
|
/// processing.
|
||||||
|
/// \param [out] pOutputList_Separated - output list of the faces lists. Separated faces list by used texture IDs. Will be cleared before processing.
|
||||||
|
void PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace> &pInputList, std::list<std::list<SComplexFace>> &pOutputList_Separated);
|
||||||
|
|
||||||
|
/// Check if child elements of node element is metadata and add it to scene node.
|
||||||
|
/// \param [in] pMetadataList - reference to list with collected metadata.
|
||||||
|
/// \param [out] pSceneNode - scene node in which metadata will be added.
|
||||||
|
void Postprocess_AddMetadata(const AMFMetaDataArray &pMetadataList, aiNode &pSceneNode) const;
|
||||||
|
|
||||||
|
/// To create aiMesh and aiNode for it from <object>.
|
||||||
|
/// \param [in] pNodeElement - reference to node element which kept <object> data.
|
||||||
|
/// \param [out] meshList - reference to a list with all aiMesh of the scene.
|
||||||
|
/// \param [out] pSceneNode - pointer to place where new aiNode will be created.
|
||||||
|
void Postprocess_BuildNodeAndObject(const AMFObject &pNodeElement, MeshArray &meshList, aiNode **pSceneNode);
|
||||||
|
|
||||||
|
/// Create mesh for every <volume> in <mesh>.
|
||||||
|
/// \param [in] pNodeElement - reference to node element which kept <mesh> data.
|
||||||
|
/// \param [in] pVertexCoordinateArray - reference to vertices coordinates for all <volume>'s.
|
||||||
|
/// \param [in] pVertexColorArray - reference to vertices colors for all <volume>'s. If color for vertex is not set then corresponding member of array
|
||||||
|
/// contain nullptr.
|
||||||
|
/// \param [in] pObjectColor - pointer to colors for <object>. If color is not set then argument contain nullptr.
|
||||||
|
/// \param [in] pMaterialList - reference to a list with defined materials.
|
||||||
|
/// \param [out] pMeshList - reference to a list with all aiMesh of the scene.
|
||||||
|
/// \param [out] pSceneNode - reference to aiNode which will own new aiMesh's.
|
||||||
|
void Postprocess_BuildMeshSet(const AMFMesh &pNodeElement, const std::vector<aiVector3D> &pVertexCoordinateArray,
|
||||||
|
const std::vector<AMFColor *> &pVertexColorArray, const AMFColor *pObjectColor,
|
||||||
|
MeshArray &pMeshList, aiNode &pSceneNode);
|
||||||
|
|
||||||
|
/// Convert material from \ref CAMFImporter_NodeElement_Material to \ref SPP_Material.
|
||||||
|
/// \param [in] pMaterial - source CAMFImporter_NodeElement_Material.
|
||||||
|
void Postprocess_BuildMaterial(const AMFMaterial &pMaterial);
|
||||||
|
|
||||||
|
/// Create and add to aiNode's list new part of scene graph defined by <constellation>.
|
||||||
|
/// \param [in] pConstellation - reference to <constellation> node.
|
||||||
|
/// \param [out] nodeArray - reference to aiNode's list.
|
||||||
|
void Postprocess_BuildConstellation(AMFConstellation &pConstellation, NodeArray &nodeArray) const;
|
||||||
|
|
||||||
|
/// Build Assimp scene graph in aiScene from collected data.
|
||||||
|
/// \param [out] pScene - pointer to aiScene where tree will be built.
|
||||||
|
void Postprocess_BuildScene(aiScene *pScene);
|
||||||
|
|
||||||
|
/// Decode Base64-encoded data.
|
||||||
|
/// \param [in] pInputBase64 - reference to input Base64-encoded string.
|
||||||
|
/// \param [out] pOutputData - reference to output array for decoded data.
|
||||||
|
void ParseHelper_Decode_Base64(const std::string &pInputBase64, std::vector<uint8_t> &pOutputData) const;
|
||||||
|
|
||||||
|
/// Parse <AMF> node of the file.
|
||||||
|
void ParseNode_Root();
|
||||||
|
|
||||||
|
/// Parse <constellation> node of the file.
|
||||||
|
void ParseNode_Constellation(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <instance> node of the file.
|
||||||
|
void ParseNode_Instance(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <material> node of the file.
|
||||||
|
void ParseNode_Material(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <metadata> node.
|
||||||
|
void ParseNode_Metadata(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <object> node of the file.
|
||||||
|
void ParseNode_Object(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <texture> node of the file.
|
||||||
|
void ParseNode_Texture(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <coordinates> node of the file.
|
||||||
|
void ParseNode_Coordinates(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <edge> node of the file.
|
||||||
|
void ParseNode_Edge(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <mesh> node of the file.
|
||||||
|
void ParseNode_Mesh(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <triangle> node of the file.
|
||||||
|
void ParseNode_Triangle(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <vertex> node of the file.
|
||||||
|
void ParseNode_Vertex(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <vertices> node of the file.
|
||||||
|
void ParseNode_Vertices(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <volume> node of the file.
|
||||||
|
void ParseNode_Volume(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <color> node of the file.
|
||||||
|
void ParseNode_Color(XmlNode &node);
|
||||||
|
|
||||||
|
/// Parse <texmap> of <map> node of the file.
|
||||||
|
/// \param [in] pUseOldName - if true then use old name of node(and children) - <map>, instead of new name - <texmap>.
|
||||||
|
void ParseNode_TexMap(XmlNode &node, const bool pUseOldName = false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
AMFNodeElementBase *mNodeElement_Cur; ///< Current element.
|
||||||
|
std::list<AMFNodeElementBase *> mNodeElement_List; ///< All elements of scene graph.
|
||||||
|
XmlParser *mXmlParser;
|
||||||
std::string mUnit;
|
std::string mUnit;
|
||||||
std::list<SPP_Material> mMaterial_Converted;///< List of converted materials for postprocessing step.
|
std::string mVersion;
|
||||||
std::list<SPP_Texture> mTexture_Converted;///< List of converted textures for postprocessing step.
|
std::list<SPP_Material> mMaterial_Converted; ///< List of converted materials for postprocessing step.
|
||||||
|
std::list<SPP_Texture> mTexture_Converted; ///< List of converted textures for postprocessing step.
|
||||||
};
|
};
|
||||||
|
|
||||||
}// namespace Assimp
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // INCLUDED_AI_AMF_IMPORTER_H
|
#endif // INCLUDED_AI_AMF_IMPORTER_H
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -41,58 +39,50 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// \file AMFImporter_Geometry.cpp
|
|
||||||
/// \brief Parsing data from geometry nodes.
|
|
||||||
/// \date 2016
|
|
||||||
/// \author smal.root@gmail.com
|
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
|
||||||
|
|
||||||
#include "AMFImporter.hpp"
|
#include "AMFImporter.hpp"
|
||||||
#include "AMFImporter_Macro.hpp"
|
#include <assimp/ParsingUtils.h>
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp {
|
||||||
{
|
|
||||||
|
|
||||||
// <mesh>
|
// <mesh>
|
||||||
// </mesh>
|
// </mesh>
|
||||||
// A 3D mesh hull.
|
// A 3D mesh hull.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <object>.
|
// Parent element - <object>.
|
||||||
void AMFImporter::ParseNode_Mesh()
|
void AMFImporter::ParseNode_Mesh(XmlNode &node) {
|
||||||
{
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement* ne;
|
|
||||||
|
|
||||||
// create new mesh object.
|
// Check for child nodes
|
||||||
ne = new CAMFImporter_NodeElement_Mesh(mNodeElement_Cur);
|
if (0 != ASSIMP_stricmp(node.name(), "mesh")) {
|
||||||
// Check for child nodes
|
return;
|
||||||
if(!mReader->isEmptyElement())
|
}
|
||||||
{
|
// create new mesh object.
|
||||||
bool vert_read = false;
|
ne = new AMFMesh(mNodeElement_Cur);
|
||||||
|
bool found_verts = false, found_volumes = false;
|
||||||
|
if (!node.empty()) {
|
||||||
|
ParseHelper_Node_Enter(ne);
|
||||||
|
pugi::xml_node vertNode = node.child("vertices");
|
||||||
|
if (!vertNode.empty()) {
|
||||||
|
ParseNode_Vertices(vertNode);
|
||||||
|
found_verts = true;
|
||||||
|
}
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
pugi::xml_node volumeNode = node.child("volume");
|
||||||
MACRO_NODECHECK_LOOPBEGIN("mesh");
|
if (!volumeNode.empty()) {
|
||||||
if(XML_CheckNode_NameEqual("vertices"))
|
ParseNode_Volume(volumeNode);
|
||||||
{
|
found_volumes = true;
|
||||||
// Check if data already defined.
|
}
|
||||||
if(vert_read) Throw_MoreThanOnceDefined("vertices", "Only one vertices set can be defined for <mesh>.");
|
ParseHelper_Node_Exit();
|
||||||
// read data and set flag about it
|
}
|
||||||
ParseNode_Vertices();
|
|
||||||
vert_read = true;
|
|
||||||
|
|
||||||
continue;
|
if (!found_verts && !found_volumes) {
|
||||||
}
|
mNodeElement_Cur->Child.push_back(ne);
|
||||||
|
} // if(!mReader->isEmptyElement()) else
|
||||||
|
|
||||||
if(XML_CheckNode_NameEqual("volume")) { ParseNode_Volume(); continue; }
|
// and to node element list because its a new object in graph.
|
||||||
MACRO_NODECHECK_LOOPEND("mesh");
|
mNodeElement_List.push_back(ne);
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
}// if(!mReader->isEmptyElement())
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
|
||||||
}// if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <vertices>
|
// <vertices>
|
||||||
|
@ -100,27 +90,25 @@ CAMFImporter_NodeElement* ne;
|
||||||
// The list of vertices to be used in defining triangles.
|
// The list of vertices to be used in defining triangles.
|
||||||
// Multi elements - No.
|
// Multi elements - No.
|
||||||
// Parent element - <mesh>.
|
// Parent element - <mesh>.
|
||||||
void AMFImporter::ParseNode_Vertices()
|
void AMFImporter::ParseNode_Vertices(XmlNode &node) {
|
||||||
{
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement* ne;
|
|
||||||
|
|
||||||
// create new mesh object.
|
// create new mesh object.
|
||||||
ne = new CAMFImporter_NodeElement_Vertices(mNodeElement_Cur);
|
ne = new AMFVertices(mNodeElement_Cur);
|
||||||
// Check for child nodes
|
// Check for child nodes
|
||||||
if(!mReader->isEmptyElement())
|
if (node.empty()) {
|
||||||
{
|
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
||||||
ParseHelper_Node_Enter(ne);
|
return;
|
||||||
MACRO_NODECHECK_LOOPBEGIN("vertices");
|
}
|
||||||
if(XML_CheckNode_NameEqual("vertex")) { ParseNode_Vertex(); continue; }
|
ParseHelper_Node_Enter(ne);
|
||||||
MACRO_NODECHECK_LOOPEND("vertices");
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
ParseHelper_Node_Exit();
|
const std::string ¤tName = currentNode.name();
|
||||||
}// if(!mReader->isEmptyElement())
|
if (currentName == "vertex") {
|
||||||
else
|
ParseNode_Vertex(currentNode);
|
||||||
{
|
}
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
}
|
||||||
}// if(!mReader->isEmptyElement()) else
|
ParseHelper_Node_Exit();
|
||||||
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <vertex>
|
// <vertex>
|
||||||
|
@ -128,52 +116,35 @@ CAMFImporter_NodeElement* ne;
|
||||||
// A vertex to be referenced in triangles.
|
// A vertex to be referenced in triangles.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <vertices>.
|
// Parent element - <vertices>.
|
||||||
void AMFImporter::ParseNode_Vertex()
|
void AMFImporter::ParseNode_Vertex(XmlNode &node) {
|
||||||
{
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement* ne;
|
|
||||||
|
|
||||||
// create new mesh object.
|
// create new mesh object.
|
||||||
ne = new CAMFImporter_NodeElement_Vertex(mNodeElement_Cur);
|
ne = new AMFVertex(mNodeElement_Cur);
|
||||||
// Check for child nodes
|
|
||||||
if(!mReader->isEmptyElement())
|
|
||||||
{
|
|
||||||
bool col_read = false;
|
|
||||||
bool coord_read = false;
|
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
// Check for child nodes
|
||||||
MACRO_NODECHECK_LOOPBEGIN("vertex");
|
pugi::xml_node colorNode = node.child("color");
|
||||||
if(XML_CheckNode_NameEqual("color"))
|
bool col_read = false;
|
||||||
{
|
bool coord_read = false;
|
||||||
// Check if data already defined.
|
if (!node.empty()) {
|
||||||
if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for <vertex>.");
|
ParseHelper_Node_Enter(ne);
|
||||||
// read data and set flag about it
|
if (!colorNode.empty()) {
|
||||||
ParseNode_Color();
|
ParseNode_Color(colorNode);
|
||||||
col_read = true;
|
col_read = true;
|
||||||
|
}
|
||||||
|
pugi::xml_node coordNode = node.child("coordinates");
|
||||||
|
if (!coordNode.empty()) {
|
||||||
|
ParseNode_Coordinates(coordNode);
|
||||||
|
coord_read = true;
|
||||||
|
}
|
||||||
|
ParseHelper_Node_Exit();
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
if (!coord_read && !col_read) {
|
||||||
}
|
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
||||||
|
}
|
||||||
|
|
||||||
if(XML_CheckNode_NameEqual("coordinates"))
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
{
|
|
||||||
// Check if data already defined.
|
|
||||||
if(coord_read) Throw_MoreThanOnceDefined("coordinates", "Only one coordinates set can be defined for <vertex>.");
|
|
||||||
// read data and set flag about it
|
|
||||||
ParseNode_Coordinates();
|
|
||||||
coord_read = true;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; }
|
|
||||||
MACRO_NODECHECK_LOOPEND("vertex");
|
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
}// if(!mReader->isEmptyElement())
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
|
||||||
}// if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <coordinates>
|
// <coordinates>
|
||||||
|
@ -186,94 +157,76 @@ CAMFImporter_NodeElement* ne;
|
||||||
// <x>, <y>, <z>
|
// <x>, <y>, <z>
|
||||||
// Multi elements - No.
|
// Multi elements - No.
|
||||||
// X, Y, or Z coordinate, respectively, of a vertex position in space.
|
// X, Y, or Z coordinate, respectively, of a vertex position in space.
|
||||||
void AMFImporter::ParseNode_Coordinates()
|
void AMFImporter::ParseNode_Coordinates(XmlNode &node) {
|
||||||
{
|
AMFNodeElementBase *ne = nullptr;
|
||||||
CAMFImporter_NodeElement* ne;
|
if (!node.empty()) {
|
||||||
|
ne = new AMFCoordinates(mNodeElement_Cur);
|
||||||
|
ParseHelper_Node_Enter(ne);
|
||||||
|
for (XmlNode ¤tNode : node.children()) {
|
||||||
|
// create new color object.
|
||||||
|
AMFCoordinates &als = *((AMFCoordinates *)ne); // alias for convenience
|
||||||
|
const std::string ¤tName = ai_tolower(currentNode.name());
|
||||||
|
if (currentName == "x") {
|
||||||
|
XmlParser::getValueAsReal(currentNode, als.Coordinate.x);
|
||||||
|
} else if (currentName == "y") {
|
||||||
|
XmlParser::getValueAsReal(currentNode, als.Coordinate.y);
|
||||||
|
} else if (currentName == "z") {
|
||||||
|
XmlParser::getValueAsReal(currentNode, als.Coordinate.z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ParseHelper_Node_Exit();
|
||||||
|
|
||||||
// create new color object.
|
} else {
|
||||||
ne = new CAMFImporter_NodeElement_Coordinates(mNodeElement_Cur);
|
mNodeElement_Cur->Child.push_back(new AMFCoordinates(mNodeElement_Cur));
|
||||||
|
}
|
||||||
|
|
||||||
CAMFImporter_NodeElement_Coordinates& als = *((CAMFImporter_NodeElement_Coordinates*)ne);// alias for convenience
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
|
|
||||||
// Check for child nodes
|
|
||||||
if(!mReader->isEmptyElement())
|
|
||||||
{
|
|
||||||
bool read_flag[3] = { false, false, false };
|
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
|
||||||
MACRO_NODECHECK_LOOPBEGIN("coordinates");
|
|
||||||
MACRO_NODECHECK_READCOMP_F("x", read_flag[0], als.Coordinate.x);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("y", read_flag[1], als.Coordinate.y);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("z", read_flag[2], als.Coordinate.z);
|
|
||||||
MACRO_NODECHECK_LOOPEND("coordinates");
|
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
// check that all components was defined
|
|
||||||
if((read_flag[0] && read_flag[1] && read_flag[2]) == 0) throw DeadlyImportError("Not all coordinate's components are defined.");
|
|
||||||
|
|
||||||
}// if(!mReader->isEmptyElement())
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
|
||||||
}// if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <volume
|
// <volume
|
||||||
// materialid="" - Which material to use.
|
// materialid="" - Which material to use.
|
||||||
// type="" - What this volume describes can be “region” or “support”. If none specified, “object” is assumed. If support, then the geometric
|
// type="" - What this volume describes can be "region" or "support". If none specified, "object" is assumed. If support, then the geometric
|
||||||
// requirements 1-8 listed in section 5 do not need to be maintained.
|
// requirements 1-8 listed in section 5 do not need to be maintained.
|
||||||
// >
|
// >
|
||||||
// </volume>
|
// </volume>
|
||||||
// Defines a volume from the established vertex list.
|
// Defines a volume from the established vertex list.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <mesh>.
|
// Parent element - <mesh>.
|
||||||
void AMFImporter::ParseNode_Volume()
|
void AMFImporter::ParseNode_Volume(XmlNode &node) {
|
||||||
{
|
std::string materialid;
|
||||||
std::string materialid;
|
std::string type;
|
||||||
std::string type;
|
AMFNodeElementBase *ne = new AMFVolume(mNodeElement_Cur);
|
||||||
CAMFImporter_NodeElement* ne;
|
|
||||||
|
|
||||||
// Read attributes for node <color>.
|
// Read attributes for node <color>.
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
// and assign read data
|
||||||
MACRO_ATTRREAD_CHECK_RET("materialid", materialid, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("type", type, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
|
||||||
|
|
||||||
// create new object.
|
((AMFVolume *)ne)->MaterialID = node.attribute("materialid").as_string();
|
||||||
ne = new CAMFImporter_NodeElement_Volume(mNodeElement_Cur);
|
|
||||||
// and assign read data
|
|
||||||
((CAMFImporter_NodeElement_Volume*)ne)->MaterialID = materialid;
|
|
||||||
((CAMFImporter_NodeElement_Volume*)ne)->Type = type;
|
|
||||||
// Check for child nodes
|
|
||||||
if(!mReader->isEmptyElement())
|
|
||||||
{
|
|
||||||
bool col_read = false;
|
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
((AMFVolume *)ne)->Type = type;
|
||||||
MACRO_NODECHECK_LOOPBEGIN("volume");
|
// Check for child nodes
|
||||||
if(XML_CheckNode_NameEqual("color"))
|
bool col_read = false;
|
||||||
{
|
if (!node.empty()) {
|
||||||
// Check if data already defined.
|
ParseHelper_Node_Enter(ne);
|
||||||
if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for <volume>.");
|
for (auto ¤tNode : node.children()) {
|
||||||
// read data and set flag about it
|
const std::string currentName = currentNode.name();
|
||||||
ParseNode_Color();
|
if (currentName == "color") {
|
||||||
col_read = true;
|
if (col_read) Throw_MoreThanOnceDefined(currentName, "color", "Only one color can be defined for <volume>.");
|
||||||
|
ParseNode_Color(currentNode);
|
||||||
|
col_read = true;
|
||||||
|
} else if (currentName == "triangle") {
|
||||||
|
ParseNode_Triangle(currentNode);
|
||||||
|
} else if (currentName == "metadata") {
|
||||||
|
ParseNode_Metadata(currentNode);
|
||||||
|
} else if (currentName == "volume") {
|
||||||
|
ParseNode_Metadata(currentNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ParseHelper_Node_Exit();
|
||||||
|
} else {
|
||||||
|
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
}
|
|
||||||
|
|
||||||
if(XML_CheckNode_NameEqual("triangle")) { ParseNode_Triangle(); continue; }
|
|
||||||
if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; }
|
|
||||||
MACRO_NODECHECK_LOOPEND("volume");
|
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
}// if(!mReader->isEmptyElement())
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
|
||||||
}// if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <triangle>
|
// <triangle>
|
||||||
|
@ -286,72 +239,46 @@ CAMFImporter_NodeElement* ne;
|
||||||
// <v1>, <v2>, <v3>
|
// <v1>, <v2>, <v3>
|
||||||
// Multi elements - No.
|
// Multi elements - No.
|
||||||
// Index of the desired vertices in a triangle or edge.
|
// Index of the desired vertices in a triangle or edge.
|
||||||
void AMFImporter::ParseNode_Triangle()
|
void AMFImporter::ParseNode_Triangle(XmlNode &node) {
|
||||||
{
|
AMFNodeElementBase *ne = new AMFTriangle(mNodeElement_Cur);
|
||||||
CAMFImporter_NodeElement* ne;
|
|
||||||
|
|
||||||
// create new color object.
|
// create new triangle object.
|
||||||
ne = new CAMFImporter_NodeElement_Triangle(mNodeElement_Cur);
|
|
||||||
|
|
||||||
CAMFImporter_NodeElement_Triangle& als = *((CAMFImporter_NodeElement_Triangle*)ne);// alias for convenience
|
AMFTriangle &als = *((AMFTriangle *)ne); // alias for convenience
|
||||||
|
|
||||||
// Check for child nodes
|
bool col_read = false;
|
||||||
if(!mReader->isEmptyElement())
|
if (!node.empty()) {
|
||||||
{
|
ParseHelper_Node_Enter(ne);
|
||||||
bool col_read = false, tex_read = false;
|
std::string v;
|
||||||
bool read_flag[3] = { false, false, false };
|
for (auto ¤tNode : node.children()) {
|
||||||
|
const std::string currentName = currentNode.name();
|
||||||
|
if (currentName == "color") {
|
||||||
|
if (col_read) Throw_MoreThanOnceDefined(currentName, "color", "Only one color can be defined for <triangle>.");
|
||||||
|
ParseNode_Color(currentNode);
|
||||||
|
col_read = true;
|
||||||
|
} else if (currentName == "texmap") {
|
||||||
|
ParseNode_TexMap(currentNode);
|
||||||
|
} else if (currentName == "map") {
|
||||||
|
ParseNode_TexMap(currentNode, true);
|
||||||
|
} else if (currentName == "v1") {
|
||||||
|
XmlParser::getValueAsString(currentNode, v);
|
||||||
|
als.V[0] = std::atoi(v.c_str());
|
||||||
|
} else if (currentName == "v2") {
|
||||||
|
XmlParser::getValueAsString(currentNode, v);
|
||||||
|
als.V[1] = std::atoi(v.c_str());
|
||||||
|
} else if (currentName == "v3") {
|
||||||
|
XmlParser::getValueAsString(currentNode, v);
|
||||||
|
als.V[2] = std::atoi(v.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ParseHelper_Node_Exit();
|
||||||
|
} else {
|
||||||
|
mNodeElement_Cur->Child.push_back(ne); // Add element to child list of current element
|
||||||
|
}
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
MACRO_NODECHECK_LOOPBEGIN("triangle");
|
|
||||||
if(XML_CheckNode_NameEqual("color"))
|
|
||||||
{
|
|
||||||
// Check if data already defined.
|
|
||||||
if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for <triangle>.");
|
|
||||||
// read data and set flag about it
|
|
||||||
ParseNode_Color();
|
|
||||||
col_read = true;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(XML_CheckNode_NameEqual("texmap"))// new name of node: "texmap".
|
|
||||||
{
|
|
||||||
// Check if data already defined.
|
|
||||||
if(tex_read) Throw_MoreThanOnceDefined("texmap", "Only one texture coordinate can be defined for <triangle>.");
|
|
||||||
// read data and set flag about it
|
|
||||||
ParseNode_TexMap();
|
|
||||||
tex_read = true;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if(XML_CheckNode_NameEqual("map"))// old name of node: "map".
|
|
||||||
{
|
|
||||||
// Check if data already defined.
|
|
||||||
if(tex_read) Throw_MoreThanOnceDefined("map", "Only one texture coordinate can be defined for <triangle>.");
|
|
||||||
// read data and set flag about it
|
|
||||||
ParseNode_TexMap(true);
|
|
||||||
tex_read = true;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
MACRO_NODECHECK_READCOMP_U32("v1", read_flag[0], als.V[0]);
|
|
||||||
MACRO_NODECHECK_READCOMP_U32("v2", read_flag[1], als.V[1]);
|
|
||||||
MACRO_NODECHECK_READCOMP_U32("v3", read_flag[2], als.V[2]);
|
|
||||||
MACRO_NODECHECK_LOOPEND("triangle");
|
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
// check that all components was defined
|
|
||||||
if((read_flag[0] && read_flag[1] && read_flag[2]) == 0) throw DeadlyImportError("Not all vertices of the triangle are defined.");
|
|
||||||
|
|
||||||
}// if(!mReader->isEmptyElement())
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
|
||||||
}// if(!mReader->isEmptyElement()) else
|
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}// namespace Assimp
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // !ASSIMP_BUILD_NO_AMF_IMPORTER
|
#endif // !ASSIMP_BUILD_NO_AMF_IMPORTER
|
||||||
|
|
|
@ -1,166 +0,0 @@
|
||||||
/*
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
Open Asset Import Library (assimp)
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
|
||||||
with or without modification, are permitted provided that the following
|
|
||||||
conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above
|
|
||||||
copyright notice, this list of conditions and the
|
|
||||||
following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the
|
|
||||||
following disclaimer in the documentation and/or other
|
|
||||||
materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the assimp team, nor the names of its
|
|
||||||
contributors may be used to endorse or promote products
|
|
||||||
derived from this software without specific prior
|
|
||||||
written permission of the assimp team.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// \file AMFImporter_Macro.hpp
|
|
||||||
/// \brief Useful macrodefines.
|
|
||||||
/// \date 2016
|
|
||||||
/// \author smal.root@gmail.com
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#ifndef AMFIMPORTER_MACRO_HPP_INCLUDED
|
|
||||||
#define AMFIMPORTER_MACRO_HPP_INCLUDED
|
|
||||||
|
|
||||||
/// \def MACRO_ATTRREAD_LOOPBEG
|
|
||||||
/// Begin of loop that read attributes values.
|
|
||||||
#define MACRO_ATTRREAD_LOOPBEG \
|
|
||||||
for(int idx = 0, idx_end = mReader->getAttributeCount(); idx < idx_end; idx++) \
|
|
||||||
{ \
|
|
||||||
std::string an(mReader->getAttributeName(idx));
|
|
||||||
|
|
||||||
/// \def MACRO_ATTRREAD_LOOPEND
|
|
||||||
/// End of loop that read attributes values.
|
|
||||||
#define MACRO_ATTRREAD_LOOPEND \
|
|
||||||
Throw_IncorrectAttr(an); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \def MACRO_ATTRREAD_LOOPEND_WSKIP
|
|
||||||
/// End of loop that read attributes values. Difference from \ref MACRO_ATTRREAD_LOOPEND in that: current macro skip unknown attributes, but
|
|
||||||
/// \ref MACRO_ATTRREAD_LOOPEND throw an exception.
|
|
||||||
#define MACRO_ATTRREAD_LOOPEND_WSKIP \
|
|
||||||
continue; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \def MACRO_ATTRREAD_CHECK_REF
|
|
||||||
/// Check current attribute name and if it equal to requested then read value. Result write to output variable by reference. If result was read then
|
|
||||||
/// "continue" will called.
|
|
||||||
/// \param [in] pAttrName - attribute name.
|
|
||||||
/// \param [out] pVarName - output variable name.
|
|
||||||
/// \param [in] pFunction - function which read attribute value and write it to pVarName.
|
|
||||||
#define MACRO_ATTRREAD_CHECK_REF(pAttrName, pVarName, pFunction) \
|
|
||||||
if(an == pAttrName) \
|
|
||||||
{ \
|
|
||||||
pFunction(idx, pVarName); \
|
|
||||||
continue; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \def MACRO_ATTRREAD_CHECK_RET
|
|
||||||
/// Check current attribute name and if it equal to requested then read value. Result write to output variable using return value of \ref pFunction.
|
|
||||||
/// If result was read then "continue" will called.
|
|
||||||
/// \param [in] pAttrName - attribute name.
|
|
||||||
/// \param [out] pVarName - output variable name.
|
|
||||||
/// \param [in] pFunction - function which read attribute value and write it to pVarName.
|
|
||||||
#define MACRO_ATTRREAD_CHECK_RET(pAttrName, pVarName, pFunction) \
|
|
||||||
if(an == pAttrName) \
|
|
||||||
{ \
|
|
||||||
pVarName = pFunction(idx); \
|
|
||||||
continue; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \def MACRO_NODECHECK_LOOPBEGIN(pNodeName)
|
|
||||||
/// Begin of loop of parsing child nodes. Do not add ';' at end.
|
|
||||||
/// \param [in] pNodeName - current node name.
|
|
||||||
#define MACRO_NODECHECK_LOOPBEGIN(pNodeName) \
|
|
||||||
do { \
|
|
||||||
bool close_found = false; \
|
|
||||||
\
|
|
||||||
while(mReader->read()) \
|
|
||||||
{ \
|
|
||||||
if(mReader->getNodeType() == irr::io::EXN_ELEMENT) \
|
|
||||||
{
|
|
||||||
|
|
||||||
/// \def MACRO_NODECHECK_LOOPEND(pNodeName)
|
|
||||||
/// End of loop of parsing child nodes.
|
|
||||||
/// \param [in] pNodeName - current node name.
|
|
||||||
#define MACRO_NODECHECK_LOOPEND(pNodeName) \
|
|
||||||
XML_CheckNode_SkipUnsupported(pNodeName); \
|
|
||||||
}/* if(mReader->getNodeType() == irr::io::EXN_ELEMENT) */ \
|
|
||||||
else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) \
|
|
||||||
{ \
|
|
||||||
if(XML_CheckNode_NameEqual(pNodeName)) \
|
|
||||||
{ \
|
|
||||||
close_found = true; \
|
|
||||||
\
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
}/* else if(mReader->getNodeType() == irr::io::EXN_ELEMENT_END) */ \
|
|
||||||
}/* while(mReader->read()) */ \
|
|
||||||
\
|
|
||||||
if(!close_found) Throw_CloseNotFound(pNodeName); \
|
|
||||||
\
|
|
||||||
} while(false)
|
|
||||||
|
|
||||||
/// \def MACRO_NODECHECK_READCOMP_F
|
|
||||||
/// Check current node name and if it equal to requested then read value. Result write to output variable of type "float".
|
|
||||||
/// If result was read then "continue" will called. Also check if node data already read then raise exception.
|
|
||||||
/// \param [in] pNodeName - node name.
|
|
||||||
/// \param [in, out] pReadFlag - read flag.
|
|
||||||
/// \param [out] pVarName - output variable name.
|
|
||||||
#define MACRO_NODECHECK_READCOMP_F(pNodeName, pReadFlag, pVarName) \
|
|
||||||
if(XML_CheckNode_NameEqual(pNodeName)) \
|
|
||||||
{ \
|
|
||||||
/* Check if field already read before. */ \
|
|
||||||
if(pReadFlag) Throw_MoreThanOnceDefined(pNodeName, "Only one component can be defined."); \
|
|
||||||
/* Read color component and assign it to object. */ \
|
|
||||||
pVarName = XML_ReadNode_GetVal_AsFloat(); \
|
|
||||||
pReadFlag = true; \
|
|
||||||
continue; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \def MACRO_NODECHECK_READCOMP_U32
|
|
||||||
/// Check current node name and if it equal to requested then read value. Result write to output variable of type "uint32_t".
|
|
||||||
/// If result was read then "continue" will called. Also check if node data already read then raise exception.
|
|
||||||
/// \param [in] pNodeName - node name.
|
|
||||||
/// \param [in, out] pReadFlag - read flag.
|
|
||||||
/// \param [out] pVarName - output variable name.
|
|
||||||
#define MACRO_NODECHECK_READCOMP_U32(pNodeName, pReadFlag, pVarName) \
|
|
||||||
if(XML_CheckNode_NameEqual(pNodeName)) \
|
|
||||||
{ \
|
|
||||||
/* Check if field already read before. */ \
|
|
||||||
if(pReadFlag) Throw_MoreThanOnceDefined(pNodeName, "Only one component can be defined."); \
|
|
||||||
/* Read color component and assign it to object. */ \
|
|
||||||
pVarName = XML_ReadNode_GetVal_AsU32(); \
|
|
||||||
pReadFlag = true; \
|
|
||||||
continue; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // AMFIMPORTER_MACRO_HPP_INCLUDED
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -49,10 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
|
||||||
|
|
||||||
#include "AMFImporter.hpp"
|
#include "AMFImporter.hpp"
|
||||||
#include "AMFImporter_Macro.hpp"
|
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp {
|
||||||
{
|
|
||||||
|
|
||||||
// <color
|
// <color
|
||||||
// profile="" - The ICC color space used to interpret the three color channels <r>, <g> and <b>.
|
// profile="" - The ICC color space used to interpret the three color channels <r>, <g> and <b>.
|
||||||
|
@ -68,51 +64,46 @@ namespace Assimp
|
||||||
// Multi elements - No.
|
// Multi elements - No.
|
||||||
// Red, Greed, Blue and Alpha (transparency) component of a color in sRGB space, values ranging from 0 to 1. The
|
// Red, Greed, Blue and Alpha (transparency) component of a color in sRGB space, values ranging from 0 to 1. The
|
||||||
// values can be specified as constants, or as a formula depending on the coordinates.
|
// values can be specified as constants, or as a formula depending on the coordinates.
|
||||||
void AMFImporter::ParseNode_Color() {
|
void AMFImporter::ParseNode_Color(XmlNode &node) {
|
||||||
std::string profile;
|
if (node.empty()) {
|
||||||
CAMFImporter_NodeElement* ne;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Read attributes for node <color>.
|
const std::string &profile = node.attribute("profile").as_string();
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
bool read_flag[4] = { false, false, false, false };
|
||||||
MACRO_ATTRREAD_CHECK_RET("profile", profile, mReader->getAttributeValue);
|
AMFNodeElementBase *ne = new AMFColor(mNodeElement_Cur);
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
AMFColor &als = *((AMFColor *)ne); // alias for convenience
|
||||||
|
ParseHelper_Node_Enter(ne);
|
||||||
|
for (pugi::xml_node &child : node.children()) {
|
||||||
|
// create new color object.
|
||||||
|
als.Profile = profile;
|
||||||
|
|
||||||
// create new color object.
|
const std::string &name = child.name();
|
||||||
ne = new CAMFImporter_NodeElement_Color(mNodeElement_Cur);
|
if ( name == "r") {
|
||||||
|
read_flag[0] = true;
|
||||||
CAMFImporter_NodeElement_Color& als = *((CAMFImporter_NodeElement_Color*)ne);// alias for convenience
|
XmlParser::getValueAsFloat(child, als.Color.r);
|
||||||
|
} else if (name == "g") {
|
||||||
als.Profile = profile;
|
read_flag[1] = true;
|
||||||
// Check for child nodes
|
XmlParser::getValueAsFloat(child, als.Color.g);
|
||||||
if(!mReader->isEmptyElement())
|
} else if (name == "b") {
|
||||||
{
|
read_flag[2] = true;
|
||||||
bool read_flag[4] = { false, false, false, false };
|
XmlParser::getValueAsFloat(child, als.Color.b);
|
||||||
|
} else if (name == "a") {
|
||||||
ParseHelper_Node_Enter(ne);
|
read_flag[3] = true;
|
||||||
MACRO_NODECHECK_LOOPBEGIN("color");
|
XmlParser::getValueAsFloat(child, als.Color.a);
|
||||||
MACRO_NODECHECK_READCOMP_F("r", read_flag[0], als.Color.r);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("g", read_flag[1], als.Color.g);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("b", read_flag[2], als.Color.b);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("a", read_flag[3], als.Color.a);
|
|
||||||
MACRO_NODECHECK_LOOPEND("color");
|
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
// check that all components was defined
|
|
||||||
if (!(read_flag[0] && read_flag[1] && read_flag[2])) {
|
|
||||||
throw DeadlyImportError("Not all color components are defined.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if <a> is absent. Then manually add "a == 1".
|
// check if <a> is absent. Then manually add "a == 1".
|
||||||
if (!read_flag[3]) {
|
if (!read_flag[3]) {
|
||||||
als.Color.a = 1;
|
als.Color.a = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
als.Composed = false;
|
||||||
|
mNodeElement_List.push_back(ne); // and to node element list because its a new object in graph.
|
||||||
|
ParseHelper_Node_Exit();
|
||||||
|
// check that all components was defined
|
||||||
|
if (!(read_flag[0] && read_flag[1] && read_flag[2])) {
|
||||||
|
throw DeadlyImportError("Not all color components are defined.");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
|
||||||
}
|
|
||||||
|
|
||||||
als.Composed = false;
|
|
||||||
mNodeElement_List.push_back(ne);// and to node element list because its a new object in graph.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <material
|
// <material
|
||||||
|
@ -122,45 +113,25 @@ void AMFImporter::ParseNode_Color() {
|
||||||
// An available material.
|
// An available material.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <amf>.
|
// Parent element - <amf>.
|
||||||
void AMFImporter::ParseNode_Material() {
|
void AMFImporter::ParseNode_Material(XmlNode &node) {
|
||||||
std::string id;
|
// create new object and assign read data
|
||||||
CAMFImporter_NodeElement* ne;
|
std::string id = node.attribute("id").as_string();
|
||||||
|
AMFNodeElementBase *ne = new AMFMaterial(mNodeElement_Cur);
|
||||||
// Read attributes for node <color>.
|
((AMFMaterial*)ne)->ID = id;
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
|
||||||
|
|
||||||
// create new object.
|
|
||||||
ne = new CAMFImporter_NodeElement_Material(mNodeElement_Cur);
|
|
||||||
|
|
||||||
// and assign read data
|
|
||||||
((CAMFImporter_NodeElement_Material*)ne)->ID = id;
|
|
||||||
|
|
||||||
// Check for child nodes
|
// Check for child nodes
|
||||||
if(!mReader->isEmptyElement())
|
if (!node.empty()) {
|
||||||
{
|
ParseHelper_Node_Enter(ne);
|
||||||
bool col_read = false;
|
for (pugi::xml_node &child : node.children()) {
|
||||||
|
const std::string name = child.name();
|
||||||
ParseHelper_Node_Enter(ne);
|
if (name == "color") {
|
||||||
MACRO_NODECHECK_LOOPBEGIN("material");
|
ParseNode_Color(child);
|
||||||
if(XML_CheckNode_NameEqual("color"))
|
} else if (name == "metadata") {
|
||||||
{
|
ParseNode_Metadata(child);
|
||||||
// Check if data already defined.
|
|
||||||
if(col_read) Throw_MoreThanOnceDefined("color", "Only one color can be defined for <material>.");
|
|
||||||
// read data and set flag about it
|
|
||||||
ParseNode_Color();
|
|
||||||
col_read = true;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(XML_CheckNode_NameEqual("metadata")) { ParseNode_Metadata(); continue; }
|
ParseHelper_Node_Exit();
|
||||||
MACRO_NODECHECK_LOOPEND("material");
|
} else {
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
mNodeElement_Cur->Child.push_back(ne);// Add element to child list of current element
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,51 +154,39 @@ void AMFImporter::ParseNode_Material() {
|
||||||
// then layer by layer.
|
// then layer by layer.
|
||||||
// Multi elements - Yes.
|
// Multi elements - Yes.
|
||||||
// Parent element - <amf>.
|
// Parent element - <amf>.
|
||||||
void AMFImporter::ParseNode_Texture()
|
void AMFImporter::ParseNode_Texture(XmlNode &node) {
|
||||||
{
|
const std::string id = node.attribute("id").as_string();
|
||||||
std::string id;
|
const uint32_t width = node.attribute("width").as_uint();
|
||||||
uint32_t width = 0;
|
const uint32_t height = node.attribute("height").as_uint();
|
||||||
uint32_t height = 0;
|
uint32_t depth = node.attribute("depth").as_uint();
|
||||||
uint32_t depth = 1;
|
const std::string type = node.attribute("type").as_string();
|
||||||
std::string type;
|
bool tiled = node.attribute("tiled").as_bool();
|
||||||
bool tiled = false;
|
|
||||||
std::string enc64_data;
|
|
||||||
|
|
||||||
// Read attributes for node <color>.
|
if (node.empty()) {
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
return;
|
||||||
MACRO_ATTRREAD_CHECK_RET("id", id, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("width", width, XML_ReadNode_GetAttrVal_AsU32);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("height", height, XML_ReadNode_GetAttrVal_AsU32);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("depth", depth, XML_ReadNode_GetAttrVal_AsU32);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("type", type, mReader->getAttributeValue);
|
|
||||||
MACRO_ATTRREAD_CHECK_RET("tiled", tiled, XML_ReadNode_GetAttrVal_AsBool);
|
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
|
||||||
|
|
||||||
// create new texture object.
|
|
||||||
CAMFImporter_NodeElement *ne = new CAMFImporter_NodeElement_Texture(mNodeElement_Cur);
|
|
||||||
|
|
||||||
CAMFImporter_NodeElement_Texture& als = *((CAMFImporter_NodeElement_Texture*)ne);// alias for convenience
|
|
||||||
|
|
||||||
// Check for child nodes
|
|
||||||
if (!mReader->isEmptyElement()) {
|
|
||||||
XML_ReadNode_GetVal_AsString(enc64_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create new texture object.
|
||||||
|
AMFNodeElementBase *ne = new AMFTexture(mNodeElement_Cur);
|
||||||
|
|
||||||
|
AMFTexture& als = *((AMFTexture*)ne);// alias for convenience
|
||||||
|
|
||||||
|
std::string enc64_data;
|
||||||
|
XmlParser::getValueAsString(node, enc64_data);
|
||||||
|
// Check for child nodes
|
||||||
|
|
||||||
// check that all components was defined
|
// check that all components was defined
|
||||||
if (id.empty()) {
|
if (id.empty()) {
|
||||||
throw DeadlyImportError("ID for texture must be defined.");
|
throw DeadlyImportError("ID for texture must be defined.");
|
||||||
}
|
}
|
||||||
if (width < 1) {
|
if (width < 1) {
|
||||||
Throw_IncorrectAttrValue("width");
|
throw DeadlyImportError("Invalid width for texture.");
|
||||||
}
|
}
|
||||||
if (height < 1) {
|
if (height < 1) {
|
||||||
Throw_IncorrectAttrValue("height");
|
throw DeadlyImportError("Invalid height for texture.");
|
||||||
}
|
}
|
||||||
if (depth < 1) {
|
|
||||||
Throw_IncorrectAttrValue("depth");
|
|
||||||
}
|
|
||||||
if (type != "grayscale") {
|
if (type != "grayscale") {
|
||||||
Throw_IncorrectAttrValue("type");
|
throw DeadlyImportError("Invalid type for texture.");
|
||||||
}
|
}
|
||||||
if (enc64_data.empty()) {
|
if (enc64_data.empty()) {
|
||||||
throw DeadlyImportError("Texture data not defined.");
|
throw DeadlyImportError("Texture data not defined.");
|
||||||
|
@ -239,7 +198,9 @@ void AMFImporter::ParseNode_Texture()
|
||||||
als.Depth = depth;
|
als.Depth = depth;
|
||||||
als.Tiled = tiled;
|
als.Tiled = tiled;
|
||||||
ParseHelper_Decode_Base64(enc64_data, als.Data);
|
ParseHelper_Decode_Base64(enc64_data, als.Data);
|
||||||
|
if (depth == 0) {
|
||||||
|
depth = (uint32_t)(als.Data.size() / (width * height));
|
||||||
|
}
|
||||||
// check data size
|
// check data size
|
||||||
if ((width * height * depth) != als.Data.size()) {
|
if ((width * height * depth) != als.Data.size()) {
|
||||||
throw DeadlyImportError("Texture has incorrect data size.");
|
throw DeadlyImportError("Texture has incorrect data size.");
|
||||||
|
@ -263,57 +224,93 @@ void AMFImporter::ParseNode_Texture()
|
||||||
// <utex1>, <utex2>, <utex3>, <vtex1>, <vtex2>, <vtex3>. Old name: <u1>, <u2>, <u3>, <v1>, <v2>, <v3>.
|
// <utex1>, <utex2>, <utex3>, <vtex1>, <vtex2>, <vtex3>. Old name: <u1>, <u2>, <u3>, <v1>, <v2>, <v3>.
|
||||||
// Multi elements - No.
|
// Multi elements - No.
|
||||||
// Texture coordinates for every vertex of triangle.
|
// Texture coordinates for every vertex of triangle.
|
||||||
void AMFImporter::ParseNode_TexMap(const bool pUseOldName) {
|
void AMFImporter::ParseNode_TexMap(XmlNode &node, const bool pUseOldName) {
|
||||||
std::string rtexid, gtexid, btexid, atexid;
|
|
||||||
|
|
||||||
// Read attributes for node <color>.
|
// Read attributes for node <color>.
|
||||||
MACRO_ATTRREAD_LOOPBEG;
|
AMFNodeElementBase *ne = new AMFTexMap(mNodeElement_Cur);
|
||||||
MACRO_ATTRREAD_CHECK_RET("rtexid", rtexid, mReader->getAttributeValue);
|
AMFTexMap &als = *((AMFTexMap *)ne); //
|
||||||
MACRO_ATTRREAD_CHECK_RET("gtexid", gtexid, mReader->getAttributeValue);
|
std::string rtexid, gtexid, btexid, atexid;
|
||||||
MACRO_ATTRREAD_CHECK_RET("btexid", btexid, mReader->getAttributeValue);
|
if (!node.empty()) {
|
||||||
MACRO_ATTRREAD_CHECK_RET("atexid", atexid, mReader->getAttributeValue);
|
for (pugi::xml_attribute &attr : node.attributes()) {
|
||||||
MACRO_ATTRREAD_LOOPEND;
|
const std::string ¤tAttr = attr.name();
|
||||||
|
if (currentAttr == "rtexid") {
|
||||||
|
rtexid = attr.as_string();
|
||||||
|
} else if (currentAttr == "gtexid") {
|
||||||
|
gtexid = attr.as_string();
|
||||||
|
} else if (currentAttr == "btexid") {
|
||||||
|
btexid = attr.as_string();
|
||||||
|
} else if (currentAttr == "atexid") {
|
||||||
|
atexid = attr.as_string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// create new texture coordinates object.
|
// create new texture coordinates object, alias for convenience
|
||||||
CAMFImporter_NodeElement *ne = new CAMFImporter_NodeElement_TexMap(mNodeElement_Cur);
|
|
||||||
|
|
||||||
CAMFImporter_NodeElement_TexMap& als = *((CAMFImporter_NodeElement_TexMap*)ne);// alias for convenience
|
|
||||||
// check data
|
// check data
|
||||||
if(rtexid.empty() && gtexid.empty() && btexid.empty()) throw DeadlyImportError("ParseNode_TexMap. At least one texture ID must be defined.");
|
if (rtexid.empty() && gtexid.empty() && btexid.empty()) {
|
||||||
|
throw DeadlyImportError("ParseNode_TexMap. At least one texture ID must be defined.");
|
||||||
|
}
|
||||||
|
|
||||||
// Check for children nodes
|
// Check for children nodes
|
||||||
XML_CheckNode_MustHaveChildren();
|
if (node.children().begin() == node.children().end()) {
|
||||||
|
throw DeadlyImportError("Invalid children definition.");
|
||||||
|
}
|
||||||
// read children nodes
|
// read children nodes
|
||||||
bool read_flag[6] = { false, false, false, false, false, false };
|
bool read_flag[6] = { false, false, false, false, false, false };
|
||||||
|
|
||||||
ParseHelper_Node_Enter(ne);
|
if (!pUseOldName) {
|
||||||
if(!pUseOldName)
|
ParseHelper_Node_Enter(ne);
|
||||||
{
|
for ( XmlNode ¤tNode : node.children()) {
|
||||||
MACRO_NODECHECK_LOOPBEGIN("texmap");
|
const std::string &name = currentNode.name();
|
||||||
MACRO_NODECHECK_READCOMP_F("utex1", read_flag[0], als.TextureCoordinate[0].x);
|
if (name == "utex1") {
|
||||||
MACRO_NODECHECK_READCOMP_F("utex2", read_flag[1], als.TextureCoordinate[1].x);
|
read_flag[0] = true;
|
||||||
MACRO_NODECHECK_READCOMP_F("utex3", read_flag[2], als.TextureCoordinate[2].x);
|
XmlParser::getValueAsReal(node, als.TextureCoordinate[0].x);
|
||||||
MACRO_NODECHECK_READCOMP_F("vtex1", read_flag[3], als.TextureCoordinate[0].y);
|
} else if (name == "utex2") {
|
||||||
MACRO_NODECHECK_READCOMP_F("vtex2", read_flag[4], als.TextureCoordinate[1].y);
|
read_flag[1] = true;
|
||||||
MACRO_NODECHECK_READCOMP_F("vtex3", read_flag[5], als.TextureCoordinate[2].y);
|
XmlParser::getValueAsReal(node, als.TextureCoordinate[1].x);
|
||||||
MACRO_NODECHECK_LOOPEND("texmap");
|
} else if (name == "utex3") {
|
||||||
|
read_flag[2] = true;
|
||||||
|
XmlParser::getValueAsReal(node, als.TextureCoordinate[2].x);
|
||||||
|
} else if (name == "vtex1") {
|
||||||
|
read_flag[3] = true;
|
||||||
|
XmlParser::getValueAsReal(node, als.TextureCoordinate[0].y);
|
||||||
|
} else if (name == "vtex2") {
|
||||||
|
read_flag[4] = true;
|
||||||
|
XmlParser::getValueAsReal(node, als.TextureCoordinate[1].y);
|
||||||
|
} else if (name == "vtex3") {
|
||||||
|
read_flag[5] = true;
|
||||||
|
XmlParser::getValueAsReal(node, als.TextureCoordinate[2].y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ParseHelper_Node_Exit();
|
||||||
|
} else {
|
||||||
|
for (pugi::xml_attribute &attr : node.attributes()) {
|
||||||
|
const std::string name = attr.name();
|
||||||
|
if (name == "u") {
|
||||||
|
read_flag[0] = true;
|
||||||
|
als.TextureCoordinate[0].x = attr.as_float();
|
||||||
|
} else if (name == "u2") {
|
||||||
|
read_flag[1] = true;
|
||||||
|
als.TextureCoordinate[1].x = attr.as_float();
|
||||||
|
} else if (name == "u3") {
|
||||||
|
read_flag[2] = true;
|
||||||
|
als.TextureCoordinate[2].x = attr.as_float();
|
||||||
|
} else if (name == "v1") {
|
||||||
|
read_flag[3] = true;
|
||||||
|
als.TextureCoordinate[0].y = attr.as_float();
|
||||||
|
} else if (name == "v2") {
|
||||||
|
read_flag[4] = true;
|
||||||
|
als.TextureCoordinate[1].y = attr.as_float();
|
||||||
|
} else if (name == "v3") {
|
||||||
|
read_flag[5] = true;
|
||||||
|
als.TextureCoordinate[0].y = attr.as_float();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
MACRO_NODECHECK_LOOPBEGIN("map");
|
|
||||||
MACRO_NODECHECK_READCOMP_F("u1", read_flag[0], als.TextureCoordinate[0].x);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("u2", read_flag[1], als.TextureCoordinate[1].x);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("u3", read_flag[2], als.TextureCoordinate[2].x);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("v1", read_flag[3], als.TextureCoordinate[0].y);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("v2", read_flag[4], als.TextureCoordinate[1].y);
|
|
||||||
MACRO_NODECHECK_READCOMP_F("v3", read_flag[5], als.TextureCoordinate[2].y);
|
|
||||||
MACRO_NODECHECK_LOOPEND("map");
|
|
||||||
}// if(!pUseOldName) else
|
|
||||||
|
|
||||||
ParseHelper_Node_Exit();
|
|
||||||
|
|
||||||
// check that all components was defined
|
// check that all components was defined
|
||||||
if(!(read_flag[0] && read_flag[1] && read_flag[2] && read_flag[3] && read_flag[4] && read_flag[5]))
|
if (!(read_flag[0] && read_flag[1] && read_flag[2] && read_flag[3] && read_flag[4] && read_flag[5])) {
|
||||||
throw DeadlyImportError("Not all texture coordinates are defined.");
|
throw DeadlyImportError("Not all texture coordinates are defined.");
|
||||||
|
}
|
||||||
|
|
||||||
// copy attributes data
|
// copy attributes data
|
||||||
als.TextureID_R = rtexid;
|
als.TextureID_R = rtexid;
|
||||||
|
@ -321,7 +318,7 @@ void AMFImporter::ParseNode_TexMap(const bool pUseOldName) {
|
||||||
als.TextureID_B = btexid;
|
als.TextureID_B = btexid;
|
||||||
als.TextureID_A = atexid;
|
als.TextureID_A = atexid;
|
||||||
|
|
||||||
mNodeElement_List.push_back(ne);// add to node element list because its a new object in graph.
|
mNodeElement_List.push_back(ne);
|
||||||
}
|
}
|
||||||
|
|
||||||
}// namespace Assimp
|
}// namespace Assimp
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -50,86 +48,76 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef INCLUDED_AI_AMF_IMPORTER_NODE_H
|
#ifndef INCLUDED_AI_AMF_IMPORTER_NODE_H
|
||||||
#define INCLUDED_AI_AMF_IMPORTER_NODE_H
|
#define INCLUDED_AI_AMF_IMPORTER_NODE_H
|
||||||
|
|
||||||
// Header files, stdlib.
|
// Header files, Assimp.
|
||||||
|
#include <assimp/scene.h>
|
||||||
|
#include <assimp/types.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// Header files, Assimp.
|
|
||||||
#include "assimp/types.h"
|
|
||||||
#include "assimp/scene.h"
|
|
||||||
|
|
||||||
/// \class CAMFImporter_NodeElement
|
|
||||||
/// Base class for elements of nodes.
|
/// Base class for elements of nodes.
|
||||||
class CAMFImporter_NodeElement {
|
class AMFNodeElementBase {
|
||||||
public:
|
public:
|
||||||
/// Define what data type contain node element.
|
/// Define what data type contain node element.
|
||||||
enum EType {
|
enum EType {
|
||||||
ENET_Color, ///< Color element: <color>.
|
ENET_Color, ///< Color element: <color>.
|
||||||
ENET_Constellation,///< Grouping element: <constellation>.
|
ENET_Constellation, ///< Grouping element: <constellation>.
|
||||||
ENET_Coordinates, ///< Coordinates element: <coordinates>.
|
ENET_Coordinates, ///< Coordinates element: <coordinates>.
|
||||||
ENET_Edge, ///< Edge element: <edge>.
|
ENET_Edge, ///< Edge element: <edge>.
|
||||||
ENET_Instance, ///< Grouping element: <constellation>.
|
ENET_Instance, ///< Grouping element: <constellation>.
|
||||||
ENET_Material, ///< Material element: <material>.
|
ENET_Material, ///< Material element: <material>.
|
||||||
ENET_Metadata, ///< Metadata element: <metadata>.
|
ENET_Metadata, ///< Metadata element: <metadata>.
|
||||||
ENET_Mesh, ///< Metadata element: <mesh>.
|
ENET_Mesh, ///< Metadata element: <mesh>.
|
||||||
ENET_Object, ///< Element which hold object: <object>.
|
ENET_Object, ///< Element which hold object: <object>.
|
||||||
ENET_Root, ///< Root element: <amf>.
|
ENET_Root, ///< Root element: <amf>.
|
||||||
ENET_Triangle, ///< Triangle element: <triangle>.
|
ENET_Triangle, ///< Triangle element: <triangle>.
|
||||||
ENET_TexMap, ///< Texture coordinates element: <texmap> or <map>.
|
ENET_TexMap, ///< Texture coordinates element: <texmap> or <map>.
|
||||||
ENET_Texture, ///< Texture element: <texture>.
|
ENET_Texture, ///< Texture element: <texture>.
|
||||||
ENET_Vertex, ///< Vertex element: <vertex>.
|
ENET_Vertex, ///< Vertex element: <vertex>.
|
||||||
ENET_Vertices, ///< Vertex element: <vertices>.
|
ENET_Vertices, ///< Vertex element: <vertices>.
|
||||||
ENET_Volume, ///< Volume element: <volume>.
|
ENET_Volume, ///< Volume element: <volume>.
|
||||||
|
|
||||||
ENET_Invalid ///< Element has invalid type and possible contain invalid data.
|
ENET_Invalid ///< Element has invalid type and possible contain invalid data.
|
||||||
};
|
};
|
||||||
|
|
||||||
const EType Type;///< Type of element.
|
const EType Type; ///< Type of element.
|
||||||
std::string ID;///< ID of element.
|
std::string ID; ///< ID of element.
|
||||||
CAMFImporter_NodeElement* Parent;///< Parent element. If nullptr then this node is root.
|
AMFNodeElementBase *Parent; ///< Parent element. If nullptr then this node is root.
|
||||||
std::list<CAMFImporter_NodeElement*> Child;///< Child elements.
|
std::list<AMFNodeElementBase *> Child; ///< Child elements.
|
||||||
|
|
||||||
public: /// Destructor, virtual..
|
public: /// Destructor, virtual..
|
||||||
virtual ~CAMFImporter_NodeElement() {
|
virtual ~AMFNodeElementBase() = default;
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Disabled copy constructor and co.
|
/// Disabled copy constructor and co.
|
||||||
CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement) = delete;
|
AMFNodeElementBase(const AMFNodeElementBase &pNodeElement) = delete;
|
||||||
CAMFImporter_NodeElement(CAMFImporter_NodeElement&&) = delete;
|
AMFNodeElementBase(AMFNodeElementBase &&) = delete;
|
||||||
CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement) = delete;
|
AMFNodeElementBase &operator=(const AMFNodeElementBase &pNodeElement) = delete;
|
||||||
CAMFImporter_NodeElement() = delete;
|
AMFNodeElementBase() = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// In constructor inheritor must set element type.
|
/// In constructor inheritor must set element type.
|
||||||
/// \param [in] pType - element type.
|
/// \param [in] pType - element type.
|
||||||
/// \param [in] pParent - parent element.
|
/// \param [in] pParent - parent element.
|
||||||
CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
|
AMFNodeElementBase(const EType pType, AMFNodeElementBase *pParent) :
|
||||||
: Type(pType)
|
Type(pType), Parent(pParent) {
|
||||||
, ID()
|
// empty
|
||||||
, Parent(pParent)
|
}
|
||||||
, Child() {
|
}; // class IAMFImporter_NodeElement
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};// class IAMFImporter_NodeElement
|
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Constellation
|
|
||||||
/// A collection of objects or constellations with specific relative locations.
|
/// A collection of objects or constellations with specific relative locations.
|
||||||
struct CAMFImporter_NodeElement_Constellation : public CAMFImporter_NodeElement {
|
struct AMFConstellation : public AMFNodeElementBase {
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Constellation(CAMFImporter_NodeElement* pParent)
|
AMFConstellation(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Constellation, pParent)
|
AMFNodeElementBase(ENET_Constellation, pParent) {}
|
||||||
{}
|
|
||||||
|
|
||||||
};// struct CAMFImporter_NodeElement_Constellation
|
}; // struct CAMFImporter_NodeElement_Constellation
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Instance
|
|
||||||
/// Part of constellation.
|
/// Part of constellation.
|
||||||
struct CAMFImporter_NodeElement_Instance : public CAMFImporter_NodeElement {
|
struct AMFInstance : public AMFNodeElementBase {
|
||||||
|
|
||||||
std::string ObjectID;///< ID of object for instantiation.
|
std::string ObjectID; ///< ID of object for instantiation.
|
||||||
/// \var Delta - The distance of translation in the x, y, or z direction, respectively, in the referenced object's coordinate system, to
|
/// \var Delta - The distance of translation in the x, y, or z direction, respectively, in the referenced object's coordinate system, to
|
||||||
/// create an instance of the object in the current constellation.
|
/// create an instance of the object in the current constellation.
|
||||||
aiVector3D Delta;
|
aiVector3D Delta;
|
||||||
|
@ -140,201 +128,161 @@ struct CAMFImporter_NodeElement_Instance : public CAMFImporter_NodeElement {
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Instance(CAMFImporter_NodeElement* pParent)
|
AMFInstance(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Instance, pParent)
|
AMFNodeElementBase(ENET_Instance, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Metadata
|
|
||||||
/// Structure that define metadata node.
|
/// Structure that define metadata node.
|
||||||
struct CAMFImporter_NodeElement_Metadata : public CAMFImporter_NodeElement {
|
struct AMFMetadata : public AMFNodeElementBase {
|
||||||
|
|
||||||
std::string Type;///< Type of "Value".
|
std::string Type; ///< Type of "Value".
|
||||||
std::string Value;///< Value.
|
std::string Value; ///< Value.
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Metadata(CAMFImporter_NodeElement* pParent)
|
AMFMetadata(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Metadata, pParent)
|
AMFNodeElementBase(ENET_Metadata, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Root
|
|
||||||
/// Structure that define root node.
|
/// Structure that define root node.
|
||||||
struct CAMFImporter_NodeElement_Root : public CAMFImporter_NodeElement {
|
struct AMFRoot : public AMFNodeElementBase {
|
||||||
|
|
||||||
std::string Unit;///< The units to be used. May be "inch", "millimeter", "meter", "feet", or "micron".
|
std::string Unit; ///< The units to be used. May be "inch", "millimeter", "meter", "feet", or "micron".
|
||||||
std::string Version;///< Version of format.
|
std::string Version; ///< Version of format.
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Root(CAMFImporter_NodeElement* pParent)
|
AMFRoot(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Root, pParent)
|
AMFNodeElementBase(ENET_Root, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Color
|
|
||||||
/// Structure that define object node.
|
/// Structure that define object node.
|
||||||
struct CAMFImporter_NodeElement_Color : public CAMFImporter_NodeElement {
|
struct AMFColor : public AMFNodeElementBase {
|
||||||
bool Composed; ///< Type of color stored: if true then look for formula in \ref Color_Composed[4], else - in \ref Color.
|
bool Composed; ///< Type of color stored: if true then look for formula in \ref Color_Composed[4], else - in \ref Color.
|
||||||
std::string Color_Composed[4]; ///< By components formulas of composed color. [0..3] - RGBA.
|
std::string Color_Composed[4]; ///< By components formulas of composed color. [0..3] - RGBA.
|
||||||
aiColor4D Color; ///< Constant color.
|
aiColor4D Color; ///< Constant color.
|
||||||
std::string Profile; ///< The ICC color space used to interpret the three color channels r, g and b..
|
std::string Profile; ///< The ICC color space used to interpret the three color channels r, g and b..
|
||||||
|
|
||||||
/// @brief Constructor.
|
/// @brief Constructor.
|
||||||
/// @param [in] pParent - pointer to parent node.
|
/// @param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Color(CAMFImporter_NodeElement* pParent)
|
AMFColor(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Color, pParent)
|
AMFNodeElementBase(ENET_Color, pParent), Composed(false), Color() {
|
||||||
, Composed( false )
|
// empty
|
||||||
, Color()
|
}
|
||||||
, Profile() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Material
|
|
||||||
/// Structure that define material node.
|
/// Structure that define material node.
|
||||||
struct CAMFImporter_NodeElement_Material : public CAMFImporter_NodeElement {
|
struct AMFMaterial : public AMFNodeElementBase {
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Material(CAMFImporter_NodeElement* pParent)
|
AMFMaterial(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Material, pParent)
|
AMFNodeElementBase(ENET_Material, pParent) {}
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Object
|
|
||||||
/// Structure that define object node.
|
/// Structure that define object node.
|
||||||
struct CAMFImporter_NodeElement_Object : public CAMFImporter_NodeElement {
|
struct AMFObject : public AMFNodeElementBase {
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Object(CAMFImporter_NodeElement* pParent)
|
AMFObject(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Object, pParent)
|
AMFNodeElementBase(ENET_Object, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Mesh
|
/// \struct CAMFImporter_NodeElement_Mesh
|
||||||
/// Structure that define mesh node.
|
/// Structure that define mesh node.
|
||||||
struct CAMFImporter_NodeElement_Mesh : public CAMFImporter_NodeElement {
|
struct AMFMesh : public AMFNodeElementBase {
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Mesh(CAMFImporter_NodeElement* pParent)
|
AMFMesh(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Mesh, pParent)
|
AMFNodeElementBase(ENET_Mesh, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Vertex
|
|
||||||
/// Structure that define vertex node.
|
/// Structure that define vertex node.
|
||||||
struct CAMFImporter_NodeElement_Vertex : public CAMFImporter_NodeElement {
|
struct AMFVertex : public AMFNodeElementBase {
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Vertex(CAMFImporter_NodeElement* pParent)
|
AMFVertex(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Vertex, pParent)
|
AMFNodeElementBase(ENET_Vertex, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Edge
|
|
||||||
/// Structure that define edge node.
|
/// Structure that define edge node.
|
||||||
struct CAMFImporter_NodeElement_Edge : public CAMFImporter_NodeElement {
|
struct AMFEdge : public AMFNodeElementBase {
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Edge(CAMFImporter_NodeElement* pParent)
|
AMFEdge(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Edge, pParent)
|
AMFNodeElementBase(ENET_Edge, pParent) {}
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Vertices
|
|
||||||
/// Structure that define vertices node.
|
/// Structure that define vertices node.
|
||||||
struct CAMFImporter_NodeElement_Vertices : public CAMFImporter_NodeElement {
|
struct AMFVertices : public AMFNodeElementBase {
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Vertices(CAMFImporter_NodeElement* pParent)
|
AMFVertices(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Vertices, pParent)
|
AMFNodeElementBase(ENET_Vertices, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Volume
|
|
||||||
/// Structure that define volume node.
|
/// Structure that define volume node.
|
||||||
struct CAMFImporter_NodeElement_Volume : public CAMFImporter_NodeElement {
|
struct AMFVolume : public AMFNodeElementBase {
|
||||||
std::string MaterialID;///< Which material to use.
|
std::string MaterialID; ///< Which material to use.
|
||||||
std::string Type;///< What this volume describes can be “region” or “support”. If none specified, “object” is assumed.
|
std::string Type; ///< What this volume describes can be "region" or "support". If none specified, "object" is assumed.
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Volume(CAMFImporter_NodeElement* pParent)
|
AMFVolume(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Volume, pParent)
|
AMFNodeElementBase(ENET_Volume, pParent) {}
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Coordinates
|
|
||||||
/// Structure that define coordinates node.
|
/// Structure that define coordinates node.
|
||||||
struct CAMFImporter_NodeElement_Coordinates : public CAMFImporter_NodeElement
|
struct AMFCoordinates : public AMFNodeElementBase {
|
||||||
{
|
aiVector3D Coordinate; ///< Coordinate.
|
||||||
aiVector3D Coordinate;///< Coordinate.
|
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Coordinates(CAMFImporter_NodeElement* pParent)
|
AMFCoordinates(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Coordinates, pParent)
|
AMFNodeElementBase(ENET_Coordinates, pParent) {}
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_TexMap
|
|
||||||
/// Structure that define texture coordinates node.
|
/// Structure that define texture coordinates node.
|
||||||
struct CAMFImporter_NodeElement_TexMap : public CAMFImporter_NodeElement {
|
struct AMFTexMap : public AMFNodeElementBase {
|
||||||
aiVector3D TextureCoordinate[3];///< Texture coordinates.
|
aiVector3D TextureCoordinate[3]; ///< Texture coordinates.
|
||||||
std::string TextureID_R;///< Texture ID for red color component.
|
std::string TextureID_R; ///< Texture ID for red color component.
|
||||||
std::string TextureID_G;///< Texture ID for green color component.
|
std::string TextureID_G; ///< Texture ID for green color component.
|
||||||
std::string TextureID_B;///< Texture ID for blue color component.
|
std::string TextureID_B; ///< Texture ID for blue color component.
|
||||||
std::string TextureID_A;///< Texture ID for alpha color component.
|
std::string TextureID_A; ///< Texture ID for alpha color component.
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_TexMap(CAMFImporter_NodeElement* pParent)
|
AMFTexMap(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_TexMap, pParent)
|
AMFNodeElementBase(ENET_TexMap, pParent), TextureCoordinate{} {
|
||||||
, TextureCoordinate{}
|
// empty
|
||||||
, TextureID_R()
|
}
|
||||||
, TextureID_G()
|
|
||||||
, TextureID_B()
|
|
||||||
, TextureID_A() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \struct CAMFImporter_NodeElement_Triangle
|
|
||||||
/// Structure that define triangle node.
|
/// Structure that define triangle node.
|
||||||
struct CAMFImporter_NodeElement_Triangle : public CAMFImporter_NodeElement {
|
struct AMFTriangle : public AMFNodeElementBase {
|
||||||
size_t V[3];///< Triangle vertices.
|
size_t V[3]; ///< Triangle vertices.
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Triangle(CAMFImporter_NodeElement* pParent)
|
AMFTriangle(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Triangle, pParent) {
|
AMFNodeElementBase(ENET_Triangle, pParent) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Structure that define texture node.
|
/// Structure that define texture node.
|
||||||
struct CAMFImporter_NodeElement_Texture : public CAMFImporter_NodeElement {
|
struct AMFTexture : public AMFNodeElementBase {
|
||||||
size_t Width, Height, Depth;///< Size of the texture.
|
size_t Width, Height, Depth; ///< Size of the texture.
|
||||||
std::vector<uint8_t> Data;///< Data of the texture.
|
std::vector<uint8_t> Data; ///< Data of the texture.
|
||||||
bool Tiled;
|
bool Tiled;
|
||||||
|
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// \param [in] pParent - pointer to parent node.
|
/// \param [in] pParent - pointer to parent node.
|
||||||
CAMFImporter_NodeElement_Texture(CAMFImporter_NodeElement* pParent)
|
AMFTexture(AMFNodeElementBase *pParent) :
|
||||||
: CAMFImporter_NodeElement(ENET_Texture, pParent)
|
AMFNodeElementBase(ENET_Texture, pParent), Width(0), Height(0), Depth(0), Data(), Tiled(false) {
|
||||||
, Width( 0 )
|
// empty
|
||||||
, Height( 0 )
|
}
|
||||||
, Depth( 0 )
|
|
||||||
, Data()
|
|
||||||
, Tiled( false ){
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INCLUDED_AI_AMF_IMPORTER_NODE_H
|
#endif // INCLUDED_AI_AMF_IMPORTER_NODE_H
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -50,12 +48,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "AMFImporter.hpp"
|
#include "AMFImporter.hpp"
|
||||||
|
|
||||||
// Header files, Assimp.
|
|
||||||
#include <assimp/SceneCombiner.h>
|
#include <assimp/SceneCombiner.h>
|
||||||
#include <assimp/StandardShapes.h>
|
#include <assimp/StandardShapes.h>
|
||||||
#include <assimp/StringUtils.h>
|
#include <assimp/StringUtils.h>
|
||||||
|
|
||||||
// Header files, stdlib.
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
@ -66,12 +62,14 @@ aiColor4D AMFImporter::SPP_Material::GetColor(const float /*pX*/, const float /*
|
||||||
// Check if stored data are supported.
|
// Check if stored data are supported.
|
||||||
if (!Composition.empty()) {
|
if (!Composition.empty()) {
|
||||||
throw DeadlyImportError("IME. GetColor for composition");
|
throw DeadlyImportError("IME. GetColor for composition");
|
||||||
} else if (Color->Composed) {
|
|
||||||
throw DeadlyImportError("IME. GetColor, composed color");
|
|
||||||
} else {
|
|
||||||
tcol = Color->Color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Color->Composed) {
|
||||||
|
throw DeadlyImportError("IME. GetColor, composed color");
|
||||||
|
}
|
||||||
|
|
||||||
|
tcol = Color->Color;
|
||||||
|
|
||||||
// Check if default color must be used
|
// Check if default color must be used
|
||||||
if ((tcol.r == 0) && (tcol.g == 0) && (tcol.b == 0) && (tcol.a == 0)) {
|
if ((tcol.r == 0) && (tcol.g == 0) && (tcol.b == 0) && (tcol.a == 0)) {
|
||||||
tcol.r = 0.5f;
|
tcol.r = 0.5f;
|
||||||
|
@ -83,61 +81,61 @@ aiColor4D AMFImporter::SPP_Material::GetColor(const float /*pX*/, const float /*
|
||||||
return tcol;
|
return tcol;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh &pNodeElement, std::vector<aiVector3D> &pVertexCoordinateArray,
|
void AMFImporter::PostprocessHelper_CreateMeshDataArray(const AMFMesh &nodeElement, std::vector<aiVector3D> &vertexCoordinateArray,
|
||||||
std::vector<CAMFImporter_NodeElement_Color *> &pVertexColorArray) const {
|
std::vector<AMFColor *> &pVertexColorArray) const {
|
||||||
CAMFImporter_NodeElement_Vertices *vn = nullptr;
|
AMFVertices *vn = nullptr;
|
||||||
size_t col_idx;
|
size_t col_idx;
|
||||||
|
|
||||||
// All data stored in "vertices", search for it.
|
// All data stored in "vertices", search for it.
|
||||||
for (CAMFImporter_NodeElement *ne_child : pNodeElement.Child) {
|
for (AMFNodeElementBase *ne_child : nodeElement.Child) {
|
||||||
if (ne_child->Type == CAMFImporter_NodeElement::ENET_Vertices) vn = (CAMFImporter_NodeElement_Vertices *)ne_child;
|
if (ne_child->Type == AMFNodeElementBase::ENET_Vertices) {
|
||||||
|
vn = (AMFVertices*)ne_child;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If "vertices" not found then no work for us.
|
// If "vertices" not found then no work for us.
|
||||||
if (vn == nullptr) return;
|
if (vn == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pVertexCoordinateArray.reserve(vn->Child.size()); // all coordinates stored as child and we need to reserve space for future push_back's.
|
// all coordinates stored as child and we need to reserve space for future push_back's.
|
||||||
pVertexColorArray.resize(vn->Child.size()); // colors count equal vertices count.
|
vertexCoordinateArray.reserve(vn->Child.size());
|
||||||
|
|
||||||
|
// colors count equal vertices count.
|
||||||
|
pVertexColorArray.resize(vn->Child.size());
|
||||||
col_idx = 0;
|
col_idx = 0;
|
||||||
|
|
||||||
// Inside vertices collect all data and place to arrays
|
// Inside vertices collect all data and place to arrays
|
||||||
for (CAMFImporter_NodeElement *vn_child : vn->Child) {
|
for (AMFNodeElementBase *vn_child : vn->Child) {
|
||||||
// vertices, colors
|
// vertices, colors
|
||||||
if (vn_child->Type == CAMFImporter_NodeElement::ENET_Vertex) {
|
if (vn_child->Type == AMFNodeElementBase::ENET_Vertex) {
|
||||||
// by default clear color for current vertex
|
// by default clear color for current vertex
|
||||||
pVertexColorArray[col_idx] = nullptr;
|
pVertexColorArray[col_idx] = nullptr;
|
||||||
|
|
||||||
for (CAMFImporter_NodeElement *vtx : vn_child->Child) {
|
for (AMFNodeElementBase *vtx : vn_child->Child) {
|
||||||
if (vtx->Type == CAMFImporter_NodeElement::ENET_Coordinates) {
|
if (vtx->Type == AMFNodeElementBase::ENET_Coordinates) {
|
||||||
pVertexCoordinateArray.push_back(((CAMFImporter_NodeElement_Coordinates *)vtx)->Coordinate);
|
vertexCoordinateArray.push_back(((AMFCoordinates *)vtx)->Coordinate);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vtx->Type == CAMFImporter_NodeElement::ENET_Color) {
|
if (vtx->Type == AMFNodeElementBase::ENET_Color) {
|
||||||
pVertexColorArray[col_idx] = (CAMFImporter_NodeElement_Color *)vtx;
|
pVertexColorArray[col_idx] = (AMFColor *)vtx;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} // for(CAMFImporter_NodeElement* vtx: vn_child->Child)
|
}
|
||||||
|
|
||||||
col_idx++;
|
++col_idx;
|
||||||
} // if(vn_child->Type == CAMFImporter_NodeElement::ENET_Vertex)
|
}
|
||||||
} // for(CAMFImporter_NodeElement* vn_child: vn->Child)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &pID_R, const std::string &pID_G, const std::string &pID_B,
|
size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &r, const std::string &g, const std::string &b, const std::string &a) {
|
||||||
const std::string &pID_A) {
|
if (r.empty() && g.empty() && b.empty() && a.empty()) {
|
||||||
size_t TextureConverted_Index;
|
|
||||||
std::string TextureConverted_ID;
|
|
||||||
|
|
||||||
// check input data
|
|
||||||
if (pID_R.empty() && pID_G.empty() && pID_B.empty() && pID_A.empty())
|
|
||||||
throw DeadlyImportError("PostprocessHelper_GetTextureID_Or_Create. At least one texture ID must be defined.");
|
throw DeadlyImportError("PostprocessHelper_GetTextureID_Or_Create. At least one texture ID must be defined.");
|
||||||
|
}
|
||||||
|
|
||||||
// Create ID
|
std::string TextureConverted_ID = r + "_" + g + "_" + b + "_" + a;
|
||||||
TextureConverted_ID = pID_R + "_" + pID_G + "_" + pID_B + "_" + pID_A;
|
size_t TextureConverted_Index = 0;
|
||||||
// Check if texture specified by set of IDs is converted already.
|
|
||||||
TextureConverted_Index = 0;
|
|
||||||
for (const SPP_Texture &tex_convd : mTexture_Converted) {
|
for (const SPP_Texture &tex_convd : mTexture_Converted) {
|
||||||
if (tex_convd.ID == TextureConverted_ID) {
|
if (tex_convd.ID == TextureConverted_ID) {
|
||||||
return TextureConverted_Index;
|
return TextureConverted_Index;
|
||||||
|
@ -146,52 +144,60 @@ size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Converted texture not found, create it.
|
// Converted texture not found, create it.
|
||||||
//
|
AMFTexture *src_texture[4] {
|
||||||
CAMFImporter_NodeElement_Texture *src_texture[4]{ nullptr };
|
nullptr
|
||||||
std::vector<CAMFImporter_NodeElement_Texture *> src_texture_4check;
|
};
|
||||||
|
std::vector<AMFTexture *> src_texture_4check;
|
||||||
SPP_Texture converted_texture;
|
SPP_Texture converted_texture;
|
||||||
|
|
||||||
{ // find all specified source textures
|
{ // find all specified source textures
|
||||||
CAMFImporter_NodeElement *t_tex;
|
AMFNodeElementBase *t_tex = nullptr;
|
||||||
|
|
||||||
// R
|
// R
|
||||||
if (!pID_R.empty()) {
|
if (!r.empty()) {
|
||||||
if (!Find_NodeElement(pID_R, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_R);
|
if (!Find_NodeElement(r, AMFNodeElementBase::EType::ENET_Texture, &t_tex)) {
|
||||||
|
Throw_ID_NotFound(r);
|
||||||
|
}
|
||||||
|
|
||||||
src_texture[0] = (CAMFImporter_NodeElement_Texture *)t_tex;
|
src_texture[0] = (AMFTexture *)t_tex;
|
||||||
src_texture_4check.push_back((CAMFImporter_NodeElement_Texture *)t_tex);
|
src_texture_4check.push_back((AMFTexture *)t_tex);
|
||||||
} else {
|
} else {
|
||||||
src_texture[0] = nullptr;
|
src_texture[0] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// G
|
// G
|
||||||
if (!pID_G.empty()) {
|
if (!g.empty()) {
|
||||||
if (!Find_NodeElement(pID_G, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_G);
|
if (!Find_NodeElement(g, AMFNodeElementBase::ENET_Texture, &t_tex)) {
|
||||||
|
Throw_ID_NotFound(g);
|
||||||
|
}
|
||||||
|
|
||||||
src_texture[1] = (CAMFImporter_NodeElement_Texture *)t_tex;
|
src_texture[1] = (AMFTexture *)t_tex;
|
||||||
src_texture_4check.push_back((CAMFImporter_NodeElement_Texture *)t_tex);
|
src_texture_4check.push_back((AMFTexture *)t_tex);
|
||||||
} else {
|
} else {
|
||||||
src_texture[1] = nullptr;
|
src_texture[1] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// B
|
// B
|
||||||
if (!pID_B.empty()) {
|
if (!b.empty()) {
|
||||||
if (!Find_NodeElement(pID_B, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_B);
|
if (!Find_NodeElement(b, AMFNodeElementBase::ENET_Texture, &t_tex)) {
|
||||||
|
Throw_ID_NotFound(b);
|
||||||
|
}
|
||||||
|
|
||||||
src_texture[2] = (CAMFImporter_NodeElement_Texture *)t_tex;
|
src_texture[2] = (AMFTexture *)t_tex;
|
||||||
src_texture_4check.push_back((CAMFImporter_NodeElement_Texture *)t_tex);
|
src_texture_4check.push_back((AMFTexture *)t_tex);
|
||||||
} else {
|
} else {
|
||||||
src_texture[2] = nullptr;
|
src_texture[2] = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A
|
// A
|
||||||
if (!pID_A.empty()) {
|
if (!a.empty()) {
|
||||||
if (!Find_NodeElement(pID_A, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_A);
|
if (!Find_NodeElement(a, AMFNodeElementBase::ENET_Texture, &t_tex)) {
|
||||||
|
Throw_ID_NotFound(a);
|
||||||
|
}
|
||||||
|
|
||||||
src_texture[3] = (CAMFImporter_NodeElement_Texture *)t_tex;
|
src_texture[3] = (AMFTexture *)t_tex;
|
||||||
src_texture_4check.push_back((CAMFImporter_NodeElement_Texture *)t_tex);
|
src_texture_4check.push_back((AMFTexture *)t_tex);
|
||||||
} else {
|
} else {
|
||||||
src_texture[3] = nullptr;
|
src_texture[3] = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -213,38 +219,38 @@ size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &
|
||||||
converted_texture.Depth = src_texture_4check[0]->Depth;
|
converted_texture.Depth = src_texture_4check[0]->Depth;
|
||||||
// if one of source texture is tiled then converted texture is tiled too.
|
// if one of source texture is tiled then converted texture is tiled too.
|
||||||
converted_texture.Tiled = false;
|
converted_texture.Tiled = false;
|
||||||
for (uint8_t i = 0; i < src_texture_4check.size(); i++)
|
for (uint8_t i = 0; i < src_texture_4check.size(); ++i) {
|
||||||
converted_texture.Tiled |= src_texture_4check[i]->Tiled;
|
converted_texture.Tiled |= src_texture_4check[i]->Tiled;
|
||||||
|
}
|
||||||
|
|
||||||
// Create format hint.
|
// Create format hint.
|
||||||
strcpy(converted_texture.FormatHint, "rgba0000"); // copy initial string.
|
constexpr char templateColor[] = "rgba0000";
|
||||||
if (!pID_R.empty()) converted_texture.FormatHint[4] = '8';
|
memcpy(converted_texture.FormatHint, templateColor, 8);
|
||||||
if (!pID_G.empty()) converted_texture.FormatHint[5] = '8';
|
if (!r.empty()) converted_texture.FormatHint[4] = '8';
|
||||||
if (!pID_B.empty()) converted_texture.FormatHint[6] = '8';
|
if (!g.empty()) converted_texture.FormatHint[5] = '8';
|
||||||
if (!pID_A.empty()) converted_texture.FormatHint[7] = '8';
|
if (!b.empty()) converted_texture.FormatHint[6] = '8';
|
||||||
|
if (!a.empty()) converted_texture.FormatHint[7] = '8';
|
||||||
|
|
||||||
//
|
|
||||||
// Сopy data of textures.
|
// Сopy data of textures.
|
||||||
//
|
|
||||||
size_t tex_size = 0;
|
size_t tex_size = 0;
|
||||||
size_t step = 0;
|
size_t step = 0;
|
||||||
size_t off_g = 0;
|
size_t off_g = 0;
|
||||||
size_t off_b = 0;
|
size_t off_b = 0;
|
||||||
|
|
||||||
// Calculate size of the target array and rule how data will be copied.
|
// Calculate size of the target array and rule how data will be copied.
|
||||||
if (!pID_R.empty() && nullptr != src_texture[0]) {
|
if (!r.empty() && nullptr != src_texture[0]) {
|
||||||
tex_size += src_texture[0]->Data.size();
|
tex_size += src_texture[0]->Data.size();
|
||||||
step++, off_g++, off_b++;
|
step++, off_g++, off_b++;
|
||||||
}
|
}
|
||||||
if (!pID_G.empty() && nullptr != src_texture[1]) {
|
if (!g.empty() && nullptr != src_texture[1]) {
|
||||||
tex_size += src_texture[1]->Data.size();
|
tex_size += src_texture[1]->Data.size();
|
||||||
step++, off_b++;
|
step++, off_b++;
|
||||||
}
|
}
|
||||||
if (!pID_B.empty() && nullptr != src_texture[2]) {
|
if (!b.empty() && nullptr != src_texture[2]) {
|
||||||
tex_size += src_texture[2]->Data.size();
|
tex_size += src_texture[2]->Data.size();
|
||||||
step++;
|
step++;
|
||||||
}
|
}
|
||||||
if (!pID_A.empty() && nullptr != src_texture[3]) {
|
if (!a.empty() && nullptr != src_texture[3]) {
|
||||||
tex_size += src_texture[3]->Data.size();
|
tex_size += src_texture[3]->Data.size();
|
||||||
step++;
|
step++;
|
||||||
}
|
}
|
||||||
|
@ -255,17 +261,17 @@ size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &
|
||||||
auto CopyTextureData = [&](const std::string &pID, const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void {
|
auto CopyTextureData = [&](const std::string &pID, const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void {
|
||||||
if (!pID.empty()) {
|
if (!pID.empty()) {
|
||||||
for (size_t idx_target = pOffset, idx_src = 0; idx_target < tex_size; idx_target += pStep, idx_src++) {
|
for (size_t idx_target = pOffset, idx_src = 0; idx_target < tex_size; idx_target += pStep, idx_src++) {
|
||||||
CAMFImporter_NodeElement_Texture *tex = src_texture[pSrcTexNum];
|
AMFTexture *tex = src_texture[pSrcTexNum];
|
||||||
ai_assert(tex);
|
ai_assert(tex);
|
||||||
converted_texture.Data[idx_target] = tex->Data.at(idx_src);
|
converted_texture.Data[idx_target] = tex->Data.at(idx_src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}; // auto CopyTextureData = [&](const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void
|
}; // auto CopyTextureData = [&](const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void
|
||||||
|
|
||||||
CopyTextureData(pID_R, 0, step, 0);
|
CopyTextureData(r, 0, step, 0);
|
||||||
CopyTextureData(pID_G, off_g, step, 1);
|
CopyTextureData(g, off_g, step, 1);
|
||||||
CopyTextureData(pID_B, off_b, step, 2);
|
CopyTextureData(b, off_b, step, 2);
|
||||||
CopyTextureData(pID_A, step - 1, step, 3);
|
CopyTextureData(a, step - 1, step, 3);
|
||||||
|
|
||||||
// Store new converted texture ID
|
// Store new converted texture ID
|
||||||
converted_texture.ID = TextureConverted_ID;
|
converted_texture.ID = TextureConverted_ID;
|
||||||
|
@ -276,7 +282,7 @@ size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace> &pInputList, std::list<std::list<SComplexFace>> &pOutputList_Separated) {
|
void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace> &pInputList, std::list<std::list<SComplexFace>> &pOutputList_Separated) {
|
||||||
auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap *pTexMap1, const CAMFImporter_NodeElement_TexMap *pTexMap2) -> bool {
|
auto texmap_is_equal = [](const AMFTexMap *pTexMap1, const AMFTexMap *pTexMap2) -> bool {
|
||||||
if ((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true;
|
if ((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true;
|
||||||
if (pTexMap1 == nullptr) return false;
|
if (pTexMap1 == nullptr) return false;
|
||||||
if (pTexMap2 == nullptr) return false;
|
if (pTexMap2 == nullptr) return false;
|
||||||
|
@ -313,73 +319,80 @@ void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list<SComplexFace
|
||||||
} while (!pInputList.empty());
|
} while (!pInputList.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Postprocess_AddMetadata(const std::list<CAMFImporter_NodeElement_Metadata *> &metadataList, aiNode &sceneNode) const {
|
void AMFImporter::Postprocess_AddMetadata(const AMFMetaDataArray &metadataList, aiNode &sceneNode) const {
|
||||||
if (!metadataList.empty()) {
|
if (metadataList.empty()) {
|
||||||
if (sceneNode.mMetaData != nullptr) throw DeadlyImportError("Postprocess. MetaData member in node are not nullptr. Something went wrong.");
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// copy collected metadata to output node.
|
if (sceneNode.mMetaData != nullptr) {
|
||||||
sceneNode.mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(metadataList.size()));
|
throw DeadlyImportError("Postprocess. MetaData member in node are not nullptr. Something went wrong.");
|
||||||
size_t meta_idx(0);
|
}
|
||||||
|
|
||||||
for (const CAMFImporter_NodeElement_Metadata &metadata : metadataList) {
|
// copy collected metadata to output node.
|
||||||
sceneNode.mMetaData->Set(static_cast<unsigned int>(meta_idx++), metadata.Type, aiString(metadata.Value));
|
sceneNode.mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(metadataList.size()));
|
||||||
}
|
size_t meta_idx(0);
|
||||||
} // if(!metadataList.empty())
|
|
||||||
|
for (const AMFMetadata *metadata : metadataList) {
|
||||||
|
sceneNode.mMetaData->Set(static_cast<unsigned int>(meta_idx++), metadata->Type, aiString(metadata->Value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Postprocess_BuildNodeAndObject(const CAMFImporter_NodeElement_Object &pNodeElement, std::list<aiMesh *> &pMeshList, aiNode **pSceneNode) {
|
void AMFImporter::Postprocess_BuildNodeAndObject(const AMFObject &pNodeElement, MeshArray &meshList, aiNode **pSceneNode) {
|
||||||
CAMFImporter_NodeElement_Color *object_color = nullptr;
|
AMFColor *object_color = nullptr;
|
||||||
|
|
||||||
// create new aiNode and set name as <object> has.
|
// create new aiNode and set name as <object> has.
|
||||||
*pSceneNode = new aiNode;
|
*pSceneNode = new aiNode;
|
||||||
(*pSceneNode)->mName = pNodeElement.ID;
|
(*pSceneNode)->mName = pNodeElement.ID;
|
||||||
// read mesh and color
|
// read mesh and color
|
||||||
for (const CAMFImporter_NodeElement *ne_child : pNodeElement.Child) {
|
for (const AMFNodeElementBase *ne_child : pNodeElement.Child) {
|
||||||
std::vector<aiVector3D> vertex_arr;
|
std::vector<aiVector3D> vertex_arr;
|
||||||
std::vector<CAMFImporter_NodeElement_Color *> color_arr;
|
std::vector<AMFColor *> color_arr;
|
||||||
|
|
||||||
// color for object
|
// color for object
|
||||||
if (ne_child->Type == CAMFImporter_NodeElement::ENET_Color) object_color = (CAMFImporter_NodeElement_Color *)ne_child;
|
if (ne_child->Type == AMFNodeElementBase::ENET_Color) {
|
||||||
|
object_color = (AMFColor *) ne_child;
|
||||||
|
}
|
||||||
|
|
||||||
if (ne_child->Type == CAMFImporter_NodeElement::ENET_Mesh) {
|
if (ne_child->Type == AMFNodeElementBase::ENET_Mesh) {
|
||||||
// Create arrays from children of mesh: vertices.
|
// Create arrays from children of mesh: vertices.
|
||||||
PostprocessHelper_CreateMeshDataArray(*((CAMFImporter_NodeElement_Mesh *)ne_child), vertex_arr, color_arr);
|
PostprocessHelper_CreateMeshDataArray(*((AMFMesh *)ne_child), vertex_arr, color_arr);
|
||||||
// Use this arrays as a source when creating every aiMesh
|
// Use this arrays as a source when creating every aiMesh
|
||||||
Postprocess_BuildMeshSet(*((CAMFImporter_NodeElement_Mesh *)ne_child), vertex_arr, color_arr, object_color, pMeshList, **pSceneNode);
|
Postprocess_BuildMeshSet(*((AMFMesh *)ne_child), vertex_arr, color_arr, object_color, meshList, **pSceneNode);
|
||||||
}
|
}
|
||||||
} // for(const CAMFImporter_NodeElement* ne_child: pNodeElement)
|
} // for(const CAMFImporter_NodeElement* ne_child: pNodeElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh &pNodeElement, const std::vector<aiVector3D> &pVertexCoordinateArray,
|
void AMFImporter::Postprocess_BuildMeshSet(const AMFMesh &pNodeElement, const std::vector<aiVector3D> &pVertexCoordinateArray,
|
||||||
const std::vector<CAMFImporter_NodeElement_Color *> &pVertexColorArray,
|
const std::vector<AMFColor *> &pVertexColorArray, const AMFColor *pObjectColor, MeshArray &pMeshList, aiNode &pSceneNode) {
|
||||||
const CAMFImporter_NodeElement_Color *pObjectColor, std::list<aiMesh *> &pMeshList, aiNode &pSceneNode) {
|
|
||||||
std::list<unsigned int> mesh_idx;
|
std::list<unsigned int> mesh_idx;
|
||||||
|
|
||||||
// all data stored in "volume", search for it.
|
// all data stored in "volume", search for it.
|
||||||
for (const CAMFImporter_NodeElement *ne_child : pNodeElement.Child) {
|
for (const AMFNodeElementBase *ne_child : pNodeElement.Child) {
|
||||||
const CAMFImporter_NodeElement_Color *ne_volume_color = nullptr;
|
const AMFColor *ne_volume_color = nullptr;
|
||||||
const SPP_Material *cur_mat = nullptr;
|
const SPP_Material *cur_mat = nullptr;
|
||||||
|
|
||||||
if (ne_child->Type == CAMFImporter_NodeElement::ENET_Volume) {
|
if (ne_child->Type == AMFNodeElementBase::ENET_Volume) {
|
||||||
/******************* Get faces *******************/
|
/******************* Get faces *******************/
|
||||||
const CAMFImporter_NodeElement_Volume *ne_volume = reinterpret_cast<const CAMFImporter_NodeElement_Volume *>(ne_child);
|
const AMFVolume *ne_volume = reinterpret_cast<const AMFVolume *>(ne_child);
|
||||||
|
|
||||||
std::list<SComplexFace> complex_faces_list; // List of the faces of the volume.
|
std::list<SComplexFace> complex_faces_list; // List of the faces of the volume.
|
||||||
std::list<std::list<SComplexFace>> complex_faces_toplist; // List of the face list for every mesh.
|
std::list<std::list<SComplexFace>> complex_faces_toplist; // List of the face list for every mesh.
|
||||||
|
|
||||||
// check if volume use material
|
// check if volume use material
|
||||||
if (!ne_volume->MaterialID.empty()) {
|
if (!ne_volume->MaterialID.empty()) {
|
||||||
if (!Find_ConvertedMaterial(ne_volume->MaterialID, &cur_mat)) Throw_ID_NotFound(ne_volume->MaterialID);
|
if (!Find_ConvertedMaterial(ne_volume->MaterialID, &cur_mat)) {
|
||||||
|
Throw_ID_NotFound(ne_volume->MaterialID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// inside "volume" collect all data and place to arrays or create new objects
|
// inside "volume" collect all data and place to arrays or create new objects
|
||||||
for (const CAMFImporter_NodeElement *ne_volume_child : ne_volume->Child) {
|
for (const AMFNodeElementBase *ne_volume_child : ne_volume->Child) {
|
||||||
// color for volume
|
// color for volume
|
||||||
if (ne_volume_child->Type == CAMFImporter_NodeElement::ENET_Color) {
|
if (ne_volume_child->Type == AMFNodeElementBase::ENET_Color) {
|
||||||
ne_volume_color = reinterpret_cast<const CAMFImporter_NodeElement_Color *>(ne_volume_child);
|
ne_volume_color = reinterpret_cast<const AMFColor *>(ne_volume_child);
|
||||||
} else if (ne_volume_child->Type == CAMFImporter_NodeElement::ENET_Triangle) // triangles, triangles colors
|
} else if (ne_volume_child->Type == AMFNodeElementBase::ENET_Triangle) // triangles, triangles colors
|
||||||
{
|
{
|
||||||
const CAMFImporter_NodeElement_Triangle &tri_al = *reinterpret_cast<const CAMFImporter_NodeElement_Triangle *>(ne_volume_child);
|
const AMFTriangle &tri_al = *reinterpret_cast<const AMFTriangle *>(ne_volume_child);
|
||||||
|
|
||||||
SComplexFace complex_face;
|
SComplexFace complex_face;
|
||||||
|
|
||||||
|
@ -388,11 +401,11 @@ void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh &
|
||||||
complex_face.TexMap = nullptr;
|
complex_face.TexMap = nullptr;
|
||||||
// get data from triangle children: color, texture coordinates.
|
// get data from triangle children: color, texture coordinates.
|
||||||
if (tri_al.Child.size()) {
|
if (tri_al.Child.size()) {
|
||||||
for (const CAMFImporter_NodeElement *ne_triangle_child : tri_al.Child) {
|
for (const AMFNodeElementBase *ne_triangle_child : tri_al.Child) {
|
||||||
if (ne_triangle_child->Type == CAMFImporter_NodeElement::ENET_Color)
|
if (ne_triangle_child->Type == AMFNodeElementBase::ENET_Color)
|
||||||
complex_face.Color = reinterpret_cast<const CAMFImporter_NodeElement_Color *>(ne_triangle_child);
|
complex_face.Color = reinterpret_cast<const AMFColor *>(ne_triangle_child);
|
||||||
else if (ne_triangle_child->Type == CAMFImporter_NodeElement::ENET_TexMap)
|
else if (ne_triangle_child->Type == AMFNodeElementBase::ENET_TexMap)
|
||||||
complex_face.TexMap = reinterpret_cast<const CAMFImporter_NodeElement_TexMap *>(ne_triangle_child);
|
complex_face.TexMap = reinterpret_cast<const AMFTexMap *>(ne_triangle_child);
|
||||||
}
|
}
|
||||||
} // if(tri_al.Child.size())
|
} // if(tri_al.Child.size())
|
||||||
|
|
||||||
|
@ -416,21 +429,24 @@ void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh &
|
||||||
|
|
||||||
if (pBiggerThan != nullptr) {
|
if (pBiggerThan != nullptr) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
const size_t biggerThan = *pBiggerThan;
|
||||||
for (const SComplexFace &face : pFaceList) {
|
for (const SComplexFace &face : pFaceList) {
|
||||||
for (size_t idx_vert = 0; idx_vert < face.Face.mNumIndices; idx_vert++) {
|
for (size_t idx_vert = 0; idx_vert < face.Face.mNumIndices; idx_vert++) {
|
||||||
if (face.Face.mIndices[idx_vert] > *pBiggerThan) {
|
if (face.Face.mIndices[idx_vert] > biggerThan) {
|
||||||
rv = face.Face.mIndices[idx_vert];
|
rv = face.Face.mIndices[idx_vert];
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found) break;
|
if (found) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found) return *pBiggerThan;
|
if (!found) {
|
||||||
|
return *pBiggerThan;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
rv = pFaceList.front().Face.mIndices[0];
|
rv = pFaceList.front().Face.mIndices[0];
|
||||||
} // if(pBiggerThan != nullptr) else
|
} // if(pBiggerThan != nullptr) else
|
||||||
|
@ -505,9 +521,9 @@ void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh &
|
||||||
tmesh->mNumFaces = static_cast<unsigned int>(face_list_cur.size());
|
tmesh->mNumFaces = static_cast<unsigned int>(face_list_cur.size());
|
||||||
tmesh->mFaces = new aiFace[tmesh->mNumFaces];
|
tmesh->mFaces = new aiFace[tmesh->mNumFaces];
|
||||||
|
|
||||||
// Create vertices list and optimize indices. Optimisation mean following.In AMF all volumes use one big list of vertices. And one volume
|
// Create vertices list and optimize indices. Optimization mean following.In AMF all volumes use one big list of vertices. And one volume
|
||||||
// can use only part of vertices list, for example: vertices list contain few thousands of vertices and volume use vertices 1, 3, 10.
|
// can use only part of vertices list, for example: vertices list contain few thousands of vertices and volume use vertices 1, 3, 10.
|
||||||
// Do you need all this thousands of garbage? Of course no. So, optimisation step transformate sparse indices set to continuous.
|
// Do you need all this thousands of garbage? Of course no. So, optimization step transform sparse indices set to continuous.
|
||||||
size_t VertexCount_Max = tmesh->mNumFaces * 3; // 3 - triangles.
|
size_t VertexCount_Max = tmesh->mNumFaces * 3; // 3 - triangles.
|
||||||
std::vector<aiVector3D> vert_arr, texcoord_arr;
|
std::vector<aiVector3D> vert_arr, texcoord_arr;
|
||||||
std::vector<aiColor4D> col_arr;
|
std::vector<aiColor4D> col_arr;
|
||||||
|
@ -566,7 +582,7 @@ void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh &
|
||||||
size_t idx_vert_new = vert_arr.size();
|
size_t idx_vert_new = vert_arr.size();
|
||||||
///TODO: clean unused vertices. "* 2": in certain cases - mesh full of triangle colors - vert_arr will contain duplicated vertices for
|
///TODO: clean unused vertices. "* 2": in certain cases - mesh full of triangle colors - vert_arr will contain duplicated vertices for
|
||||||
/// colored triangles and initial vertices (for colored vertices) which in real became unused. This part need more thinking about
|
/// colored triangles and initial vertices (for colored vertices) which in real became unused. This part need more thinking about
|
||||||
/// optimisation.
|
/// optimization.
|
||||||
bool *idx_vert_used;
|
bool *idx_vert_used;
|
||||||
|
|
||||||
idx_vert_used = new bool[VertexCount_Max * 2];
|
idx_vert_used = new bool[VertexCount_Max * 2];
|
||||||
|
@ -639,15 +655,15 @@ void AMFImporter::Postprocess_BuildMeshSet(const CAMFImporter_NodeElement_Mesh &
|
||||||
} // if(mesh_idx.size() > 0)
|
} // if(mesh_idx.size() > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Postprocess_BuildMaterial(const CAMFImporter_NodeElement_Material &pMaterial) {
|
void AMFImporter::Postprocess_BuildMaterial(const AMFMaterial &pMaterial) {
|
||||||
SPP_Material new_mat;
|
SPP_Material new_mat;
|
||||||
|
|
||||||
new_mat.ID = pMaterial.ID;
|
new_mat.ID = pMaterial.ID;
|
||||||
for (const CAMFImporter_NodeElement *mat_child : pMaterial.Child) {
|
for (const AMFNodeElementBase *mat_child : pMaterial.Child) {
|
||||||
if (mat_child->Type == CAMFImporter_NodeElement::ENET_Color) {
|
if (mat_child->Type == AMFNodeElementBase::ENET_Color) {
|
||||||
new_mat.Color = (CAMFImporter_NodeElement_Color *)mat_child;
|
new_mat.Color = (AMFColor*)mat_child;
|
||||||
} else if (mat_child->Type == CAMFImporter_NodeElement::ENET_Metadata) {
|
} else if (mat_child->Type == AMFNodeElementBase::ENET_Metadata) {
|
||||||
new_mat.Metadata.push_back((CAMFImporter_NodeElement_Metadata *)mat_child);
|
new_mat.Metadata.push_back((AMFMetadata *)mat_child);
|
||||||
}
|
}
|
||||||
} // for(const CAMFImporter_NodeElement* mat_child; pMaterial.Child)
|
} // for(const CAMFImporter_NodeElement* mat_child; pMaterial.Child)
|
||||||
|
|
||||||
|
@ -655,7 +671,7 @@ void AMFImporter::Postprocess_BuildMaterial(const CAMFImporter_NodeElement_Mater
|
||||||
mMaterial_Converted.push_back(new_mat);
|
mMaterial_Converted.push_back(new_mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Postprocess_BuildConstellation(CAMFImporter_NodeElement_Constellation &pConstellation, std::list<aiNode *> &pNodeList) const {
|
void AMFImporter::Postprocess_BuildConstellation(AMFConstellation &pConstellation, NodeArray &nodeArray) const {
|
||||||
aiNode *con_node;
|
aiNode *con_node;
|
||||||
std::list<aiNode *> ch_node;
|
std::list<aiNode *> ch_node;
|
||||||
|
|
||||||
|
@ -667,18 +683,18 @@ void AMFImporter::Postprocess_BuildConstellation(CAMFImporter_NodeElement_Conste
|
||||||
con_node = new aiNode;
|
con_node = new aiNode;
|
||||||
con_node->mName = pConstellation.ID;
|
con_node->mName = pConstellation.ID;
|
||||||
// Walk through children and search for instances of another objects, constellations.
|
// Walk through children and search for instances of another objects, constellations.
|
||||||
for (const CAMFImporter_NodeElement *ne : pConstellation.Child) {
|
for (const AMFNodeElementBase *ne : pConstellation.Child) {
|
||||||
aiMatrix4x4 tmat;
|
aiMatrix4x4 tmat;
|
||||||
aiNode *t_node;
|
aiNode *t_node;
|
||||||
aiNode *found_node;
|
aiNode *found_node;
|
||||||
|
|
||||||
if (ne->Type == CAMFImporter_NodeElement::ENET_Metadata) continue;
|
if (ne->Type == AMFNodeElementBase::ENET_Metadata) continue;
|
||||||
if (ne->Type != CAMFImporter_NodeElement::ENET_Instance) throw DeadlyImportError("Only <instance> nodes can be in <constellation>.");
|
if (ne->Type != AMFNodeElementBase::ENET_Instance) throw DeadlyImportError("Only <instance> nodes can be in <constellation>.");
|
||||||
|
|
||||||
// create alias for conveniance
|
// create alias for convenience
|
||||||
CAMFImporter_NodeElement_Instance &als = *((CAMFImporter_NodeElement_Instance *)ne);
|
AMFInstance &als = *((AMFInstance *)ne);
|
||||||
// find referenced object
|
// find referenced object
|
||||||
if (!Find_ConvertedNode(als.ObjectID, pNodeList, &found_node)) Throw_ID_NotFound(als.ObjectID);
|
if (!Find_ConvertedNode(als.ObjectID, nodeArray, &found_node)) Throw_ID_NotFound(als.ObjectID);
|
||||||
|
|
||||||
// create node for applying transformation
|
// create node for applying transformation
|
||||||
t_node = new aiNode;
|
t_node = new aiNode;
|
||||||
|
@ -707,13 +723,13 @@ void AMFImporter::Postprocess_BuildConstellation(CAMFImporter_NodeElement_Conste
|
||||||
con_node->mChildren[ch_idx++] = node;
|
con_node->mChildren[ch_idx++] = node;
|
||||||
|
|
||||||
// and place "root" of <constellation> node to node list
|
// and place "root" of <constellation> node to node list
|
||||||
pNodeList.push_back(con_node);
|
nodeArray.push_back(con_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMFImporter::Postprocess_BuildScene(aiScene *pScene) {
|
void AMFImporter::Postprocess_BuildScene(aiScene *pScene) {
|
||||||
std::list<aiNode *> node_list;
|
NodeArray nodeArray;
|
||||||
std::list<aiMesh *> mesh_list;
|
MeshArray mesh_list;
|
||||||
std::list<CAMFImporter_NodeElement_Metadata *> meta_list;
|
AMFMetaDataArray meta_list;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Because for AMF "material" is just complex colors mixing so aiMaterial will not be used.
|
// Because for AMF "material" is just complex colors mixing so aiMaterial will not be used.
|
||||||
|
@ -723,18 +739,21 @@ void AMFImporter::Postprocess_BuildScene(aiScene *pScene) {
|
||||||
pScene->mRootNode->mParent = nullptr;
|
pScene->mRootNode->mParent = nullptr;
|
||||||
pScene->mFlags |= AI_SCENE_FLAGS_ALLOW_SHARED;
|
pScene->mFlags |= AI_SCENE_FLAGS_ALLOW_SHARED;
|
||||||
// search for root(<amf>) element
|
// search for root(<amf>) element
|
||||||
CAMFImporter_NodeElement *root_el = nullptr;
|
AMFNodeElementBase *root_el = nullptr;
|
||||||
|
|
||||||
for (CAMFImporter_NodeElement *ne : mNodeElement_List) {
|
for (AMFNodeElementBase *ne : mNodeElement_List) {
|
||||||
if (ne->Type != CAMFImporter_NodeElement::ENET_Root) continue;
|
if (ne->Type != AMFNodeElementBase::ENET_Root) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
root_el = ne;
|
root_el = ne;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} // for(const CAMFImporter_NodeElement* ne: mNodeElement_List)
|
} // for(const CAMFImporter_NodeElement* ne: mNodeElement_List)
|
||||||
|
|
||||||
// Check if root element are found.
|
// Check if root element are found.
|
||||||
if (root_el == nullptr) throw DeadlyImportError("Root(<amf>) element not found.");
|
if (root_el == nullptr) {
|
||||||
|
throw DeadlyImportError("Root(<amf>) element not found.");
|
||||||
|
}
|
||||||
|
|
||||||
// after that walk through children of root and collect data. Five types of nodes can be placed at top level - in <amf>: <object>, <material>, <texture>,
|
// after that walk through children of root and collect data. Five types of nodes can be placed at top level - in <amf>: <object>, <material>, <texture>,
|
||||||
// <constellation> and <metadata>. But at first we must read <material> and <texture> because they will be used in <object>. <metadata> can be read
|
// <constellation> and <metadata>. But at first we must read <material> and <texture> because they will be used in <object>. <metadata> can be read
|
||||||
|
@ -742,34 +761,38 @@ void AMFImporter::Postprocess_BuildScene(aiScene *pScene) {
|
||||||
//
|
//
|
||||||
// 1. <material>
|
// 1. <material>
|
||||||
// 2. <texture> will be converted later when processing triangles list. \sa Postprocess_BuildMeshSet
|
// 2. <texture> will be converted later when processing triangles list. \sa Postprocess_BuildMeshSet
|
||||||
for (const CAMFImporter_NodeElement *root_child : root_el->Child) {
|
for (const AMFNodeElementBase *root_child : root_el->Child) {
|
||||||
if (root_child->Type == CAMFImporter_NodeElement::ENET_Material) Postprocess_BuildMaterial(*((CAMFImporter_NodeElement_Material *)root_child));
|
if (root_child->Type == AMFNodeElementBase::ENET_Material) {
|
||||||
|
Postprocess_BuildMaterial(*((AMFMaterial *)root_child));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// After "appearance" nodes we must read <object> because it will be used in <constellation> -> <instance>.
|
// After "appearance" nodes we must read <object> because it will be used in <constellation> -> <instance>.
|
||||||
//
|
//
|
||||||
// 3. <object>
|
// 3. <object>
|
||||||
for (const CAMFImporter_NodeElement *root_child : root_el->Child) {
|
for (const AMFNodeElementBase *root_child : root_el->Child) {
|
||||||
if (root_child->Type == CAMFImporter_NodeElement::ENET_Object) {
|
if (root_child->Type == AMFNodeElementBase::ENET_Object) {
|
||||||
aiNode *tnode = nullptr;
|
aiNode *tnode = nullptr;
|
||||||
|
|
||||||
// for <object> mesh and node must be built: object ID assigned to aiNode name and will be used in future for <instance>
|
// for <object> mesh and node must be built: object ID assigned to aiNode name and will be used in future for <instance>
|
||||||
Postprocess_BuildNodeAndObject(*((CAMFImporter_NodeElement_Object *)root_child), mesh_list, &tnode);
|
Postprocess_BuildNodeAndObject(*((AMFObject *)root_child), mesh_list, &tnode);
|
||||||
if (tnode != nullptr) node_list.push_back(tnode);
|
if (tnode != nullptr) {
|
||||||
|
nodeArray.push_back(tnode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // for(const CAMFImporter_NodeElement* root_child: root_el->Child)
|
} // for(const CAMFImporter_NodeElement* root_child: root_el->Child)
|
||||||
|
|
||||||
// And finally read rest of nodes.
|
// And finally read rest of nodes.
|
||||||
//
|
//
|
||||||
for (const CAMFImporter_NodeElement *root_child : root_el->Child) {
|
for (const AMFNodeElementBase *root_child : root_el->Child) {
|
||||||
// 4. <constellation>
|
// 4. <constellation>
|
||||||
if (root_child->Type == CAMFImporter_NodeElement::ENET_Constellation) {
|
if (root_child->Type == AMFNodeElementBase::ENET_Constellation) {
|
||||||
// <object> and <constellation> at top of self abstraction use aiNode. So we can use only aiNode list for creating new aiNode's.
|
// <object> and <constellation> at top of self abstraction use aiNode. So we can use only aiNode list for creating new aiNode's.
|
||||||
Postprocess_BuildConstellation(*((CAMFImporter_NodeElement_Constellation *)root_child), node_list);
|
Postprocess_BuildConstellation(*((AMFConstellation *)root_child), nodeArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5, <metadata>
|
// 5, <metadata>
|
||||||
if (root_child->Type == CAMFImporter_NodeElement::ENET_Metadata) meta_list.push_back((CAMFImporter_NodeElement_Metadata *)root_child);
|
if (root_child->Type == AMFNodeElementBase::ENET_Metadata) meta_list.push_back((AMFMetadata *)root_child);
|
||||||
} // for(const CAMFImporter_NodeElement* root_child: root_el->Child)
|
} // for(const CAMFImporter_NodeElement* root_child: root_el->Child)
|
||||||
|
|
||||||
// at now we can add collected metadata to root node
|
// at now we can add collected metadata to root node
|
||||||
|
@ -783,17 +806,18 @@ void AMFImporter::Postprocess_BuildScene(aiScene *pScene) {
|
||||||
// And at this step we are checking that relations.
|
// And at this step we are checking that relations.
|
||||||
nl_clean_loop:
|
nl_clean_loop:
|
||||||
|
|
||||||
if (node_list.size() > 1) {
|
if (nodeArray.size() > 1) {
|
||||||
// walk through all nodes
|
// walk through all nodes
|
||||||
for (std::list<aiNode *>::iterator nl_it = node_list.begin(); nl_it != node_list.end(); ++nl_it) {
|
for (NodeArray::iterator nl_it = nodeArray.begin(); nl_it != nodeArray.end(); ++nl_it) {
|
||||||
// and try to find them in another top nodes.
|
// and try to find them in another top nodes.
|
||||||
std::list<aiNode *>::const_iterator next_it = nl_it;
|
NodeArray::const_iterator next_it = nl_it;
|
||||||
|
|
||||||
++next_it;
|
++next_it;
|
||||||
for (; next_it != node_list.end(); ++next_it) {
|
for (; next_it != nodeArray.end(); ++next_it) {
|
||||||
if ((*next_it)->FindNode((*nl_it)->mName) != nullptr) {
|
if ((*next_it)->FindNode((*nl_it)->mName) != nullptr) {
|
||||||
// if current top node(nl_it) found in another top node then erase it from node_list and restart search loop.
|
// if current top node(nl_it) found in another top node then erase it from node_list and restart search loop.
|
||||||
node_list.erase(nl_it);
|
// FIXME: this leaks memory on test models test8.amf and test9.amf
|
||||||
|
nodeArray.erase(nl_it);
|
||||||
|
|
||||||
goto nl_clean_loop;
|
goto nl_clean_loop;
|
||||||
}
|
}
|
||||||
|
@ -806,10 +830,10 @@ nl_clean_loop:
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Nodes
|
// Nodes
|
||||||
if (!node_list.empty()) {
|
if (!nodeArray.empty()) {
|
||||||
std::list<aiNode *>::const_iterator nl_it = node_list.begin();
|
NodeArray::const_iterator nl_it = nodeArray.begin();
|
||||||
|
|
||||||
pScene->mRootNode->mNumChildren = static_cast<unsigned int>(node_list.size());
|
pScene->mRootNode->mNumChildren = static_cast<unsigned int>(nodeArray.size());
|
||||||
pScene->mRootNode->mChildren = new aiNode *[pScene->mRootNode->mNumChildren];
|
pScene->mRootNode->mChildren = new aiNode *[pScene->mRootNode->mNumChildren];
|
||||||
for (size_t i = 0; i < pScene->mRootNode->mNumChildren; i++) {
|
for (size_t i = 0; i < pScene->mRootNode->mNumChildren; i++) {
|
||||||
// Objects and constellation that must be showed placed at top of hierarchy in <amf> node. So all aiNode's in node_list must have
|
// Objects and constellation that must be showed placed at top of hierarchy in <amf> node. So all aiNode's in node_list must have
|
||||||
|
@ -822,7 +846,7 @@ nl_clean_loop:
|
||||||
//
|
//
|
||||||
// Meshes
|
// Meshes
|
||||||
if (!mesh_list.empty()) {
|
if (!mesh_list.empty()) {
|
||||||
std::list<aiMesh *>::const_iterator ml_it = mesh_list.begin();
|
MeshArray::const_iterator ml_it = mesh_list.begin();
|
||||||
|
|
||||||
pScene->mNumMeshes = static_cast<unsigned int>(mesh_list.size());
|
pScene->mNumMeshes = static_cast<unsigned int>(mesh_list.size());
|
||||||
pScene->mMeshes = new aiMesh *[pScene->mNumMeshes];
|
pScene->mMeshes = new aiMesh *[pScene->mNumMeshes];
|
||||||
|
@ -844,7 +868,7 @@ nl_clean_loop:
|
||||||
pScene->mTextures[idx]->mHeight = static_cast<unsigned int>(tex_convd.Height);
|
pScene->mTextures[idx]->mHeight = static_cast<unsigned int>(tex_convd.Height);
|
||||||
pScene->mTextures[idx]->pcData = (aiTexel *)tex_convd.Data;
|
pScene->mTextures[idx]->pcData = (aiTexel *)tex_convd.Data;
|
||||||
// texture format description.
|
// texture format description.
|
||||||
strcpy(pScene->mTextures[idx]->achFormatHint, tex_convd.FormatHint);
|
strncpy(pScene->mTextures[idx]->achFormatHint, tex_convd.FormatHint, HINTMAXTEXTURELEN);
|
||||||
idx++;
|
idx++;
|
||||||
} // for(const SPP_Texture& tex_convd: mTexture_Converted)
|
} // for(const SPP_Texture& tex_convd: mTexture_Converted)
|
||||||
|
|
||||||
|
@ -853,7 +877,7 @@ nl_clean_loop:
|
||||||
pScene->mNumMaterials = static_cast<unsigned int>(mTexture_Converted.size());
|
pScene->mNumMaterials = static_cast<unsigned int>(mTexture_Converted.size());
|
||||||
pScene->mMaterials = new aiMaterial *[pScene->mNumMaterials];
|
pScene->mMaterials = new aiMaterial *[pScene->mNumMaterials];
|
||||||
for (const SPP_Texture &tex_convd : mTexture_Converted) {
|
for (const SPP_Texture &tex_convd : mTexture_Converted) {
|
||||||
const aiString texture_id(AI_EMBEDDED_TEXNAME_PREFIX + to_string(idx));
|
const aiString texture_id(AI_EMBEDDED_TEXNAME_PREFIX + ai_to_string(idx));
|
||||||
const int mode = aiTextureOp_Multiply;
|
const int mode = aiTextureOp_Multiply;
|
||||||
const int repeat = tex_convd.Tiled ? 1 : 0;
|
const int repeat = tex_convd.Tiled ? 1 : 0;
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -46,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
// internal headers
|
// internal headers
|
||||||
|
@ -66,10 +63,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// utilities
|
// utilities
|
||||||
#include <assimp/fast_atof.h>
|
#include <assimp/fast_atof.h>
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
using namespace Assimp::ASE;
|
using namespace Assimp::ASE;
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
static constexpr aiImporterDesc desc = {
|
||||||
"ASE Importer",
|
"ASE Importer",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -89,27 +86,11 @@ ASEImporter::ASEImporter() :
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Destructor, private as well
|
|
||||||
ASEImporter::~ASEImporter() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Returns whether the class can handle the format of the given file.
|
// Returns whether the class can handle the format of the given file.
|
||||||
bool ASEImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool cs) const {
|
bool ASEImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
||||||
// check file extension
|
static const char *tokens[] = { "*3dsmax_asciiexport" };
|
||||||
const std::string extension = GetExtension(pFile);
|
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
|
||||||
|
|
||||||
if (extension == "ase" || extension == "ask") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((!extension.length() || cs) && pIOHandler) {
|
|
||||||
const char *tokens[] = { "*3dsmax_asciiexport" };
|
|
||||||
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -136,14 +117,14 @@ void ASEImporter::InternReadFile(const std::string &pFile,
|
||||||
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
|
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile, "rb"));
|
||||||
|
|
||||||
// Check whether we can read from the file
|
// Check whether we can read from the file
|
||||||
if (file.get() == nullptr) {
|
if (file == nullptr) {
|
||||||
throw DeadlyImportError("Failed to open ASE file " + pFile + ".");
|
throw DeadlyImportError("Failed to open ASE file ", pFile, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate storage and copy the contents of the file to a memory buffer
|
// Allocate storage and copy the contents of the file to a memory buffer
|
||||||
std::vector<char> mBuffer2;
|
std::vector<char> mBuffer2;
|
||||||
TextFileToBuffer(file.get(), mBuffer2);
|
TextFileToBuffer(file.get(), mBuffer2);
|
||||||
|
const size_t fileSize = mBuffer2.size();
|
||||||
this->mBuffer = &mBuffer2[0];
|
this->mBuffer = &mBuffer2[0];
|
||||||
this->pcScene = pScene;
|
this->pcScene = pScene;
|
||||||
|
|
||||||
|
@ -165,7 +146,7 @@ void ASEImporter::InternReadFile(const std::string &pFile,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Construct an ASE parser and parse the file
|
// Construct an ASE parser and parse the file
|
||||||
ASE::Parser parser(mBuffer, defaultFormat);
|
ASE::Parser parser(mBuffer, fileSize, defaultFormat);
|
||||||
mParser = &parser;
|
mParser = &parser;
|
||||||
mParser->Parse();
|
mParser->Parse();
|
||||||
|
|
||||||
|
@ -277,7 +258,7 @@ void ASEImporter::GenerateDefaultMaterial() {
|
||||||
}
|
}
|
||||||
if (bHas || mParser->m_vMaterials.empty()) {
|
if (bHas || mParser->m_vMaterials.empty()) {
|
||||||
// add a simple material without submaterials to the parser's list
|
// add a simple material without submaterials to the parser's list
|
||||||
mParser->m_vMaterials.push_back(ASE::Material(AI_DEFAULT_MATERIAL_NAME));
|
mParser->m_vMaterials.emplace_back(AI_DEFAULT_MATERIAL_NAME);
|
||||||
ASE::Material &mat = mParser->m_vMaterials.back();
|
ASE::Material &mat = mParser->m_vMaterials.back();
|
||||||
|
|
||||||
mat.mDiffuse = aiColor3D(0.6f, 0.6f, 0.6f);
|
mat.mDiffuse = aiColor3D(0.6f, 0.6f, 0.6f);
|
||||||
|
@ -340,21 +321,6 @@ void ASEImporter::BuildAnimations(const std::vector<BaseNode *> &nodes) {
|
||||||
aiNodeAnim *nd = pcAnim->mChannels[iNum++] = new aiNodeAnim();
|
aiNodeAnim *nd = pcAnim->mChannels[iNum++] = new aiNodeAnim();
|
||||||
nd->mNodeName.Set(me->mName + ".Target");
|
nd->mNodeName.Set(me->mName + ".Target");
|
||||||
|
|
||||||
// If there is no input position channel we will need
|
|
||||||
// to supply the default position from the node's
|
|
||||||
// local transformation matrix.
|
|
||||||
/*TargetAnimationHelper helper;
|
|
||||||
if (me->mAnim.akeyPositions.empty())
|
|
||||||
{
|
|
||||||
aiMatrix4x4& mat = (*i)->mTransform;
|
|
||||||
helper.SetFixedMainAnimationChannel(aiVector3D(
|
|
||||||
mat.a4, mat.b4, mat.c4));
|
|
||||||
}
|
|
||||||
else helper.SetMainAnimationChannel (&me->mAnim.akeyPositions);
|
|
||||||
helper.SetTargetAnimationChannel (&me->mTargetAnim.akeyPositions);
|
|
||||||
|
|
||||||
helper.Process(&me->mTargetAnim.akeyPositions);*/
|
|
||||||
|
|
||||||
// Allocate the key array and fill it
|
// Allocate the key array and fill it
|
||||||
nd->mNumPositionKeys = (unsigned int)me->mTargetAnim.akeyPositions.size();
|
nd->mNumPositionKeys = (unsigned int)me->mTargetAnim.akeyPositions.size();
|
||||||
nd->mPositionKeys = new aiVectorKey[nd->mNumPositionKeys];
|
nd->mPositionKeys = new aiVectorKey[nd->mNumPositionKeys];
|
||||||
|
@ -480,10 +446,9 @@ void ASEImporter::BuildLights() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes,
|
void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes, aiNode *pcParent, const std::string &name) {
|
||||||
aiNode *pcParent, const char *szName) {
|
|
||||||
aiMatrix4x4 m;
|
aiMatrix4x4 m;
|
||||||
AddNodes(nodes, pcParent, szName, m);
|
AddNodes(nodes, pcParent, name, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -540,10 +505,9 @@ void ASEImporter::AddMeshes(const ASE::BaseNode *snode, aiNode *node) {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Add child nodes to a given parent node
|
// Add child nodes to a given parent node
|
||||||
void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes,
|
void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes, aiNode *pcParent, const std::string &name,
|
||||||
aiNode *pcParent, const char *szName,
|
|
||||||
const aiMatrix4x4 &mat) {
|
const aiMatrix4x4 &mat) {
|
||||||
const size_t len = szName ? ::strlen(szName) : 0;
|
const size_t len = name.size();
|
||||||
ai_assert(4 <= AI_MAX_NUMBER_OF_COLOR_SETS);
|
ai_assert(4 <= AI_MAX_NUMBER_OF_COLOR_SETS);
|
||||||
|
|
||||||
// Receives child nodes for the pcParent node
|
// Receives child nodes for the pcParent node
|
||||||
|
@ -553,16 +517,18 @@ void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes,
|
||||||
// which has *us* as parent.
|
// which has *us* as parent.
|
||||||
for (std::vector<BaseNode *>::const_iterator it = nodes.begin(), end = nodes.end(); it != end; ++it) {
|
for (std::vector<BaseNode *>::const_iterator it = nodes.begin(), end = nodes.end(); it != end; ++it) {
|
||||||
const BaseNode *snode = *it;
|
const BaseNode *snode = *it;
|
||||||
if (szName) {
|
if (!name.empty()) {
|
||||||
if (len != snode->mParent.length() || ::strcmp(szName, snode->mParent.c_str()))
|
if (len != snode->mParent.length() || name != snode->mParent.c_str()) {
|
||||||
continue;
|
continue;
|
||||||
} else if (snode->mParent.length())
|
}
|
||||||
|
} else if (snode->mParent.length()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
(*it)->mProcessed = true;
|
(*it)->mProcessed = true;
|
||||||
|
|
||||||
// Allocate a new node and add it to the output data structure
|
// Allocate a new node and add it to the output data structure
|
||||||
apcNodes.push_back(new aiNode());
|
apcNodes.push_back(new aiNode);
|
||||||
aiNode *node = apcNodes.back();
|
aiNode *node = apcNodes.back();
|
||||||
|
|
||||||
node->mName.Set((snode->mName.length() ? snode->mName.c_str() : "Unnamed_Node"));
|
node->mName.Set((snode->mName.length() ? snode->mName.c_str() : "Unnamed_Node"));
|
||||||
|
@ -575,7 +541,7 @@ void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes,
|
||||||
|
|
||||||
// Add sub nodes - prevent stack overflow due to recursive parenting
|
// Add sub nodes - prevent stack overflow due to recursive parenting
|
||||||
if (node->mName != node->mParent->mName && node->mName != node->mParent->mParent->mName) {
|
if (node->mName != node->mParent->mName && node->mName != node->mParent->mParent->mName) {
|
||||||
AddNodes(nodes, node, node->mName.data, snode->mTransform);
|
AddNodes(nodes, node, node->mName.C_Str(), snode->mTransform);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Further processing depends on the type of the node
|
// Further processing depends on the type of the node
|
||||||
|
@ -614,7 +580,7 @@ void ASEImporter::AddNodes(const std::vector<BaseNode *> &nodes,
|
||||||
node->mNumChildren++;
|
node->mNumChildren++;
|
||||||
|
|
||||||
// What we did is so great, it is at least worth a debug message
|
// What we did is so great, it is at least worth a debug message
|
||||||
ASSIMP_LOG_VERBOSE_DEBUG("ASE: Generating separate target node (" + snode->mName + ")");
|
ASSIMP_LOG_VERBOSE_DEBUG("ASE: Generating separate target node (", snode->mName, ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,7 +619,8 @@ void ASEImporter::BuildNodes(std::vector<BaseNode *> &nodes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add all nodes
|
// add all nodes
|
||||||
AddNodes(nodes, ch, nullptr);
|
static const std::string none = "";
|
||||||
|
AddNodes(nodes, ch, none);
|
||||||
|
|
||||||
// now iterate through al nodes and find those that have not yet
|
// now iterate through al nodes and find those that have not yet
|
||||||
// been added to the nodegraph (= their parent could not be recognized)
|
// been added to the nodegraph (= their parent could not be recognized)
|
||||||
|
@ -683,7 +650,7 @@ void ASEImporter::BuildNodes(std::vector<BaseNode *> &nodes) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Are there ane orphaned nodes?
|
// Are there any orphaned nodes?
|
||||||
if (!aiList.empty()) {
|
if (!aiList.empty()) {
|
||||||
std::vector<aiNode *> apcNodes;
|
std::vector<aiNode *> apcNodes;
|
||||||
apcNodes.reserve(aiList.size() + pcScene->mRootNode->mNumChildren);
|
apcNodes.reserve(aiList.size() + pcScene->mRootNode->mNumChildren);
|
||||||
|
@ -882,6 +849,7 @@ void ASEImporter::ConvertMaterial(ASE::Material &mat) {
|
||||||
unsigned int iWire = 1;
|
unsigned int iWire = 1;
|
||||||
mat.pcInstance->AddProperty<int>((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME);
|
mat.pcInstance->AddProperty<int>((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME);
|
||||||
}
|
}
|
||||||
|
// fallthrough
|
||||||
case D3DS::Discreet3DS::Gouraud:
|
case D3DS::Discreet3DS::Gouraud:
|
||||||
eShading = aiShadingMode_Gouraud;
|
eShading = aiShadingMode_Gouraud;
|
||||||
break;
|
break;
|
||||||
|
@ -937,7 +905,7 @@ void ASEImporter::ConvertMeshes(ASE::Mesh &mesh, std::vector<aiMesh *> &avOutMes
|
||||||
ASSIMP_LOG_WARN("Material index is out of range");
|
ASSIMP_LOG_WARN("Material index is out of range");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the material the mesh is assigned to is consisting of submeshes, split it
|
// If the material the mesh is assigned to consists of submeshes, split it
|
||||||
if (!mParser->m_vMaterials[mesh.iMaterialIndex].avSubMaterials.empty()) {
|
if (!mParser->m_vMaterials[mesh.iMaterialIndex].avSubMaterials.empty()) {
|
||||||
std::vector<ASE::Material> vSubMaterials = mParser->m_vMaterials[mesh.iMaterialIndex].avSubMaterials;
|
std::vector<ASE::Material> vSubMaterials = mParser->m_vMaterials[mesh.iMaterialIndex].avSubMaterials;
|
||||||
|
|
||||||
|
@ -1016,8 +984,8 @@ void ASEImporter::ConvertMeshes(ASE::Mesh &mesh, std::vector<aiMesh *> &avOutMes
|
||||||
blubb != mesh.mBoneVertices[iIndex2].mBoneWeights.end(); ++blubb) {
|
blubb != mesh.mBoneVertices[iIndex2].mBoneWeights.end(); ++blubb) {
|
||||||
|
|
||||||
// NOTE: illegal cases have already been filtered out
|
// NOTE: illegal cases have already been filtered out
|
||||||
avOutputBones[(*blubb).first].push_back(std::pair<unsigned int, float>(
|
avOutputBones[(*blubb).first].emplace_back(
|
||||||
iBase, (*blubb).second));
|
iBase, (*blubb).second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1295,6 +1263,8 @@ bool ASEImporter::GenerateNormals(ASE::Mesh &mesh) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif // ASSIMP_BUILD_NO_3DS_IMPORTER
|
#endif // ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_BASE_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_BASE_IMPORTER
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -62,42 +62,37 @@ namespace Assimp {
|
||||||
class ASEImporter : public BaseImporter {
|
class ASEImporter : public BaseImporter {
|
||||||
public:
|
public:
|
||||||
ASEImporter();
|
ASEImporter();
|
||||||
~ASEImporter();
|
~ASEImporter() override = default;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Returns whether the class can handle the format of the given file.
|
/** Returns whether the class can handle the format of the given file.
|
||||||
* See BaseImporter::CanRead() for details.
|
* See BaseImporter::CanRead() for details.
|
||||||
*/
|
*/
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||||
bool checkSig) const;
|
bool checkSig) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Return importer meta information.
|
/** Return importer meta information.
|
||||||
* See #BaseImporter::GetInfo for the details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
const aiImporterDesc* GetInfo () const;
|
const aiImporterDesc* GetInfo () const override;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details
|
* See BaseImporter::InternReadFile() for details
|
||||||
*/
|
*/
|
||||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||||
IOSystem* pIOHandler);
|
IOSystem* pIOHandler) override;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called prior to ReadFile().
|
/** Called prior to ReadFile().
|
||||||
* The function is a request to the importer to update its configuration
|
* The function is a request to the importer to update its configuration
|
||||||
* basing on the Importer's configuration property list.
|
* basing on the Importer's configuration property list.
|
||||||
*/
|
*/
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp) override;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Generate normal vectors basing on smoothing groups
|
/** Generate normal vectors basing on smoothing groups
|
||||||
* (in some cases the normal are already contained in the file)
|
* (in some cases the normal are already contained in the file)
|
||||||
|
@ -106,7 +101,6 @@ private:
|
||||||
*/
|
*/
|
||||||
bool GenerateNormals(ASE::Mesh& mesh);
|
bool GenerateNormals(ASE::Mesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Create valid vertex/normal/UV/color/face lists.
|
/** Create valid vertex/normal/UV/color/face lists.
|
||||||
* All elements are unique, faces have only one set of indices
|
* All elements are unique, faces have only one set of indices
|
||||||
|
@ -115,51 +109,43 @@ private:
|
||||||
*/
|
*/
|
||||||
void BuildUniqueRepresentation(ASE::Mesh& mesh);
|
void BuildUniqueRepresentation(ASE::Mesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
/** Create one-material-per-mesh meshes ;-)
|
/** Create one-material-per-mesh meshes ;-)
|
||||||
* \param mesh Mesh to work with
|
* \param mesh Mesh to work with
|
||||||
* \param Receives the list of all created meshes
|
* \param Receives the list of all created meshes
|
||||||
*/
|
*/
|
||||||
void ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOut);
|
void ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOut);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Convert a material to a aiMaterial object
|
/** Convert a material to a aiMaterial object
|
||||||
* \param mat Input material
|
* \param mat Input material
|
||||||
*/
|
*/
|
||||||
void ConvertMaterial(ASE::Material& mat);
|
void ConvertMaterial(ASE::Material& mat);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Setup the final material indices for each mesh
|
/** Setup the final material indices for each mesh
|
||||||
*/
|
*/
|
||||||
void BuildMaterialIndices();
|
void BuildMaterialIndices();
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Build the node graph
|
/** Build the node graph
|
||||||
*/
|
*/
|
||||||
void BuildNodes(std::vector<ASE::BaseNode*>& nodes);
|
void BuildNodes(std::vector<ASE::BaseNode*>& nodes);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Build output cameras
|
/** Build output cameras
|
||||||
*/
|
*/
|
||||||
void BuildCameras();
|
void BuildCameras();
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Build output lights
|
/** Build output lights
|
||||||
*/
|
*/
|
||||||
void BuildLights();
|
void BuildLights();
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Build output animations
|
/** Build output animations
|
||||||
*/
|
*/
|
||||||
void BuildAnimations(const std::vector<ASE::BaseNode*>& nodes);
|
void BuildAnimations(const std::vector<ASE::BaseNode*>& nodes);
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Add sub nodes to a node
|
/** Add sub nodes to a node
|
||||||
* \param pcParent parent node to be filled
|
* \param pcParent parent node to be filled
|
||||||
|
@ -167,13 +153,13 @@ private:
|
||||||
* \param matrix Current transform
|
* \param matrix Current transform
|
||||||
*/
|
*/
|
||||||
void AddNodes(const std::vector<ASE::BaseNode*>& nodes,
|
void AddNodes(const std::vector<ASE::BaseNode*>& nodes,
|
||||||
aiNode* pcParent,const char* szName);
|
aiNode* pcParent, const std::string &name);
|
||||||
|
|
||||||
void AddNodes(const std::vector<ASE::BaseNode*>& nodes,
|
void AddNodes(const std::vector<ASE::BaseNode*>& nodes,
|
||||||
aiNode* pcParent,const char* szName,
|
aiNode* pcParent, const std::string &name,
|
||||||
const aiMatrix4x4& matrix);
|
const aiMatrix4x4& matrix);
|
||||||
|
|
||||||
void AddMeshes(const ASE::BaseNode* snode,aiNode* node);
|
void AddMeshes(const ASE::BaseNode* snode, aiNode* node);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Generate a default material and add it to the parser's list
|
/** Generate a default material and add it to the parser's list
|
||||||
|
@ -183,7 +169,6 @@ private:
|
||||||
void GenerateDefaultMaterial();
|
void GenerateDefaultMaterial();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/** Parser instance */
|
/** Parser instance */
|
||||||
ASE::Parser* mParser;
|
ASE::Parser* mParser;
|
||||||
|
|
||||||
|
@ -203,5 +188,4 @@ protected:
|
||||||
|
|
||||||
} // end of namespace Assimp
|
} // end of namespace Assimp
|
||||||
|
|
||||||
|
|
||||||
#endif // AI_3DSIMPORTER_H_INC
|
#endif // AI_3DSIMPORTER_H_INC
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -40,15 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @file Defines the helper data structures for importing ASE files */
|
/** @file Defines the helper data structures for importing ASE files */
|
||||||
#ifndef AI_ASEFILEHELPER_H_INC
|
#ifndef AI_ASEFILEHELPER_H_INC
|
||||||
#define AI_ASEFILEHELPER_H_INC
|
#define AI_ASEFILEHELPER_H_INC
|
||||||
|
|
||||||
// public ASSIMP headers
|
// public ASSIMP headers
|
||||||
#include <assimp/types.h>
|
|
||||||
#include <assimp/mesh.h>
|
|
||||||
#include <assimp/anim.h>
|
#include <assimp/anim.h>
|
||||||
|
#include <assimp/mesh.h>
|
||||||
|
#include <assimp/types.h>
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
|
@ -59,27 +57,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
// ASE is quite similar to 3ds. We can reuse some structures
|
// ASE is quite similar to 3ds. We can reuse some structures
|
||||||
#include "AssetLib/3DS/3DSLoader.h"
|
#include "AssetLib/3DS/3DSLoader.h"
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace ASE {
|
namespace ASE {
|
||||||
|
|
||||||
using namespace D3DS;
|
using namespace D3DS;
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure representing an ASE material */
|
/** Helper structure representing an ASE material */
|
||||||
struct Material : public D3DS::Material
|
struct Material : public D3DS::Material {
|
||||||
{
|
|
||||||
//! Default constructor has been deleted
|
//! Default constructor has been deleted
|
||||||
Material() = delete;
|
Material() = delete;
|
||||||
|
|
||||||
//! Constructor with explicit name
|
//! Constructor with explicit name
|
||||||
explicit Material(const std::string &name)
|
explicit Material(const std::string &name) :
|
||||||
: D3DS::Material(name)
|
D3DS::Material(name),
|
||||||
, pcInstance(NULL)
|
pcInstance(nullptr),
|
||||||
, bNeed (false) {
|
bNeed(false) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
Material(const Material &other) = default;
|
Material(const Material &other) = default;
|
||||||
|
|
||||||
Material &operator=(const Material &other) {
|
Material &operator=(const Material &other) {
|
||||||
if (this == &other) {
|
if (this == &other) {
|
||||||
|
@ -93,19 +90,16 @@ struct Material : public D3DS::Material
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
|
//! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
|
||||||
Material(Material &&other) AI_NO_EXCEPT
|
Material(Material &&other) AI_NO_EXCEPT
|
||||||
: D3DS::Material(std::move(other))
|
: D3DS::Material(std::move(other)),
|
||||||
, avSubMaterials(std::move(other.avSubMaterials))
|
avSubMaterials(std::move(other.avSubMaterials)),
|
||||||
, pcInstance(std::move(other.pcInstance))
|
pcInstance(other.pcInstance),
|
||||||
, bNeed(std::move(other.bNeed))
|
bNeed(other.bNeed) {
|
||||||
{
|
|
||||||
other.pcInstance = nullptr;
|
other.pcInstance = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Material &operator=(Material &&other) AI_NO_EXCEPT {
|
||||||
Material &operator=( Material &&other) AI_NO_EXCEPT {
|
|
||||||
if (this == &other) {
|
if (this == &other) {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -113,23 +107,21 @@ struct Material : public D3DS::Material
|
||||||
//D3DS::Material::operator=(std::move(other));
|
//D3DS::Material::operator=(std::move(other));
|
||||||
|
|
||||||
avSubMaterials = std::move(other.avSubMaterials);
|
avSubMaterials = std::move(other.avSubMaterials);
|
||||||
pcInstance = std::move(other.pcInstance);
|
pcInstance = other.pcInstance;
|
||||||
bNeed = std::move(other.bNeed);
|
bNeed = other.bNeed;
|
||||||
|
|
||||||
other.pcInstance = nullptr;
|
other.pcInstance = nullptr;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~Material() = default;
|
||||||
~Material() {}
|
|
||||||
|
|
||||||
|
|
||||||
//! Contains all sub materials of this material
|
//! Contains all sub materials of this material
|
||||||
std::vector<Material> avSubMaterials;
|
std::vector<Material> avSubMaterials;
|
||||||
|
|
||||||
//! aiMaterial object
|
//! aiMaterial object
|
||||||
aiMaterial* pcInstance;
|
aiMaterial *pcInstance;
|
||||||
|
|
||||||
//! Can we remove this material?
|
//! Can we remove this material?
|
||||||
bool bNeed;
|
bool bNeed;
|
||||||
|
@ -140,8 +132,8 @@ struct Material : public D3DS::Material
|
||||||
struct Face : public FaceWithSmoothingGroup {
|
struct Face : public FaceWithSmoothingGroup {
|
||||||
//! Default constructor. Initializes everything with 0
|
//! Default constructor. Initializes everything with 0
|
||||||
Face() AI_NO_EXCEPT
|
Face() AI_NO_EXCEPT
|
||||||
: iMaterial(DEFAULT_MATINDEX)
|
: iMaterial(DEFAULT_MATINDEX),
|
||||||
, iFace(0) {
|
iFace(0) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,8 +164,8 @@ struct Bone {
|
||||||
Bone() = delete;
|
Bone() = delete;
|
||||||
|
|
||||||
//! Construction from an existing name
|
//! Construction from an existing name
|
||||||
explicit Bone( const std::string& name)
|
explicit Bone(const std::string &name) :
|
||||||
: mName(name) {
|
mName(name) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,33 +178,34 @@ struct Bone {
|
||||||
struct BoneVertex {
|
struct BoneVertex {
|
||||||
//! Bone and corresponding vertex weight.
|
//! Bone and corresponding vertex weight.
|
||||||
//! -1 for unrequired bones ....
|
//! -1 for unrequired bones ....
|
||||||
std::vector<std::pair<int,float> > mBoneWeights;
|
std::vector<std::pair<int, float>> mBoneWeights;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure to represent an ASE file animation */
|
/** Helper structure to represent an ASE file animation */
|
||||||
struct Animation {
|
struct Animation {
|
||||||
enum Type {
|
enum Type {
|
||||||
TRACK = 0x0,
|
TRACK = 0x0,
|
||||||
BEZIER = 0x1,
|
BEZIER = 0x1,
|
||||||
TCB = 0x2
|
TCB = 0x2
|
||||||
} mRotationType, mScalingType, mPositionType;
|
} mRotationType,
|
||||||
|
mScalingType, mPositionType;
|
||||||
|
|
||||||
Animation() AI_NO_EXCEPT
|
Animation() AI_NO_EXCEPT
|
||||||
: mRotationType (TRACK)
|
: mRotationType(TRACK),
|
||||||
, mScalingType (TRACK)
|
mScalingType(TRACK),
|
||||||
, mPositionType (TRACK) {
|
mPositionType(TRACK) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
//! List of track rotation keyframes
|
//! List of track rotation keyframes
|
||||||
std::vector< aiQuatKey > akeyRotations;
|
std::vector<aiQuatKey> akeyRotations;
|
||||||
|
|
||||||
//! List of track position keyframes
|
//! List of track position keyframes
|
||||||
std::vector< aiVectorKey > akeyPositions;
|
std::vector<aiVectorKey> akeyPositions;
|
||||||
|
|
||||||
//! List of track scaling keyframes
|
//! List of track scaling keyframes
|
||||||
std::vector< aiVectorKey > akeyScaling;
|
std::vector<aiVectorKey> akeyScaling;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -220,7 +213,7 @@ struct Animation {
|
||||||
struct InheritanceInfo {
|
struct InheritanceInfo {
|
||||||
//! Default constructor
|
//! Default constructor
|
||||||
InheritanceInfo() AI_NO_EXCEPT {
|
InheritanceInfo() AI_NO_EXCEPT {
|
||||||
for ( size_t i=0; i<3; ++i ) {
|
for (size_t i = 0; i < 3; ++i) {
|
||||||
abInheritPosition[i] = abInheritRotation[i] = abInheritScaling[i] = true;
|
abInheritPosition[i] = abInheritRotation[i] = abInheritScaling[i] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,10 +239,8 @@ struct BaseNode {
|
||||||
} mType;
|
} mType;
|
||||||
|
|
||||||
//! Construction from an existing name
|
//! Construction from an existing name
|
||||||
BaseNode(Type _mType, const std::string &name)
|
BaseNode(Type _mType, const std::string &name) :
|
||||||
: mType (_mType)
|
mType(_mType), mName(name), mProcessed(false) {
|
||||||
, mName (name)
|
|
||||||
, mProcessed (false) {
|
|
||||||
// Set mTargetPosition to qnan
|
// Set mTargetPosition to qnan
|
||||||
const ai_real qnan = get_qnan();
|
const ai_real qnan = get_qnan();
|
||||||
mTargetPosition.x = qnan;
|
mTargetPosition.x = qnan;
|
||||||
|
@ -289,14 +280,9 @@ struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode {
|
||||||
Mesh() = delete;
|
Mesh() = delete;
|
||||||
|
|
||||||
//! Construction from an existing name
|
//! Construction from an existing name
|
||||||
explicit Mesh(const std::string &name)
|
explicit Mesh(const std::string &name) :
|
||||||
: BaseNode( BaseNode::Mesh, name )
|
BaseNode(BaseNode::Mesh, name), mVertexColors(), mBoneVertices(), mBones(), iMaterialIndex(Face::DEFAULT_MATINDEX), bSkip(false) {
|
||||||
, mVertexColors()
|
for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++c) {
|
||||||
, mBoneVertices()
|
|
||||||
, mBones()
|
|
||||||
, iMaterialIndex(Face::DEFAULT_MATINDEX)
|
|
||||||
, bSkip (false) {
|
|
||||||
for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) {
|
|
||||||
this->mNumUVComponents[c] = 2;
|
this->mNumUVComponents[c] = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,10 +311,8 @@ struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode {
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure to represent an ASE light source */
|
/** Helper structure to represent an ASE light source */
|
||||||
struct Light : public BaseNode
|
struct Light : public BaseNode {
|
||||||
{
|
enum LightType {
|
||||||
enum LightType
|
|
||||||
{
|
|
||||||
OMNI,
|
OMNI,
|
||||||
TARGET,
|
TARGET,
|
||||||
FREE,
|
FREE,
|
||||||
|
@ -339,17 +323,13 @@ struct Light : public BaseNode
|
||||||
Light() = delete;
|
Light() = delete;
|
||||||
|
|
||||||
//! Construction from an existing name
|
//! Construction from an existing name
|
||||||
explicit Light(const std::string &name)
|
explicit Light(const std::string &name) :
|
||||||
: BaseNode (BaseNode::Light, name)
|
BaseNode(BaseNode::Light, name), mLightType(OMNI), mColor(1.f, 1.f, 1.f), mIntensity(1.f) // light is white by default
|
||||||
, mLightType (OMNI)
|
,
|
||||||
, mColor (1.f,1.f,1.f)
|
mAngle(45.f),
|
||||||
, mIntensity (1.f) // light is white by default
|
mFalloff(0.f) {
|
||||||
, mAngle (45.f)
|
|
||||||
, mFalloff (0.f)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LightType mLightType;
|
LightType mLightType;
|
||||||
aiColor3D mColor;
|
aiColor3D mColor;
|
||||||
ai_real mIntensity;
|
ai_real mIntensity;
|
||||||
|
@ -359,10 +339,8 @@ struct Light : public BaseNode
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** Helper structure to represent an ASE camera */
|
/** Helper structure to represent an ASE camera */
|
||||||
struct Camera : public BaseNode
|
struct Camera : public BaseNode {
|
||||||
{
|
enum CameraType {
|
||||||
enum CameraType
|
|
||||||
{
|
|
||||||
FREE,
|
FREE,
|
||||||
TARGET
|
TARGET
|
||||||
};
|
};
|
||||||
|
@ -370,18 +348,16 @@ struct Camera : public BaseNode
|
||||||
//! Default constructor has been deleted
|
//! Default constructor has been deleted
|
||||||
Camera() = delete;
|
Camera() = delete;
|
||||||
|
|
||||||
|
|
||||||
//! Construction from an existing name
|
//! Construction from an existing name
|
||||||
explicit Camera(const std::string &name)
|
explicit Camera(const std::string &name) :
|
||||||
: BaseNode (BaseNode::Camera, name)
|
BaseNode(BaseNode::Camera, name), mFOV(0.75f) // in radians
|
||||||
, mFOV (0.75f) // in radians
|
,
|
||||||
, mNear (0.1f)
|
mNear(0.1f),
|
||||||
, mFar (1000.f) // could be zero
|
mFar(1000.f) // could be zero
|
||||||
, mCameraType (FREE)
|
,
|
||||||
{
|
mCameraType(FREE) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ai_real mFOV, mNear, mFar;
|
ai_real mFOV, mNear, mFar;
|
||||||
CameraType mCameraType;
|
CameraType mCameraType;
|
||||||
};
|
};
|
||||||
|
@ -391,7 +367,7 @@ struct Camera : public BaseNode
|
||||||
struct Dummy : public BaseNode {
|
struct Dummy : public BaseNode {
|
||||||
//! Constructor
|
//! Constructor
|
||||||
Dummy() AI_NO_EXCEPT
|
Dummy() AI_NO_EXCEPT
|
||||||
: BaseNode (BaseNode::Dummy, "DUMMY") {
|
: BaseNode(BaseNode::Dummy, "DUMMY") {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -408,29 +384,24 @@ struct Dummy : public BaseNode {
|
||||||
/** \brief Class to parse ASE files
|
/** \brief Class to parse ASE files
|
||||||
*/
|
*/
|
||||||
class Parser {
|
class Parser {
|
||||||
private:
|
|
||||||
Parser() AI_NO_EXCEPT {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/// @brief No default constructor.
|
||||||
|
Parser() = delete;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Construct a parser from a given input file which is
|
//! Construct a parser from a given input file which is
|
||||||
//! guaranteed to be terminated with zero.
|
//! guaranteed to be terminated with zero.
|
||||||
//! @param szFile Input file
|
//! @param file The name of the input file.
|
||||||
//! @param fileFormatDefault Assumed file format version. If the
|
//! @param fileFormatDefault Assumed file format version. If the
|
||||||
//! file format is specified in the file the new value replaces
|
//! file format is specified in the file the new value replaces
|
||||||
//! the default value.
|
//! the default value.
|
||||||
Parser (const char* szFile, unsigned int fileFormatDefault);
|
Parser(const char *file, size_t fileLen, unsigned int fileFormatDefault);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parses the file into the parsers internal representation
|
//! Parses the file into the parsers internal representation
|
||||||
void Parse();
|
void Parse();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse the *SCENE block in a file
|
//! Parse the *SCENE block in a file
|
||||||
void ParseLV1SceneBlock();
|
void ParseLV1SceneBlock();
|
||||||
|
@ -446,45 +417,45 @@ private:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *<xxx>OBJECT block in a file
|
//! Parse a *<xxx>OBJECT block in a file
|
||||||
//! \param mesh Node to be filled
|
//! \param mesh Node to be filled
|
||||||
void ParseLV1ObjectBlock(BaseNode& mesh);
|
void ParseLV1ObjectBlock(BaseNode &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MATERIAL blocks in a material list
|
//! Parse a *MATERIAL blocks in a material list
|
||||||
//! \param mat Material structure to be filled
|
//! \param mat Material structure to be filled
|
||||||
void ParseLV2MaterialBlock(Material& mat);
|
void ParseLV2MaterialBlock(Material &mat);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *NODE_TM block in a file
|
//! Parse a *NODE_TM block in a file
|
||||||
//! \param mesh Node (!) object to be filled
|
//! \param mesh Node (!) object to be filled
|
||||||
void ParseLV2NodeTransformBlock(BaseNode& mesh);
|
void ParseLV2NodeTransformBlock(BaseNode &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *TM_ANIMATION block in a file
|
//! Parse a *TM_ANIMATION block in a file
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV2AnimationBlock(BaseNode& mesh);
|
void ParseLV2AnimationBlock(BaseNode &mesh);
|
||||||
void ParseLV3PosAnimationBlock(ASE::Animation& anim);
|
void ParseLV3PosAnimationBlock(ASE::Animation &anim);
|
||||||
void ParseLV3ScaleAnimationBlock(ASE::Animation& anim);
|
void ParseLV3ScaleAnimationBlock(ASE::Animation &anim);
|
||||||
void ParseLV3RotAnimationBlock(ASE::Animation& anim);
|
void ParseLV3RotAnimationBlock(ASE::Animation &anim);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH block in a file
|
//! Parse a *MESH block in a file
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV2MeshBlock(Mesh& mesh);
|
void ParseLV2MeshBlock(Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *LIGHT_SETTINGS block in a file
|
//! Parse a *LIGHT_SETTINGS block in a file
|
||||||
//! \param light Light object to be filled
|
//! \param light Light object to be filled
|
||||||
void ParseLV2LightSettingsBlock(Light& light);
|
void ParseLV2LightSettingsBlock(Light &light);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *CAMERA_SETTINGS block in a file
|
//! Parse a *CAMERA_SETTINGS block in a file
|
||||||
//! \param cam Camera object to be filled
|
//! \param cam Camera object to be filled
|
||||||
void ParseLV2CameraSettingsBlock(Camera& cam);
|
void ParseLV2CameraSettingsBlock(Camera &cam);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse the *MAP_XXXXXX blocks in a material
|
//! Parse the *MAP_XXXXXX blocks in a material
|
||||||
//! \param map Texture structure to be filled
|
//! \param map Texture structure to be filled
|
||||||
void ParseLV3MapBlock(Texture& map);
|
void ParseLV3MapBlock(Texture &map);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_VERTEX_LIST block in a file
|
//! Parse a *MESH_VERTEX_LIST block in a file
|
||||||
|
@ -493,7 +464,7 @@ private:
|
||||||
//! A warning is sent to the logger if the validations fails.
|
//! A warning is sent to the logger if the validations fails.
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MeshVertexListBlock(
|
void ParseLV3MeshVertexListBlock(
|
||||||
unsigned int iNumVertices,Mesh& mesh);
|
unsigned int iNumVertices, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_FACE_LIST block in a file
|
//! Parse a *MESH_FACE_LIST block in a file
|
||||||
|
@ -502,7 +473,7 @@ private:
|
||||||
//! A warning is sent to the logger if the validations fails.
|
//! A warning is sent to the logger if the validations fails.
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MeshFaceListBlock(
|
void ParseLV3MeshFaceListBlock(
|
||||||
unsigned int iNumFaces,Mesh& mesh);
|
unsigned int iNumFaces, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_TVERT_LIST block in a file
|
//! Parse a *MESH_TVERT_LIST block in a file
|
||||||
|
@ -512,7 +483,7 @@ private:
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
//! \param iChannel Output UVW channel
|
//! \param iChannel Output UVW channel
|
||||||
void ParseLV3MeshTListBlock(
|
void ParseLV3MeshTListBlock(
|
||||||
unsigned int iNumVertices,Mesh& mesh, unsigned int iChannel = 0);
|
unsigned int iNumVertices, Mesh &mesh, unsigned int iChannel = 0);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_TFACELIST block in a file
|
//! Parse a *MESH_TFACELIST block in a file
|
||||||
|
@ -522,7 +493,7 @@ private:
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
//! \param iChannel Output UVW channel
|
//! \param iChannel Output UVW channel
|
||||||
void ParseLV3MeshTFaceListBlock(
|
void ParseLV3MeshTFaceListBlock(
|
||||||
unsigned int iNumFaces,Mesh& mesh, unsigned int iChannel = 0);
|
unsigned int iNumFaces, Mesh &mesh, unsigned int iChannel = 0);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse an additional mapping channel
|
//! Parse an additional mapping channel
|
||||||
|
@ -530,7 +501,7 @@ private:
|
||||||
//! \param iChannel Channel index to be filled
|
//! \param iChannel Channel index to be filled
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MappingChannel(
|
void ParseLV3MappingChannel(
|
||||||
unsigned int iChannel, Mesh& mesh);
|
unsigned int iChannel, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_CVERTLIST block in a file
|
//! Parse a *MESH_CVERTLIST block in a file
|
||||||
|
@ -539,7 +510,7 @@ private:
|
||||||
//! A warning is sent to the logger if the validations fails.
|
//! A warning is sent to the logger if the validations fails.
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MeshCListBlock(
|
void ParseLV3MeshCListBlock(
|
||||||
unsigned int iNumVertices, Mesh& mesh);
|
unsigned int iNumVertices, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_CFACELIST block in a file
|
//! Parse a *MESH_CFACELIST block in a file
|
||||||
|
@ -548,70 +519,73 @@ private:
|
||||||
//! A warning is sent to the logger if the validations fails.
|
//! A warning is sent to the logger if the validations fails.
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MeshCFaceListBlock(
|
void ParseLV3MeshCFaceListBlock(
|
||||||
unsigned int iNumFaces, Mesh& mesh);
|
unsigned int iNumFaces, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_NORMALS block in a file
|
//! Parse a *MESH_NORMALS block in a file
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MeshNormalListBlock(Mesh& mesh);
|
void ParseLV3MeshNormalListBlock(Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_WEIGHTSblock in a file
|
//! Parse a *MESH_WEIGHTSblock in a file
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
void ParseLV3MeshWeightsBlock(Mesh& mesh);
|
void ParseLV3MeshWeightsBlock(Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse the bone list of a file
|
//! Parse the bone list of a file
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
//! \param iNumBones Number of bones in the mesh
|
//! \param iNumBones Number of bones in the mesh
|
||||||
void ParseLV4MeshBones(unsigned int iNumBones,Mesh& mesh);
|
void ParseLV4MeshBones(unsigned int iNumBones, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse the bone vertices list of a file
|
//! Parse the bone vertices list of a file
|
||||||
//! \param mesh Mesh object to be filled
|
//! \param mesh Mesh object to be filled
|
||||||
//! \param iNumVertices Number of vertices to be parsed
|
//! \param iNumVertices Number of vertices to be parsed
|
||||||
void ParseLV4MeshBonesVertices(unsigned int iNumVertices,Mesh& mesh);
|
void ParseLV4MeshBonesVertices(unsigned int iNumVertices, Mesh &mesh);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_FACE block in a file
|
//! Parse a *MESH_FACE block in a file
|
||||||
//! \param out receive the face data
|
//! \param out receive the face data
|
||||||
void ParseLV4MeshFace(ASE::Face& out);
|
void ParseLV4MeshFace(ASE::Face &out);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_VERT block in a file
|
//! Parse a *MESH_VERT block in a file
|
||||||
//! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
|
//! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
|
||||||
//! \param apOut Output buffer (3 floats)
|
//! \param apOut Output buffer (3 floats)
|
||||||
//! \param rIndexOut Output index
|
//! \param rIndexOut Output index
|
||||||
void ParseLV4MeshFloatTriple(ai_real* apOut, unsigned int& rIndexOut);
|
void ParseLV4MeshRealTriple(ai_real *apOut, unsigned int &rIndexOut);
|
||||||
|
void ParseLV4MeshFloatTriple(float *apOut, unsigned int &rIndexOut);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_VERT block in a file
|
//! Parse a *MESH_VERT block in a file
|
||||||
//! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
|
//! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
|
||||||
//! \param apOut Output buffer (3 floats)
|
//! \param apOut Output buffer (3 floats)
|
||||||
void ParseLV4MeshFloatTriple(ai_real* apOut);
|
void ParseLV4MeshRealTriple(ai_real *apOut);
|
||||||
|
void ParseLV4MeshFloatTriple(float *apOut);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_TFACE block in a file
|
//! Parse a *MESH_TFACE block in a file
|
||||||
//! (also works for MESH_CFACE)
|
//! (also works for MESH_CFACE)
|
||||||
//! \param apOut Output buffer (3 ints)
|
//! \param apOut Output buffer (3 ints)
|
||||||
//! \param rIndexOut Output index
|
//! \param rIndexOut Output index
|
||||||
void ParseLV4MeshLongTriple(unsigned int* apOut, unsigned int& rIndexOut);
|
void ParseLV4MeshLongTriple(unsigned int *apOut, unsigned int &rIndexOut);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a *MESH_TFACE block in a file
|
//! Parse a *MESH_TFACE block in a file
|
||||||
//! (also works for MESH_CFACE)
|
//! (also works for MESH_CFACE)
|
||||||
//! \param apOut Output buffer (3 ints)
|
//! \param apOut Output buffer (3 ints)
|
||||||
void ParseLV4MeshLongTriple(unsigned int* apOut);
|
void ParseLV4MeshLongTriple(unsigned int *apOut);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a single float element
|
//! Parse a single float element
|
||||||
//! \param fOut Output float
|
//! \param fOut Output float
|
||||||
void ParseLV4MeshFloat(ai_real& fOut);
|
void ParseLV4MeshReal(ai_real &fOut);
|
||||||
|
void ParseLV4MeshFloat(float &fOut);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a single int element
|
//! Parse a single int element
|
||||||
//! \param iOut Output integer
|
//! \param iOut Output integer
|
||||||
void ParseLV4MeshLong(unsigned int& iOut);
|
void ParseLV4MeshLong(unsigned int &iOut);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Skip everything to the next: '*' or '\0'
|
//! Skip everything to the next: '*' or '\0'
|
||||||
|
@ -625,17 +599,17 @@ private:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Output a warning to the logger
|
//! Output a warning to the logger
|
||||||
//! \param szWarn Warn message
|
//! \param szWarn Warn message
|
||||||
void LogWarning(const char* szWarn);
|
void LogWarning(const char *szWarn);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Output a message to the logger
|
//! Output a message to the logger
|
||||||
//! \param szWarn Message
|
//! \param szWarn Message
|
||||||
void LogInfo(const char* szWarn);
|
void LogInfo(const char *szWarn);
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Output an error to the logger
|
//! Output an error to the logger
|
||||||
//! \param szWarn Error message
|
//! \param szWarn Error message
|
||||||
AI_WONT_RETURN void LogError(const char* szWarn) AI_WONT_RETURN_SUFFIX;
|
AI_WONT_RETURN void LogError(const char *szWarn) AI_WONT_RETURN_SUFFIX;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
//! Parse a string, enclosed in double quotation marks
|
//! Parse a string, enclosed in double quotation marks
|
||||||
|
@ -643,12 +617,11 @@ private:
|
||||||
//! \param szName Name of the enclosing element -> used in error
|
//! \param szName Name of the enclosing element -> used in error
|
||||||
//! messages.
|
//! messages.
|
||||||
//! \return false if an error occurred
|
//! \return false if an error occurred
|
||||||
bool ParseString(std::string& out,const char* szName);
|
bool ParseString(std::string &out, const char *szName);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
const char *mFilePtr; ////< Pointer to current data
|
||||||
//! Pointer to current data
|
const char *mEnd; ///< The end pointer of the file data
|
||||||
const char* filePtr;
|
|
||||||
|
|
||||||
//! background color to be passed to the viewer
|
//! background color to be passed to the viewer
|
||||||
//! QNAN if none was found
|
//! QNAN if none was found
|
||||||
|
@ -695,9 +668,8 @@ public:
|
||||||
unsigned int iFileFormat;
|
unsigned int iFileFormat;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // Namespace ASE
|
} // Namespace ASE
|
||||||
} // Namespace ASSIMP
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // ASSIMP_BUILD_NO_3DS_IMPORTER
|
#endif // ASSIMP_BUILD_NO_3DS_IMPORTER
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,16 +42,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file AssbinExporter.h
|
/** @file AssbinExporter.h
|
||||||
* ASSBIN Exporter Main Header
|
* ASSBIN Exporter Main Header
|
||||||
*/
|
*/
|
||||||
|
#pragma once
|
||||||
#ifndef AI_ASSBINEXPORTER_H_INC
|
#ifndef AI_ASSBINEXPORTER_H_INC
|
||||||
#define AI_ASSBINEXPORTER_H_INC
|
#define AI_ASSBINEXPORTER_H_INC
|
||||||
|
|
||||||
#include <assimp/defs.h>
|
#include <assimp/defs.h>
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
// nothing really needed here - reserved for future use like properties
|
// nothing really needed here - reserved for future use like properties
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
void ASSIMP_API ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/);
|
void ASSIMP_API ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif // AI_ASSBINEXPORTER_H_INC
|
#endif // AI_ASSBINEXPORTER_H_INC
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,27 +43,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssbinFileWriter.h"
|
#include "AssbinFileWriter.h"
|
||||||
|
|
||||||
#include "Common/assbin_chunks.h"
|
#include "Common/assbin_chunks.h"
|
||||||
#include "PostProcessing/ProcessHelper.h"
|
#include "PostProcessing/ProcessHelper.h"
|
||||||
|
|
||||||
#include <assimp/Exceptional.h>
|
#include <assimp/Exceptional.h>
|
||||||
#include <assimp/version.h>
|
#include <assimp/version.h>
|
||||||
#include <assimp/Exporter.hpp>
|
|
||||||
#include <assimp/IOStream.hpp>
|
#include <assimp/IOStream.hpp>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#include "zlib.h"
|
||||||
#include <zlib.h>
|
|
||||||
#else
|
|
||||||
#include "../contrib/zlib/zlib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <time.h>
|
#include <ctime>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4706)
|
#pragma warning(disable : 4706)
|
||||||
#endif // _WIN32
|
#endif // _MSC_VER
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
@ -132,7 +126,7 @@ inline size_t Write<double>(IOStream *stream, const double &f) {
|
||||||
// Serialize a vec3
|
// Serialize a vec3
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
|
inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
|
||||||
size_t t = Write<float>(stream, v.x);
|
size_t t = Write<ai_real>(stream, v.x);
|
||||||
t += Write<float>(stream, v.y);
|
t += Write<float>(stream, v.y);
|
||||||
t += Write<float>(stream, v.z);
|
t += Write<float>(stream, v.z);
|
||||||
|
|
||||||
|
@ -143,7 +137,7 @@ inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
|
||||||
// Serialize a color value
|
// Serialize a color value
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
|
inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
|
||||||
size_t t = Write<float>(stream, v.r);
|
size_t t = Write<ai_real>(stream, v.r);
|
||||||
t += Write<float>(stream, v.g);
|
t += Write<float>(stream, v.g);
|
||||||
t += Write<float>(stream, v.b);
|
t += Write<float>(stream, v.b);
|
||||||
|
|
||||||
|
@ -154,7 +148,7 @@ inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
|
||||||
// Serialize a color value
|
// Serialize a color value
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
|
inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
|
||||||
size_t t = Write<float>(stream, v.r);
|
size_t t = Write<ai_real>(stream, v.r);
|
||||||
t += Write<float>(stream, v.g);
|
t += Write<float>(stream, v.g);
|
||||||
t += Write<float>(stream, v.b);
|
t += Write<float>(stream, v.b);
|
||||||
t += Write<float>(stream, v.a);
|
t += Write<float>(stream, v.a);
|
||||||
|
@ -166,13 +160,13 @@ inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
|
||||||
// Serialize a quaternion
|
// Serialize a quaternion
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiQuaternion>(IOStream *stream, const aiQuaternion &v) {
|
inline size_t Write<aiQuaternion>(IOStream *stream, const aiQuaternion &v) {
|
||||||
size_t t = Write<float>(stream, v.w);
|
size_t t = Write<ai_real>(stream, v.w);
|
||||||
t += Write<float>(stream, v.x);
|
t += Write<float>(stream, v.x);
|
||||||
t += Write<float>(stream, v.y);
|
t += Write<float>(stream, v.y);
|
||||||
t += Write<float>(stream, v.z);
|
t += Write<float>(stream, v.z);
|
||||||
ai_assert(t == 16);
|
ai_assert(t == 16);
|
||||||
|
|
||||||
return 16;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
|
@ -184,17 +178,19 @@ inline size_t Write<aiVertexWeight>(IOStream *stream, const aiVertexWeight &v) {
|
||||||
return t + Write<float>(stream, v.mWeight);
|
return t + Write<float>(stream, v.mWeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr size_t MatrixSize = 64;
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
// Serialize a mat4x4
|
// Serialize a mat4x4
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiMatrix4x4>(IOStream *stream, const aiMatrix4x4 &m) {
|
inline size_t Write<aiMatrix4x4>(IOStream *stream, const aiMatrix4x4 &m) {
|
||||||
for (unsigned int i = 0; i < 4; ++i) {
|
for (unsigned int i = 0; i < 4; ++i) {
|
||||||
for (unsigned int i2 = 0; i2 < 4; ++i2) {
|
for (unsigned int i2 = 0; i2 < 4; ++i2) {
|
||||||
Write<float>(stream, m[i][i2]);
|
Write<ai_real>(stream, m[i][i2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 64;
|
return MatrixSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
|
@ -277,7 +273,7 @@ public:
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~AssbinChunkWriter() {
|
~AssbinChunkWriter() override {
|
||||||
if (container) {
|
if (container) {
|
||||||
container->Write(&magic, sizeof(uint32_t), 1);
|
container->Write(&magic, sizeof(uint32_t), 1);
|
||||||
container->Write(&cursor, sizeof(uint32_t), 1);
|
container->Write(&cursor, sizeof(uint32_t), 1);
|
||||||
|
@ -288,26 +284,27 @@ public:
|
||||||
|
|
||||||
void *GetBufferPointer() { return buffer; }
|
void *GetBufferPointer() { return buffer; }
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t Read(void * /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) override {
|
||||||
virtual size_t Read(void * /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) {
|
|
||||||
|
aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) override {
|
||||||
return aiReturn_FAILURE;
|
return aiReturn_FAILURE;
|
||||||
}
|
}
|
||||||
virtual size_t Tell() const {
|
|
||||||
|
size_t Tell() const override {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
virtual void Flush() {
|
|
||||||
|
void Flush() override {
|
||||||
// not implemented
|
// not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual size_t FileSize() const {
|
size_t FileSize() const override {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) override {
|
||||||
virtual size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) {
|
|
||||||
pSize *= pCount;
|
pSize *= pCount;
|
||||||
if (cursor + pSize > cur_size) {
|
if (cursor + pSize > cur_size) {
|
||||||
Grow(cursor + pSize);
|
Grow(cursor + pSize);
|
||||||
|
@ -336,7 +333,7 @@ protected:
|
||||||
void WriteBinaryNode(IOStream *container, const aiNode *node) {
|
void WriteBinaryNode(IOStream *container, const aiNode *node) {
|
||||||
AssbinChunkWriter chunk(container, ASSBIN_CHUNK_AINODE);
|
AssbinChunkWriter chunk(container, ASSBIN_CHUNK_AINODE);
|
||||||
|
|
||||||
unsigned int nb_metadata = (node->mMetaData != NULL ? node->mMetaData->mNumProperties : 0);
|
unsigned int nb_metadata = (node->mMetaData != nullptr ? node->mMetaData->mNumProperties : 0);
|
||||||
|
|
||||||
Write<aiString>(&chunk, node->mName);
|
Write<aiString>(&chunk, node->mName);
|
||||||
Write<aiMatrix4x4>(&chunk, node->mTransformation);
|
Write<aiMatrix4x4>(&chunk, node->mTransformation);
|
||||||
|
@ -641,6 +638,10 @@ protected:
|
||||||
Write<aiString>(&chunk, l->mName);
|
Write<aiString>(&chunk, l->mName);
|
||||||
Write<unsigned int>(&chunk, l->mType);
|
Write<unsigned int>(&chunk, l->mType);
|
||||||
|
|
||||||
|
Write<aiVector3D>(&chunk, l->mPosition);
|
||||||
|
Write<aiVector3D>(&chunk, l->mDirection);
|
||||||
|
Write<aiVector3D>(&chunk, l->mUp);
|
||||||
|
|
||||||
if (l->mType != aiLightSource_DIRECTIONAL) {
|
if (l->mType != aiLightSource_DIRECTIONAL) {
|
||||||
Write<float>(&chunk, l->mAttenuationConstant);
|
Write<float>(&chunk, l->mAttenuationConstant);
|
||||||
Write<float>(&chunk, l->mAttenuationLinear);
|
Write<float>(&chunk, l->mAttenuationLinear);
|
||||||
|
@ -744,7 +745,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
time_t tt = time(NULL);
|
time_t tt = time(nullptr);
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
tm *p = gmtime(&tt);
|
tm *p = gmtime(&tt);
|
||||||
#else
|
#else
|
||||||
|
@ -790,7 +791,7 @@ public:
|
||||||
// Up to here the data is uncompressed. For compressed files, the rest
|
// Up to here the data is uncompressed. For compressed files, the rest
|
||||||
// is compressed using standard DEFLATE from zlib.
|
// is compressed using standard DEFLATE from zlib.
|
||||||
if (compressed) {
|
if (compressed) {
|
||||||
AssbinChunkWriter uncompressedStream(NULL, 0);
|
AssbinChunkWriter uncompressedStream(nullptr, 0);
|
||||||
WriteBinaryScene(&uncompressedStream, pScene);
|
WriteBinaryScene(&uncompressedStream, pScene);
|
||||||
|
|
||||||
uLongf uncompressedSize = static_cast<uLongf>(uncompressedStream.Tell());
|
uLongf uncompressedSize = static_cast<uLongf>(uncompressedStream.Tell());
|
||||||
|
@ -825,8 +826,8 @@ void DumpSceneToAssbin(
|
||||||
AssbinFileWriter fileWriter(shortened, compressed);
|
AssbinFileWriter fileWriter(shortened, compressed);
|
||||||
fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
|
fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#if _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif // _WIN32
|
#endif // _MSC_VER
|
||||||
|
|
||||||
} // end of namespace Assimp
|
} // end of namespace Assimp
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
static constexpr aiImporterDesc desc = {
|
||||||
"Assimp Binary Importer",
|
"Assimp Binary Importer",
|
||||||
"Gargaj / Conspiracy",
|
"Gargaj / Conspiracy",
|
||||||
"",
|
"",
|
||||||
|
@ -406,7 +406,7 @@ void AssbinImporter::ReadBinaryMesh(IOStream *stream, aiMesh *mesh) {
|
||||||
f.mIndices = new unsigned int[f.mNumIndices];
|
f.mIndices = new unsigned int[f.mNumIndices];
|
||||||
|
|
||||||
for (unsigned int a = 0; a < f.mNumIndices; ++a) {
|
for (unsigned int a = 0; a < f.mNumIndices; ++a) {
|
||||||
// Check if unsigned short ( 16 bit ) are big enought for the indices
|
// Check if unsigned short ( 16 bit ) are big enough for the indices
|
||||||
if (fitsIntoUI16(mesh->mNumVertices)) {
|
if (fitsIntoUI16(mesh->mNumVertices)) {
|
||||||
f.mIndices[a] = Read<uint16_t>(stream);
|
f.mIndices[a] = Read<uint16_t>(stream);
|
||||||
} else {
|
} else {
|
||||||
|
@ -556,6 +556,10 @@ void AssbinImporter::ReadBinaryLight(IOStream *stream, aiLight *l) {
|
||||||
l->mName = Read<aiString>(stream);
|
l->mName = Read<aiString>(stream);
|
||||||
l->mType = (aiLightSourceType)Read<unsigned int>(stream);
|
l->mType = (aiLightSourceType)Read<unsigned int>(stream);
|
||||||
|
|
||||||
|
l->mPosition = Read<aiVector3D>(stream);
|
||||||
|
l->mDirection = Read<aiVector3D>(stream);
|
||||||
|
l->mUp = Read<aiVector3D>(stream);
|
||||||
|
|
||||||
if (l->mType != aiLightSource_DIRECTIONAL) {
|
if (l->mType != aiLightSource_DIRECTIONAL) {
|
||||||
l->mAttenuationConstant = Read<float>(stream);
|
l->mAttenuationConstant = Read<float>(stream);
|
||||||
l->mAttenuationLinear = Read<float>(stream);
|
l->mAttenuationLinear = Read<float>(stream);
|
||||||
|
@ -604,7 +608,7 @@ void AssbinImporter::ReadBinaryScene(IOStream *stream, aiScene *scene) {
|
||||||
|
|
||||||
// Read node graph
|
// Read node graph
|
||||||
//scene->mRootNode = new aiNode[1];
|
//scene->mRootNode = new aiNode[1];
|
||||||
ReadBinaryNode(stream, &scene->mRootNode, (aiNode *)NULL);
|
ReadBinaryNode(stream, &scene->mRootNode, (aiNode *)nullptr);
|
||||||
|
|
||||||
// Read all meshes
|
// Read all meshes
|
||||||
if (scene->mNumMeshes) {
|
if (scene->mNumMeshes) {
|
||||||
|
@ -671,7 +675,7 @@ void AssbinImporter::ReadBinaryScene(IOStream *stream, aiScene *scene) {
|
||||||
void AssbinImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
|
void AssbinImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
|
||||||
IOStream *stream = pIOHandler->Open(pFile, "rb");
|
IOStream *stream = pIOHandler->Open(pFile, "rb");
|
||||||
if (nullptr == stream) {
|
if (nullptr == stream) {
|
||||||
return;
|
throw DeadlyImportError("ASSBIN: Could not open ", pFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// signature
|
// signature
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -74,17 +73,11 @@ private:
|
||||||
bool compressed;
|
bool compressed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool CanRead(
|
bool CanRead(const std::string& pFile,
|
||||||
const std::string& pFile,
|
IOSystem* pIOHandler, bool checkSig) const override;
|
||||||
IOSystem* pIOHandler,
|
const aiImporterDesc* GetInfo() const override;
|
||||||
bool checkSig
|
void InternReadFile(
|
||||||
) const;
|
const std::string& pFile,aiScene* pScene,IOSystem* pIOHandler) override;
|
||||||
virtual const aiImporterDesc* GetInfo() const;
|
|
||||||
virtual void InternReadFile(
|
|
||||||
const std::string& pFile,
|
|
||||||
aiScene* pScene,
|
|
||||||
IOSystem* pIOHandler
|
|
||||||
);
|
|
||||||
void ReadHeader();
|
void ReadHeader();
|
||||||
void ReadBinaryScene( IOStream * stream, aiScene* pScene );
|
void ReadBinaryScene( IOStream * stream, aiScene* pScene );
|
||||||
void ReadBinaryNode( IOStream * stream, aiNode** mRootNode, aiNode* parent );
|
void ReadBinaryNode( IOStream * stream, aiNode** mRootNode, aiNode* parent );
|
||||||
|
|
|
@ -7,10 +7,12 @@ For details, see http://sourceforge.net/projects/libb64
|
||||||
|
|
||||||
#include "cencode.h" // changed from <B64/cencode.h>
|
#include "cencode.h" // changed from <B64/cencode.h>
|
||||||
|
|
||||||
const int CHARS_PER_LINE = 72;
|
static const int CHARS_PER_LINE = 72;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4244)
|
#pragma warning(disable : 4244)
|
||||||
|
#endif // _MSC_VER
|
||||||
|
|
||||||
void base64_init_encodestate(base64_encodestate* state_in)
|
void base64_init_encodestate(base64_encodestate* state_in)
|
||||||
{
|
{
|
||||||
|
@ -110,4 +112,6 @@ int base64_encode_blockend(char* code_out, base64_encodestate* state_in)
|
||||||
return (int)(codechar - code_out);
|
return (int)(codechar - code_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
#endif // _MSC_VER
|
||||||
|
|
|
@ -8,9 +8,9 @@ For details, see http://sourceforge.net/projects/libb64
|
||||||
#ifndef BASE64_CENCODE_H
|
#ifndef BASE64_CENCODE_H
|
||||||
#define BASE64_CENCODE_H
|
#define BASE64_CENCODE_H
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable : 4127 )
|
#pragma warning(disable : 4127 )
|
||||||
#endif // _WIN32
|
#endif // _MSC_VER
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@ Licensed under a 3-clause BSD license. See the LICENSE file for more information
|
||||||
#ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER
|
#ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER
|
||||||
|
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
|
#include <assimp/ai_assert.h>
|
||||||
#include <assimp/Exporter.hpp>
|
#include <assimp/Exporter.hpp>
|
||||||
#include <assimp/IOStream.hpp>
|
#include <assimp/IOStream.hpp>
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
|
@ -23,16 +24,15 @@ Licensed under a 3-clause BSD license. See the LICENSE file for more information
|
||||||
|
|
||||||
#define CURRENT_FORMAT_VERSION 100
|
#define CURRENT_FORMAT_VERSION 100
|
||||||
|
|
||||||
// grab scoped_ptr from assimp to avoid a dependency on boost.
|
|
||||||
//#include <assimp/../../code/BoostWorkaround/boost/scoped_ptr.hpp>
|
|
||||||
|
|
||||||
#include "mesh_splitter.h"
|
#include "mesh_splitter.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "cencode.h"
|
# include "cencode.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
|
// Forward declarations
|
||||||
void ExportAssimp2Json(const char *, Assimp::IOSystem *, const aiScene *, const Assimp::ExportProperties *);
|
void ExportAssimp2Json(const char *, Assimp::IOSystem *, const aiScene *, const Assimp::ExportProperties *);
|
||||||
|
|
||||||
// small utility class to simplify serializing the aiScene to Json
|
// small utility class to simplify serializing the aiScene to Json
|
||||||
|
@ -41,12 +41,17 @@ public:
|
||||||
enum {
|
enum {
|
||||||
Flag_DoNotIndent = 0x1,
|
Flag_DoNotIndent = 0x1,
|
||||||
Flag_WriteSpecialFloats = 0x2,
|
Flag_WriteSpecialFloats = 0x2,
|
||||||
|
Flag_SkipWhitespaces = 0x4
|
||||||
};
|
};
|
||||||
|
|
||||||
JSONWriter(Assimp::IOStream &out, unsigned int flags = 0u) :
|
JSONWriter(Assimp::IOStream &out, unsigned int flags = 0u) :
|
||||||
out(out), first(), flags(flags) {
|
out(out), indent (""), newline("\n"), space(" "), buff (), first(false), flags(flags) {
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
buff.imbue(std::locale("C"));
|
buff.imbue(std::locale("C"));
|
||||||
|
if (flags & Flag_SkipWhitespaces) {
|
||||||
|
newline = "";
|
||||||
|
space = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~JSONWriter() {
|
~JSONWriter() {
|
||||||
|
@ -70,7 +75,7 @@ public:
|
||||||
void Key(const std::string &name) {
|
void Key(const std::string &name) {
|
||||||
AddIndentation();
|
AddIndentation();
|
||||||
Delimit();
|
Delimit();
|
||||||
buff << '\"' + name + "\": ";
|
buff << '\"' + name + "\":" << space;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Literal>
|
template <typename Literal>
|
||||||
|
@ -78,12 +83,12 @@ public:
|
||||||
AddIndentation();
|
AddIndentation();
|
||||||
Delimit();
|
Delimit();
|
||||||
|
|
||||||
LiteralToString(buff, name) << '\n';
|
LiteralToString(buff, name) << newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Literal>
|
template <typename Literal>
|
||||||
void SimpleValue(const Literal &s) {
|
void SimpleValue(const Literal &s) {
|
||||||
LiteralToString(buff, s) << '\n';
|
LiteralToString(buff, s) << newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleValue(const void *buffer, size_t len) {
|
void SimpleValue(const void *buffer, size_t len) {
|
||||||
|
@ -102,7 +107,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buff << '\"' << cur_out << "\"\n";
|
buff << '\"' << cur_out << "\"" << newline;
|
||||||
delete[] cur_out;
|
delete[] cur_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +120,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
first = true;
|
first = true;
|
||||||
buff << "{\n";
|
buff << "{" << newline;
|
||||||
PushIndent();
|
PushIndent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +128,7 @@ public:
|
||||||
PopIndent();
|
PopIndent();
|
||||||
AddIndentation();
|
AddIndentation();
|
||||||
first = false;
|
first = false;
|
||||||
buff << "}\n";
|
buff << "}" << newline;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartArray(bool is_element = false) {
|
void StartArray(bool is_element = false) {
|
||||||
|
@ -135,19 +140,19 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
first = true;
|
first = true;
|
||||||
buff << "[\n";
|
buff << "[" << newline;
|
||||||
PushIndent();
|
PushIndent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndArray() {
|
void EndArray() {
|
||||||
PopIndent();
|
PopIndent();
|
||||||
AddIndentation();
|
AddIndentation();
|
||||||
buff << "]\n";
|
buff << "]" << newline;
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddIndentation() {
|
void AddIndentation() {
|
||||||
if (!(flags & Flag_DoNotIndent)) {
|
if (!(flags & Flag_DoNotIndent) && !(flags & Flag_SkipWhitespaces)) {
|
||||||
buff << indent;
|
buff << indent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +161,7 @@ public:
|
||||||
if (!first) {
|
if (!first) {
|
||||||
buff << ',';
|
buff << ',';
|
||||||
} else {
|
} else {
|
||||||
buff << ' ';
|
buff << space;
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +179,6 @@ private:
|
||||||
// escape backslashes and single quotes, both would render the JSON invalid if left as is
|
// escape backslashes and single quotes, both would render the JSON invalid if left as is
|
||||||
t.reserve(s.length);
|
t.reserve(s.length);
|
||||||
for (size_t i = 0; i < s.length; ++i) {
|
for (size_t i = 0; i < s.length; ++i) {
|
||||||
|
|
||||||
if (s.data[i] == '\\' || s.data[i] == '\'' || s.data[i] == '\"') {
|
if (s.data[i] == '\\' || s.data[i] == '\'' || s.data[i] == '\"') {
|
||||||
t.push_back('\\');
|
t.push_back('\\');
|
||||||
}
|
}
|
||||||
|
@ -227,14 +231,16 @@ private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Assimp::IOStream &out;
|
Assimp::IOStream &out;
|
||||||
std::string indent, newline;
|
std::string indent;
|
||||||
|
std::string newline;
|
||||||
|
std::string space;
|
||||||
std::stringstream buff;
|
std::stringstream buff;
|
||||||
bool first;
|
bool first;
|
||||||
|
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiVector3D &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiVector3D &ai, bool is_elem = true) {
|
||||||
out.StartArray(is_elem);
|
out.StartArray(is_elem);
|
||||||
out.Element(ai.x);
|
out.Element(ai.x);
|
||||||
out.Element(ai.y);
|
out.Element(ai.y);
|
||||||
|
@ -242,7 +248,7 @@ void Write(JSONWriter &out, const aiVector3D &ai, bool is_elem = true) {
|
||||||
out.EndArray();
|
out.EndArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiQuaternion &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiQuaternion &ai, bool is_elem = true) {
|
||||||
out.StartArray(is_elem);
|
out.StartArray(is_elem);
|
||||||
out.Element(ai.w);
|
out.Element(ai.w);
|
||||||
out.Element(ai.x);
|
out.Element(ai.x);
|
||||||
|
@ -251,7 +257,7 @@ void Write(JSONWriter &out, const aiQuaternion &ai, bool is_elem = true) {
|
||||||
out.EndArray();
|
out.EndArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiColor3D &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiColor3D &ai, bool is_elem = true) {
|
||||||
out.StartArray(is_elem);
|
out.StartArray(is_elem);
|
||||||
out.Element(ai.r);
|
out.Element(ai.r);
|
||||||
out.Element(ai.g);
|
out.Element(ai.g);
|
||||||
|
@ -259,7 +265,7 @@ void Write(JSONWriter &out, const aiColor3D &ai, bool is_elem = true) {
|
||||||
out.EndArray();
|
out.EndArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiMatrix4x4 &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiMatrix4x4 &ai, bool is_elem = true) {
|
||||||
out.StartArray(is_elem);
|
out.StartArray(is_elem);
|
||||||
for (unsigned int x = 0; x < 4; ++x) {
|
for (unsigned int x = 0; x < 4; ++x) {
|
||||||
for (unsigned int y = 0; y < 4; ++y) {
|
for (unsigned int y = 0; y < 4; ++y) {
|
||||||
|
@ -269,7 +275,7 @@ void Write(JSONWriter &out, const aiMatrix4x4 &ai, bool is_elem = true) {
|
||||||
out.EndArray();
|
out.EndArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiBone &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiBone &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -290,7 +296,7 @@ void Write(JSONWriter &out, const aiBone &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiFace &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiFace &ai, bool is_elem = true) {
|
||||||
out.StartArray(is_elem);
|
out.StartArray(is_elem);
|
||||||
for (unsigned int i = 0; i < ai.mNumIndices; ++i) {
|
for (unsigned int i = 0; i < ai.mNumIndices; ++i) {
|
||||||
out.Element(ai.mIndices[i]);
|
out.Element(ai.mIndices[i]);
|
||||||
|
@ -298,7 +304,7 @@ void Write(JSONWriter &out, const aiFace &ai, bool is_elem = true) {
|
||||||
out.EndArray();
|
out.EndArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiMesh &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiMesh &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -409,7 +415,7 @@ void Write(JSONWriter &out, const aiMesh &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiNode &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiNode &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -439,7 +445,7 @@ void Write(JSONWriter &out, const aiNode &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiMaterial &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiMaterial &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("properties");
|
out.Key("properties");
|
||||||
|
@ -459,41 +465,55 @@ void Write(JSONWriter &out, const aiMaterial &ai, bool is_elem = true) {
|
||||||
|
|
||||||
out.Key("value");
|
out.Key("value");
|
||||||
switch (prop->mType) {
|
switch (prop->mType) {
|
||||||
case aiPTI_Float:
|
case aiPTI_Float:
|
||||||
if (prop->mDataLength / sizeof(float) > 1) {
|
if (prop->mDataLength / sizeof(float) > 1) {
|
||||||
out.StartArray();
|
out.StartArray();
|
||||||
for (unsigned int ii = 0; ii < prop->mDataLength / sizeof(float); ++ii) {
|
for (unsigned int ii = 0; ii < prop->mDataLength / sizeof(float); ++ii) {
|
||||||
out.Element(reinterpret_cast<float *>(prop->mData)[ii]);
|
out.Element(reinterpret_cast<float *>(prop->mData)[ii]);
|
||||||
|
}
|
||||||
|
out.EndArray();
|
||||||
|
} else {
|
||||||
|
out.SimpleValue(*reinterpret_cast<float *>(prop->mData));
|
||||||
}
|
}
|
||||||
out.EndArray();
|
break;
|
||||||
} else {
|
case aiPTI_Double:
|
||||||
out.SimpleValue(*reinterpret_cast<float *>(prop->mData));
|
if (prop->mDataLength / sizeof(double) > 1) {
|
||||||
}
|
out.StartArray();
|
||||||
break;
|
for (unsigned int ii = 0; ii < prop->mDataLength / sizeof(double); ++ii) {
|
||||||
|
out.Element(reinterpret_cast<double*>(prop->mData)[ii]);
|
||||||
case aiPTI_Integer:
|
}
|
||||||
if (prop->mDataLength / sizeof(int) > 1) {
|
out.EndArray();
|
||||||
out.StartArray();
|
} else {
|
||||||
for (unsigned int ii = 0; ii < prop->mDataLength / sizeof(int); ++ii) {
|
out.SimpleValue(*reinterpret_cast<double*>(prop->mData));
|
||||||
out.Element(reinterpret_cast<int *>(prop->mData)[ii]);
|
|
||||||
}
|
}
|
||||||
out.EndArray();
|
break;
|
||||||
} else {
|
case aiPTI_Integer:
|
||||||
out.SimpleValue(*reinterpret_cast<int *>(prop->mData));
|
if (prop->mDataLength / sizeof(int) > 1) {
|
||||||
}
|
out.StartArray();
|
||||||
break;
|
for (unsigned int ii = 0; ii < prop->mDataLength / sizeof(int); ++ii) {
|
||||||
|
out.Element(reinterpret_cast<int *>(prop->mData)[ii]);
|
||||||
|
}
|
||||||
|
out.EndArray();
|
||||||
|
} else {
|
||||||
|
out.SimpleValue(*reinterpret_cast<int *>(prop->mData));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case aiPTI_String: {
|
case aiPTI_String:
|
||||||
aiString s;
|
{
|
||||||
aiGetMaterialString(&ai, prop->mKey.data, prop->mSemantic, prop->mIndex, &s);
|
aiString s;
|
||||||
out.SimpleValue(s);
|
aiGetMaterialString(&ai, prop->mKey.data, prop->mSemantic, prop->mIndex, &s);
|
||||||
} break;
|
out.SimpleValue(s);
|
||||||
case aiPTI_Buffer: {
|
}
|
||||||
// binary data is written as series of hex-encoded octets
|
break;
|
||||||
out.SimpleValue(prop->mData, prop->mDataLength);
|
case aiPTI_Buffer:
|
||||||
} break;
|
{
|
||||||
default:
|
// binary data is written as series of hex-encoded octets
|
||||||
assert(false);
|
out.SimpleValue(prop->mData, prop->mDataLength);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ai_assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
|
@ -503,7 +523,7 @@ void Write(JSONWriter &out, const aiMaterial &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiTexture &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiTexture &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("width");
|
out.Key("width");
|
||||||
|
@ -539,7 +559,7 @@ void Write(JSONWriter &out, const aiTexture &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiLight &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiLight &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -587,7 +607,7 @@ void Write(JSONWriter &out, const aiLight &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiNodeAnim &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiNodeAnim &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -640,7 +660,7 @@ void Write(JSONWriter &out, const aiNodeAnim &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiAnimation &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiAnimation &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -661,7 +681,7 @@ void Write(JSONWriter &out, const aiAnimation &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiCamera &ai, bool is_elem = true) {
|
static void Write(JSONWriter &out, const aiCamera &ai, bool is_elem = true) {
|
||||||
out.StartObj(is_elem);
|
out.StartObj(is_elem);
|
||||||
|
|
||||||
out.Key("name");
|
out.Key("name");
|
||||||
|
@ -688,7 +708,7 @@ void Write(JSONWriter &out, const aiCamera &ai, bool is_elem = true) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteFormatInfo(JSONWriter &out) {
|
static void WriteFormatInfo(JSONWriter &out) {
|
||||||
out.StartObj();
|
out.StartObj();
|
||||||
out.Key("format");
|
out.Key("format");
|
||||||
out.SimpleValue("\"assimp2json\"");
|
out.SimpleValue("\"assimp2json\"");
|
||||||
|
@ -697,7 +717,7 @@ void WriteFormatInfo(JSONWriter &out) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write(JSONWriter &out, const aiScene &ai) {
|
static void Write(JSONWriter &out, const aiScene &ai) {
|
||||||
out.StartObj();
|
out.StartObj();
|
||||||
|
|
||||||
out.Key("__metadata__");
|
out.Key("__metadata__");
|
||||||
|
@ -765,7 +785,7 @@ void Write(JSONWriter &out, const aiScene &ai) {
|
||||||
out.EndObj();
|
out.EndObj();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportAssimp2Json(const char *file, Assimp::IOSystem *io, const aiScene *scene, const Assimp::ExportProperties *) {
|
void ExportAssimp2Json(const char *file, Assimp::IOSystem *io, const aiScene *scene, const Assimp::ExportProperties *pProperties) {
|
||||||
std::unique_ptr<Assimp::IOStream> str(io->Open(file, "wt"));
|
std::unique_ptr<Assimp::IOStream> str(io->Open(file, "wt"));
|
||||||
if (!str) {
|
if (!str) {
|
||||||
throw DeadlyExportError("could not open output file");
|
throw DeadlyExportError("could not open output file");
|
||||||
|
@ -782,7 +802,12 @@ void ExportAssimp2Json(const char *file, Assimp::IOSystem *io, const aiScene *sc
|
||||||
splitter.Execute(scenecopy_tmp);
|
splitter.Execute(scenecopy_tmp);
|
||||||
|
|
||||||
// XXX Flag_WriteSpecialFloats is turned on by default, right now we don't have a configuration interface for exporters
|
// XXX Flag_WriteSpecialFloats is turned on by default, right now we don't have a configuration interface for exporters
|
||||||
JSONWriter s(*str, JSONWriter::Flag_WriteSpecialFloats);
|
|
||||||
|
unsigned int flags = JSONWriter::Flag_WriteSpecialFloats;
|
||||||
|
if (pProperties->GetPropertyBool("JSON_SKIP_WHITESPACES", false)) {
|
||||||
|
flags |= JSONWriter::Flag_SkipWhitespaces;
|
||||||
|
}
|
||||||
|
JSONWriter s(*str, flags);
|
||||||
Write(s, *scenecopy_tmp);
|
Write(s, *scenecopy_tmp);
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
|
@ -69,13 +69,12 @@ void MeshSplitter::UpdateNode(aiNode* pcNode, const std::vector<std::pair<aiMesh
|
||||||
for (unsigned int i = 0, end = pcNode->mNumChildren; i < end;++i) {
|
for (unsigned int i = 0, end = pcNode->mNumChildren; i < end;++i) {
|
||||||
UpdateNode ( pcNode->mChildren[i], source_mesh_map );
|
UpdateNode ( pcNode->mChildren[i], source_mesh_map );
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WAS_NOT_COPIED 0xffffffff
|
static const unsigned int WAS_NOT_COPIED = 0xffffffff;
|
||||||
|
|
||||||
typedef std::pair <unsigned int,float> PerVertexWeight;
|
using PerVertexWeight = std::pair <unsigned int,float>;
|
||||||
typedef std::vector <PerVertexWeight> VertexWeightTable;
|
using VertexWeightTable = std::vector <PerVertexWeight>;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
VertexWeightTable* ComputeVertexBoneWeightTable(const aiMesh* pMesh) {
|
VertexWeightTable* ComputeVertexBoneWeightTable(const aiMesh* pMesh) {
|
||||||
|
@ -89,7 +88,7 @@ VertexWeightTable* ComputeVertexBoneWeightTable(const aiMesh* pMesh) {
|
||||||
aiBone* bone = pMesh->mBones[i];
|
aiBone* bone = pMesh->mBones[i];
|
||||||
for (unsigned int a = 0; a < bone->mNumWeights;++a) {
|
for (unsigned int a = 0; a < bone->mNumWeights;++a) {
|
||||||
const aiVertexWeight& weight = bone->mWeights[a];
|
const aiVertexWeight& weight = bone->mWeights[a];
|
||||||
avPerVertexWeights[weight.mVertexId].push_back( std::make_pair(i,weight.mWeight) );
|
avPerVertexWeights[weight.mVertexId].emplace_back(i,weight.mWeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return avPerVertexWeights;
|
return avPerVertexWeights;
|
||||||
|
@ -100,7 +99,7 @@ void MeshSplitter :: SplitMesh(unsigned int a, aiMesh* in_mesh, std::vector<std:
|
||||||
// TODO: should better use std::(multi)set for source_mesh_map.
|
// TODO: should better use std::(multi)set for source_mesh_map.
|
||||||
|
|
||||||
if (in_mesh->mNumVertices <= LIMIT) {
|
if (in_mesh->mNumVertices <= LIMIT) {
|
||||||
source_mesh_map.push_back(std::make_pair(in_mesh,a));
|
source_mesh_map.emplace_back(in_mesh,a);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +186,7 @@ void MeshSplitter :: SplitMesh(unsigned int a, aiMesh* in_mesh, std::vector<std:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
vFaces.push_back(aiFace());
|
vFaces.emplace_back();
|
||||||
aiFace& rFace = vFaces.back();
|
aiFace& rFace = vFaces.back();
|
||||||
|
|
||||||
// setup face type and number of indices
|
// setup face type and number of indices
|
||||||
|
@ -305,7 +304,7 @@ void MeshSplitter :: SplitMesh(unsigned int a, aiMesh* in_mesh, std::vector<std:
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the newly created mesh to the list
|
// add the newly created mesh to the list
|
||||||
source_mesh_map.push_back(std::make_pair(out_mesh,a));
|
source_mesh_map.emplace_back(out_mesh,a);
|
||||||
|
|
||||||
if (base == in_mesh->mNumFaces) {
|
if (base == in_mesh->mNumFaces) {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -24,38 +24,29 @@ struct aiNode;
|
||||||
/** Splits meshes of unique vertices into meshes with no more vertices than
|
/** Splits meshes of unique vertices into meshes with no more vertices than
|
||||||
* a given, configurable threshold value.
|
* a given, configurable threshold value.
|
||||||
*/
|
*/
|
||||||
class MeshSplitter
|
class MeshSplitter {
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
unsigned int LIMIT;
|
||||||
|
|
||||||
void SetLimit(unsigned int l) {
|
void SetLimit(unsigned int l) {
|
||||||
LIMIT = l;
|
LIMIT = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int GetLimit() const {
|
unsigned int GetLimit() const {
|
||||||
return LIMIT;
|
return LIMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
// -------------------------------------------------------------------
|
||||||
|
/** Executes the post processing step on the given imported data.
|
||||||
// -------------------------------------------------------------------
|
|
||||||
/** Executes the post processing step on the given imported data.
|
|
||||||
* At the moment a process is not supposed to fail.
|
* At the moment a process is not supposed to fail.
|
||||||
* @param pScene The imported data to work at.
|
* @param pScene The imported data to work at.
|
||||||
*/
|
*/
|
||||||
void Execute( aiScene* pScene);
|
void Execute(aiScene *pScene);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void UpdateNode(aiNode *pcNode, const std::vector<std::pair<aiMesh *, unsigned int>> &source_mesh_map);
|
||||||
|
void SplitMesh(unsigned int index, aiMesh *mesh, std::vector<std::pair<aiMesh *, unsigned int>> &source_mesh_map);
|
||||||
|
|
||||||
void UpdateNode(aiNode* pcNode, const std::vector<std::pair<aiMesh*, unsigned int> >& source_mesh_map);
|
|
||||||
void SplitMesh (unsigned int index, aiMesh* mesh, std::vector<std::pair<aiMesh*, unsigned int> >& source_mesh_map);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
unsigned int LIMIT;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INCLUDED_MESH_SPLITTER
|
#endif // INCLUDED_MESH_SPLITTER
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file AssxmlExporter.h
|
/** @file AssxmlExporter.h
|
||||||
* ASSXML Exporter Main Header
|
* ASSXML Exporter Main Header
|
||||||
*/
|
*/
|
||||||
|
#pragma once
|
||||||
#ifndef AI_ASSXMLEXPORTER_H_INC
|
#ifndef AI_ASSXMLEXPORTER_H_INC
|
||||||
#define AI_ASSXMLEXPORTER_H_INC
|
#define AI_ASSXMLEXPORTER_H_INC
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -168,7 +168,7 @@ static void WriteNode(const aiNode *node, IOStream *io, unsigned int depth) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
// Some chuncks of text will need to be encoded for XML
|
// Some chunks of text will need to be encoded for XML
|
||||||
// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377
|
// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377
|
||||||
static std::string encodeXML(const std::string &data) {
|
static std::string encodeXML(const std::string &data) {
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
|
@ -189,7 +189,7 @@ static std::string encodeXML(const std::string &data) {
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
// Write a text model dump
|
// Write a text model dump
|
||||||
static void WriteDump(const char *pFile, const char *cmd, const aiScene *scene, IOStream *io, bool shortened) {
|
static void WriteDump(const char *pFile, const char *cmd, const aiScene *scene, IOStream *io, bool shortened) {
|
||||||
time_t tt = ::time(NULL);
|
time_t tt = ::time(nullptr);
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
tm *p = gmtime(&tt);
|
tm *p = gmtime(&tt);
|
||||||
#else
|
#else
|
||||||
|
@ -365,7 +365,7 @@ static void WriteDump(const char *pFile, const char *cmd, const aiScene *scene,
|
||||||
|
|
||||||
ioprintf(io, "\t\t\t<MatProperty key=\"%s\" \n\t\t\ttype=\"%s\" tex_usage=\"%s\" tex_index=\"%u\"",
|
ioprintf(io, "\t\t\t<MatProperty key=\"%s\" \n\t\t\ttype=\"%s\" tex_usage=\"%s\" tex_index=\"%u\"",
|
||||||
prop->mKey.data, sz,
|
prop->mKey.data, sz,
|
||||||
::TextureTypeToString((aiTextureType)prop->mSemantic), prop->mIndex);
|
::aiTextureTypeToString((aiTextureType)prop->mSemantic), prop->mIndex);
|
||||||
|
|
||||||
if (prop->mType == aiPTI_Float) {
|
if (prop->mType == aiPTI_Float) {
|
||||||
ioprintf(io, " size=\"%i\">\n\t\t\t\t",
|
ioprintf(io, " size=\"%i\">\n\t\t\t\t",
|
||||||
|
@ -598,8 +598,11 @@ static void WriteDump(const char *pFile, const char *cmd, const aiScene *scene,
|
||||||
if (!mesh->mTextureCoords[a])
|
if (!mesh->mTextureCoords[a])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ioprintf(io, "\t\t<TextureCoords num=\"%u\" set=\"%u\" num_components=\"%u\"> \n", mesh->mNumVertices,
|
ioprintf(io, "\t\t<TextureCoords num=\"%u\" set=\"%u\" name=\"%s\" num_components=\"%u\"> \n",
|
||||||
a, mesh->mNumUVComponents[a]);
|
mesh->mNumVertices,
|
||||||
|
a,
|
||||||
|
(mesh->HasTextureCoordsName(a) ? mesh->GetTextureCoordsName(a)->C_Str() : ""),
|
||||||
|
mesh->mNumUVComponents[a]);
|
||||||
|
|
||||||
if (!shortened) {
|
if (!shortened) {
|
||||||
if (mesh->mNumUVComponents[a] == 3) {
|
if (mesh->mNumUVComponents[a] == 3) {
|
||||||
|
@ -649,7 +652,7 @@ void DumpSceneToAssxml(
|
||||||
const char *pFile, const char *cmd, IOSystem *pIOSystem,
|
const char *pFile, const char *cmd, IOSystem *pIOSystem,
|
||||||
const aiScene *pScene, bool shortened) {
|
const aiScene *pScene, bool shortened) {
|
||||||
std::unique_ptr<IOStream> file(pIOSystem->Open(pFile, "wt"));
|
std::unique_ptr<IOStream> file(pIOSystem->Open(pFile, "wt"));
|
||||||
if (!file.get()) {
|
if (!file) {
|
||||||
throw std::runtime_error("Unable to open output file " + std::string(pFile) + '\n');
|
throw std::runtime_error("Unable to open output file " + std::string(pFile) + '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file AssxmlFileWriter.h
|
/** @file AssxmlFileWriter.h
|
||||||
* @brief Declaration of Assxml file writer.
|
* @brief Declaration of Assxml file writer.
|
||||||
*/
|
*/
|
||||||
|
#pragma once
|
||||||
#ifndef AI_ASSXMLFILEWRITER_H_INC
|
#ifndef AI_ASSXMLFILEWRITER_H_INC
|
||||||
#define AI_ASSXMLFILEWRITER_H_INC
|
#define AI_ASSXMLFILEWRITER_H_INC
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -59,10 +59,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
static constexpr aiImporterDesc desc = {
|
||||||
"BlitzBasic 3D Importer",
|
"BlitzBasic 3D Importer",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -79,7 +79,7 @@ static const aiImporterDesc desc = {
|
||||||
#pragma warning(disable : 4018)
|
#pragma warning(disable : 4018)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define DEBUG_B3D
|
// #define DEBUG_B3D
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void DeleteAllBarePointers(std::vector<T> &x) {
|
void DeleteAllBarePointers(std::vector<T> &x) {
|
||||||
|
@ -88,12 +88,10 @@ void DeleteAllBarePointers(std::vector<T> &x) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
B3DImporter::~B3DImporter() {
|
B3DImporter::~B3DImporter() = default;
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
bool B3DImporter::CanRead(const std::string &pFile, IOSystem * /*pIOHandler*/, bool /*checkSig*/) const {
|
bool B3DImporter::CanRead(const std::string &pFile, IOSystem * /*pIOHandler*/, bool /*checkSig*/) const {
|
||||||
|
|
||||||
size_t pos = pFile.find_last_of('.');
|
size_t pos = pFile.find_last_of('.');
|
||||||
if (pos == string::npos) {
|
if (pos == string::npos) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -118,8 +116,8 @@ void B3DImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
||||||
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
|
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
|
||||||
|
|
||||||
// Check whether we can read from the file
|
// Check whether we can read from the file
|
||||||
if (file.get() == nullptr) {
|
if (file == nullptr) {
|
||||||
throw DeadlyImportError("Failed to open B3D file " + pFile + ".");
|
throw DeadlyImportError("Failed to open B3D file ", pFile, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check whether the .b3d file is large enough to contain
|
// check whether the .b3d file is large enough to contain
|
||||||
|
@ -143,16 +141,16 @@ AI_WONT_RETURN void B3DImporter::Oops() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AI_WONT_RETURN void B3DImporter::Fail(string str) {
|
AI_WONT_RETURN void B3DImporter::Fail(const string &str) {
|
||||||
#ifdef DEBUG_B3D
|
#ifdef DEBUG_B3D
|
||||||
ASSIMP_LOG_ERROR_F("Error in B3D file data: ", str);
|
ASSIMP_LOG_ERROR("Error in B3D file data: ", str);
|
||||||
#endif
|
#endif
|
||||||
throw DeadlyImportError("B3D Importer - error in B3D file data: " + str);
|
throw DeadlyImportError("B3D Importer - error in B3D file data: ", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
int B3DImporter::ReadByte() {
|
int B3DImporter::ReadByte() {
|
||||||
if (_pos > _buf.size()) {
|
if (_pos >= _buf.size()) {
|
||||||
Fail("EOF");
|
Fail("EOF");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +231,7 @@ string B3DImporter::ReadChunk() {
|
||||||
tag += char(ReadByte());
|
tag += char(ReadByte());
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_B3D
|
#ifdef DEBUG_B3D
|
||||||
ASSIMP_LOG_DEBUG_F("ReadChunk: ", tag);
|
ASSIMP_LOG_DEBUG("ReadChunk: ", tag);
|
||||||
#endif
|
#endif
|
||||||
unsigned sz = (unsigned)ReadInt();
|
unsigned sz = (unsigned)ReadInt();
|
||||||
_stack.push_back(_pos + sz);
|
_stack.push_back(_pos + sz);
|
||||||
|
@ -255,7 +253,7 @@ size_t B3DImporter::ChunkSize() {
|
||||||
template <class T>
|
template <class T>
|
||||||
T *B3DImporter::to_array(const vector<T> &v) {
|
T *B3DImporter::to_array(const vector<T> &v) {
|
||||||
if (v.empty()) {
|
if (v.empty()) {
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
T *p = new T[v.size()];
|
T *p = new T[v.size()];
|
||||||
for (size_t i = 0; i < v.size(); ++i) {
|
for (size_t i = 0; i < v.size(); ++i) {
|
||||||
|
@ -268,7 +266,7 @@ T *B3DImporter::to_array(const vector<T> &v) {
|
||||||
template <class T>
|
template <class T>
|
||||||
T **unique_to_array(vector<std::unique_ptr<T>> &v) {
|
T **unique_to_array(vector<std::unique_ptr<T>> &v) {
|
||||||
if (v.empty()) {
|
if (v.empty()) {
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
T **p = new T *[v.size()];
|
T **p = new T *[v.size()];
|
||||||
for (size_t i = 0; i < v.size(); ++i) {
|
for (size_t i = 0; i < v.size(); ++i) {
|
||||||
|
@ -331,7 +329,7 @@ void B3DImporter::ReadBRUS() {
|
||||||
mat->AddProperty(&i, 1, AI_MATKEY_TWOSIDED);
|
mat->AddProperty(&i, 1, AI_MATKEY_TWOSIDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Textures
|
// Textures
|
||||||
for (int i = 0; i < n_texs; ++i) {
|
for (int i = 0; i < n_texs; ++i) {
|
||||||
int texid = ReadInt();
|
int texid = ReadInt();
|
||||||
if (texid < -1 || (texid >= 0 && texid >= static_cast<int>(_textures.size()))) {
|
if (texid < -1 || (texid >= 0 && texid >= static_cast<int>(_textures.size()))) {
|
||||||
|
@ -374,7 +372,7 @@ void B3DImporter::ReadVRTS() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_vflags & 2) {
|
if (_vflags & 2) {
|
||||||
ReadQuat(); //skip v 4bytes...
|
ReadQuat(); // skip v 4bytes...
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < _tcsets; ++j) {
|
for (int j = 0; j < _tcsets; ++j) {
|
||||||
|
@ -397,7 +395,7 @@ void B3DImporter::ReadTRIS(int v0) {
|
||||||
matid = 0;
|
matid = 0;
|
||||||
} else if (matid < 0 || matid >= (int)_materials.size()) {
|
} else if (matid < 0 || matid >= (int)_materials.size()) {
|
||||||
#ifdef DEBUG_B3D
|
#ifdef DEBUG_B3D
|
||||||
ASSIMP_LOG_ERROR_F("material id=", matid);
|
ASSIMP_LOG_ERROR("material id=", matid);
|
||||||
#endif
|
#endif
|
||||||
Fail("Bad material id");
|
Fail("Bad material id");
|
||||||
}
|
}
|
||||||
|
@ -417,10 +415,9 @@ void B3DImporter::ReadTRIS(int v0) {
|
||||||
int i2 = ReadInt() + v0;
|
int i2 = ReadInt() + v0;
|
||||||
if (i0 < 0 || i0 >= (int)_vertices.size() || i1 < 0 || i1 >= (int)_vertices.size() || i2 < 0 || i2 >= (int)_vertices.size()) {
|
if (i0 < 0 || i0 >= (int)_vertices.size() || i1 < 0 || i1 >= (int)_vertices.size() || i2 < 0 || i2 >= (int)_vertices.size()) {
|
||||||
#ifdef DEBUG_B3D
|
#ifdef DEBUG_B3D
|
||||||
ASSIMP_LOG_ERROR_F("Bad triangle index: i0=", i0, ", i1=", i1, ", i2=", i2);
|
ASSIMP_LOG_ERROR("Bad triangle index: i0=", i0, ", i1=", i1, ", i2=", i2);
|
||||||
#endif
|
#endif
|
||||||
Fail("Bad triangle index");
|
Fail("Bad triangle index");
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
face->mNumIndices = 3;
|
face->mNumIndices = 3;
|
||||||
face->mIndices = new unsigned[3];
|
face->mIndices = new unsigned[3];
|
||||||
|
@ -479,13 +476,13 @@ void B3DImporter::ReadKEYS(aiNodeAnim *nodeAnim) {
|
||||||
while (ChunkSize()) {
|
while (ChunkSize()) {
|
||||||
int frame = ReadInt();
|
int frame = ReadInt();
|
||||||
if (flags & 1) {
|
if (flags & 1) {
|
||||||
trans.push_back(aiVectorKey(frame, ReadVec3()));
|
trans.emplace_back(frame, ReadVec3());
|
||||||
}
|
}
|
||||||
if (flags & 2) {
|
if (flags & 2) {
|
||||||
scale.push_back(aiVectorKey(frame, ReadVec3()));
|
scale.emplace_back(frame, ReadVec3());
|
||||||
}
|
}
|
||||||
if (flags & 4) {
|
if (flags & 4) {
|
||||||
rot.push_back(aiQuatKey(frame, ReadQuat()));
|
rot.emplace_back(frame, ReadQuat());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,7 +616,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
|
||||||
} else if (chunk == "BRUS") {
|
} else if (chunk == "BRUS") {
|
||||||
ReadBRUS();
|
ReadBRUS();
|
||||||
} else if (chunk == "NODE") {
|
} else if (chunk == "NODE") {
|
||||||
ReadNODE(0);
|
ReadNODE(nullptr);
|
||||||
}
|
}
|
||||||
ExitChunk();
|
ExitChunk();
|
||||||
}
|
}
|
||||||
|
@ -644,7 +641,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
|
||||||
int n_tris = mesh->mNumFaces;
|
int n_tris = mesh->mNumFaces;
|
||||||
int n_verts = mesh->mNumVertices = n_tris * 3;
|
int n_verts = mesh->mNumVertices = n_tris * 3;
|
||||||
|
|
||||||
aiVector3D *mv = mesh->mVertices = new aiVector3D[n_verts], *mn = 0, *mc = 0;
|
aiVector3D *mv = mesh->mVertices = new aiVector3D[n_verts], *mn = nullptr, *mc = nullptr;
|
||||||
if (_vflags & 1) {
|
if (_vflags & 1) {
|
||||||
mn = mesh->mNormals = new aiVector3D[n_verts];
|
mn = mesh->mNormals = new aiVector3D[n_verts];
|
||||||
}
|
}
|
||||||
|
@ -673,7 +670,7 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
|
||||||
int bone = v.bones[k];
|
int bone = v.bones[k];
|
||||||
float weight = v.weights[k];
|
float weight = v.weights[k];
|
||||||
|
|
||||||
vweights[bone].push_back(aiVertexWeight(vertIdx + faceIndex, weight));
|
vweights[bone].emplace_back(vertIdx + faceIndex, weight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++face;
|
++face;
|
||||||
|
@ -707,22 +704,22 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//nodes
|
// nodes
|
||||||
scene->mRootNode = _nodes[0];
|
scene->mRootNode = _nodes[0];
|
||||||
_nodes.clear(); // node ownership now belongs to scene
|
_nodes.clear(); // node ownership now belongs to scene
|
||||||
|
|
||||||
//material
|
// material
|
||||||
if (!_materials.size()) {
|
if (!_materials.size()) {
|
||||||
_materials.emplace_back(std::unique_ptr<aiMaterial>(new aiMaterial));
|
_materials.emplace_back(std::unique_ptr<aiMaterial>(new aiMaterial));
|
||||||
}
|
}
|
||||||
scene->mNumMaterials = static_cast<unsigned int>(_materials.size());
|
scene->mNumMaterials = static_cast<unsigned int>(_materials.size());
|
||||||
scene->mMaterials = unique_to_array(_materials);
|
scene->mMaterials = unique_to_array(_materials);
|
||||||
|
|
||||||
//meshes
|
// meshes
|
||||||
scene->mNumMeshes = static_cast<unsigned int>(_meshes.size());
|
scene->mNumMeshes = static_cast<unsigned int>(_meshes.size());
|
||||||
scene->mMeshes = unique_to_array(_meshes);
|
scene->mMeshes = unique_to_array(_meshes);
|
||||||
|
|
||||||
//animations
|
// animations
|
||||||
if (_animations.size() == 1 && _nodeAnims.size()) {
|
if (_animations.size() == 1 && _nodeAnims.size()) {
|
||||||
|
|
||||||
aiAnimation *anim = _animations.back().get();
|
aiAnimation *anim = _animations.back().get();
|
||||||
|
@ -741,4 +738,6 @@ void B3DImporter::ReadBB3D(aiScene *scene) {
|
||||||
flip.Execute(scene);
|
flip.Execute(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_B3D_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_B3D_IMPORTER
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -40,8 +39,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file Definition of the .b3d importer class. */
|
/**
|
||||||
|
* @file Definition of the .b3d importer class.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
#ifndef AI_B3DIMPORTER_H_INC
|
#ifndef AI_B3DIMPORTER_H_INC
|
||||||
#define AI_B3DIMPORTER_H_INC
|
#define AI_B3DIMPORTER_H_INC
|
||||||
|
|
||||||
|
@ -62,14 +63,12 @@ namespace Assimp{
|
||||||
class B3DImporter : public BaseImporter{
|
class B3DImporter : public BaseImporter{
|
||||||
public:
|
public:
|
||||||
B3DImporter() = default;
|
B3DImporter() = default;
|
||||||
virtual ~B3DImporter();
|
~B3DImporter() override;
|
||||||
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override;
|
||||||
virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
const aiImporterDesc* GetInfo () const override;
|
||||||
virtual const aiImporterDesc* GetInfo () const;
|
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) override;
|
||||||
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
AI_WONT_RETURN void Oops() AI_WONT_RETURN_SUFFIX;
|
AI_WONT_RETURN void Oops() AI_WONT_RETURN_SUFFIX;
|
||||||
AI_WONT_RETURN void Fail( std::string str ) AI_WONT_RETURN_SUFFIX;
|
AI_WONT_RETURN void Fail(const std::string &str) AI_WONT_RETURN_SUFFIX;
|
||||||
|
|
||||||
void ReadTEXS();
|
void ReadTEXS();
|
||||||
void ReadBRUS();
|
void ReadBRUS();
|
||||||
|
@ -113,7 +112,6 @@ private:
|
||||||
void ReadBB3D( aiScene *scene );
|
void ReadBB3D( aiScene *scene );
|
||||||
|
|
||||||
size_t _pos;
|
size_t _pos;
|
||||||
// unsigned _size;
|
|
||||||
std::vector<unsigned char> _buf;
|
std::vector<unsigned char> _buf;
|
||||||
std::vector<size_t> _stack;
|
std::vector<size_t> _stack;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,10 +55,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
|
|
||||||
using namespace Assimp::Formatter;
|
using namespace Assimp::Formatter;
|
||||||
|
|
||||||
static const aiImporterDesc desc = {
|
static constexpr aiImporterDesc desc = {
|
||||||
"BVH Importer (MoCap)",
|
"BVH Importer (MoCap)",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
@ -71,6 +72,13 @@ static const aiImporterDesc desc = {
|
||||||
"bvh"
|
"bvh"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Aborts the file reading with an exception
|
||||||
|
template <typename... T>
|
||||||
|
AI_WONT_RETURN void BVHLoader::ThrowException(T &&...args) {
|
||||||
|
throw DeadlyImportError(mFileName, ":", mLine, " - ", args...);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
BVHLoader::BVHLoader() :
|
BVHLoader::BVHLoader() :
|
||||||
|
@ -81,22 +89,13 @@ BVHLoader::BVHLoader() :
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Destructor, private as well
|
// Destructor, private as well
|
||||||
BVHLoader::~BVHLoader() {}
|
BVHLoader::~BVHLoader() = default;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Returns whether the class can handle the format of the given file.
|
// Returns whether the class can handle the format of the given file.
|
||||||
bool BVHLoader::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool cs) const {
|
bool BVHLoader::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
|
||||||
// check file extension
|
static const char *tokens[] = { "HIERARCHY" };
|
||||||
const std::string extension = GetExtension(pFile);
|
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
|
||||||
|
|
||||||
if (extension == "bvh")
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if ((!extension.length() || cs) && pIOHandler) {
|
|
||||||
const char *tokens[] = { "HIERARCHY" };
|
|
||||||
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -117,8 +116,8 @@ void BVHLoader::InternReadFile(const std::string &pFile, aiScene *pScene, IOSyst
|
||||||
|
|
||||||
// read file into memory
|
// read file into memory
|
||||||
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
|
std::unique_ptr<IOStream> file(pIOHandler->Open(pFile));
|
||||||
if (file.get() == nullptr) {
|
if (file == nullptr) {
|
||||||
throw DeadlyImportError("Failed to open file " + pFile + ".");
|
throw DeadlyImportError("Failed to open file ", pFile, ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t fileSize = file->FileSize();
|
size_t fileSize = file->FileSize();
|
||||||
|
@ -171,29 +170,29 @@ void BVHLoader::ReadHierarchy(aiScene *pScene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Reads a node and recursively its childs and returns the created node;
|
// Reads a node and recursively its children and returns the created node;
|
||||||
aiNode *BVHLoader::ReadNode() {
|
aiNode *BVHLoader::ReadNode() {
|
||||||
// first token is name
|
// first token is name
|
||||||
std::string nodeName = GetNextToken();
|
std::string nodeName = GetNextToken();
|
||||||
if (nodeName.empty() || nodeName == "{")
|
if (nodeName.empty() || nodeName == "{")
|
||||||
ThrowException(format() << "Expected node name, but found \"" << nodeName << "\".");
|
ThrowException("Expected node name, but found \"", nodeName, "\".");
|
||||||
|
|
||||||
// then an opening brace should follow
|
// then an opening brace should follow
|
||||||
std::string openBrace = GetNextToken();
|
std::string openBrace = GetNextToken();
|
||||||
if (openBrace != "{")
|
if (openBrace != "{")
|
||||||
ThrowException(format() << "Expected opening brace \"{\", but found \"" << openBrace << "\".");
|
ThrowException("Expected opening brace \"{\", but found \"", openBrace, "\".");
|
||||||
|
|
||||||
// Create a node
|
// Create a node
|
||||||
aiNode *node = new aiNode(nodeName);
|
aiNode *node = new aiNode(nodeName);
|
||||||
std::vector<aiNode *> childNodes;
|
std::vector<aiNode *> childNodes;
|
||||||
|
|
||||||
// and create an bone entry for it
|
// and create an bone entry for it
|
||||||
mNodes.push_back(Node(node));
|
mNodes.emplace_back(node);
|
||||||
Node &internNode = mNodes.back();
|
Node &internNode = mNodes.back();
|
||||||
|
|
||||||
// now read the node's contents
|
// now read the node's contents
|
||||||
std::string siteToken;
|
std::string siteToken;
|
||||||
while (1) {
|
while (true) {
|
||||||
std::string token = GetNextToken();
|
std::string token = GetNextToken();
|
||||||
|
|
||||||
// node offset to parent node
|
// node offset to parent node
|
||||||
|
@ -211,7 +210,7 @@ aiNode *BVHLoader::ReadNode() {
|
||||||
siteToken.clear();
|
siteToken.clear();
|
||||||
siteToken = GetNextToken();
|
siteToken = GetNextToken();
|
||||||
if (siteToken != "Site")
|
if (siteToken != "Site")
|
||||||
ThrowException(format() << "Expected \"End Site\" keyword, but found \"" << token << " " << siteToken << "\".");
|
ThrowException("Expected \"End Site\" keyword, but found \"", token, " ", siteToken, "\".");
|
||||||
|
|
||||||
aiNode *child = ReadEndSite(nodeName);
|
aiNode *child = ReadEndSite(nodeName);
|
||||||
child->mParent = node;
|
child->mParent = node;
|
||||||
|
@ -221,7 +220,7 @@ aiNode *BVHLoader::ReadNode() {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
// everything else is a parse error
|
// everything else is a parse error
|
||||||
ThrowException(format() << "Unknown keyword \"" << token << "\".");
|
ThrowException("Unknown keyword \"", token, "\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,14 +241,14 @@ aiNode *BVHLoader::ReadEndSite(const std::string &pParentName) {
|
||||||
// check opening brace
|
// check opening brace
|
||||||
std::string openBrace = GetNextToken();
|
std::string openBrace = GetNextToken();
|
||||||
if (openBrace != "{")
|
if (openBrace != "{")
|
||||||
ThrowException(format() << "Expected opening brace \"{\", but found \"" << openBrace << "\".");
|
ThrowException("Expected opening brace \"{\", but found \"", openBrace, "\".");
|
||||||
|
|
||||||
// Create a node
|
// Create a node
|
||||||
aiNode *node = new aiNode("EndSite_" + pParentName);
|
aiNode *node = new aiNode("EndSite_" + pParentName);
|
||||||
|
|
||||||
// now read the node's contents. Only possible entry is "OFFSET"
|
// now read the node's contents. Only possible entry is "OFFSET"
|
||||||
std::string token;
|
std::string token;
|
||||||
while (1) {
|
while (true) {
|
||||||
token.clear();
|
token.clear();
|
||||||
token = GetNextToken();
|
token = GetNextToken();
|
||||||
|
|
||||||
|
@ -261,7 +260,7 @@ aiNode *BVHLoader::ReadEndSite(const std::string &pParentName) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
// everything else is a parse error
|
// everything else is a parse error
|
||||||
ThrowException(format() << "Unknown keyword \"" << token << "\".");
|
ThrowException("Unknown keyword \"", token, "\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +306,7 @@ void BVHLoader::ReadNodeChannels(BVHLoader::Node &pNode) {
|
||||||
else if (channelToken == "Zrotation")
|
else if (channelToken == "Zrotation")
|
||||||
pNode.mChannels.push_back(Channel_RotationZ);
|
pNode.mChannels.push_back(Channel_RotationZ);
|
||||||
else
|
else
|
||||||
ThrowException(format() << "Invalid channel specifier \"" << channelToken << "\".");
|
ThrowException("Invalid channel specifier \"", channelToken, "\".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +316,7 @@ void BVHLoader::ReadMotion(aiScene * /*pScene*/) {
|
||||||
// Read number of frames
|
// Read number of frames
|
||||||
std::string tokenFrames = GetNextToken();
|
std::string tokenFrames = GetNextToken();
|
||||||
if (tokenFrames != "Frames:")
|
if (tokenFrames != "Frames:")
|
||||||
ThrowException(format() << "Expected frame count \"Frames:\", but found \"" << tokenFrames << "\".");
|
ThrowException("Expected frame count \"Frames:\", but found \"", tokenFrames, "\".");
|
||||||
|
|
||||||
float numFramesFloat = GetNextTokenAsFloat();
|
float numFramesFloat = GetNextTokenAsFloat();
|
||||||
mAnimNumFrames = (unsigned int)numFramesFloat;
|
mAnimNumFrames = (unsigned int)numFramesFloat;
|
||||||
|
@ -326,7 +325,7 @@ void BVHLoader::ReadMotion(aiScene * /*pScene*/) {
|
||||||
std::string tokenDuration1 = GetNextToken();
|
std::string tokenDuration1 = GetNextToken();
|
||||||
std::string tokenDuration2 = GetNextToken();
|
std::string tokenDuration2 = GetNextToken();
|
||||||
if (tokenDuration1 != "Frame" || tokenDuration2 != "Time:")
|
if (tokenDuration1 != "Frame" || tokenDuration2 != "Time:")
|
||||||
ThrowException(format() << "Expected frame duration \"Frame Time:\", but found \"" << tokenDuration1 << " " << tokenDuration2 << "\".");
|
ThrowException("Expected frame duration \"Frame Time:\", but found \"", tokenDuration1, " ", tokenDuration2, "\".");
|
||||||
|
|
||||||
mAnimTickDuration = GetNextTokenAsFloat();
|
mAnimTickDuration = GetNextTokenAsFloat();
|
||||||
|
|
||||||
|
@ -352,7 +351,7 @@ void BVHLoader::ReadMotion(aiScene * /*pScene*/) {
|
||||||
std::string BVHLoader::GetNextToken() {
|
std::string BVHLoader::GetNextToken() {
|
||||||
// skip any preceding whitespace
|
// skip any preceding whitespace
|
||||||
while (mReader != mBuffer.end()) {
|
while (mReader != mBuffer.end()) {
|
||||||
if (!isspace(*mReader))
|
if (!isspace((unsigned char)*mReader))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// count lines
|
// count lines
|
||||||
|
@ -365,7 +364,7 @@ std::string BVHLoader::GetNextToken() {
|
||||||
// collect all chars till the next whitespace. BVH is easy in respect to that.
|
// collect all chars till the next whitespace. BVH is easy in respect to that.
|
||||||
std::string token;
|
std::string token;
|
||||||
while (mReader != mBuffer.end()) {
|
while (mReader != mBuffer.end()) {
|
||||||
if (isspace(*mReader))
|
if (isspace((unsigned char)*mReader))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
token.push_back(*mReader);
|
token.push_back(*mReader);
|
||||||
|
@ -393,17 +392,11 @@ float BVHLoader::GetNextTokenAsFloat() {
|
||||||
ctoken = fast_atoreal_move<float>(ctoken, result);
|
ctoken = fast_atoreal_move<float>(ctoken, result);
|
||||||
|
|
||||||
if (ctoken != token.c_str() + token.length())
|
if (ctoken != token.c_str() + token.length())
|
||||||
ThrowException(format() << "Expected a floating point number, but found \"" << token << "\".");
|
ThrowException("Expected a floating point number, but found \"", token, "\".");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
// Aborts the file reading with an exception
|
|
||||||
AI_WONT_RETURN void BVHLoader::ThrowException(const std::string &pError) {
|
|
||||||
throw DeadlyImportError(format() << mFileName << ":" << mLine << " - " << pError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructs an animation for the motion data and stores it in the given scene
|
// Constructs an animation for the motion data and stores it in the given scene
|
||||||
void BVHLoader::CreateAnimation(aiScene *pScene) {
|
void BVHLoader::CreateAnimation(aiScene *pScene) {
|
||||||
|
@ -422,9 +415,9 @@ void BVHLoader::CreateAnimation(aiScene *pScene) {
|
||||||
anim->mNumChannels = static_cast<unsigned int>(mNodes.size());
|
anim->mNumChannels = static_cast<unsigned int>(mNodes.size());
|
||||||
anim->mChannels = new aiNodeAnim *[anim->mNumChannels];
|
anim->mChannels = new aiNodeAnim *[anim->mNumChannels];
|
||||||
|
|
||||||
// FIX: set the array elements to NULL to ensure proper deletion if an exception is thrown
|
// FIX: set the array elements to nullptr to ensure proper deletion if an exception is thrown
|
||||||
for (unsigned int i = 0; i < anim->mNumChannels; ++i)
|
for (unsigned int i = 0; i < anim->mNumChannels; ++i)
|
||||||
anim->mChannels[i] = NULL;
|
anim->mChannels[i] = nullptr;
|
||||||
|
|
||||||
for (unsigned int a = 0; a < anim->mNumChannels; a++) {
|
for (unsigned int a = 0; a < anim->mNumChannels; a++) {
|
||||||
const Node &node = mNodes[a];
|
const Node &node = mNodes[a];
|
||||||
|
@ -434,7 +427,7 @@ void BVHLoader::CreateAnimation(aiScene *pScene) {
|
||||||
nodeAnim->mNodeName.Set(nodeName);
|
nodeAnim->mNodeName.Set(nodeName);
|
||||||
std::map<BVHLoader::ChannelType, int> channelMap;
|
std::map<BVHLoader::ChannelType, int> channelMap;
|
||||||
|
|
||||||
//Build map of channels
|
// Build map of channels
|
||||||
for (unsigned int channel = 0; channel < node.mChannels.size(); ++channel) {
|
for (unsigned int channel = 0; channel < node.mChannels.size(); ++channel) {
|
||||||
channelMap[node.mChannels[channel]] = channel;
|
channelMap[node.mChannels[channel]] = channel;
|
||||||
}
|
}
|
||||||
|
@ -449,11 +442,11 @@ void BVHLoader::CreateAnimation(aiScene *pScene) {
|
||||||
|
|
||||||
// Now compute all translations
|
// Now compute all translations
|
||||||
for (BVHLoader::ChannelType channel = Channel_PositionX; channel <= Channel_PositionZ; channel = (BVHLoader::ChannelType)(channel + 1)) {
|
for (BVHLoader::ChannelType channel = Channel_PositionX; channel <= Channel_PositionZ; channel = (BVHLoader::ChannelType)(channel + 1)) {
|
||||||
//Find channel in node
|
// Find channel in node
|
||||||
std::map<BVHLoader::ChannelType, int>::iterator mapIter = channelMap.find(channel);
|
std::map<BVHLoader::ChannelType, int>::iterator mapIter = channelMap.find(channel);
|
||||||
|
|
||||||
if (mapIter == channelMap.end())
|
if (mapIter == channelMap.end())
|
||||||
throw DeadlyImportError("Missing position channel in node " + nodeName);
|
throw DeadlyImportError("Missing position channel in node ", nodeName);
|
||||||
else {
|
else {
|
||||||
int channelIdx = mapIter->second;
|
int channelIdx = mapIter->second;
|
||||||
switch (channel) {
|
switch (channel) {
|
||||||
|
@ -493,30 +486,27 @@ void BVHLoader::CreateAnimation(aiScene *pScene) {
|
||||||
for (unsigned int fr = 0; fr < mAnimNumFrames; ++fr) {
|
for (unsigned int fr = 0; fr < mAnimNumFrames; ++fr) {
|
||||||
aiMatrix4x4 temp;
|
aiMatrix4x4 temp;
|
||||||
aiMatrix3x3 rotMatrix;
|
aiMatrix3x3 rotMatrix;
|
||||||
for (unsigned int channelIdx = 0; channelIdx < node.mChannels.size(); ++ channelIdx) {
|
for (unsigned int channelIdx = 0; channelIdx < node.mChannels.size(); ++channelIdx) {
|
||||||
switch (node.mChannels[channelIdx]) {
|
switch (node.mChannels[channelIdx]) {
|
||||||
case Channel_RotationX:
|
case Channel_RotationX: {
|
||||||
{
|
|
||||||
const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f;
|
const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f;
|
||||||
aiMatrix4x4::RotationX( angle, temp); rotMatrix *= aiMatrix3x3( temp);
|
aiMatrix4x4::RotationX(angle, temp);
|
||||||
}
|
rotMatrix *= aiMatrix3x3(temp);
|
||||||
break;
|
} break;
|
||||||
case Channel_RotationY:
|
case Channel_RotationY: {
|
||||||
{
|
|
||||||
const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f;
|
const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f;
|
||||||
aiMatrix4x4::RotationY( angle, temp); rotMatrix *= aiMatrix3x3( temp);
|
aiMatrix4x4::RotationY(angle, temp);
|
||||||
}
|
rotMatrix *= aiMatrix3x3(temp);
|
||||||
break;
|
} break;
|
||||||
case Channel_RotationZ:
|
case Channel_RotationZ: {
|
||||||
{
|
|
||||||
const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f;
|
const float angle = node.mChannelValues[fr * node.mChannels.size() + channelIdx] * float(AI_MATH_PI) / 180.0f;
|
||||||
aiMatrix4x4::RotationZ( angle, temp); rotMatrix *= aiMatrix3x3( temp);
|
aiMatrix4x4::RotationZ(angle, temp);
|
||||||
}
|
rotMatrix *= aiMatrix3x3(temp);
|
||||||
break;
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rotkey->mTime = double(fr);
|
rotkey->mTime = double(fr);
|
||||||
rotkey->mValue = aiQuaternion(rotMatrix);
|
rotkey->mValue = aiQuaternion(rotMatrix);
|
||||||
++rotkey;
|
++rotkey;
|
||||||
|
@ -533,4 +523,6 @@ void BVHLoader::CreateAnimation(aiScene *pScene) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Assimp
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_BVH_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_BVH_IMPORTER
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -112,7 +112,7 @@ protected:
|
||||||
/** Reads the hierarchy */
|
/** Reads the hierarchy */
|
||||||
void ReadHierarchy(aiScene *pScene);
|
void ReadHierarchy(aiScene *pScene);
|
||||||
|
|
||||||
/** Reads a node and recursively its childs and returns the created node. */
|
/** Reads a node and recursively its children and returns the created node. */
|
||||||
aiNode *ReadNode();
|
aiNode *ReadNode();
|
||||||
|
|
||||||
/** Reads an end node and returns the created node. */
|
/** Reads an end node and returns the created node. */
|
||||||
|
@ -134,7 +134,8 @@ protected:
|
||||||
float GetNextTokenAsFloat();
|
float GetNextTokenAsFloat();
|
||||||
|
|
||||||
/** Aborts the file reading with an exception */
|
/** Aborts the file reading with an exception */
|
||||||
AI_WONT_RETURN void ThrowException(const std::string &pError) AI_WONT_RETURN_SUFFIX;
|
template<typename... T>
|
||||||
|
AI_WONT_RETURN void ThrowException(T&&... args) AI_WONT_RETURN_SUFFIX;
|
||||||
|
|
||||||
/** Constructs an animation for the motion data and stores it in the given scene */
|
/** Constructs an animation for the motion data and stores it in the given scene */
|
||||||
void CreateAnimation(aiScene *pScene);
|
void CreateAnimation(aiScene *pScene);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
@ -52,8 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
template <>
|
template <>
|
||||||
const char *LogFunctions<BlenderBMeshConverter>::Prefix() {
|
const char *LogFunctions<BlenderBMeshConverter>::Prefix() {
|
||||||
static auto prefix = "BLEND_BMESH: ";
|
return "BLEND_BMESH: ";
|
||||||
return prefix;
|
|
||||||
}
|
}
|
||||||
} // namespace Assimp
|
} // namespace Assimp
|
||||||
|
|
||||||
|
@ -140,7 +139,7 @@ void BlenderBMeshConverter::ConvertPolyToFaces(const MPoly &poly) {
|
||||||
ThrowException("BMesh uv loop array has incorrect size");
|
ThrowException("BMesh uv loop array has incorrect size");
|
||||||
}
|
}
|
||||||
const MLoopUV *loopUV = &BMesh->mloopuv[poly.loopstart];
|
const MLoopUV *loopUV = &BMesh->mloopuv[poly.loopstart];
|
||||||
AddTFace(loopUV[0].uv, loopUV[1].uv, loopUV[2].uv, poly.totloop == 4 ? loopUV[3].uv : 0);
|
AddTFace(loopUV[0].uv, loopUV[1].uv, loopUV[2].uv, poly.totloop == 4 ? loopUV[3].uv : nullptr);
|
||||||
}
|
}
|
||||||
} else if (poly.totloop > 4) {
|
} else if (poly.totloop > 4) {
|
||||||
#if ASSIMP_BLEND_WITH_GLU_TESSELLATE
|
#if ASSIMP_BLEND_WITH_GLU_TESSELLATE
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
|
@ -80,7 +80,7 @@ namespace Assimp
|
||||||
void DestroyTriMesh( );
|
void DestroyTriMesh( );
|
||||||
void ConvertPolyToFaces( const Blender::MPoly& poly );
|
void ConvertPolyToFaces( const Blender::MPoly& poly );
|
||||||
void AddFace( int v1, int v2, int v3, int v4 = 0 );
|
void AddFace( int v1, int v2, int v3, int v4 = 0 );
|
||||||
void AddTFace( const float* uv1, const float* uv2, const float *uv3, const float* uv4 = 0 );
|
void AddTFace(const float *uv1, const float *uv2, const float *uv3, const float *uv4 = nullptr);
|
||||||
|
|
||||||
const Blender::Mesh* BMesh;
|
const Blender::Mesh* BMesh;
|
||||||
Blender::Mesh* triMesh;
|
Blender::Mesh* triMesh;
|
||||||
|
|
|
@ -96,7 +96,8 @@ struct CustomDataTypeDescription {
|
||||||
* other (like CD_ORCO, ...) uses arrays of rawtypes or even arrays of Structures
|
* other (like CD_ORCO, ...) uses arrays of rawtypes or even arrays of Structures
|
||||||
* use a special readfunction for that cases
|
* use a special readfunction for that cases
|
||||||
*/
|
*/
|
||||||
std::array<CustomDataTypeDescription, CD_NUMTYPES> customDataTypeDescriptions = { { DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MVert),
|
static std::array<CustomDataTypeDescription, CD_NUMTYPES> customDataTypeDescriptions = { {
|
||||||
|
DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MVert),
|
||||||
DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION,
|
DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION,
|
||||||
DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION,
|
DECL_UNSUPPORTED_CUSTOMDATATYPEDESCRIPTION,
|
||||||
DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MEdge),
|
DECL_STRUCT_CUSTOMDATATYPEDESCRIPTION(MEdge),
|
||||||
|
@ -149,7 +150,7 @@ bool isValidCustomDataType(const int cdtype) {
|
||||||
|
|
||||||
bool readCustomData(std::shared_ptr<ElemBase> &out, const int cdtype, const size_t cnt, const FileDatabase &db) {
|
bool readCustomData(std::shared_ptr<ElemBase> &out, const int cdtype, const size_t cnt, const FileDatabase &db) {
|
||||||
if (!isValidCustomDataType(cdtype)) {
|
if (!isValidCustomDataType(cdtype)) {
|
||||||
throw Error((Formatter::format(), "CustomData.type ", cdtype, " out of index"));
|
throw Error("CustomData.type ", cdtype, " out of index");
|
||||||
}
|
}
|
||||||
|
|
||||||
const CustomDataTypeDescription cdtd = customDataTypeDescriptions[cdtype];
|
const CustomDataTypeDescription cdtd = customDataTypeDescriptions[cdtype];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -72,7 +72,7 @@ struct Type {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void DNAParser::Parse() {
|
void DNAParser::Parse() {
|
||||||
StreamReaderAny &stream = *db.reader.get();
|
StreamReaderAny &stream = *db.reader;
|
||||||
DNA &dna = db.dna;
|
DNA &dna = db.dna;
|
||||||
|
|
||||||
if (!match4(stream, "SDNA")) {
|
if (!match4(stream, "SDNA")) {
|
||||||
|
@ -130,9 +130,7 @@ void DNAParser::Parse() {
|
||||||
|
|
||||||
uint16_t n = stream.GetI2();
|
uint16_t n = stream.GetI2();
|
||||||
if (n >= types.size()) {
|
if (n >= types.size()) {
|
||||||
throw DeadlyImportError((format(),
|
throw DeadlyImportError("BlenderDNA: Invalid type index in structure name", n, " (there are only ", types.size(), " entries)");
|
||||||
"BlenderDNA: Invalid type index in structure name", n,
|
|
||||||
" (there are only ", types.size(), " entries)"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// maintain separate indexes
|
// maintain separate indexes
|
||||||
|
@ -141,7 +139,6 @@ void DNAParser::Parse() {
|
||||||
dna.structures.push_back(Structure());
|
dna.structures.push_back(Structure());
|
||||||
Structure &s = dna.structures.back();
|
Structure &s = dna.structures.back();
|
||||||
s.name = types[n].name;
|
s.name = types[n].name;
|
||||||
//s.index = dna.structures.size()-1;
|
|
||||||
|
|
||||||
n = stream.GetI2();
|
n = stream.GetI2();
|
||||||
s.fields.reserve(n);
|
s.fields.reserve(n);
|
||||||
|
@ -151,9 +148,7 @@ void DNAParser::Parse() {
|
||||||
|
|
||||||
uint16_t j = stream.GetI2();
|
uint16_t j = stream.GetI2();
|
||||||
if (j >= types.size()) {
|
if (j >= types.size()) {
|
||||||
throw DeadlyImportError((format(),
|
throw DeadlyImportError("BlenderDNA: Invalid type index in structure field ", j, " (there are only ", types.size(), " entries)");
|
||||||
"BlenderDNA: Invalid type index in structure field ", j,
|
|
||||||
" (there are only ", types.size(), " entries)"));
|
|
||||||
}
|
}
|
||||||
s.fields.push_back(Field());
|
s.fields.push_back(Field());
|
||||||
Field &f = s.fields.back();
|
Field &f = s.fields.back();
|
||||||
|
@ -164,9 +159,7 @@ void DNAParser::Parse() {
|
||||||
|
|
||||||
j = stream.GetI2();
|
j = stream.GetI2();
|
||||||
if (j >= names.size()) {
|
if (j >= names.size()) {
|
||||||
throw DeadlyImportError((format(),
|
throw DeadlyImportError("BlenderDNA: Invalid name index in structure field ", j, " (there are only ", names.size(), " entries)");
|
||||||
"BlenderDNA: Invalid name index in structure field ", j,
|
|
||||||
" (there are only ", names.size(), " entries)"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f.name = names[j];
|
f.name = names[j];
|
||||||
|
@ -188,9 +181,7 @@ void DNAParser::Parse() {
|
||||||
if (*f.name.rbegin() == ']') {
|
if (*f.name.rbegin() == ']') {
|
||||||
const std::string::size_type rb = f.name.find('[');
|
const std::string::size_type rb = f.name.find('[');
|
||||||
if (rb == std::string::npos) {
|
if (rb == std::string::npos) {
|
||||||
throw DeadlyImportError((format(),
|
throw DeadlyImportError("BlenderDNA: Encountered invalid array declaration ", f.name);
|
||||||
"BlenderDNA: Encountered invalid array declaration ",
|
|
||||||
f.name));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f.flags |= FieldFlag_Array;
|
f.flags |= FieldFlag_Array;
|
||||||
|
@ -207,9 +198,9 @@ void DNAParser::Parse() {
|
||||||
s.size = offset;
|
s.size = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSIMP_LOG_DEBUG_F("BlenderDNA: Got ", dna.structures.size(), " structures with totally ", fields, " fields");
|
ASSIMP_LOG_DEBUG("BlenderDNA: Got ", dna.structures.size(), " structures with totally ", fields, " fields");
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_BLENDER_DEBUG
|
#if ASSIMP_BUILD_BLENDER_DEBUG_DNA
|
||||||
dna.DumpToFile();
|
dna.DumpToFile();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -217,7 +208,7 @@ void DNAParser::Parse() {
|
||||||
dna.RegisterConverters();
|
dna.RegisterConverters();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_BLENDER_DEBUG
|
#if ASSIMP_BUILD_BLENDER_DEBUG_DNA
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -246,7 +237,7 @@ void DNA ::DumpToFile() {
|
||||||
|
|
||||||
ASSIMP_LOG_INFO("BlenderDNA: Dumped dna to dna.txt");
|
ASSIMP_LOG_INFO("BlenderDNA: Dumped dna to dna.txt");
|
||||||
}
|
}
|
||||||
#endif
|
#endif // ASSIMP_BUILD_BLENDER_DEBUG_DNA
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
/*static*/ void DNA ::ExtractArraySize(
|
/*static*/ void DNA ::ExtractArraySize(
|
||||||
|
@ -334,10 +325,10 @@ void SectionParser ::Next() {
|
||||||
stream.SetCurrentPos(current.start + current.size);
|
stream.SetCurrentPos(current.start + current.size);
|
||||||
|
|
||||||
const char tmp[] = {
|
const char tmp[] = {
|
||||||
(const char)stream.GetI1(),
|
(char)stream.GetI1(),
|
||||||
(const char)stream.GetI1(),
|
(char)stream.GetI1(),
|
||||||
(const char)stream.GetI1(),
|
(char)stream.GetI1(),
|
||||||
(const char)stream.GetI1()
|
(char)stream.GetI1()
|
||||||
};
|
};
|
||||||
current.id = std::string(tmp, tmp[3] ? 4 : tmp[2] ? 3 : tmp[1] ? 2 : 1);
|
current.id = std::string(tmp, tmp[3] ? 4 : tmp[2] ? 3 : tmp[1] ? 2 : 1);
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -59,6 +59,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define ASSIMP_BUILD_BLENDER_DEBUG
|
#define ASSIMP_BUILD_BLENDER_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// set this to non-zero to dump BlenderDNA stuff to dna.txt.
|
||||||
|
// you could set it on the assimp build command line too without touching it here.
|
||||||
|
// !!! please make sure this is set to 0 in the repo !!!
|
||||||
|
#ifndef ASSIMP_BUILD_BLENDER_DEBUG_DNA
|
||||||
|
#define ASSIMP_BUILD_BLENDER_DEBUG_DNA 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// #define ASSIMP_BUILD_BLENDER_NO_STATS
|
// #define ASSIMP_BUILD_BLENDER_NO_STATS
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
@ -83,9 +90,9 @@ class ObjectCache;
|
||||||
* ancestry. */
|
* ancestry. */
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct Error : DeadlyImportError {
|
struct Error : DeadlyImportError {
|
||||||
Error(const std::string &s) :
|
template <typename... T>
|
||||||
DeadlyImportError(s) {
|
explicit Error(T &&...args) :
|
||||||
// empty
|
DeadlyImportError(args...) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,9 +106,7 @@ struct ElemBase {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~ElemBase() {
|
virtual ~ElemBase() = default;
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Type name of the element. The type
|
/** Type name of the element. The type
|
||||||
* string points is the `c_str` of the `name` attribute of the
|
* string points is the `c_str` of the `name` attribute of the
|
||||||
|
@ -186,7 +191,7 @@ struct Field {
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** Range of possible behaviours for fields absend in the input file. Some are
|
/** Range of possible behaviors for fields absence in the input file. Some are
|
||||||
* mission critical so we need them, while others can silently be default
|
* mission critical so we need them, while others can silently be default
|
||||||
* initialized and no animations are harmed. */
|
* initialized and no animations are harmed. */
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
@ -230,7 +235,7 @@ public:
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
/** Access a field of the structure by its canonical name. The pointer version
|
/** Access a field of the structure by its canonical name. The pointer version
|
||||||
* returns NULL on failure while the reference version raises an import error. */
|
* returns nullptr on failure while the reference version raises an import error. */
|
||||||
inline const Field &operator[](const std::string &ss) const;
|
inline const Field &operator[](const std::string &ss) const;
|
||||||
inline const Field *Get(const std::string &ss) const;
|
inline const Field *Get(const std::string &ss) const;
|
||||||
|
|
||||||
|
@ -359,7 +364,7 @@ private:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T *_allocate(vector<T> &out, size_t &s) const {
|
T *_allocate(vector<T> &out, size_t &s) const {
|
||||||
out.resize(s);
|
out.resize(s);
|
||||||
return s ? &out.front() : NULL;
|
return s ? &out.front() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
@ -367,14 +372,14 @@ private:
|
||||||
struct _defaultInitializer {
|
struct _defaultInitializer {
|
||||||
|
|
||||||
template <typename T, unsigned int N>
|
template <typename T, unsigned int N>
|
||||||
void operator()(T (&out)[N], const char * = NULL) {
|
void operator()(T (&out)[N], const char * = nullptr) {
|
||||||
for (unsigned int i = 0; i < N; ++i) {
|
for (unsigned int i = 0; i < N; ++i) {
|
||||||
out[i] = T();
|
out[i] = T();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, unsigned int N, unsigned int M>
|
template <typename T, unsigned int N, unsigned int M>
|
||||||
void operator()(T (&out)[N][M], const char * = NULL) {
|
void operator()(T (&out)[N][M], const char * = nullptr) {
|
||||||
for (unsigned int i = 0; i < N; ++i) {
|
for (unsigned int i = 0; i < N; ++i) {
|
||||||
for (unsigned int j = 0; j < M; ++j) {
|
for (unsigned int j = 0; j < M; ++j) {
|
||||||
out[i][j] = T();
|
out[i][j] = T();
|
||||||
|
@ -383,7 +388,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void operator()(T &out, const char * = NULL) {
|
void operator()(T &out, const char * = nullptr) {
|
||||||
out = T();
|
out = T();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -394,7 +399,7 @@ private:
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
template <>
|
template <>
|
||||||
struct Structure ::_defaultInitializer<ErrorPolicy_Warn> {
|
struct Structure::_defaultInitializer<ErrorPolicy_Warn> {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void operator()(T &out, const char *reason = "<add reason>") {
|
void operator()(T &out, const char *reason = "<add reason>") {
|
||||||
|
@ -406,13 +411,13 @@ struct Structure ::_defaultInitializer<ErrorPolicy_Warn> {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct Structure ::_defaultInitializer<ErrorPolicy_Fail> {
|
struct Structure::_defaultInitializer<ErrorPolicy_Fail> {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void operator()(T & /*out*/, const char * = "") {
|
void operator()(T & /*out*/, const char *message = "") {
|
||||||
// obviously, it is crucial that _DefaultInitializer is used
|
// obviously, it is crucial that _DefaultInitializer is used
|
||||||
// only from within a catch clause.
|
// only from within a catch clause.
|
||||||
throw DeadlyImportError("Constructing BlenderDNA Structure encountered an error");
|
throw DeadlyImportError("Constructing BlenderDNA Structure encountered an error: ", message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -424,6 +429,17 @@ inline bool Structure ::ResolvePointer<std::shared_ptr, ElemBase>(std::shared_pt
|
||||||
const Field &f,
|
const Field &f,
|
||||||
bool) const;
|
bool) const;
|
||||||
|
|
||||||
|
template <> bool Structure :: ResolvePointer<std::shared_ptr,ElemBase>(
|
||||||
|
std::shared_ptr<ElemBase>& out, const Pointer & ptrval,
|
||||||
|
const FileDatabase& db, const Field&, bool) const;
|
||||||
|
template <> inline void Structure :: Convert<int> (int& dest,const FileDatabase& db) const;
|
||||||
|
template<> inline void Structure :: Convert<short> (short& dest,const FileDatabase& db) const;
|
||||||
|
template <> inline void Structure :: Convert<char> (char& dest,const FileDatabase& db) const;
|
||||||
|
template <> inline void Structure::Convert<unsigned char>(unsigned char& dest, const FileDatabase& db) const;
|
||||||
|
template <> inline void Structure :: Convert<float> (float& dest,const FileDatabase& db) const;
|
||||||
|
template <> inline void Structure :: Convert<double> (double& dest,const FileDatabase& db) const;
|
||||||
|
template <> inline void Structure :: Convert<Pointer> (Pointer& dest,const FileDatabase& db) const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** Represents the full data structure information for a single BLEND file.
|
/** Represents the full data structure information for a single BLEND file.
|
||||||
* This data is extracted from the DNA1 chunk in the file.
|
* This data is extracted from the DNA1 chunk in the file.
|
||||||
|
@ -448,7 +464,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
/** Access a structure by its canonical name, the pointer version returns NULL on failure
|
/** Access a structure by its canonical name, the pointer version returns nullptr on failure
|
||||||
* while the reference version raises an error. */
|
* while the reference version raises an error. */
|
||||||
inline const Structure &operator[](const std::string &ss) const;
|
inline const Structure &operator[](const std::string &ss) const;
|
||||||
inline const Structure *Get(const std::string &ss) const;
|
inline const Structure *Get(const std::string &ss) const;
|
||||||
|
@ -469,7 +485,7 @@ public:
|
||||||
* in BlenderScene.cpp and is machine-generated.
|
* in BlenderScene.cpp and is machine-generated.
|
||||||
* Converters are used to quickly handle objects whose
|
* Converters are used to quickly handle objects whose
|
||||||
* exact data type is a runtime-property and not yet
|
* exact data type is a runtime-property and not yet
|
||||||
* known at compile time (consier Object::data).*/
|
* known at compile time (consider Object::data).*/
|
||||||
void RegisterConverters();
|
void RegisterConverters();
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
@ -495,7 +511,7 @@ public:
|
||||||
const Structure &structure,
|
const Structure &structure,
|
||||||
const FileDatabase &db) const;
|
const FileDatabase &db) const;
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_BLENDER_DEBUG
|
#if ASSIMP_BUILD_BLENDER_DEBUG_DNA
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
/** Dump the DNA to a text file. This is for debugging purposes.
|
/** Dump the DNA to a text file. This is for debugging purposes.
|
||||||
* The output file is `dna.txt` in the current working folder*/
|
* The output file is `dna.txt` in the current working folder*/
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -57,9 +57,7 @@ const Field& Structure :: operator [] (const std::string& ss) const
|
||||||
{
|
{
|
||||||
std::map<std::string, size_t>::const_iterator it = indices.find(ss);
|
std::map<std::string, size_t>::const_iterator it = indices.find(ss);
|
||||||
if (it == indices.end()) {
|
if (it == indices.end()) {
|
||||||
throw Error((Formatter::format(),
|
throw Error("BlendDNA: Did not find a field named `",ss,"` in structure `",name,"`");
|
||||||
"BlendDNA: Did not find a field named `",ss,"` in structure `",name,"`"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fields[(*it).second];
|
return fields[(*it).second];
|
||||||
|
@ -69,16 +67,14 @@ const Field& Structure :: operator [] (const std::string& ss) const
|
||||||
const Field* Structure :: Get (const std::string& ss) const
|
const Field* Structure :: Get (const std::string& ss) const
|
||||||
{
|
{
|
||||||
std::map<std::string, size_t>::const_iterator it = indices.find(ss);
|
std::map<std::string, size_t>::const_iterator it = indices.find(ss);
|
||||||
return it == indices.end() ? NULL : &fields[(*it).second];
|
return it == indices.end() ? nullptr : &fields[(*it).second];
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
const Field& Structure :: operator [] (const size_t i) const
|
const Field& Structure :: operator [] (const size_t i) const
|
||||||
{
|
{
|
||||||
if (i >= fields.size()) {
|
if (i >= fields.size()) {
|
||||||
throw Error((Formatter::format(),
|
throw Error("BlendDNA: There is no field with index `",i,"` in structure `",name,"`");
|
||||||
"BlendDNA: There is no field with index `",i,"` in structure `",name,"`"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fields[i];
|
return fields[i];
|
||||||
|
@ -109,9 +105,7 @@ void Structure :: ReadFieldArray(T (& out)[M], const char* name, const FileDatab
|
||||||
|
|
||||||
// is the input actually an array?
|
// is the input actually an array?
|
||||||
if (!(f.flags & FieldFlag_Array)) {
|
if (!(f.flags & FieldFlag_Array)) {
|
||||||
throw Error((Formatter::format(),"Field `",name,"` of structure `",
|
throw Error("Field `",name,"` of structure `",this->name,"` ought to be an array of size ",M);
|
||||||
this->name,"` ought to be an array of size ",M
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
db.reader->IncPtr(f.offset);
|
db.reader->IncPtr(f.offset);
|
||||||
|
@ -148,9 +142,9 @@ void Structure :: ReadFieldArray2(T (& out)[M][N], const char* name, const FileD
|
||||||
|
|
||||||
// is the input actually an array?
|
// is the input actually an array?
|
||||||
if (!(f.flags & FieldFlag_Array)) {
|
if (!(f.flags & FieldFlag_Array)) {
|
||||||
throw Error((Formatter::format(),"Field `",name,"` of structure `",
|
throw Error("Field `",name,"` of structure `",
|
||||||
this->name,"` ought to be an array of size ",M,"*",N
|
this->name,"` ought to be an array of size ",M,"*",N
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
db.reader->IncPtr(f.offset);
|
db.reader->IncPtr(f.offset);
|
||||||
|
@ -195,8 +189,8 @@ bool Structure :: ReadFieldPtr(TOUT<T>& out, const char* name, const FileDatabas
|
||||||
|
|
||||||
// sanity check, should never happen if the genblenddna script is right
|
// sanity check, should never happen if the genblenddna script is right
|
||||||
if (!(f->flags & FieldFlag_Pointer)) {
|
if (!(f->flags & FieldFlag_Pointer)) {
|
||||||
throw Error((Formatter::format(),"Field `",name,"` of structure `",
|
throw Error("Field `",name,"` of structure `",
|
||||||
this->name,"` ought to be a pointer"));
|
this->name,"` ought to be a pointer");
|
||||||
}
|
}
|
||||||
|
|
||||||
db.reader->IncPtr(f->offset);
|
db.reader->IncPtr(f->offset);
|
||||||
|
@ -241,8 +235,8 @@ bool Structure :: ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// sanity check, should never happen if the genblenddna script is right
|
// sanity check, should never happen if the genblenddna script is right
|
||||||
if ((FieldFlag_Pointer|FieldFlag_Pointer) != (f->flags & (FieldFlag_Pointer|FieldFlag_Pointer))) {
|
if ((FieldFlag_Pointer|FieldFlag_Pointer) != (f->flags & (FieldFlag_Pointer|FieldFlag_Pointer))) {
|
||||||
throw Error((Formatter::format(),"Field `",name,"` of structure `",
|
throw Error("Field `",name,"` of structure `",
|
||||||
this->name,"` ought to be a pointer AND an array"));
|
this->name,"` ought to be a pointer AND an array");
|
||||||
}
|
}
|
||||||
#endif // _DEBUG
|
#endif // _DEBUG
|
||||||
|
|
||||||
|
@ -322,8 +316,8 @@ bool Structure::ReadCustomDataPtr(std::shared_ptr<ElemBase>&out, int cdtype, con
|
||||||
|
|
||||||
// sanity check, should never happen if the genblenddna script is right
|
// sanity check, should never happen if the genblenddna script is right
|
||||||
if (!(f->flags & FieldFlag_Pointer)) {
|
if (!(f->flags & FieldFlag_Pointer)) {
|
||||||
throw Error((Formatter::format(), "Field `", name, "` of structure `",
|
throw Error("Field `", name, "` of structure `",
|
||||||
this->name, "` ought to be a pointer"));
|
this->name, "` ought to be a pointer");
|
||||||
}
|
}
|
||||||
|
|
||||||
db.reader->IncPtr(f->offset);
|
db.reader->IncPtr(f->offset);
|
||||||
|
@ -369,8 +363,8 @@ bool Structure::ReadFieldPtrVector(vector<TOUT<T>>&out, const char* name, const
|
||||||
|
|
||||||
// sanity check, should never happen if the genblenddna script is right
|
// sanity check, should never happen if the genblenddna script is right
|
||||||
if (!(f->flags & FieldFlag_Pointer)) {
|
if (!(f->flags & FieldFlag_Pointer)) {
|
||||||
throw Error((Formatter::format(), "Field `", name, "` of structure `",
|
throw Error("Field `", name, "` of structure `",
|
||||||
this->name, "` ought to be a pointer"));
|
this->name, "` ought to be a pointer");
|
||||||
}
|
}
|
||||||
|
|
||||||
db.reader->IncPtr(f->offset);
|
db.reader->IncPtr(f->offset);
|
||||||
|
@ -428,9 +422,9 @@ bool Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const Fil
|
||||||
// and check if it matches the type which we expect.
|
// and check if it matches the type which we expect.
|
||||||
const Structure& ss = db.dna[block->dna_index];
|
const Structure& ss = db.dna[block->dna_index];
|
||||||
if (ss != s) {
|
if (ss != s) {
|
||||||
throw Error((Formatter::format(),"Expected target to be of type `",s.name,
|
throw Error("Expected target to be of type `",s.name,
|
||||||
"` but seemingly it is a `",ss.name,"` instead"
|
"` but seemingly it is a `",ss.name,"` instead"
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to retrieve the object from the cache
|
// try to retrieve the object from the cache
|
||||||
|
@ -571,7 +565,7 @@ template <> bool Structure :: ResolvePointer<std::shared_ptr,ElemBase>(std::shar
|
||||||
// this might happen if DNA::RegisterConverters hasn't been called so far
|
// this might happen if DNA::RegisterConverters hasn't been called so far
|
||||||
// or if the target type is not contained in `our` DNA.
|
// or if the target type is not contained in `our` DNA.
|
||||||
out.reset();
|
out.reset();
|
||||||
ASSIMP_LOG_WARN_F( "Failed to find a converter for the `",s.name,"` structure" );
|
ASSIMP_LOG_WARN( "Failed to find a converter for the `",s.name,"` structure" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,16 +608,14 @@ const FileBlockHead* Structure :: LocateFileBlockForAddress(const Pointer & ptrv
|
||||||
if (it == db.entries.end()) {
|
if (it == db.entries.end()) {
|
||||||
// this is crucial, pointers may not be invalid.
|
// this is crucial, pointers may not be invalid.
|
||||||
// this is either a corrupted file or an attempted attack.
|
// this is either a corrupted file or an attempted attack.
|
||||||
throw DeadlyImportError((Formatter::format(),"Failure resolving pointer 0x",
|
throw DeadlyImportError("Failure resolving pointer 0x",
|
||||||
std::hex,ptrval.val,", no file block falls into this address range"
|
std::hex,ptrval.val,", no file block falls into this address range");
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (ptrval.val >= (*it).address.val + (*it).size) {
|
if (ptrval.val >= (*it).address.val + (*it).size) {
|
||||||
throw DeadlyImportError((Formatter::format(),"Failure resolving pointer 0x",
|
throw DeadlyImportError("Failure resolving pointer 0x",
|
||||||
std::hex,ptrval.val,", nearest file block starting at 0x",
|
std::hex,ptrval.val,", nearest file block starting at 0x",
|
||||||
(*it).address.val," ends at 0x",
|
(*it).address.val," ends at 0x",
|
||||||
(*it).address.val + (*it).size
|
(*it).address.val + (*it).size);
|
||||||
));
|
|
||||||
}
|
}
|
||||||
return &*it;
|
return &*it;
|
||||||
}
|
}
|
||||||
|
@ -676,7 +668,7 @@ template <typename T> inline void ConvertDispatcher(T& out, const Structure& in,
|
||||||
out = static_cast<T>(db.reader->GetF8());
|
out = static_cast<T>(db.reader->GetF8());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw DeadlyImportError("Unknown source for conversion to primitive data type: "+in.name);
|
throw DeadlyImportError("Unknown source for conversion to primitive data type: ", in.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,9 +776,7 @@ const Structure& DNA :: operator [] (const std::string& ss) const
|
||||||
{
|
{
|
||||||
std::map<std::string, size_t>::const_iterator it = indices.find(ss);
|
std::map<std::string, size_t>::const_iterator it = indices.find(ss);
|
||||||
if (it == indices.end()) {
|
if (it == indices.end()) {
|
||||||
throw Error((Formatter::format(),
|
throw Error("BlendDNA: Did not find a structure named `",ss,"`");
|
||||||
"BlendDNA: Did not find a structure named `",ss,"`"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return structures[(*it).second];
|
return structures[(*it).second];
|
||||||
|
@ -803,9 +793,7 @@ const Structure* DNA :: Get (const std::string& ss) const
|
||||||
const Structure& DNA :: operator [] (const size_t i) const
|
const Structure& DNA :: operator [] (const size_t i) const
|
||||||
{
|
{
|
||||||
if (i >= structures.size()) {
|
if (i >= structures.size()) {
|
||||||
throw Error((Formatter::format(),
|
throw Error("BlendDNA: There is no structure with index `",i,"`");
|
||||||
"BlendDNA: There is no structure with index `",i,"`"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return structures[i];
|
return structures[i];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -65,8 +65,7 @@ namespace Blender {
|
||||||
struct TempArray {
|
struct TempArray {
|
||||||
typedef TCLASS< T*,std::allocator<T*> > mywrap;
|
typedef TCLASS< T*,std::allocator<T*> > mywrap;
|
||||||
|
|
||||||
TempArray() {
|
TempArray() = default;
|
||||||
}
|
|
||||||
|
|
||||||
~TempArray () {
|
~TempArray () {
|
||||||
for(T* elem : arr) {
|
for(T* elem : arr) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,8 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
@ -43,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** @file BlenderLoader.h
|
/** @file BlenderLoader.h
|
||||||
* @brief Declaration of the Blender 3D (*.blend) importer class.
|
* @brief Declaration of the Blender 3D (*.blend) importer class.
|
||||||
*/
|
*/
|
||||||
|
#pragma once
|
||||||
#ifndef INCLUDED_AI_BLEND_LOADER_H
|
#ifndef INCLUDED_AI_BLEND_LOADER_H
|
||||||
#define INCLUDED_AI_BLEND_LOADER_H
|
#define INCLUDED_AI_BLEND_LOADER_H
|
||||||
|
|
||||||
|
@ -56,183 +56,154 @@ struct aiLight;
|
||||||
struct aiCamera;
|
struct aiCamera;
|
||||||
struct aiMaterial;
|
struct aiMaterial;
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
// TinyFormatter.h
|
// TinyFormatter.h
|
||||||
namespace Formatter {
|
namespace Formatter {
|
||||||
template <typename T,typename TR, typename A> class basic_formatter;
|
|
||||||
typedef class basic_formatter< char, std::char_traits<char>, std::allocator<char> > format;
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlenderDNA.h
|
template <typename T, typename TR, typename A>
|
||||||
namespace Blender {
|
class basic_formatter;
|
||||||
class FileDatabase;
|
|
||||||
struct ElemBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlenderScene.h
|
typedef class basic_formatter<char, std::char_traits<char>, std::allocator<char>> format;
|
||||||
namespace Blender {
|
|
||||||
struct Scene;
|
|
||||||
struct Object;
|
|
||||||
struct Mesh;
|
|
||||||
struct Camera;
|
|
||||||
struct Lamp;
|
|
||||||
struct MTex;
|
|
||||||
struct Image;
|
|
||||||
struct Material;
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlenderIntermediate.h
|
} // namespace Formatter
|
||||||
namespace Blender {
|
|
||||||
struct ConversionData;
|
|
||||||
template <template <typename,typename> class TCLASS, typename T> struct TempArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlenderModifier.h
|
// BlenderDNA.h
|
||||||
namespace Blender {
|
namespace Blender {
|
||||||
class BlenderModifierShowcase;
|
class FileDatabase;
|
||||||
class BlenderModifier;
|
struct ElemBase;
|
||||||
}
|
} // namespace Blender
|
||||||
|
|
||||||
|
// BlenderScene.h
|
||||||
|
namespace Blender {
|
||||||
|
struct Scene;
|
||||||
|
struct Object;
|
||||||
|
struct Collection;
|
||||||
|
struct Mesh;
|
||||||
|
struct Camera;
|
||||||
|
struct Lamp;
|
||||||
|
struct MTex;
|
||||||
|
struct Image;
|
||||||
|
struct Material;
|
||||||
|
} // namespace Blender
|
||||||
|
|
||||||
|
// BlenderIntermediate.h
|
||||||
|
namespace Blender {
|
||||||
|
struct ConversionData;
|
||||||
|
template <template <typename, typename> class TCLASS, typename T>
|
||||||
|
struct TempArray;
|
||||||
|
} // namespace Blender
|
||||||
|
|
||||||
|
// BlenderModifier.h
|
||||||
|
namespace Blender {
|
||||||
|
class BlenderModifierShowcase;
|
||||||
|
class BlenderModifier;
|
||||||
|
} // namespace Blender
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
/** Load blenders official binary format. The actual file structure (the `DNA` how they
|
/** Load blenders official binary format. The actual file structure (the `DNA` how they
|
||||||
* call it is outsourced to BlenderDNA.cpp/BlenderDNA.h. This class only performs the
|
* call it is outsourced to BlenderDNA.cpp/BlenderDNA.h. This class only performs the
|
||||||
* conversion from intermediate format to aiScene. */
|
* conversion from intermediate format to aiScene. */
|
||||||
// -------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------
|
||||||
class BlenderImporter : public BaseImporter, public LogFunctions<BlenderImporter>
|
class BlenderImporter : public BaseImporter, public LogFunctions<BlenderImporter> {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
BlenderImporter();
|
BlenderImporter();
|
||||||
~BlenderImporter();
|
~BlenderImporter() override;
|
||||||
|
bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const override;
|
||||||
public:
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
bool CanRead( const std::string& pFile,
|
|
||||||
IOSystem* pIOHandler,
|
|
||||||
bool checkSig
|
|
||||||
) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
const aiImporterDesc *GetInfo() const override;
|
||||||
// --------------------
|
void SetupProperties(const Importer *pImp) override;
|
||||||
const aiImporterDesc* GetInfo () const;
|
void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) override;
|
||||||
|
void ParseBlendFile(Blender::FileDatabase &out, std::shared_ptr<IOStream> stream);
|
||||||
// --------------------
|
void ExtractScene(Blender::Scene &out, const Blender::FileDatabase &file);
|
||||||
void GetExtensionList(std::set<std::string>& app);
|
void ParseSubCollection(const Blender::Scene &in, aiNode *root, const std::shared_ptr<Blender::Collection>& collection, Blender::ConversionData &conv_data);
|
||||||
|
void ConvertBlendFile(aiScene *out, const Blender::Scene &in, const Blender::FileDatabase &file);
|
||||||
// --------------------
|
|
||||||
void SetupProperties(const Importer* pImp);
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
void InternReadFile( const std::string& pFile,
|
|
||||||
aiScene* pScene,
|
|
||||||
IOSystem* pIOHandler
|
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
void ParseBlendFile(Blender::FileDatabase& out,
|
|
||||||
std::shared_ptr<IOStream> stream
|
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
void ExtractScene(Blender::Scene& out,
|
|
||||||
const Blender::FileDatabase& file
|
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
void ConvertBlendFile(aiScene* out,
|
|
||||||
const Blender::Scene& in,
|
|
||||||
const Blender::FileDatabase& file
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
aiNode *ConvertNode(const Blender::Scene &in,
|
||||||
|
const Blender::Object *obj,
|
||||||
|
Blender::ConversionData &conv_info,
|
||||||
|
const aiMatrix4x4 &parentTransform);
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
aiNode* ConvertNode(const Blender::Scene& in,
|
void ConvertMesh(const Blender::Scene &in,
|
||||||
const Blender::Object* obj,
|
const Blender::Object *obj,
|
||||||
Blender::ConversionData& conv_info,
|
const Blender::Mesh *mesh,
|
||||||
const aiMatrix4x4& parentTransform
|
Blender::ConversionData &conv_data,
|
||||||
);
|
Blender::TempArray<std::vector, aiMesh> &temp);
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void ConvertMesh(const Blender::Scene& in,
|
aiLight *ConvertLight(const Blender::Scene &in,
|
||||||
const Blender::Object* obj,
|
const Blender::Object *obj,
|
||||||
const Blender::Mesh* mesh,
|
const Blender::Lamp *mesh,
|
||||||
Blender::ConversionData& conv_data,
|
Blender::ConversionData &conv_data);
|
||||||
Blender::TempArray<std::vector,aiMesh>& temp
|
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
aiLight* ConvertLight(const Blender::Scene& in,
|
aiCamera *ConvertCamera(const Blender::Scene &in,
|
||||||
const Blender::Object* obj,
|
const Blender::Object *obj,
|
||||||
const Blender::Lamp* mesh,
|
const Blender::Camera *mesh,
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData &conv_data);
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
aiCamera* ConvertCamera(const Blender::Scene& in,
|
|
||||||
const Blender::Object* obj,
|
|
||||||
const Blender::Camera* mesh,
|
|
||||||
Blender::ConversionData& conv_data
|
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void BuildDefaultMaterial(
|
void BuildDefaultMaterial(
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData &conv_data);
|
||||||
);
|
|
||||||
|
|
||||||
|
// --------------------
|
||||||
void AddBlendParams(
|
void AddBlendParams(
|
||||||
aiMaterial* result,
|
aiMaterial *result,
|
||||||
const Blender::Material* source
|
const Blender::Material *source);
|
||||||
);
|
|
||||||
|
|
||||||
|
// --------------------
|
||||||
void BuildMaterials(
|
void BuildMaterials(
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData &conv_data);
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void ResolveTexture(
|
void ResolveTexture(
|
||||||
aiMaterial* out,
|
aiMaterial *out,
|
||||||
const Blender::Material* mat,
|
const Blender::Material *mat,
|
||||||
const Blender::MTex* tex,
|
const Blender::MTex *tex,
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData &conv_data);
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void ResolveImage(
|
void ResolveImage(
|
||||||
aiMaterial* out,
|
aiMaterial *out,
|
||||||
const Blender::Material* mat,
|
const Blender::Material *mat,
|
||||||
const Blender::MTex* tex,
|
const Blender::MTex *tex,
|
||||||
const Blender::Image* img,
|
const Blender::Image *img,
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData &conv_data);
|
||||||
);
|
|
||||||
|
|
||||||
|
// --------------------
|
||||||
void AddSentinelTexture(
|
void AddSentinelTexture(
|
||||||
aiMaterial* out,
|
aiMaterial *out,
|
||||||
const Blender::Material* mat,
|
const Blender::Material *mat,
|
||||||
const Blender::MTex* tex,
|
const Blender::MTex *tex,
|
||||||
Blender::ConversionData& conv_data
|
Blender::ConversionData &conv_data);
|
||||||
);
|
|
||||||
|
// TODO: Move to a std::variant, once c++17 is supported.
|
||||||
|
struct StreamOrError {
|
||||||
|
std::shared_ptr<IOStream> stream;
|
||||||
|
std::shared_ptr<std::vector<char>> input;
|
||||||
|
std::string error;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns either a stream (and optional input data for the stream) or
|
||||||
|
// an error if it can't parse the magic token.
|
||||||
|
StreamOrError ParseMagicToken(
|
||||||
|
const std::string &pFile,
|
||||||
|
IOSystem *pIOHandler) const;
|
||||||
|
|
||||||
private: // static stuff, mostly logging and error reporting.
|
private: // static stuff, mostly logging and error reporting.
|
||||||
|
// --------------------
|
||||||
|
static void CheckActualType(const Blender::ElemBase *dt,
|
||||||
|
const char *check);
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
static void CheckActualType(const Blender::ElemBase* dt,
|
static void NotSupportedObjectType(const Blender::Object *obj,
|
||||||
const char* check
|
const char *type);
|
||||||
);
|
|
||||||
|
|
||||||
// --------------------
|
|
||||||
static void NotSupportedObjectType(const Blender::Object* obj,
|
|
||||||
const char* type
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Blender::BlenderModifierShowcase *modifier_cache;
|
||||||
Blender::BlenderModifierShowcase* modifier_cache;
|
|
||||||
|
|
||||||
}; // !class BlenderImporter
|
}; // !class BlenderImporter
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -71,10 +71,6 @@ static const fpCreateModifier creators[] = {
|
||||||
nullptr // sentinel
|
nullptr // sentinel
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
struct SharedModifierData : ElemBase {
|
|
||||||
ModifierData modifier;
|
|
||||||
};
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void BlenderModifierShowcase::ApplyModifiers(aiNode &out, ConversionData &conv_data, const Scene &in, const Object &orig_object) {
|
void BlenderModifierShowcase::ApplyModifiers(aiNode &out, ConversionData &conv_data, const Scene &in, const Object &orig_object) {
|
||||||
|
@ -90,7 +86,7 @@ void BlenderModifierShowcase::ApplyModifiers(aiNode &out, ConversionData &conv_d
|
||||||
|
|
||||||
const Structure *s = conv_data.db.dna.Get(cur->dna_type);
|
const Structure *s = conv_data.db.dna.Get(cur->dna_type);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
ASSIMP_LOG_WARN_F("BlendModifier: could not resolve DNA name: ", cur->dna_type);
|
ASSIMP_LOG_WARN("BlendModifier: could not resolve DNA name: ", cur->dna_type);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +128,7 @@ void BlenderModifierShowcase::ApplyModifiers(aiNode &out, ConversionData &conv_d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (curgod) {
|
if (curgod) {
|
||||||
ASSIMP_LOG_WARN_F("Couldn't find a handler for modifier: ", dat.name);
|
ASSIMP_LOG_WARN("Couldn't find a handler for modifier: ", dat.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +136,7 @@ void BlenderModifierShowcase::ApplyModifiers(aiNode &out, ConversionData &conv_d
|
||||||
// object, we still can't say whether our modifier implementations were
|
// object, we still can't say whether our modifier implementations were
|
||||||
// able to fully do their job.
|
// able to fully do their job.
|
||||||
if (ful) {
|
if (ful) {
|
||||||
ASSIMP_LOG_DEBUG_F("BlendModifier: found handlers for ", cnt, " of ", ful, " modifiers on `", orig_object.id.name,
|
ASSIMP_LOG_DEBUG("BlendModifier: found handlers for ", cnt, " of ", ful, " modifiers on `", orig_object.id.name,
|
||||||
"`, check log messages above for errors");
|
"`, check log messages above for errors");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,6 +153,7 @@ void BlenderModifier_Mirror ::DoIt(aiNode &out, ConversionData &conv_data, const
|
||||||
// hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
|
// hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
|
||||||
const MirrorModifierData &mir = static_cast<const MirrorModifierData &>(orig_modifier);
|
const MirrorModifierData &mir = static_cast<const MirrorModifierData &>(orig_modifier);
|
||||||
ai_assert(mir.modifier.type == ModifierData::eModifierType_Mirror);
|
ai_assert(mir.modifier.type == ModifierData::eModifierType_Mirror);
|
||||||
|
std::shared_ptr<Object> mirror_ob = mir.mirror_ob.lock();
|
||||||
|
|
||||||
conv_data.meshes->reserve(conv_data.meshes->size() + out.mNumMeshes);
|
conv_data.meshes->reserve(conv_data.meshes->size() + out.mNumMeshes);
|
||||||
|
|
||||||
|
@ -171,8 +168,8 @@ void BlenderModifier_Mirror ::DoIt(aiNode &out, ConversionData &conv_data, const
|
||||||
const float ys = mir.flag & MirrorModifierData::Flags_AXIS_Y ? -1.f : 1.f;
|
const float ys = mir.flag & MirrorModifierData::Flags_AXIS_Y ? -1.f : 1.f;
|
||||||
const float zs = mir.flag & MirrorModifierData::Flags_AXIS_Z ? -1.f : 1.f;
|
const float zs = mir.flag & MirrorModifierData::Flags_AXIS_Z ? -1.f : 1.f;
|
||||||
|
|
||||||
if (mir.mirror_ob) {
|
if (mirror_ob) {
|
||||||
const aiVector3D center(mir.mirror_ob->obmat[3][0], mir.mirror_ob->obmat[3][1], mir.mirror_ob->obmat[3][2]);
|
const aiVector3D center(mirror_ob->obmat[3][0], mirror_ob->obmat[3][1], mirror_ob->obmat[3][2]);
|
||||||
for (unsigned int j = 0; j < mesh->mNumVertices; ++j) {
|
for (unsigned int j = 0; j < mesh->mNumVertices; ++j) {
|
||||||
aiVector3D &v = mesh->mVertices[j];
|
aiVector3D &v = mesh->mVertices[j];
|
||||||
|
|
||||||
|
@ -248,7 +245,7 @@ void BlenderModifier_Mirror ::DoIt(aiNode &out, ConversionData &conv_data, const
|
||||||
out.mMeshes = nind;
|
out.mMeshes = nind;
|
||||||
out.mNumMeshes *= 2;
|
out.mNumMeshes *= 2;
|
||||||
|
|
||||||
ASSIMP_LOG_INFO_F("BlendModifier: Applied the `Mirror` modifier to `",
|
ASSIMP_LOG_INFO("BlendModifier: Applied the `Mirror` modifier to `",
|
||||||
orig_object.id.name, "`");
|
orig_object.id.name, "`");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +274,7 @@ void BlenderModifier_Subdivision ::DoIt(aiNode &out, ConversionData &conv_data,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSIMP_LOG_WARN_F("BlendModifier: Unrecognized subdivision algorithm: ", mir.subdivType);
|
ASSIMP_LOG_WARN("BlendModifier: Unrecognized subdivision algorithm: ", mir.subdivType);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -286,13 +283,18 @@ void BlenderModifier_Subdivision ::DoIt(aiNode &out, ConversionData &conv_data,
|
||||||
if (conv_data.meshes->empty()) {
|
if (conv_data.meshes->empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const size_t meshIndex = conv_data.meshes->size() - out.mNumMeshes;
|
||||||
|
if (meshIndex >= conv_data.meshes->size()) {
|
||||||
|
ASSIMP_LOG_ERROR("Invalid index detected.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
aiMesh **const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes];
|
aiMesh **const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes];
|
||||||
std::unique_ptr<aiMesh *[]> tempmeshes(new aiMesh *[out.mNumMeshes]());
|
std::unique_ptr<aiMesh *[]> tempmeshes(new aiMesh *[out.mNumMeshes]());
|
||||||
|
|
||||||
subd->Subdivide(meshes, out.mNumMeshes, tempmeshes.get(), std::max(mir.renderLevels, mir.levels), true);
|
subd->Subdivide(meshes, out.mNumMeshes, tempmeshes.get(), std::max(mir.renderLevels, mir.levels), true);
|
||||||
std::copy(tempmeshes.get(), tempmeshes.get() + out.mNumMeshes, meshes);
|
std::copy(tempmeshes.get(), tempmeshes.get() + out.mNumMeshes, meshes);
|
||||||
|
|
||||||
ASSIMP_LOG_INFO_F("BlendModifier: Applied the `Subdivision` modifier to `",
|
ASSIMP_LOG_INFO("BlendModifier: Applied the `Subdivision` modifier to `",
|
||||||
orig_object.id.name, "`");
|
orig_object.id.name, "`");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -62,9 +62,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* The class destructor, virtual.
|
* The class destructor, virtual.
|
||||||
*/
|
*/
|
||||||
virtual ~BlenderModifier() {
|
virtual ~BlenderModifier() = default;
|
||||||
// empty
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +84,7 @@ public:
|
||||||
const Scene& /*in*/,
|
const Scene& /*in*/,
|
||||||
const Object& /*orig_object*/
|
const Object& /*orig_object*/
|
||||||
) {
|
) {
|
||||||
ASSIMP_LOG_INFO_F("This modifier is not supported, skipping: ",orig_modifier.dna_type );
|
ASSIMP_LOG_INFO("This modifier is not supported, skipping: ",orig_modifier.dna_type );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,8 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "BlenderDNA.h"
|
#include "BlenderDNA.h"
|
||||||
#include "BlenderSceneGen.h"
|
#include "BlenderSceneGen.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
namespace Assimp {
|
||||||
using namespace Assimp::Blender;
|
namespace Blender {
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
template <>
|
template <>
|
||||||
|
@ -94,6 +94,48 @@ void Structure ::Convert<Group>(
|
||||||
db.reader->IncPtr(size);
|
db.reader->IncPtr(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------
|
||||||
|
template <>
|
||||||
|
void Structure::Convert<CollectionObject>(
|
||||||
|
CollectionObject &dest,
|
||||||
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
|
ReadFieldPtr<ErrorPolicy_Fail>(dest.next, "*next", db);
|
||||||
|
{
|
||||||
|
std::shared_ptr<Object> ob;
|
||||||
|
ReadFieldPtr<ErrorPolicy_Igno>(ob, "*ob", db);
|
||||||
|
dest.ob = ob.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
db.reader->IncPtr(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------
|
||||||
|
template <>
|
||||||
|
void Structure::Convert<CollectionChild>(
|
||||||
|
CollectionChild &dest,
|
||||||
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
|
ReadFieldPtr<ErrorPolicy_Fail>(dest.prev, "*prev", db);
|
||||||
|
ReadFieldPtr<ErrorPolicy_Fail>(dest.next, "*next", db);
|
||||||
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.collection, "*collection", db);
|
||||||
|
|
||||||
|
db.reader->IncPtr(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------
|
||||||
|
template <>
|
||||||
|
void Structure::Convert<Collection>(
|
||||||
|
Collection &dest,
|
||||||
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
|
ReadField<ErrorPolicy_Fail>(dest.id, "id", db);
|
||||||
|
ReadField<ErrorPolicy_Fail>(dest.gobject, "gobject", db);
|
||||||
|
ReadField<ErrorPolicy_Fail>(dest.children, "children", db);
|
||||||
|
|
||||||
|
db.reader->IncPtr(size);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
template <>
|
template <>
|
||||||
void Structure ::Convert<MTex>(
|
void Structure ::Convert<MTex>(
|
||||||
|
@ -255,7 +297,7 @@ void Structure ::Convert<Base>(
|
||||||
const FileDatabase &db) const {
|
const FileDatabase &db) const {
|
||||||
// note: as per https://github.com/assimp/assimp/issues/128,
|
// note: as per https://github.com/assimp/assimp/issues/128,
|
||||||
// reading the Object linked list recursively is prone to stack overflow.
|
// reading the Object linked list recursively is prone to stack overflow.
|
||||||
// This structure converter is therefore an hand-written exception that
|
// This structure converter is therefore a hand-written exception that
|
||||||
// does it iteratively.
|
// does it iteratively.
|
||||||
|
|
||||||
const int initial_pos = db.reader->GetCurrentPos();
|
const int initial_pos = db.reader->GetCurrentPos();
|
||||||
|
@ -523,7 +565,7 @@ void Structure ::Convert<MVert>(
|
||||||
const FileDatabase &db) const {
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
ReadFieldArray<ErrorPolicy_Fail>(dest.co, "co", db);
|
ReadFieldArray<ErrorPolicy_Fail>(dest.co, "co", db);
|
||||||
ReadFieldArray<ErrorPolicy_Fail>(dest.no, "no", db);
|
ReadFieldArray<ErrorPolicy_Warn>(dest.no, "no", db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
|
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
|
||||||
//ReadField<ErrorPolicy_Warn>(dest.mat_nr,"mat_nr",db);
|
//ReadField<ErrorPolicy_Warn>(dest.mat_nr,"mat_nr",db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.bweight, "bweight", db);
|
ReadField<ErrorPolicy_Igno>(dest.bweight, "bweight", db);
|
||||||
|
@ -578,7 +620,9 @@ void Structure ::Convert<ListBase>(
|
||||||
const FileDatabase &db) const {
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
ReadFieldPtr<ErrorPolicy_Igno>(dest.first, "*first", db);
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.first, "*first", db);
|
||||||
ReadFieldPtr<ErrorPolicy_Igno>(dest.last, "*last", db);
|
std::shared_ptr<ElemBase> last;
|
||||||
|
ReadFieldPtr<ErrorPolicy_Igno>(last, "*last", db);
|
||||||
|
dest.last = last;
|
||||||
|
|
||||||
db.reader->IncPtr(size);
|
db.reader->IncPtr(size);
|
||||||
}
|
}
|
||||||
|
@ -602,7 +646,9 @@ void Structure ::Convert<ModifierData>(
|
||||||
const FileDatabase &db) const {
|
const FileDatabase &db) const {
|
||||||
|
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.next, "*next", db);
|
ReadFieldPtr<ErrorPolicy_Warn>(dest.next, "*next", db);
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.prev, "*prev", db);
|
std::shared_ptr<ElemBase> prev;
|
||||||
|
ReadFieldPtr<ErrorPolicy_Warn>(prev, "*prev", db);
|
||||||
|
dest.prev = prev;
|
||||||
ReadField<ErrorPolicy_Igno>(dest.type, "type", db);
|
ReadField<ErrorPolicy_Igno>(dest.type, "type", db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.mode, "mode", db);
|
ReadField<ErrorPolicy_Igno>(dest.mode, "mode", db);
|
||||||
ReadFieldArray<ErrorPolicy_Igno>(dest.name, "name", db);
|
ReadFieldArray<ErrorPolicy_Igno>(dest.name, "name", db);
|
||||||
|
@ -660,6 +706,7 @@ void Structure ::Convert<Scene>(
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.camera, "*camera", db);
|
ReadFieldPtr<ErrorPolicy_Warn>(dest.camera, "*camera", db);
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.world, "*world", db);
|
ReadFieldPtr<ErrorPolicy_Warn>(dest.world, "*world", db);
|
||||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.basact, "*basact", db);
|
ReadFieldPtr<ErrorPolicy_Warn>(dest.basact, "*basact", db);
|
||||||
|
ReadFieldPtr<ErrorPolicy_Warn>(dest.master_collection, "*master_collection", db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.base, "base", db);
|
ReadField<ErrorPolicy_Igno>(dest.base, "base", db);
|
||||||
|
|
||||||
db.reader->IncPtr(size);
|
db.reader->IncPtr(size);
|
||||||
|
@ -725,7 +772,9 @@ void Structure ::Convert<MirrorModifierData>(
|
||||||
ReadField<ErrorPolicy_Igno>(dest.axis, "axis", db);
|
ReadField<ErrorPolicy_Igno>(dest.axis, "axis", db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
|
ReadField<ErrorPolicy_Igno>(dest.flag, "flag", db);
|
||||||
ReadField<ErrorPolicy_Igno>(dest.tolerance, "tolerance", db);
|
ReadField<ErrorPolicy_Igno>(dest.tolerance, "tolerance", db);
|
||||||
ReadFieldPtr<ErrorPolicy_Igno>(dest.mirror_ob, "*mirror_ob", db);
|
std::shared_ptr<Object> mirror_ob;
|
||||||
|
ReadFieldPtr<ErrorPolicy_Igno>(mirror_ob, "*mirror_ob", db);
|
||||||
|
dest.mirror_ob = mirror_ob;
|
||||||
|
|
||||||
db.reader->IncPtr(size);
|
db.reader->IncPtr(size);
|
||||||
}
|
}
|
||||||
|
@ -786,9 +835,9 @@ void Structure::Convert<CustomDataLayer>(
|
||||||
ReadField<ErrorPolicy_Fail>(dest.flag, "flag", db);
|
ReadField<ErrorPolicy_Fail>(dest.flag, "flag", db);
|
||||||
ReadField<ErrorPolicy_Fail>(dest.active, "active", db);
|
ReadField<ErrorPolicy_Fail>(dest.active, "active", db);
|
||||||
ReadField<ErrorPolicy_Fail>(dest.active_rnd, "active_rnd", db);
|
ReadField<ErrorPolicy_Fail>(dest.active_rnd, "active_rnd", db);
|
||||||
ReadField<ErrorPolicy_Fail>(dest.active_clone, "active_clone", db);
|
ReadField<ErrorPolicy_Warn>(dest.active_clone, "active_clone", db);
|
||||||
ReadField<ErrorPolicy_Fail>(dest.active_mask, "active_mask", db);
|
ReadField<ErrorPolicy_Warn>(dest.active_mask, "active_mask", db);
|
||||||
ReadField<ErrorPolicy_Fail>(dest.uid, "uid", db);
|
ReadField<ErrorPolicy_Warn>(dest.uid, "uid", db);
|
||||||
ReadFieldArray<ErrorPolicy_Warn>(dest.name, "name", db);
|
ReadFieldArray<ErrorPolicy_Warn>(dest.name, "name", db);
|
||||||
ReadCustomDataPtr<ErrorPolicy_Fail>(dest.data, dest.type, "*data", db);
|
ReadCustomDataPtr<ErrorPolicy_Fail>(dest.data, dest.type, "*data", db);
|
||||||
|
|
||||||
|
@ -833,6 +882,12 @@ void DNA::RegisterConverters() {
|
||||||
converters["Image"] = DNA::FactoryPair(&Structure::Allocate<Image>, &Structure::Convert<Image>);
|
converters["Image"] = DNA::FactoryPair(&Structure::Allocate<Image>, &Structure::Convert<Image>);
|
||||||
converters["CustomData"] = DNA::FactoryPair(&Structure::Allocate<CustomData>, &Structure::Convert<CustomData>);
|
converters["CustomData"] = DNA::FactoryPair(&Structure::Allocate<CustomData>, &Structure::Convert<CustomData>);
|
||||||
converters["CustomDataLayer"] = DNA::FactoryPair(&Structure::Allocate<CustomDataLayer>, &Structure::Convert<CustomDataLayer>);
|
converters["CustomDataLayer"] = DNA::FactoryPair(&Structure::Allocate<CustomDataLayer>, &Structure::Convert<CustomDataLayer>);
|
||||||
|
converters["Collection"] = DNA::FactoryPair(&Structure::Allocate<Collection>, &Structure::Convert<Collection>);
|
||||||
|
converters["CollectionChild"] = DNA::FactoryPair(&Structure::Allocate<CollectionChild>, &Structure::Convert<CollectionChild>);
|
||||||
|
converters["CollectionObject"] = DNA::FactoryPair(&Structure::Allocate<CollectionObject>, &Structure::Convert<CollectionObject>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Blender
|
||||||
|
} //namespace Assimp
|
||||||
|
|
||||||
#endif // ASSIMP_BUILD_NO_BLEND_IMPORTER
|
#endif // ASSIMP_BUILD_NO_BLEND_IMPORTER
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2020, assimp team
|
Copyright (c) 2006-2024, assimp team
|
||||||
|
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
@ -107,6 +107,7 @@ namespace Blender {
|
||||||
struct Object;
|
struct Object;
|
||||||
struct MTex;
|
struct MTex;
|
||||||
struct Image;
|
struct Image;
|
||||||
|
struct Collection;
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@ -123,7 +124,7 @@ struct ID : ElemBase {
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct ListBase : ElemBase {
|
struct ListBase : ElemBase {
|
||||||
std::shared_ptr<ElemBase> first;
|
std::shared_ptr<ElemBase> first;
|
||||||
std::shared_ptr<ElemBase> last;
|
std::weak_ptr<ElemBase> last;
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
@ -147,6 +148,26 @@ struct Group : ElemBase {
|
||||||
std::shared_ptr<GroupObject> gobject;
|
std::shared_ptr<GroupObject> gobject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct CollectionObject : ElemBase {
|
||||||
|
//CollectionObject* prev;
|
||||||
|
std::shared_ptr<CollectionObject> next;
|
||||||
|
Object *ob;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct CollectionChild : ElemBase {
|
||||||
|
std::shared_ptr<CollectionChild> next, prev;
|
||||||
|
std::shared_ptr<Collection> collection;
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------
|
||||||
|
struct Collection : ElemBase {
|
||||||
|
ID id FAIL;
|
||||||
|
ListBase gobject; // CollectionObject
|
||||||
|
ListBase children; // CollectionChild
|
||||||
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct World : ElemBase {
|
struct World : ElemBase {
|
||||||
ID id FAIL;
|
ID id FAIL;
|
||||||
|
@ -155,13 +176,13 @@ struct World : ElemBase {
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct MVert : ElemBase {
|
struct MVert : ElemBase {
|
||||||
float co[3] FAIL;
|
float co[3] FAIL;
|
||||||
float no[3] FAIL; // readed as short and divided through / 32767.f
|
float no[3] FAIL; // read as short and divided through / 32767.f
|
||||||
char flag;
|
char flag;
|
||||||
int mat_nr WARN;
|
int mat_nr WARN;
|
||||||
int bweight;
|
int bweight;
|
||||||
|
|
||||||
MVert() :
|
MVert() :
|
||||||
ElemBase(), flag(0), mat_nr(0), bweight(0) {}
|
flag(0), mat_nr(0), bweight(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
@ -228,7 +249,10 @@ struct TFace : ElemBase {
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct MTFace : ElemBase {
|
struct MTFace : ElemBase {
|
||||||
MTFace() :
|
MTFace() :
|
||||||
flag(0), mode(0), tile(0), unwrap(0) {
|
flag(0),
|
||||||
|
mode(0),
|
||||||
|
tile(0),
|
||||||
|
unwrap(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float uv[4][2] FAIL;
|
float uv[4][2] FAIL;
|
||||||
|
@ -393,7 +417,6 @@ struct CustomDataLayer : ElemBase {
|
||||||
std::shared_ptr<ElemBase> data; // must be converted to real type according type member
|
std::shared_ptr<ElemBase> data; // must be converted to real type according type member
|
||||||
|
|
||||||
CustomDataLayer() :
|
CustomDataLayer() :
|
||||||
ElemBase(),
|
|
||||||
type(0),
|
type(0),
|
||||||
offset(0),
|
offset(0),
|
||||||
flag(0),
|
flag(0),
|
||||||
|
@ -618,14 +641,21 @@ struct ModifierData : ElemBase {
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<ElemBase> next WARN;
|
std::shared_ptr<ElemBase> next WARN;
|
||||||
std::shared_ptr<ElemBase> prev WARN;
|
std::weak_ptr<ElemBase> prev WARN;
|
||||||
|
|
||||||
int type, mode;
|
int type, mode;
|
||||||
char name[32];
|
char name[32];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
struct SharedModifierData : ElemBase {
|
||||||
|
ModifierData modifier;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct SubsurfModifierData : ElemBase {
|
struct SubsurfModifierData : SharedModifierData {
|
||||||
|
|
||||||
enum Type {
|
enum Type {
|
||||||
|
|
||||||
|
@ -638,7 +668,6 @@ struct SubsurfModifierData : ElemBase {
|
||||||
FLAGS_SubsurfUV = 1 << 3
|
FLAGS_SubsurfUV = 1 << 3
|
||||||
};
|
};
|
||||||
|
|
||||||
ModifierData modifier FAIL;
|
|
||||||
short subdivType WARN;
|
short subdivType WARN;
|
||||||
short levels FAIL;
|
short levels FAIL;
|
||||||
short renderLevels;
|
short renderLevels;
|
||||||
|
@ -646,7 +675,7 @@ struct SubsurfModifierData : ElemBase {
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
struct MirrorModifierData : ElemBase {
|
struct MirrorModifierData : SharedModifierData {
|
||||||
|
|
||||||
enum Flags {
|
enum Flags {
|
||||||
Flags_CLIPPING = 1 << 0,
|
Flags_CLIPPING = 1 << 0,
|
||||||
|
@ -658,11 +687,9 @@ struct MirrorModifierData : ElemBase {
|
||||||
Flags_VGROUP = 1 << 6
|
Flags_VGROUP = 1 << 6
|
||||||
};
|
};
|
||||||
|
|
||||||
ModifierData modifier FAIL;
|
|
||||||
|
|
||||||
short axis, flag;
|
short axis, flag;
|
||||||
float tolerance;
|
float tolerance;
|
||||||
std::shared_ptr<Object> mirror_ob;
|
std::weak_ptr<Object> mirror_ob;
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
@ -701,7 +728,7 @@ struct Object : ElemBase {
|
||||||
ListBase modifiers;
|
ListBase modifiers;
|
||||||
|
|
||||||
Object() :
|
Object() :
|
||||||
ElemBase(), type(Type_EMPTY), parent(nullptr), track(), proxy(), proxy_from(), data() {
|
type(Type_EMPTY), parent(nullptr) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -713,8 +740,7 @@ struct Base : ElemBase {
|
||||||
std::shared_ptr<Object> object WARN;
|
std::shared_ptr<Object> object WARN;
|
||||||
|
|
||||||
Base() :
|
Base() :
|
||||||
ElemBase(), prev(nullptr), next(), object() {
|
prev(nullptr) {
|
||||||
// empty
|
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -726,13 +752,11 @@ struct Scene : ElemBase {
|
||||||
std::shared_ptr<Object> camera WARN;
|
std::shared_ptr<Object> camera WARN;
|
||||||
std::shared_ptr<World> world WARN;
|
std::shared_ptr<World> world WARN;
|
||||||
std::shared_ptr<Base> basact WARN;
|
std::shared_ptr<Base> basact WARN;
|
||||||
|
std::shared_ptr<Collection> master_collection WARN;
|
||||||
|
|
||||||
ListBase base;
|
ListBase base;
|
||||||
|
|
||||||
Scene() :
|
Scene() = default;
|
||||||
ElemBase(), camera(), world(), basact() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
@ -762,10 +786,7 @@ struct Image : ElemBase {
|
||||||
|
|
||||||
short gen_x, gen_y, gen_type;
|
short gen_x, gen_y, gen_type;
|
||||||
|
|
||||||
Image() :
|
Image() = default;
|
||||||
ElemBase() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
@ -855,7 +876,7 @@ struct Tex : ElemBase {
|
||||||
//char use_nodes;
|
//char use_nodes;
|
||||||
|
|
||||||
Tex() :
|
Tex() :
|
||||||
ElemBase(), imaflag(ImageFlags_INTERPOL), type(Type_CLOUDS), ima() {
|
imaflag(ImageFlags_INTERPOL), type(Type_CLOUDS) {
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -947,10 +968,7 @@ struct MTex : ElemBase {
|
||||||
//float shadowfac;
|
//float shadowfac;
|
||||||
//float zenupfac, zendownfac, blendfac;
|
//float zenupfac, zendownfac, blendfac;
|
||||||
|
|
||||||
MTex() :
|
MTex() = default;
|
||||||
ElemBase() {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Blender
|
} // namespace Blender
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue