Compare commits

...

39 Commits

Author SHA1 Message Date
Kim Kulling
bb1eaad91c Add prototypes for jt 2025-12-14 21:27:21 +01:00
Kim Kulling
81fad0f20c Prepare jt importer 2025-12-14 10:39:21 +01:00
Kim Kulling
354cf46b51 Merge 2998ad82a1 into 5b8cfa920b 2023-10-07 12:36:19 +00:00
Kim Kulling
2998ad82a1 Fix verbose string + refactorings 2023-10-07 14:21:59 +02:00
Kim Kulling
3ce8af18e2 Revert "Fix verbose string + refactorings"
This reverts commit 824db16a68.
2023-10-07 14:20:55 +02:00
Kim Kulling
824db16a68 Fix verbose string + refactorings 2023-10-07 14:17:39 +02:00
Kim Kulling
3dd83275c9 Merge branch 'master' of https://github.com/assimp/assimp 2023-10-07 08:43:44 +02:00
Kim Kulling
d65049a657 Merge branch 'master' of https://github.com/assimp/assimp 2023-09-09 20:28:25 +02:00
Kim Kulling
e2fa181aa6 Merge branch 'master' of https://github.com/assimp/assimp 2023-02-14 21:10:12 +01:00
Kim Kulling
6332f8a5bc Merge branch 'master' of https://github.com/assimp/assimp 2023-02-08 19:17:17 +01:00
Kim Kulling
b58bec39d9 Merge branch 'NeosSharedProject-fix-artifact' 2023-02-05 13:01:47 +01:00
Kim Kulling
ce7b2e571a Merge branch 'fix-artifact' of https://github.com/NeosSharedProject/assimp into NeosSharedProject-fix-artifact 2023-02-05 13:00:52 +01:00
Kazuki Y
6c95fe19d0 Merge branch 'master' into fix-artifact 2022-12-29 23:46:13 +09:00
Kazuki Y
26e4ab2a23 Merge branch 'assimp:master' into master 2022-12-29 23:44:30 +09:00
Kazuki Y
a84bf34cbb Update ccpp.yml 2022-12-29 23:43:07 +09:00
Kazuki Y
cd0bbe15af Merge branch 'master' into fix-artifact 2022-12-28 22:07:07 +09:00
Kazuki Y
d04dd1af9b Merge branch 'master' into fix-artifact 2022-12-21 22:35:35 +09:00
Kazuki Y
b406ce6707 Merge branch 'assimp:master' into master 2022-12-20 19:24:15 +09:00
Kazuki Y
2c87088079 Update ccpp.yml 2022-12-17 21:49:28 +09:00
Kazuki Y
2ec097b862 Update ccpp.yml 2022-12-17 21:06:36 +09:00
Kazuki Y
dd313da24f Update ccpp.yml 2022-12-17 21:04:11 +09:00
Kazuki Y
5925dcd0e2 Update ccpp.yml 2022-12-17 15:08:25 +09:00
Kazuki Y
9b644494ed Merge branch 'assimp:master' into master 2022-12-17 15:00:20 +09:00
Kazuki Y
b1a700dbbc Merge pull request #1 from NeosSharedProject/TestPatch
Update ccpp.yml
2022-12-12 12:43:51 +09:00
Kazuki Y
f77db867b5 Update ccpp.yml 2022-12-12 12:43:34 +09:00
kazu0617
4b523e99c4 fix ccpp.yml - build both hunter or not 2022-12-12 12:13:37 +09:00
kazu0617
53f0d5dcbd fix ccpp.yml -- fix matrix.name check for artifact 2022-12-12 10:55:13 +09:00
Kazuki Y
bbfc9f4658 upload/release対象のartifactを修正
追加当時のIssueを参考に修正(当時はHunterなかったっぽい)
a9a0c30932
2022-12-12 10:34:45 +09:00
Kazuki Y
fde8bf1071 buildする方についてwindows-msvcのついている方にした
この二つ、何の違いがあるかいまいち理解してない…
clでビルドするかhunterでビルドするかの違い?
2022-12-10 17:37:49 +09:00
Kazuki Y
cf3be00fd3 Update ccpp.yml 2022-12-09 17:42:45 +09:00
Kazuki Y
1f8f4da97c Merge branch 'assimp:master' into master 2022-12-09 16:21:11 +09:00
Kazuki Y
b9cf35ea3a Update ccpp.yml 2022-12-09 16:20:49 +09:00
Kazuki Y
09375a386a Update ccpp.yml 2022-12-09 10:28:32 +09:00
Kazuki Y
a09a4d0518 Update ccpp.yml 2022-12-09 01:49:22 +09:00
Kazuki Y
8b73b85628 Update ccpp.yml 2022-12-09 01:34:19 +09:00
Kazuki Y
b0515a0dd0 Update ccpp.yml 2022-12-08 20:50:48 +09:00
Kazuki Y
05b9940ce3 Merge branch 'assimp:master' into master 2022-12-08 20:19:58 +09:00
Kazuki Y
e8393116d4 Update ccpp.yml 2022-12-08 02:09:09 +09:00
Kazuki Y
49fa7fcc44 upload contains "windows" in GH Actions 2022-12-08 02:07:19 +09:00
8 changed files with 139 additions and 33 deletions

