[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47833] branches/soc-2012-bratwurst/extern /assimp: - cleanup ext_assimp repository and remove loaders redundant in Blender.
Alexander Gessler
alexander.gessler at gmx.net
Wed Jun 13 16:22:04 CEST 2012
Revision: 47833
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47833
Author: aramis_acg
Date: 2012-06-13 14:22:03 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
- cleanup ext_assimp repository and remove loaders redundant in Blender.
Modified Paths:
--------------
branches/soc-2012-bratwurst/extern/assimp/CMakeLists.txt
Removed Paths:
-------------
branches/soc-2012-bratwurst/extern/assimp/code/BlenderDNA.cpp
branches/soc-2012-bratwurst/extern/assimp/code/BlenderDNA.h
branches/soc-2012-bratwurst/extern/assimp/code/BlenderDNA.inl
branches/soc-2012-bratwurst/extern/assimp/code/BlenderIntermediate.h
branches/soc-2012-bratwurst/extern/assimp/code/BlenderLoader.cpp
branches/soc-2012-bratwurst/extern/assimp/code/BlenderLoader.h
branches/soc-2012-bratwurst/extern/assimp/code/BlenderModifier.cpp
branches/soc-2012-bratwurst/extern/assimp/code/BlenderModifier.h
branches/soc-2012-bratwurst/extern/assimp/code/BlenderScene.cpp
branches/soc-2012-bratwurst/extern/assimp/code/BlenderScene.h
branches/soc-2012-bratwurst/extern/assimp/code/BlenderSceneGen.h
branches/soc-2012-bratwurst/extern/assimp/code/ColladaExporter.cpp
branches/soc-2012-bratwurst/extern/assimp/code/ColladaExporter.h
branches/soc-2012-bratwurst/extern/assimp/code/ColladaHelper.h
branches/soc-2012-bratwurst/extern/assimp/code/ColladaLoader.cpp
branches/soc-2012-bratwurst/extern/assimp/code/ColladaLoader.h
branches/soc-2012-bratwurst/extern/assimp/code/ColladaParser.cpp
branches/soc-2012-bratwurst/extern/assimp/code/ColladaParser.h
Modified: branches/soc-2012-bratwurst/extern/assimp/CMakeLists.txt
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/CMakeLists.txt 2012-06-13 14:18:42 UTC (rev 47832)
+++ branches/soc-2012-bratwurst/extern/assimp/CMakeLists.txt 2012-06-13 14:22:03 UTC (rev 47833)
@@ -116,16 +116,6 @@
code/BVHLoader.h
)
-SET( Collada_SRCS
- code/ColladaHelper.h
- code/ColladaLoader.cpp
- code/ColladaLoader.h
- code/ColladaParser.cpp
- code/ColladaParser.h
- code/ColladaExporter.h
- code/ColladaExporter.cpp
-)
-
SET( DXF_SRCS
code/DXFLoader.cpp
code/DXFLoader.h
@@ -271,20 +261,6 @@
code/COBScene.h
)
-SET(BLENDER_SRCS
- code/BlenderLoader.cpp
- code/BlenderLoader.h
- code/BlenderDNA.cpp
- code/BlenderDNA.h
- code/BlenderDNA.inl
- code/BlenderScene.cpp
- code/BlenderScene.h
- code/BlenderSceneGen.h
- code/BlenderIntermediate.h
- code/BlenderModifier.h
- code/BlenderModifier.cpp
-)
-
SET(IFC_SRCS
code/IFCLoader.cpp
code/IFCLoader.h
@@ -486,7 +462,6 @@
${ASE_SRCS}
${B3D_SRCS}
${BVH_SRCS}
- ${Collada_SRCS}
${DXF_SRCS}
${CSM_SRCS}
${HMP_SRCS}
@@ -515,7 +490,6 @@
${Extra_SRCS}
${MS3D_SRCS}
${COB_SRCS}
- ${BLENDER_SRCS}
${NDO_SRCS}
${IFC_SRCS}
${XGL_SRCS}
@@ -529,6 +503,9 @@
${Boost_SRCS}
)
+add_definitions(-DASSIMP_BUILD_NO_COLLADA_IMPORTER)
+add_definitions(-DASSIMP_BUILD_NO_BLEND_IMPORTER)
+
blender_add_lib(extern_assimp "${SRC}" "${INC}" "$(INC_SYS)")
Deleted: branches/soc-2012-bratwurst/extern/assimp/code/BlenderDNA.cpp
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/code/BlenderDNA.cpp 2012-06-13 14:18:42 UTC (rev 47832)
+++ branches/soc-2012-bratwurst/extern/assimp/code/BlenderDNA.cpp 2012-06-13 14:22:03 UTC (rev 47833)
@@ -1,372 +0,0 @@
-/*
-Open Asset Import Library (assimp)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2012, 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 BlenderDNA.cpp
- * @brief Implementation of the Blender `DNA`, that is its own
- * serialized set of data structures.
- */
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
-#include "BlenderDNA.h"
-#include "StreamReader.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace Assimp::Blender;
-using namespace Assimp::Formatter;
-
-#define for_each BOOST_FOREACH
-bool match4(StreamReaderAny& stream, const char* string) {
- char tmp[] = {
- (stream).GetI1(),
- (stream).GetI1(),
- (stream).GetI1(),
- (stream).GetI1()
- };
- return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]);
-}
-
-struct Type {
- size_t size;
- std::string name;
-};
-
-// ------------------------------------------------------------------------------------------------
-void DNAParser :: Parse ()
-{
- StreamReaderAny& stream = *db.reader.get();
- DNA& dna = db.dna;
-
- if(!match4(stream,"SDNA")) {
- throw DeadlyImportError("BlenderDNA: Expected SDNA chunk");
- }
-
- // name dictionary
- if(!match4(stream,"NAME")) {
- throw DeadlyImportError("BlenderDNA: Expected NAME field");
- }
-
- std::vector<std::string> names (stream.GetI4());
- for_each(std::string& s, names) {
- while (char c = stream.GetI1()) {
- s += c;
- }
- }
-
- // type dictionary
- for (;stream.GetCurrentPos() & 0x3; stream.GetI1());
- if(!match4(stream,"TYPE")) {
- throw DeadlyImportError("BlenderDNA: Expected TYPE field");
- }
-
- std::vector<Type> types (stream.GetI4());
- for_each(Type& s, types) {
- while (char c = stream.GetI1()) {
- s.name += c;
- }
- }
-
- // type length dictionary
- for (;stream.GetCurrentPos() & 0x3; stream.GetI1());
- if(!match4(stream,"TLEN")) {
- throw DeadlyImportError("BlenderDNA: Expected TLEN field");
- }
-
- for_each(Type& s, types) {
- s.size = stream.GetI2();
- }
-
- // structures dictionary
- for (;stream.GetCurrentPos() & 0x3; stream.GetI1());
- if(!match4(stream,"STRC")) {
- throw DeadlyImportError("BlenderDNA: Expected STRC field");
- }
-
- size_t end = stream.GetI4(), fields = 0;
-
- dna.structures.reserve(end);
- for(size_t i = 0; i != end; ++i) {
-
- uint16_t n = stream.GetI2();
- if (n >= types.size()) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Invalid type index in structure name" ,n,
- " (there are only ", types.size(), " entries)"
- ));
- }
-
- // maintain separate indexes
- dna.indices[types[n].name] = dna.structures.size();
-
- dna.structures.push_back(Structure());
- Structure& s = dna.structures.back();
- s.name = types[n].name;
- //s.index = dna.structures.size()-1;
-
- n = stream.GetI2();
- s.fields.reserve(n);
-
- size_t offset = 0;
- for (size_t m = 0; m < n; ++m, ++fields) {
-
- uint16_t j = stream.GetI2();
- if (j >= types.size()) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Invalid type index in structure field ", j,
- " (there are only ", types.size(), " entries)"
- ));
- }
- s.fields.push_back(Field());
- Field& f = s.fields.back();
- f.offset = offset;
-
- f.type = types[j].name;
- f.size = types[j].size;
-
- j = stream.GetI2();
- if (j >= names.size()) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Invalid name index in structure field ", j,
- " (there are only ", names.size(), " entries)"
- ));
- }
-
- f.name = names[j];
- f.flags = 0u;
-
- // pointers always specify the size of the pointee instead of their own.
- // The pointer asterisk remains a property of the lookup name.
- if (f.name[0] == '*') {
- f.size = db.i64bit ? 8 : 4;
- f.flags |= FieldFlag_Pointer;
- }
-
- // arrays, however, specify the size of a single element so we
- // need to parse the (possibly multi-dimensional) array declaration
- // in order to obtain the actual size of the array in the file.
- // Also we need to alter the lookup name to include no array
- // brackets anymore or size fixup won't work (if our size does
- // not match the size read from the DNA).
- if (*f.name.rbegin() == ']') {
- const std::string::size_type rb = f.name.find('[');
- if (rb == std::string::npos) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Encountered invalid array declaration ",
- f.name
- ));
- }
-
- f.flags |= FieldFlag_Array;
- DNA::ExtractArraySize(f.name,f.array_sizes);
- f.name = f.name.substr(0,rb);
-
- f.size *= f.array_sizes[0] * f.array_sizes[1];
- }
-
- // maintain separate indexes
- s.indices[f.name] = s.fields.size()-1;
- offset += f.size;
- }
- s.size = offset;
- }
-
- DefaultLogger::get()->debug((format(),"BlenderDNA: Got ",dna.structures.size(),
- " structures with totally ",fields," fields"));
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
- dna.DumpToFile();
-#endif
-
- dna.AddPrimitiveStructures();
- dna.RegisterConverters();
-}
-
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
-
-#include <fstream>
-// ------------------------------------------------------------------------------------------------
-void DNA :: DumpToFile()
-{
- // we dont't bother using the VFS here for this is only for debugging.
- // (and all your bases are belong to us).
-
- std::ofstream f("dna.txt");
- if (f.fail()) {
- DefaultLogger::get()->error("Could not dump dna to dna.txt");
- return;
- }
- f << "Field format: type name offset size" << "\n";
- f << "Structure format: name size" << "\n";
-
- for_each(const Structure& s, structures) {
- f << s.name << " " << s.size << "\n\n";
- for_each(const Field& ff, s.fields) {
- f << "\t" << ff.type << " " << ff.name << " " << ff.offset << " " << ff.size << std::endl;
- }
- f << std::endl;
- }
- DefaultLogger::get()->info("BlenderDNA: Dumped dna to dna.txt");
-}
-#endif
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void DNA :: ExtractArraySize(
- const std::string& out,
- size_t array_sizes[2]
-)
-{
- array_sizes[0] = array_sizes[1] = 1;
- std::string::size_type pos = out.find('[');
- if (pos++ == std::string::npos) {
- return;
- }
- array_sizes[0] = strtoul10(&out[pos]);
-
- pos = out.find('[',pos);
- if (pos++ == std::string::npos) {
- return;
- }
- array_sizes[1] = strtoul10(&out[pos]);
-}
-
-// ------------------------------------------------------------------------------------------------
-boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
- const Structure& structure,
- const FileDatabase& db
-) const
-{
- std::map<std::string, FactoryPair >::const_iterator it = converters.find(structure.name);
- if (it == converters.end()) {
- return boost::shared_ptr< ElemBase >();
- }
-
- boost::shared_ptr< ElemBase > ret = (structure.*((*it).second.first))();
- (structure.*((*it).second.second))(ret,db);
-
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-DNA::FactoryPair DNA :: GetBlobToStructureConverter(
- const Structure& structure,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list