540 lines
20 KiB
C++
540 lines
20 KiB
C++
/*
|
|
Open Asset Import Library (ASSIMP)
|
|
----------------------------------------------------------------------
|
|
|
|
Copyright (c) 2006-2010, ASSIMP Development 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 Development 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 BlenderScene.cpp
|
|
* @brief MACHINE GENERATED BY ./scripts/BlenderImporter/genblenddna.py
|
|
*/
|
|
#include "AssimpPCH.h"
|
|
#ifndef AI_BUILD_NO_BLEND_IMPORTER
|
|
|
|
#include "BlenderDNA.h"
|
|
#include "BlenderScene.h"
|
|
#include "BlenderSceneGen.h"
|
|
|
|
using namespace Assimp;
|
|
using namespace Assimp::Blender;
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Object> (
|
|
Object& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.type,"type",db);
|
|
ReadFieldArray2<ErrorPolicy_Igno>(dest.obmat,"obmat",db);
|
|
ReadFieldArray2<ErrorPolicy_Igno>(dest.parentinv,"parentinv",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.parsubstr,"parsubstr",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.parent,"*parent",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.track,"*track",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.proxy,"*proxy",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.proxy_from,"*proxy_from",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.proxy_group,"*proxy_group",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.dup_group,"*dup_group",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.data,"*data",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Group> (
|
|
Group& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.layer,"layer",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.gobject,"*gobject",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MTex> (
|
|
MTex& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.blendtype,"blendtype",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.object,"*object",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.tex,"*tex",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.uvname,"uvname",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.projx,"projx",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.projy,"projy",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.projz,"projz",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mapping,"mapping",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.ofs,"ofs",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.size,"size",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.rot,"rot",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.texflag,"texflag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.colormodel,"colormodel",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.pmapto,"pmapto",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.pmaptoneg,"pmaptoneg",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.r,"r",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.g,"g",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.b,"b",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.k,"k",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.colspecfac,"colspecfac",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mirrfac,"mirrfac",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.alphafac,"alphafac",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.difffac,"difffac",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.specfac,"specfac",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.emitfac,"emitfac",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.hardfac,"hardfac",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<TFace> (
|
|
TFace& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldArray2<ErrorPolicy_Igno>(dest.uv,"uv",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.col,"col",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.unwrap,"unwrap",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MFace> (
|
|
MFace& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.v1,"v1",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.v2,"v2",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.v3,"v3",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.v4,"v4",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mat_nr,"mat_nr",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Lamp> (
|
|
Lamp& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.type,"type",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flags,"flags",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.colormodel,"colormodel",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.totex,"totex",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.r,"r",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.g,"g",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.b,"b",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.k,"k",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.energy,"energy",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.dist,"dist",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.spotsize,"spotsize",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.spotblend,"spotblend",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.att1,"att1",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.att2,"att2",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.falloff_type,"falloff_type",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.sun_brightness,"sun_brightness",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MDeformWeight> (
|
|
MDeformWeight& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.def_nr,"def_nr",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.weight,"weight",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<PackedFile> (
|
|
PackedFile& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Base> (
|
|
Base& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.prev,"*prev",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.next,"*next",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.object,"*object",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MTFace> (
|
|
MTFace& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldArray2<ErrorPolicy_Igno>(dest.uv,"uv",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.unwrap,"unwrap",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Material> (
|
|
Material& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.r,"r",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.g,"g",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.b,"b",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.specr,"specr",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.specg,"specg",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.specb,"specb",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.ambir,"ambir",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.ambig,"ambig",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.ambib,"ambib",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mirr,"mirr",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mirg,"mirg",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mirb,"mirb",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.emit,"emit",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.alpha,"alpha",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.ref,"ref",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.translucency,"translucency",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.roughness,"roughness",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.darkness,"darkness",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.refrac,"refrac",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.group,"*group",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.diff_shader,"diff_shader",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.spec_shader,"spec_shader",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Mesh> (
|
|
Mesh& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.totface,"totface",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.totedge,"totedge",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.totvert,"totvert",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.subdiv,"subdiv",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.subdivr,"subdivr",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.subsurftype,"subsurftype",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.smoothresh,"smoothresh",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.mface,"*mface",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.mtface,"*mtface",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.tface,"*tface",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.mvert,"*mvert",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.medge,"*medge",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.dvert,"*dvert",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.mcol,"*mcol",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MDeformVert> (
|
|
MDeformVert& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.dw,"*dw",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.totweight,"totweight",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<World> (
|
|
World& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MVert> (
|
|
MVert& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.co,"co",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.no,"no",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.mat_nr,"mat_nr",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.bweight,"bweight",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MEdge> (
|
|
MEdge& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.v1,"v1",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.v2,"v2",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.crease,"crease",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.bweight,"bweight",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<GroupObject> (
|
|
GroupObject& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.prev,"*prev",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.next,"*next",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.ob,"*ob",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<ListBase> (
|
|
ListBase& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.first,"*first",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.last,"*last",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<ID> (
|
|
ID& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.name,"name",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<MCol> (
|
|
MCol& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.r,"r",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.g,"g",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.b,"b",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.a,"a",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Image> (
|
|
Image& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.name,"name",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.ok,"ok",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.source,"source",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.type,"type",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.pad,"pad",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.pad1,"pad1",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.lastframe,"lastframe",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.tpageflag,"tpageflag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.totbind,"totbind",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.xrep,"xrep",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.yrep,"yrep",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.twsta,"twsta",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.twend,"twend",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.packedfile,"*packedfile",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.lastupdate,"lastupdate",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.lastused,"lastused",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.animspeed,"animspeed",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.gen_x,"gen_x",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.gen_y,"gen_y",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.gen_type,"gen_type",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Scene> (
|
|
Scene& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.camera,"*camera",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.world,"*world",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.basact,"*basact",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.base,"base",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Library> (
|
|
Library& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.name,"name",db);
|
|
ReadFieldArray<ErrorPolicy_Igno>(dest.filename,"filename",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.parent,"*parent",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Tex> (
|
|
Tex& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.type,"type",db);
|
|
ReadFieldPtr<ErrorPolicy_Igno>(dest.ima,"*ima",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
template <> void Structure :: Convert<Camera> (
|
|
Camera& dest,
|
|
const FileDatabase& db
|
|
) const
|
|
{
|
|
|
|
ReadField<ErrorPolicy_Igno>(dest.id,"id",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.type,"type",db);
|
|
ReadField<ErrorPolicy_Igno>((int&)dest.flag,"flag",db);
|
|
ReadField<ErrorPolicy_Igno>(dest.angle,"angle",db);
|
|
|
|
db.reader->IncPtr(size);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
void DNA::RegisterConverters() {
|
|
|
|
converters["Object"] = &Structure::Convert<Object>;
|
|
converters["Group"] = &Structure::Convert<Group>;
|
|
converters["MTex"] = &Structure::Convert<MTex>;
|
|
converters["TFace"] = &Structure::Convert<TFace>;
|
|
converters["MFace"] = &Structure::Convert<MFace>;
|
|
converters["Lamp"] = &Structure::Convert<Lamp>;
|
|
converters["MDeformWeight"] = &Structure::Convert<MDeformWeight>;
|
|
converters["PackedFile"] = &Structure::Convert<PackedFile>;
|
|
converters["Base"] = &Structure::Convert<Base>;
|
|
converters["MTFace"] = &Structure::Convert<MTFace>;
|
|
converters["Material"] = &Structure::Convert<Material>;
|
|
converters["Mesh"] = &Structure::Convert<Mesh>;
|
|
converters["MDeformVert"] = &Structure::Convert<MDeformVert>;
|
|
converters["World"] = &Structure::Convert<World>;
|
|
converters["MVert"] = &Structure::Convert<MVert>;
|
|
converters["MEdge"] = &Structure::Convert<MEdge>;
|
|
converters["GroupObject"] = &Structure::Convert<GroupObject>;
|
|
converters["ListBase"] = &Structure::Convert<ListBase>;
|
|
converters["ID"] = &Structure::Convert<ID>;
|
|
converters["MCol"] = &Structure::Convert<MCol>;
|
|
converters["Image"] = &Structure::Convert<Image>;
|
|
converters["Scene"] = &Structure::Convert<Scene>;
|
|
converters["Library"] = &Structure::Convert<Library>;
|
|
converters["Tex"] = &Structure::Convert<Tex>;
|
|
converters["Camera"] = &Structure::Convert<Camera>;
|
|
}
|
|
|
|
|
|
#endif
|