View File

@@ -197,4 +197,13 @@ jobs:
with: with:
files: | files: |
*.zip *.zip
upload_url: '${{ steps.upload-url.outputs.url }}'
- name: Upload EXE files
if: contains(matrix.name, 'windows-msvc-hunter')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
with:
files: |
build/bin/assimp*.exe
upload_url: '${{ steps.upload-url.outputs.url }}'

View File

@@ -0,0 +1,83 @@
//
#include "JT/JTImporter.h"
#include <assimp/StreamReader.h>
#include <cstddef>
namespace Assimp::JT {
enum class SegmentType {
Invalid = -1, //< Predefined class: Invalid
LOGICAL_SCENE_GRAPH,//< Predefined class: Logical_Scene_Graph
JT_BREP,//< Predefined class: JT_BRep
PMI_DATA, //<Predefined class: PMI_Data
META_DATA, //< Predefined class: Meta_Data
SHAPE, //< Predefined class: Shape
SHAPE_LOD0, //< Predefined class: Shape_LOD0
SHAPE_LOD1, //< Predefined class: Logical_Scene_Graph
SHAPE_LOD2, //< Predefined class: Shape_LOD2
SHAPE_LOD3, //< Predefined class: Shape_LOD3
SHAPE_LOD4, //< Predefined class: Shape_LOD4
SHAPE_LOD5, //< Predefined class: Shape_LOD5
SHAPE_LOD6, //< Predefined class: Shape_LOD6
SHAPE_LOD7, //< Predefined class: Shape_LOD7
SHAPE_LOD8, //< Predefined class: Shape_LOD8
SHAPE_LOD9, ///< Predefined class: Shape_LOD9
XT_BREP, //< Predefined class: XT_BRep
Count //< Number of segment types
};
struct Guid {
uint32_t Data0{};
uint32_t Data1{};
uint32_t Data2{}
uint32_t Data3{};
};
struct Version {
constexpr static size_t VersionSize = 80;
uint8_t Version[VersionSize]{};
int32_t Empty{0};
uint64_t TOCOffset{0};
}
struct SegmentHeader {
Guid SegmentGuid{};
SegmentType Type{SegmentType::Invalid};
};
namespace {
void readVersion(StreamReaderLE& reader, Version& version) {
reader.ReadBytes(version.Version, Version::VersionSize);
version.Empty = reader.Read<int32_t>();
version.TOCOffset = reader.Read<uint64_t>();
}
} // Anonymous namespace
JTImporter::JTImporter() : BaseImporter() {
}
JTImporter::~JTImporter() {
}
bool JTImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const {
}
void JTImporter::setupProperties(const Importer* pImp) {
}
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) {
auto stream = std::shared_ptr<IOStream>(pIOHandler->Open(pFile, "rb"));
if (!stream) {
throw DeadlyImportError("Failed to open JT file " + pFile + " for reading.");
}
StreamReaderLE reader(stream);
Version version;
readVersion(reader, version);
}
} // Namespace Assimp

View File

@@ -0,0 +1,17 @@
#pragma once
#include <assimp/BaseImporter.h>
namespace Assimp::JT {
class JTImporter : public BaseImporter {
public:
JTImporter();
~JTImporter() override;
bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override;
void setupProperties(const Importer* pImp) override;
protected:
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) override;
}

View File

