Comments (9)
This is the verbose log for the make file:
https://gist.github.com/mastro/6194183
from assimp.
Do you have to use importer.GetOrphanedScene()? That should really only be used as a last resort; I don't believe aiScene::~aiScene is exported by the library.
I would recommend just using importer.GetScene(), and if necessary create separate importers if you need multiple scenes loaded simultaneously.
from assimp.
@jdduke yes I now store the Importer and use GetScene()
but I do not see why you are not exporting aiScene::~aiScene
you give the GetOrphanedScene() with a comment to say: be very careful and delete it when its not used anymore, but then don't give a way to delete it.. makes no sense to me.
I think the ~aiScene should be exported for that very reason.
from assimp.
I did not write the code, so no need to get feisty :)
I would argue that the cleaner solution would be to simply remove Importer::GetOrphanedScene() completely. Leaving it as an option will inevitably lead to abuse, undefined behavior and user issues like those you've experienced. I wonder... does assimp have a formal way of deprecating public API's?
from assimp.
@jdduke didn't meant to be feisty! :) English is not my main language, I don't know why I sounded mean but didn't meant to ;)
Even if I find a way around using GetOrphanedScene I'm personally against removing it.
Id rather publish the destructor for aiScene.
The comment is already enough to discourage the usage of that method.
I wanted to use it for being able to load multiple scene with the same importer keeping them. The only other way to do it is storing multiple importers.
To make it public it is enough to modify include/assimp/scene.h changing:
struct aiScene
{
to
struct ASSIMP_API aiScene
{
from assimp.
Exporting is easy... what's not as easy is debugging the undefined behavior that inevitably results from allocating objects in one library (assimp) and deleting them in another.
The Importer class provides a copy constructor with which you can easily copy all of the settings from a given importer (without copying the owned aiScene). I would highly recommend creating your desired Importer, and duplicating it where necessary to load multiple aiScenes. The Importer itself is relatively lightweight, so you won't be losing anything, and you'll be gaining security and happy coworkers. Another option would be to add a static method to Importer that would let you free the orphaned scene (i.e., "class Importer { .... static FreeScene(aiScene* orphanedScene); ... };".
It's really a shame naked pointers are used everywhere (backwards compatibility?); unique_ptr would do the codebase a lot of good =/
from assimp.
It would. In fact, I sometimes thought about rewriting from scratch, but I just don't think it is worth the effort.
Assimp's codebase has grown over the past 6 years, and the initial code quality was just not very high. Since then it has improved a lot, but the core - a very Cish data structure - has not changed.
If there was a rewrite, we would probably use a C++ish scene data structure (which would get us rid of at least 30% of the code and also the bugs for the importers) and copy over to a plain C structure.
from assimp.
@jdduke @acgessler using the importer is ok. But if you need custom IO you have to create multiple instances of them too.
I'd ++ every effort of removing a C++ data structure in favor of a C structure, I never liked C++.
sorry for the late reply, was on holyday
from assimp.
Deprecated!
from assimp.
Related Issues (20)
- Please close open PRs which will not be merged HOT 6
- Bug: Mixamo imported Fbx animation key id == mTime HOT 1
- run postprocessing on imported scene HOT 1
- Bug:libassimp has lots of undefined references (linker errors) HOT 1
- Bug: Assimp FBX Blendshape export incorrect class
- Bug: FBX Importer using wrong Angles in Animations HOT 14
- Bug: Assimp incorrectly places 3dface inserts HOT 3
- 如何编译静态库和使用arm的编译工具链编译 HOT 1
- How to compile static libraries and compile with arm's compilation toolchain HOT 3
- Bug: aiMaterial::Get requires 4 parameters but docs only use 2 HOT 2
- Bug: quaternion.h doesn't compile HOT 1
- Bug: SEGV when trying to access aiMaterial->mNumProperties HOT 2
- Bug: Doesn't compile with zlib-ng HOT 2
- Bug: IFC file import causes a crash
- Bug: FBX Blendshape Export cannot be imported into Unity HOT 1
- Bug: Repository tag version numbers don't match CMake project versions HOT 1
- Bug: Failed to load file: No materials remaining HOT 10
- Bug: FBX Blendshape Exporter exports double where binary FBX expects float
- Bug: Imported DXF do not assign color to inserts HOT 2
- Bug: DXF conversion assigns incorrect colors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assimp.