vrshoot

annotate libs/assimp/BlenderScene.cpp @ 2:334d17aed7de

visual studio project files
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 18:36:38 +0200
parents
children
rev   line source
nuclear@0 1 /*
nuclear@0 2 Open Asset Import Library (ASSIMP)
nuclear@0 3 ----------------------------------------------------------------------
nuclear@0 4
nuclear@0 5 Copyright (c) 2006-2010, ASSIMP Development Team
nuclear@0 6 All rights reserved.
nuclear@0 7
nuclear@0 8 Redistribution and use of this software in source and binary forms,
nuclear@0 9 with or without modification, are permitted provided that the
nuclear@0 10 following conditions are met:
nuclear@0 11
nuclear@0 12 * Redistributions of source code must retain the above
nuclear@0 13 copyright notice, this list of conditions and the
nuclear@0 14 following disclaimer.
nuclear@0 15
nuclear@0 16 * Redistributions in binary form must reproduce the above
nuclear@0 17 copyright notice, this list of conditions and the
nuclear@0 18 following disclaimer in the documentation and/or other
nuclear@0 19 materials provided with the distribution.
nuclear@0 20
nuclear@0 21 * Neither the name of the ASSIMP team, nor the names of its
nuclear@0 22 contributors may be used to endorse or promote products
nuclear@0 23 derived from this software without specific prior
nuclear@0 24 written permission of the ASSIMP Development Team.
nuclear@0 25
nuclear@0 26 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
nuclear@0 27 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
nuclear@0 28 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
nuclear@0 29 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
nuclear@0 30 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
nuclear@0 31 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
nuclear@0 32 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
nuclear@0 33 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
nuclear@0 34 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
nuclear@0 35 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
nuclear@0 36 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
nuclear@0 37
nuclear@0 38 ----------------------------------------------------------------------
nuclear@0 39 */
nuclear@0 40
nuclear@0 41 /** @file BlenderScene.cpp
nuclear@0 42 * @brief MACHINE GENERATED BY ./scripts/BlenderImporter/genblenddna.py
nuclear@0 43 */
nuclear@0 44 #include "AssimpPCH.h"
nuclear@0 45 #ifndef AI_BUILD_NO_BLEND_IMPORTER
nuclear@0 46
nuclear@0 47 #include "BlenderDNA.h"
nuclear@0 48 #include "BlenderScene.h"
nuclear@0 49 #include "BlenderSceneGen.h"
nuclear@0 50
nuclear@0 51 using namespace Assimp;
nuclear@0 52 using namespace Assimp::Blender;
nuclear@0 53
nuclear@0 54 //--------------------------------------------------------------------------------
nuclear@0 55 template <> void Structure :: Convert<Object> (
nuclear@0 56 Object& dest,
nuclear@0 57 const FileDatabase& db
nuclear@0 58 ) const
nuclear@0 59 {
nuclear@0 60
nuclear@0 61 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 62 ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
nuclear@0 63 ReadFieldArray2<ErrorPolicy_Warn>(dest.obmat,"obmat",db);
nuclear@0 64 ReadFieldArray2<ErrorPolicy_Warn>(dest.parentinv,"parentinv",db);
nuclear@0 65 ReadFieldArray<ErrorPolicy_Warn>(dest.parsubstr,"parsubstr",db);
nuclear@0 66 {
nuclear@0 67 boost::shared_ptr<Object> parent;
nuclear@0 68 ReadFieldPtr<ErrorPolicy_Warn>(parent,"*parent",db);
nuclear@0 69 dest.parent = parent.get();
nuclear@0 70 }
nuclear@0 71 ReadFieldPtr<ErrorPolicy_Warn>(dest.track,"*track",db);
nuclear@0 72 ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy,"*proxy",db);
nuclear@0 73 ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy_from,"*proxy_from",db);
nuclear@0 74 ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy_group,"*proxy_group",db);
nuclear@0 75 ReadFieldPtr<ErrorPolicy_Warn>(dest.dup_group,"*dup_group",db);
nuclear@0 76 ReadFieldPtr<ErrorPolicy_Fail>(dest.data,"*data",db);
nuclear@0 77 ReadField<ErrorPolicy_Igno>(dest.modifiers,"modifiers",db);
nuclear@0 78
nuclear@0 79 db.reader->IncPtr(size);
nuclear@0 80 }
nuclear@0 81
nuclear@0 82 //--------------------------------------------------------------------------------
nuclear@0 83 template <> void Structure :: Convert<Group> (
nuclear@0 84 Group& dest,
nuclear@0 85 const FileDatabase& db
nuclear@0 86 ) const
nuclear@0 87 {
nuclear@0 88
nuclear@0 89 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 90 ReadField<ErrorPolicy_Igno>(dest.layer,"layer",db);
nuclear@0 91 ReadFieldPtr<ErrorPolicy_Igno>(dest.gobject,"*gobject",db);
nuclear@0 92
nuclear@0 93 db.reader->IncPtr(size);
nuclear@0 94 }
nuclear@0 95
nuclear@0 96 //--------------------------------------------------------------------------------
nuclear@0 97 template <> void Structure :: Convert<MTex> (
nuclear@0 98 MTex& dest,
nuclear@0 99 const FileDatabase& db
nuclear@0 100 ) const
nuclear@0 101 {
nuclear@0 102
nuclear@0 103 ReadField<ErrorPolicy_Igno>((int&)dest.blendtype,"blendtype",db);
nuclear@0 104 ReadFieldPtr<ErrorPolicy_Igno>(dest.object,"*object",db);
nuclear@0 105 ReadFieldPtr<ErrorPolicy_Igno>(dest.tex,"*tex",db);
nuclear@0 106 ReadFieldArray<ErrorPolicy_Igno>(dest.uvname,"uvname",db);
nuclear@0 107 ReadField<ErrorPolicy_Igno>((int&)dest.projx,"projx",db);
nuclear@0 108 ReadField<ErrorPolicy_Igno>((int&)dest.projy,"projy",db);
nuclear@0 109 ReadField<ErrorPolicy_Igno>((int&)dest.projz,"projz",db);
nuclear@0 110 ReadField<ErrorPolicy_Igno>(dest.mapping,"mapping",db);
nuclear@0 111 ReadFieldArray<ErrorPolicy_Igno>(dest.ofs,"ofs",db);
nuclear@0 112 ReadFieldArray<ErrorPolicy_Igno>(dest.size,"size",db);
nuclear@0 113 ReadField<ErrorPolicy_Igno>(dest.rot,"rot",db);
nuclear@0 114 ReadField<ErrorPolicy_Igno>(dest.texflag,"texflag",db);
nuclear@0 115 ReadField<ErrorPolicy_Igno>(dest.colormodel,"colormodel",db);
nuclear@0 116 ReadField<ErrorPolicy_Igno>(dest.pmapto,"pmapto",db);
nuclear@0 117 ReadField<ErrorPolicy_Igno>(dest.pmaptoneg,"pmaptoneg",db);
nuclear@0 118 ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
nuclear@0 119 ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
nuclear@0 120 ReadField<ErrorPolicy_Warn>(dest.b,"b",db);
nuclear@0 121 ReadField<ErrorPolicy_Warn>(dest.k,"k",db);
nuclear@0 122 ReadField<ErrorPolicy_Igno>(dest.colspecfac,"colspecfac",db);
nuclear@0 123 ReadField<ErrorPolicy_Igno>(dest.mirrfac,"mirrfac",db);
nuclear@0 124 ReadField<ErrorPolicy_Igno>(dest.alphafac,"alphafac",db);
nuclear@0 125 ReadField<ErrorPolicy_Igno>(dest.difffac,"difffac",db);
nuclear@0 126 ReadField<ErrorPolicy_Igno>(dest.specfac,"specfac",db);
nuclear@0 127 ReadField<ErrorPolicy_Igno>(dest.emitfac,"emitfac",db);
nuclear@0 128 ReadField<ErrorPolicy_Igno>(dest.hardfac,"hardfac",db);
nuclear@0 129
nuclear@0 130 db.reader->IncPtr(size);
nuclear@0 131 }
nuclear@0 132
nuclear@0 133 //--------------------------------------------------------------------------------
nuclear@0 134 template <> void Structure :: Convert<TFace> (
nuclear@0 135 TFace& dest,
nuclear@0 136 const FileDatabase& db
nuclear@0 137 ) const
nuclear@0 138 {
nuclear@0 139
nuclear@0 140 ReadFieldArray2<ErrorPolicy_Fail>(dest.uv,"uv",db);
nuclear@0 141 ReadFieldArray<ErrorPolicy_Fail>(dest.col,"col",db);
nuclear@0 142 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 143 ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
nuclear@0 144 ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
nuclear@0 145 ReadField<ErrorPolicy_Igno>(dest.unwrap,"unwrap",db);
nuclear@0 146
nuclear@0 147 db.reader->IncPtr(size);
nuclear@0 148 }
nuclear@0 149
nuclear@0 150 //--------------------------------------------------------------------------------
nuclear@0 151 template <> void Structure :: Convert<SubsurfModifierData> (
nuclear@0 152 SubsurfModifierData& dest,
nuclear@0 153 const FileDatabase& db
nuclear@0 154 ) const
nuclear@0 155 {
nuclear@0 156
nuclear@0 157 ReadField<ErrorPolicy_Fail>(dest.modifier,"modifier",db);
nuclear@0 158 ReadField<ErrorPolicy_Warn>(dest.subdivType,"subdivType",db);
nuclear@0 159 ReadField<ErrorPolicy_Fail>(dest.levels,"levels",db);
nuclear@0 160 ReadField<ErrorPolicy_Igno>(dest.renderLevels,"renderLevels",db);
nuclear@0 161 ReadField<ErrorPolicy_Igno>(dest.flags,"flags",db);
nuclear@0 162
nuclear@0 163 db.reader->IncPtr(size);
nuclear@0 164 }
nuclear@0 165
nuclear@0 166 //--------------------------------------------------------------------------------
nuclear@0 167 template <> void Structure :: Convert<MFace> (
nuclear@0 168 MFace& dest,
nuclear@0 169 const FileDatabase& db
nuclear@0 170 ) const
nuclear@0 171 {
nuclear@0 172
nuclear@0 173 ReadField<ErrorPolicy_Fail>(dest.v1,"v1",db);
nuclear@0 174 ReadField<ErrorPolicy_Fail>(dest.v2,"v2",db);
nuclear@0 175 ReadField<ErrorPolicy_Fail>(dest.v3,"v3",db);
nuclear@0 176 ReadField<ErrorPolicy_Fail>(dest.v4,"v4",db);
nuclear@0 177 ReadField<ErrorPolicy_Fail>(dest.mat_nr,"mat_nr",db);
nuclear@0 178 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 179
nuclear@0 180 db.reader->IncPtr(size);
nuclear@0 181 }
nuclear@0 182
nuclear@0 183 //--------------------------------------------------------------------------------
nuclear@0 184 template <> void Structure :: Convert<Lamp> (
nuclear@0 185 Lamp& dest,
nuclear@0 186 const FileDatabase& db
nuclear@0 187 ) const
nuclear@0 188 {
nuclear@0 189
nuclear@0 190 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 191 ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
nuclear@0 192 ReadField<ErrorPolicy_Igno>(dest.flags,"flags",db);
nuclear@0 193 ReadField<ErrorPolicy_Igno>(dest.colormodel,"colormodel",db);
nuclear@0 194 ReadField<ErrorPolicy_Igno>(dest.totex,"totex",db);
nuclear@0 195 ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
nuclear@0 196 ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
nuclear@0 197 ReadField<ErrorPolicy_Warn>(dest.b,"b",db);
nuclear@0 198 ReadField<ErrorPolicy_Warn>(dest.k,"k",db);
nuclear@0 199 ReadField<ErrorPolicy_Igno>(dest.energy,"energy",db);
nuclear@0 200 ReadField<ErrorPolicy_Igno>(dest.dist,"dist",db);
nuclear@0 201 ReadField<ErrorPolicy_Igno>(dest.spotsize,"spotsize",db);
nuclear@0 202 ReadField<ErrorPolicy_Igno>(dest.spotblend,"spotblend",db);
nuclear@0 203 ReadField<ErrorPolicy_Igno>(dest.att1,"att1",db);
nuclear@0 204 ReadField<ErrorPolicy_Igno>(dest.att2,"att2",db);
nuclear@0 205 ReadField<ErrorPolicy_Igno>((int&)dest.falloff_type,"falloff_type",db);
nuclear@0 206 ReadField<ErrorPolicy_Igno>(dest.sun_brightness,"sun_brightness",db);
nuclear@0 207
nuclear@0 208 db.reader->IncPtr(size);
nuclear@0 209 }
nuclear@0 210
nuclear@0 211 //--------------------------------------------------------------------------------
nuclear@0 212 template <> void Structure :: Convert<MDeformWeight> (
nuclear@0 213 MDeformWeight& dest,
nuclear@0 214 const FileDatabase& db
nuclear@0 215 ) const
nuclear@0 216 {
nuclear@0 217
nuclear@0 218 ReadField<ErrorPolicy_Fail>(dest.def_nr,"def_nr",db);
nuclear@0 219 ReadField<ErrorPolicy_Fail>(dest.weight,"weight",db);
nuclear@0 220
nuclear@0 221 db.reader->IncPtr(size);
nuclear@0 222 }
nuclear@0 223
nuclear@0 224 //--------------------------------------------------------------------------------
nuclear@0 225 template <> void Structure :: Convert<PackedFile> (
nuclear@0 226 PackedFile& dest,
nuclear@0 227 const FileDatabase& db
nuclear@0 228 ) const
nuclear@0 229 {
nuclear@0 230
nuclear@0 231 ReadField<ErrorPolicy_Warn>(dest.size,"size",db);
nuclear@0 232 ReadField<ErrorPolicy_Warn>(dest.seek,"seek",db);
nuclear@0 233 ReadFieldPtr<ErrorPolicy_Warn>(dest.data,"*data",db);
nuclear@0 234
nuclear@0 235 db.reader->IncPtr(size);
nuclear@0 236 }
nuclear@0 237
nuclear@0 238 //--------------------------------------------------------------------------------
nuclear@0 239 template <> void Structure :: Convert<Base> (
nuclear@0 240 Base& dest,
nuclear@0 241 const FileDatabase& db
nuclear@0 242 ) const
nuclear@0 243 {
nuclear@0 244
nuclear@0 245 {
nuclear@0 246 boost::shared_ptr<Base> prev;
nuclear@0 247 ReadFieldPtr<ErrorPolicy_Warn>(prev,"*prev",db);
nuclear@0 248 dest.prev = prev.get();
nuclear@0 249 }
nuclear@0 250 ReadFieldPtr<ErrorPolicy_Warn>(dest.next,"*next",db);
nuclear@0 251 ReadFieldPtr<ErrorPolicy_Warn>(dest.object,"*object",db);
nuclear@0 252
nuclear@0 253 db.reader->IncPtr(size);
nuclear@0 254 }
nuclear@0 255
nuclear@0 256 //--------------------------------------------------------------------------------
nuclear@0 257 template <> void Structure :: Convert<MTFace> (
nuclear@0 258 MTFace& dest,
nuclear@0 259 const FileDatabase& db
nuclear@0 260 ) const
nuclear@0 261 {
nuclear@0 262
nuclear@0 263 ReadFieldArray2<ErrorPolicy_Fail>(dest.uv,"uv",db);
nuclear@0 264 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 265 ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
nuclear@0 266 ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
nuclear@0 267 ReadField<ErrorPolicy_Igno>(dest.unwrap,"unwrap",db);
nuclear@0 268
nuclear@0 269 db.reader->IncPtr(size);
nuclear@0 270 }
nuclear@0 271
nuclear@0 272 //--------------------------------------------------------------------------------
nuclear@0 273 template <> void Structure :: Convert<Material> (
nuclear@0 274 Material& dest,
nuclear@0 275 const FileDatabase& db
nuclear@0 276 ) const
nuclear@0 277 {
nuclear@0 278
nuclear@0 279 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 280 ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
nuclear@0 281 ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
nuclear@0 282 ReadField<ErrorPolicy_Warn>(dest.b,"b",db);
nuclear@0 283 ReadField<ErrorPolicy_Warn>(dest.specr,"specr",db);
nuclear@0 284 ReadField<ErrorPolicy_Warn>(dest.specg,"specg",db);
nuclear@0 285 ReadField<ErrorPolicy_Warn>(dest.specb,"specb",db);
nuclear@0 286 ReadField<ErrorPolicy_Igno>(dest.har,"har",db);
nuclear@0 287 ReadField<ErrorPolicy_Warn>(dest.ambr,"ambr",db);
nuclear@0 288 ReadField<ErrorPolicy_Warn>(dest.ambg,"ambg",db);
nuclear@0 289 ReadField<ErrorPolicy_Warn>(dest.ambb,"ambb",db);
nuclear@0 290 ReadField<ErrorPolicy_Igno>(dest.mirr,"mirr",db);
nuclear@0 291 ReadField<ErrorPolicy_Igno>(dest.mirg,"mirg",db);
nuclear@0 292 ReadField<ErrorPolicy_Igno>(dest.mirb,"mirb",db);
nuclear@0 293 ReadField<ErrorPolicy_Warn>(dest.emit,"emit",db);
nuclear@0 294 ReadField<ErrorPolicy_Warn>(dest.alpha,"alpha",db);
nuclear@0 295 ReadField<ErrorPolicy_Igno>(dest.ref,"ref",db);
nuclear@0 296 ReadField<ErrorPolicy_Igno>(dest.translucency,"translucency",db);
nuclear@0 297 ReadField<ErrorPolicy_Igno>(dest.roughness,"roughness",db);
nuclear@0 298 ReadField<ErrorPolicy_Igno>(dest.darkness,"darkness",db);
nuclear@0 299 ReadField<ErrorPolicy_Igno>(dest.refrac,"refrac",db);
nuclear@0 300 ReadFieldPtr<ErrorPolicy_Igno>(dest.group,"*group",db);
nuclear@0 301 ReadField<ErrorPolicy_Warn>(dest.diff_shader,"diff_shader",db);
nuclear@0 302 ReadField<ErrorPolicy_Warn>(dest.spec_shader,"spec_shader",db);
nuclear@0 303 ReadFieldPtr<ErrorPolicy_Igno>(dest.mtex,"*mtex",db);
nuclear@0 304
nuclear@0 305 db.reader->IncPtr(size);
nuclear@0 306 }
nuclear@0 307
nuclear@0 308 //--------------------------------------------------------------------------------
nuclear@0 309 template <> void Structure :: Convert<MTexPoly> (
nuclear@0 310 MTexPoly& dest,
nuclear@0 311 const FileDatabase& db
nuclear@0 312 ) const
nuclear@0 313 {
nuclear@0 314
nuclear@0 315 {
nuclear@0 316 boost::shared_ptr<Image> tpage;
nuclear@0 317 ReadFieldPtr<ErrorPolicy_Igno>(tpage,"*tpage",db);
nuclear@0 318 dest.tpage = tpage.get();
nuclear@0 319 }
nuclear@0 320 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 321 ReadField<ErrorPolicy_Igno>(dest.transp,"transp",db);
nuclear@0 322 ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
nuclear@0 323 ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
nuclear@0 324 ReadField<ErrorPolicy_Igno>(dest.pad,"pad",db);
nuclear@0 325
nuclear@0 326 db.reader->IncPtr(size);
nuclear@0 327 }
nuclear@0 328
nuclear@0 329 //--------------------------------------------------------------------------------
nuclear@0 330 template <> void Structure :: Convert<Mesh> (
nuclear@0 331 Mesh& dest,
nuclear@0 332 const FileDatabase& db
nuclear@0 333 ) const
nuclear@0 334 {
nuclear@0 335
nuclear@0 336 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 337 ReadField<ErrorPolicy_Fail>(dest.totface,"totface",db);
nuclear@0 338 ReadField<ErrorPolicy_Fail>(dest.totedge,"totedge",db);
nuclear@0 339 ReadField<ErrorPolicy_Fail>(dest.totvert,"totvert",db);
nuclear@0 340 ReadField<ErrorPolicy_Igno>(dest.totloop,"totloop",db);
nuclear@0 341 ReadField<ErrorPolicy_Igno>(dest.totpoly,"totpoly",db);
nuclear@0 342 ReadField<ErrorPolicy_Igno>(dest.subdiv,"subdiv",db);
nuclear@0 343 ReadField<ErrorPolicy_Igno>(dest.subdivr,"subdivr",db);
nuclear@0 344 ReadField<ErrorPolicy_Igno>(dest.subsurftype,"subsurftype",db);
nuclear@0 345 ReadField<ErrorPolicy_Igno>(dest.smoothresh,"smoothresh",db);
nuclear@0 346 ReadFieldPtr<ErrorPolicy_Fail>(dest.mface,"*mface",db);
nuclear@0 347 ReadFieldPtr<ErrorPolicy_Igno>(dest.mtface,"*mtface",db);
nuclear@0 348 ReadFieldPtr<ErrorPolicy_Igno>(dest.tface,"*tface",db);
nuclear@0 349 ReadFieldPtr<ErrorPolicy_Fail>(dest.mvert,"*mvert",db);
nuclear@0 350 ReadFieldPtr<ErrorPolicy_Warn>(dest.medge,"*medge",db);
nuclear@0 351 ReadFieldPtr<ErrorPolicy_Igno>(dest.mloop,"*mloop",db);
nuclear@0 352 ReadFieldPtr<ErrorPolicy_Igno>(dest.mloopuv,"*mloopuv",db);
nuclear@0 353 ReadFieldPtr<ErrorPolicy_Igno>(dest.mloopcol,"*mloopcol",db);
nuclear@0 354 ReadFieldPtr<ErrorPolicy_Igno>(dest.mpoly,"*mpoly",db);
nuclear@0 355 ReadFieldPtr<ErrorPolicy_Igno>(dest.mtpoly,"*mtpoly",db);
nuclear@0 356 ReadFieldPtr<ErrorPolicy_Igno>(dest.dvert,"*dvert",db);
nuclear@0 357 ReadFieldPtr<ErrorPolicy_Igno>(dest.mcol,"*mcol",db);
nuclear@0 358 ReadFieldPtr<ErrorPolicy_Fail>(dest.mat,"**mat",db);
nuclear@0 359
nuclear@0 360 db.reader->IncPtr(size);
nuclear@0 361 }
nuclear@0 362
nuclear@0 363 //--------------------------------------------------------------------------------
nuclear@0 364 template <> void Structure :: Convert<MDeformVert> (
nuclear@0 365 MDeformVert& dest,
nuclear@0 366 const FileDatabase& db
nuclear@0 367 ) const
nuclear@0 368 {
nuclear@0 369
nuclear@0 370 ReadFieldPtr<ErrorPolicy_Warn>(dest.dw,"*dw",db);
nuclear@0 371 ReadField<ErrorPolicy_Igno>(dest.totweight,"totweight",db);
nuclear@0 372
nuclear@0 373 db.reader->IncPtr(size);
nuclear@0 374 }
nuclear@0 375
nuclear@0 376 //--------------------------------------------------------------------------------
nuclear@0 377 template <> void Structure :: Convert<World> (
nuclear@0 378 World& dest,
nuclear@0 379 const FileDatabase& db
nuclear@0 380 ) const
nuclear@0 381 {
nuclear@0 382
nuclear@0 383 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 384
nuclear@0 385 db.reader->IncPtr(size);
nuclear@0 386 }
nuclear@0 387
nuclear@0 388 //--------------------------------------------------------------------------------
nuclear@0 389 template <> void Structure :: Convert<MLoopCol> (
nuclear@0 390 MLoopCol& dest,
nuclear@0 391 const FileDatabase& db
nuclear@0 392 ) const
nuclear@0 393 {
nuclear@0 394
nuclear@0 395 ReadField<ErrorPolicy_Igno>(dest.r,"r",db);
nuclear@0 396 ReadField<ErrorPolicy_Igno>(dest.g,"g",db);
nuclear@0 397 ReadField<ErrorPolicy_Igno>(dest.b,"b",db);
nuclear@0 398 ReadField<ErrorPolicy_Igno>(dest.a,"a",db);
nuclear@0 399
nuclear@0 400 db.reader->IncPtr(size);
nuclear@0 401 }
nuclear@0 402
nuclear@0 403 //--------------------------------------------------------------------------------
nuclear@0 404 template <> void Structure :: Convert<MVert> (
nuclear@0 405 MVert& dest,
nuclear@0 406 const FileDatabase& db
nuclear@0 407 ) const
nuclear@0 408 {
nuclear@0 409
nuclear@0 410 ReadFieldArray<ErrorPolicy_Fail>(dest.co,"co",db);
nuclear@0 411 ReadFieldArray<ErrorPolicy_Fail>(dest.no,"no",db);
nuclear@0 412 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 413 ReadField<ErrorPolicy_Warn>(dest.mat_nr,"mat_nr",db);
nuclear@0 414 ReadField<ErrorPolicy_Igno>(dest.bweight,"bweight",db);
nuclear@0 415
nuclear@0 416 db.reader->IncPtr(size);
nuclear@0 417 }
nuclear@0 418
nuclear@0 419 //--------------------------------------------------------------------------------
nuclear@0 420 template <> void Structure :: Convert<MEdge> (
nuclear@0 421 MEdge& dest,
nuclear@0 422 const FileDatabase& db
nuclear@0 423 ) const
nuclear@0 424 {
nuclear@0 425
nuclear@0 426 ReadField<ErrorPolicy_Fail>(dest.v1,"v1",db);
nuclear@0 427 ReadField<ErrorPolicy_Fail>(dest.v2,"v2",db);
nuclear@0 428 ReadField<ErrorPolicy_Igno>(dest.crease,"crease",db);
nuclear@0 429 ReadField<ErrorPolicy_Igno>(dest.bweight,"bweight",db);
nuclear@0 430 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 431
nuclear@0 432 db.reader->IncPtr(size);
nuclear@0 433 }
nuclear@0 434
nuclear@0 435 //--------------------------------------------------------------------------------
nuclear@0 436 template <> void Structure :: Convert<MLoopUV> (
nuclear@0 437 MLoopUV& dest,
nuclear@0 438 const FileDatabase& db
nuclear@0 439 ) const
nuclear@0 440 {
nuclear@0 441
nuclear@0 442 ReadFieldArray<ErrorPolicy_Igno>(dest.uv,"uv",db);
nuclear@0 443 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 444
nuclear@0 445 db.reader->IncPtr(size);
nuclear@0 446 }
nuclear@0 447
nuclear@0 448 //--------------------------------------------------------------------------------
nuclear@0 449 template <> void Structure :: Convert<GroupObject> (
nuclear@0 450 GroupObject& dest,
nuclear@0 451 const FileDatabase& db
nuclear@0 452 ) const
nuclear@0 453 {
nuclear@0 454
nuclear@0 455 ReadFieldPtr<ErrorPolicy_Fail>(dest.prev,"*prev",db);
nuclear@0 456 ReadFieldPtr<ErrorPolicy_Fail>(dest.next,"*next",db);
nuclear@0 457 ReadFieldPtr<ErrorPolicy_Igno>(dest.ob,"*ob",db);
nuclear@0 458
nuclear@0 459 db.reader->IncPtr(size);
nuclear@0 460 }
nuclear@0 461
nuclear@0 462 //--------------------------------------------------------------------------------
nuclear@0 463 template <> void Structure :: Convert<ListBase> (
nuclear@0 464 ListBase& dest,
nuclear@0 465 const FileDatabase& db
nuclear@0 466 ) const
nuclear@0 467 {
nuclear@0 468
nuclear@0 469 ReadFieldPtr<ErrorPolicy_Igno>(dest.first,"*first",db);
nuclear@0 470 ReadFieldPtr<ErrorPolicy_Igno>(dest.last,"*last",db);
nuclear@0 471
nuclear@0 472 db.reader->IncPtr(size);
nuclear@0 473 }
nuclear@0 474
nuclear@0 475 //--------------------------------------------------------------------------------
nuclear@0 476 template <> void Structure :: Convert<MLoop> (
nuclear@0 477 MLoop& dest,
nuclear@0 478 const FileDatabase& db
nuclear@0 479 ) const
nuclear@0 480 {
nuclear@0 481
nuclear@0 482 ReadField<ErrorPolicy_Igno>(dest.v,"v",db);
nuclear@0 483 ReadField<ErrorPolicy_Igno>(dest.e,"e",db);
nuclear@0 484
nuclear@0 485 db.reader->IncPtr(size);
nuclear@0 486 }
nuclear@0 487
nuclear@0 488 //--------------------------------------------------------------------------------
nuclear@0 489 template <> void Structure :: Convert<ModifierData> (
nuclear@0 490 ModifierData& dest,
nuclear@0 491 const FileDatabase& db
nuclear@0 492 ) const
nuclear@0 493 {
nuclear@0 494
nuclear@0 495 ReadFieldPtr<ErrorPolicy_Warn>(dest.next,"*next",db);
nuclear@0 496 ReadFieldPtr<ErrorPolicy_Warn>(dest.prev,"*prev",db);
nuclear@0 497 ReadField<ErrorPolicy_Igno>(dest.type,"type",db);
nuclear@0 498 ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
nuclear@0 499 ReadFieldArray<ErrorPolicy_Igno>(dest.name,"name",db);
nuclear@0 500
nuclear@0 501 db.reader->IncPtr(size);
nuclear@0 502 }
nuclear@0 503
nuclear@0 504 //--------------------------------------------------------------------------------
nuclear@0 505 template <> void Structure :: Convert<ID> (
nuclear@0 506 ID& dest,
nuclear@0 507 const FileDatabase& db
nuclear@0 508 ) const
nuclear@0 509 {
nuclear@0 510
nuclear@0 511 ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
nuclear@0 512 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 513
nuclear@0 514 db.reader->IncPtr(size);
nuclear@0 515 }
nuclear@0 516
nuclear@0 517 //--------------------------------------------------------------------------------
nuclear@0 518 template <> void Structure :: Convert<MCol> (
nuclear@0 519 MCol& dest,
nuclear@0 520 const FileDatabase& db
nuclear@0 521 ) const
nuclear@0 522 {
nuclear@0 523
nuclear@0 524 ReadField<ErrorPolicy_Fail>(dest.r,"r",db);
nuclear@0 525 ReadField<ErrorPolicy_Fail>(dest.g,"g",db);
nuclear@0 526 ReadField<ErrorPolicy_Fail>(dest.b,"b",db);
nuclear@0 527 ReadField<ErrorPolicy_Fail>(dest.a,"a",db);
nuclear@0 528
nuclear@0 529 db.reader->IncPtr(size);
nuclear@0 530 }
nuclear@0 531
nuclear@0 532 //--------------------------------------------------------------------------------
nuclear@0 533 template <> void Structure :: Convert<MPoly> (
nuclear@0 534 MPoly& dest,
nuclear@0 535 const FileDatabase& db
nuclear@0 536 ) const
nuclear@0 537 {
nuclear@0 538
nuclear@0 539 ReadField<ErrorPolicy_Igno>(dest.loopstart,"loopstart",db);
nuclear@0 540 ReadField<ErrorPolicy_Igno>(dest.totloop,"totloop",db);
nuclear@0 541 ReadField<ErrorPolicy_Igno>(dest.mat_nr,"mat_nr",db);
nuclear@0 542 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 543
nuclear@0 544 db.reader->IncPtr(size);
nuclear@0 545 }
nuclear@0 546
nuclear@0 547 //--------------------------------------------------------------------------------
nuclear@0 548 template <> void Structure :: Convert<Scene> (
nuclear@0 549 Scene& dest,
nuclear@0 550 const FileDatabase& db
nuclear@0 551 ) const
nuclear@0 552 {
nuclear@0 553
nuclear@0 554 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 555 ReadFieldPtr<ErrorPolicy_Warn>(dest.camera,"*camera",db);
nuclear@0 556 ReadFieldPtr<ErrorPolicy_Warn>(dest.world,"*world",db);
nuclear@0 557 ReadFieldPtr<ErrorPolicy_Warn>(dest.basact,"*basact",db);
nuclear@0 558 ReadField<ErrorPolicy_Igno>(dest.base,"base",db);
nuclear@0 559
nuclear@0 560 db.reader->IncPtr(size);
nuclear@0 561 }
nuclear@0 562
nuclear@0 563 //--------------------------------------------------------------------------------
nuclear@0 564 template <> void Structure :: Convert<Library> (
nuclear@0 565 Library& dest,
nuclear@0 566 const FileDatabase& db
nuclear@0 567 ) const
nuclear@0 568 {
nuclear@0 569
nuclear@0 570 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 571 ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
nuclear@0 572 ReadFieldArray<ErrorPolicy_Fail>(dest.filename,"filename",db);
nuclear@0 573 ReadFieldPtr<ErrorPolicy_Warn>(dest.parent,"*parent",db);
nuclear@0 574
nuclear@0 575 db.reader->IncPtr(size);
nuclear@0 576 }
nuclear@0 577
nuclear@0 578 //--------------------------------------------------------------------------------
nuclear@0 579 template <> void Structure :: Convert<Tex> (
nuclear@0 580 Tex& dest,
nuclear@0 581 const FileDatabase& db
nuclear@0 582 ) const
nuclear@0 583 {
nuclear@0 584
nuclear@0 585 ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
nuclear@0 586 ReadFieldPtr<ErrorPolicy_Warn>(dest.ima,"*ima",db);
nuclear@0 587
nuclear@0 588 db.reader->IncPtr(size);
nuclear@0 589 }
nuclear@0 590
nuclear@0 591 //--------------------------------------------------------------------------------
nuclear@0 592 template <> void Structure :: Convert<Camera> (
nuclear@0 593 Camera& dest,
nuclear@0 594 const FileDatabase& db
nuclear@0 595 ) const
nuclear@0 596 {
nuclear@0 597
nuclear@0 598 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 599 ReadField<ErrorPolicy_Warn>((int&)dest.type,"type",db);
nuclear@0 600 ReadField<ErrorPolicy_Warn>((int&)dest.flag,"flag",db);
nuclear@0 601 ReadField<ErrorPolicy_Warn>(dest.angle,"angle",db);
nuclear@0 602
nuclear@0 603 db.reader->IncPtr(size);
nuclear@0 604 }
nuclear@0 605
nuclear@0 606 //--------------------------------------------------------------------------------
nuclear@0 607 template <> void Structure :: Convert<MirrorModifierData> (
nuclear@0 608 MirrorModifierData& dest,
nuclear@0 609 const FileDatabase& db
nuclear@0 610 ) const
nuclear@0 611 {
nuclear@0 612
nuclear@0 613 ReadField<ErrorPolicy_Fail>(dest.modifier,"modifier",db);
nuclear@0 614 ReadField<ErrorPolicy_Igno>(dest.axis,"axis",db);
nuclear@0 615 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 616 ReadField<ErrorPolicy_Igno>(dest.tolerance,"tolerance",db);
nuclear@0 617 ReadFieldPtr<ErrorPolicy_Igno>(dest.mirror_ob,"*mirror_ob",db);
nuclear@0 618
nuclear@0 619 db.reader->IncPtr(size);
nuclear@0 620 }
nuclear@0 621
nuclear@0 622 //--------------------------------------------------------------------------------
nuclear@0 623 template <> void Structure :: Convert<Image> (
nuclear@0 624 Image& dest,
nuclear@0 625 const FileDatabase& db
nuclear@0 626 ) const
nuclear@0 627 {
nuclear@0 628
nuclear@0 629 ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
nuclear@0 630 ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
nuclear@0 631 ReadField<ErrorPolicy_Igno>(dest.ok,"ok",db);
nuclear@0 632 ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
nuclear@0 633 ReadField<ErrorPolicy_Igno>(dest.source,"source",db);
nuclear@0 634 ReadField<ErrorPolicy_Igno>(dest.type,"type",db);
nuclear@0 635 ReadField<ErrorPolicy_Igno>(dest.pad,"pad",db);
nuclear@0 636 ReadField<ErrorPolicy_Igno>(dest.pad1,"pad1",db);
nuclear@0 637 ReadField<ErrorPolicy_Igno>(dest.lastframe,"lastframe",db);
nuclear@0 638 ReadField<ErrorPolicy_Igno>(dest.tpageflag,"tpageflag",db);
nuclear@0 639 ReadField<ErrorPolicy_Igno>(dest.totbind,"totbind",db);
nuclear@0 640 ReadField<ErrorPolicy_Igno>(dest.xrep,"xrep",db);
nuclear@0 641 ReadField<ErrorPolicy_Igno>(dest.yrep,"yrep",db);
nuclear@0 642 ReadField<ErrorPolicy_Igno>(dest.twsta,"twsta",db);
nuclear@0 643 ReadField<ErrorPolicy_Igno>(dest.twend,"twend",db);
nuclear@0 644 ReadFieldPtr<ErrorPolicy_Igno>(dest.packedfile,"*packedfile",db);
nuclear@0 645 ReadField<ErrorPolicy_Igno>(dest.lastupdate,"lastupdate",db);
nuclear@0 646 ReadField<ErrorPolicy_Igno>(dest.lastused,"lastused",db);
nuclear@0 647 ReadField<ErrorPolicy_Igno>(dest.animspeed,"animspeed",db);
nuclear@0 648 ReadField<ErrorPolicy_Igno>(dest.gen_x,"gen_x",db);
nuclear@0 649 ReadField<ErrorPolicy_Igno>(dest.gen_y,"gen_y",db);
nuclear@0 650 ReadField<ErrorPolicy_Igno>(dest.gen_type,"gen_type",db);
nuclear@0 651
nuclear@0 652 db.reader->IncPtr(size);
nuclear@0 653 }
nuclear@0 654
nuclear@0 655 //--------------------------------------------------------------------------------
nuclear@0 656 void DNA::RegisterConverters() {
nuclear@0 657
nuclear@0 658 converters["Object"] = DNA::FactoryPair( &Structure::Allocate<Object>, &Structure::Convert<Object> );
nuclear@0 659 converters["Group"] = DNA::FactoryPair( &Structure::Allocate<Group>, &Structure::Convert<Group> );
nuclear@0 660 converters["MTex"] = DNA::FactoryPair( &Structure::Allocate<MTex>, &Structure::Convert<MTex> );
nuclear@0 661 converters["TFace"] = DNA::FactoryPair( &Structure::Allocate<TFace>, &Structure::Convert<TFace> );
nuclear@0 662 converters["SubsurfModifierData"] = DNA::FactoryPair( &Structure::Allocate<SubsurfModifierData>, &Structure::Convert<SubsurfModifierData> );
nuclear@0 663 converters["MFace"] = DNA::FactoryPair( &Structure::Allocate<MFace>, &Structure::Convert<MFace> );
nuclear@0 664 converters["Lamp"] = DNA::FactoryPair( &Structure::Allocate<Lamp>, &Structure::Convert<Lamp> );
nuclear@0 665 converters["MDeformWeight"] = DNA::FactoryPair( &Structure::Allocate<MDeformWeight>, &Structure::Convert<MDeformWeight> );
nuclear@0 666 converters["PackedFile"] = DNA::FactoryPair( &Structure::Allocate<PackedFile>, &Structure::Convert<PackedFile> );
nuclear@0 667 converters["Base"] = DNA::FactoryPair( &Structure::Allocate<Base>, &Structure::Convert<Base> );
nuclear@0 668 converters["MTFace"] = DNA::FactoryPair( &Structure::Allocate<MTFace>, &Structure::Convert<MTFace> );
nuclear@0 669 converters["Material"] = DNA::FactoryPair( &Structure::Allocate<Material>, &Structure::Convert<Material> );
nuclear@0 670 converters["MTexPoly"] = DNA::FactoryPair( &Structure::Allocate<MTexPoly>, &Structure::Convert<MTexPoly> );
nuclear@0 671 converters["Mesh"] = DNA::FactoryPair( &Structure::Allocate<Mesh>, &Structure::Convert<Mesh> );
nuclear@0 672 converters["MDeformVert"] = DNA::FactoryPair( &Structure::Allocate<MDeformVert>, &Structure::Convert<MDeformVert> );
nuclear@0 673 converters["World"] = DNA::FactoryPair( &Structure::Allocate<World>, &Structure::Convert<World> );
nuclear@0 674 converters["MLoopCol"] = DNA::FactoryPair( &Structure::Allocate<MLoopCol>, &Structure::Convert<MLoopCol> );
nuclear@0 675 converters["MVert"] = DNA::FactoryPair( &Structure::Allocate<MVert>, &Structure::Convert<MVert> );
nuclear@0 676 converters["MEdge"] = DNA::FactoryPair( &Structure::Allocate<MEdge>, &Structure::Convert<MEdge> );
nuclear@0 677 converters["MLoopUV"] = DNA::FactoryPair( &Structure::Allocate<MLoopUV>, &Structure::Convert<MLoopUV> );
nuclear@0 678 converters["GroupObject"] = DNA::FactoryPair( &Structure::Allocate<GroupObject>, &Structure::Convert<GroupObject> );
nuclear@0 679 converters["ListBase"] = DNA::FactoryPair( &Structure::Allocate<ListBase>, &Structure::Convert<ListBase> );
nuclear@0 680 converters["MLoop"] = DNA::FactoryPair( &Structure::Allocate<MLoop>, &Structure::Convert<MLoop> );
nuclear@0 681 converters["ModifierData"] = DNA::FactoryPair( &Structure::Allocate<ModifierData>, &Structure::Convert<ModifierData> );
nuclear@0 682 converters["ID"] = DNA::FactoryPair( &Structure::Allocate<ID>, &Structure::Convert<ID> );
nuclear@0 683 converters["MCol"] = DNA::FactoryPair( &Structure::Allocate<MCol>, &Structure::Convert<MCol> );
nuclear@0 684 converters["MPoly"] = DNA::FactoryPair( &Structure::Allocate<MPoly>, &Structure::Convert<MPoly> );
nuclear@0 685 converters["Scene"] = DNA::FactoryPair( &Structure::Allocate<Scene>, &Structure::Convert<Scene> );
nuclear@0 686 converters["Library"] = DNA::FactoryPair( &Structure::Allocate<Library>, &Structure::Convert<Library> );
nuclear@0 687 converters["Tex"] = DNA::FactoryPair( &Structure::Allocate<Tex>, &Structure::Convert<Tex> );
nuclear@0 688 converters["Camera"] = DNA::FactoryPair( &Structure::Allocate<Camera>, &Structure::Convert<Camera> );
nuclear@0 689 converters["MirrorModifierData"] = DNA::FactoryPair( &Structure::Allocate<MirrorModifierData>, &Structure::Convert<MirrorModifierData> );
nuclear@0 690 converters["Image"] = DNA::FactoryPair( &Structure::Allocate<Image>, &Structure::Convert<Image> );
nuclear@0 691 }
nuclear@0 692
nuclear@0 693
nuclear@0 694 #endif