@@ -914,29 +914,16 @@ class Asset {
friend struct Buffer; // To access OpenFile friend struct Buffer; // To access OpenFile
friend class AssetWriter; friend class AssetWriter;
private:
IOSystem *mIOSystem;
std::string mCurrentAssetDir;
size_t mSceneLength;
size_t mBodyOffset, mBodyLength;
std::vector<LazyDictBase *> mDicts;
IdMap mUsedIds;
Ref<Buffer> mBodyBuffer;
Asset(Asset &);
Asset &operator=(const Asset &);
public: public:
// Copy policies
Asset(Asset &) = delete;
Asset &operator=(const Asset &) = delete;
//! Keeps info about the enabled extensions //! Keeps info about the enabled extensions
struct Extensions { struct Extensions {
bool KHR_binary_glTF; bool KHR_binary_glTF{ false };
bool KHR_materials_common; bool KHR_materials_common{ false };
} extensionsUsed; } extensionsUsed;
AssetMetadata asset; AssetMetadata asset;
@@ -961,8 +948,7 @@ public:
Ref<Scene> scene; Ref<Scene> scene;
public: explicit Asset(IOSystem *io = nullptr) :
Asset(IOSystem *io = nullptr) :
mIOSystem(io), mIOSystem(io),
asset(), asset(),
accessors(*this, "accessors"), accessors(*this, "accessors"),
@@ -979,7 +965,7 @@ public:
skins(*this, "skins"), skins(*this, "skins"),
textures(*this, "textures"), textures(*this, "textures"),
lights(*this, "lights", "KHR_materials_common") { lights(*this, "lights", "KHR_materials_common") {
memset(&extensionsUsed, 0, sizeof(extensionsUsed)); // empty
} }
//! Main function //! Main function
@@ -995,10 +981,17 @@ public:
private: private:
void ReadBinaryHeader(IOStream &stream); void ReadBinaryHeader(IOStream &stream);
void ReadExtensionsUsed(Document &doc); void ReadExtensionsUsed(Document &doc);
IOStream *OpenFile(const std::string &path, const char *mode, bool absolute = false); IOStream *OpenFile(const std::string &path, const char *mode, bool absolute = false);
private:
IOSystem *mIOSystem;
std::string mCurrentAssetDir;
size_t mSceneLength;
size_t mBodyOffset, mBodyLength;
std::vector<LazyDictBase *> mDicts;
IdMap mUsedIds;
Ref<Buffer> mBodyBuffer;
}; };
} // namespace glTF } // namespace glTF

View File

@@ -49,7 +49,6 @@ struct aiNode;
namespace glTF { namespace glTF {
class Asset; class Asset;
} }
namespace Assimp { namespace Assimp {
@@ -58,7 +57,7 @@ namespace Assimp {
* Load the glTF format. * Load the glTF format.
* https://github.com/KhronosGroup/glTF/tree/master/specification * https://github.com/KhronosGroup/glTF/tree/master/specification
*/ */
class glTFImporter : public BaseImporter { class glTFImporter final : public BaseImporter {
public: public:
glTFImporter(); glTFImporter();
~glTFImporter() override = default; ~glTFImporter() override = default;

View File

@@ -401,6 +401,11 @@ ADD_ASSIMP_IMPORTER( IRR
AssetLib/Irr/IRRShared.h AssetLib/Irr/IRRShared.h
) )
ADD_ASSIMP_IMPORTER(JT
AssetLib/JT/JTImporter.cpp
AssetLib/JT/JTImporter.h
)
ADD_ASSIMP_IMPORTER( LWO ADD_ASSIMP_IMPORTER( LWO
AssetLib/LWO/LWOAnimation.cpp AssetLib/LWO/LWOAnimation.cpp
AssetLib/LWO/LWOAnimation.h AssetLib/LWO/LWOAnimation.h

View File

@@ -156,8 +156,8 @@ private:
std::string mCur{}; std::string mCur{};
const char *mEnd{nullptr}; const char *mEnd{nullptr};
StreamReaderLE &mStream; StreamReaderLE &mStream;
bool mSwallow{false}; bool mSwallow{ false };
bool mSkip_empty_lines{ false }; bool mSkip_empty_lines{ false };1
bool mTrim{ false }; bool mTrim{ false };
}; };

View File

@@ -331,11 +331,11 @@ private:
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
// `static` StreamReaders. Their byte order is fixed and they might be a little bit faster. // `static` StreamReaders. Their byte order is fixed and they might be a little bit faster.
#ifdef AI_BUILD_BIG_ENDIAN #ifdef AI_BUILD_BIG_ENDIAN
typedef StreamReader<true> StreamReaderLE; using StreamReaderLE = StreamReader<true> ;
typedef StreamReader<false> StreamReaderBE; using StreamReaderBE = StreamReader<false> ;
#else #else
typedef StreamReader<true> StreamReaderBE; using StreamReaderBE = StreamReader<true> ;
typedef StreamReader<false> StreamReaderLE; using StreamReaderLE = StreamReader<false> ;
#endif #endif
// `dynamic` StreamReader. The byte order of the input data is specified in the // `dynamic` StreamReader. The byte order of the input data is specified in the