Code Monkey home page Code Monkey logo

assimpkit's People

Contributors

anton-plebanovich avatar dmsurti avatar dwaynecoussement avatar maddthesane avatar maheshpj avatar tsharju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assimpkit's Issues

Configurable log levels

Change log levels for release. Also allow log level to be configured at runtime by client of AssimpKit to allow collecting detailed crash logs.

iOS-Example Requires Adjustments to Build

The instructions for building and running the iOS-Example code did not work for me: http://assimpkit.readthedocs.io/en/latest/user/examples.html

The first error is the provisioning profile/Team. It must be changed to the user's actual team to sign to code. Or set to none to run in the simulator.

The more important issue is that the framework that is included is referenced to a location that doesn't exist on my computer: /Users/Kyle/Library/Developer/Xcode/DerivedData/iOS-Example-dhbxrfamklnjjgantqahedchrnis/Build/Products/Debug-iphoneos/AssimpKit.framework

The solution to the second issue is to use carthage with the project and follow the steps to install the framework with carthage. Or to use AssimpKit.xcworkspace to compile the framework and copy it into the iOS-Example project manually as shown in #49

Add light support

Current importing lights causes the serialization to fail. This has been disabled for now, as after exporting to scene kit, using the Xcode scene editor, the scene can be edited. But lighting support needs to be added back, at least optionally.

Related PR's: #43

No transparency

I tried everything but can't get transparency to work.
I exported from 3 different programs (Cinema 4D, Blender and 3dsmax) in all kinds of formats (.obj, .fbx, .3ds, .dae and so on) but every time neither the iOS App I wrote, nor the provided os x App shows any kind of transparency. Is this a well known missing feature or am I missing something?

Fix texture path

Some model files (example: soldier.dae) have the full texture path whereas we only need the texture file name. Ensure we pick only the last path component.

Build Settings for source Assimp library?

Hi Deepak,

Sorry for the spam but I can't find a contact email for you anywhere.

I was wondering if you would mind sharing your build settings for Assimp for iOS / macOS. The original project doesn't have much support for non-Windows users.

Feel free to email me at [email protected] if you would rather speak offline.

And thanks for the great library!

Ecosystem

  • Update the copyright in all files.
  • Check all licenses are in place.

Host library website

Use github.io to host the public website for this library which provides links to:

  • User guide
  • Github repo
  • Gallery with videos and screenshots
  • API docs
  • Installation
  • Example apps
  • Developer guide
  • Known limitations

Can't build with Carthage

Hi !

I'm working on a mobile application, and I wanted to use your library to modify my .dae models for making them compatible with SceneKit.
But when I added your library into my Carthage file I got this :

Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Users/AOD3746/Projects/ARKit-Drive-iOS/Carthage/Checkouts/AssimpKit/AssimpKit/AssimpKit.xcworkspace -scheme AssimpKit-iOS -configuration Release -derivedDataPath /Users/AOD3746/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9M214v/AssimpKit/v1.2.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/AOD3746/Projects/ARKit-Drive-iOS/Carthage/Checkouts/AssimpKit)

And in the log file it seems that a "libassimp-fat.a" is missing.

I don't know if other developers have faced the same issue, but now I'm stuck with that, and I wanted to let you know that bug.

Support for Blender files

Hi Deepak,
do you plan to add support for Blender files (.blend), which are supported by the Assimp library
Thanks

SCNMaterial cannot be serialized

If one tries to serialize a SCNScene file as generated by this library, and serialize it using writeToURL:options:delegate:progressHandler: method results in the following error:

2016-12-26 18:45:21.295143 iOS-Example[6600:290522] -[__NSCFType encodeWithCoder:]: unrecognized selector sent to instance 0x1740ba640
2016-12-26 18:45:21.296803 iOS-Example[6600:290522] failed to archive material's custom attributes. <SCNMaterial: 0x1741a15e0
  diffuse=<SCNMaterialProperty: 0x17413d380 | contents=/var/mobile/Containers/Data/Application/ABD6105E-1D4F-47DE-A796-FE38DBAECDAA/Documents/boy_10.tga>
  ambient=<SCNMaterialProperty: 0x1743217c0 | contents=UIExtendedSRGBColorSpace 0.484529 0.484529 0.484529 1>
  specular=<SCNMaterialProperty: 0x174321860 | contents=UIExtendedSRGBColorSpace 0 0 0 1>
  emission=<SCNMaterialProperty: 0x174321900 | contents=UIExtendedSRGBColorSpace 0 0 0 1>
  transparent=<SCNMaterialProperty: 0x1743219a0 | contents=UIExtendedSRGBColorSpace 1 1 1 1>
  reflective=<SCNMaterialProperty: 0x174321a40 | contents=UIExtendedSRGBColorSpace 0 0 0 1>
  multiply=<SCNMaterialProperty: 0x174321ae0 | contents=UIExtendedSRGBColorSpace 1 1 1 1>
  normal=<SCNMaterialProperty: 0x174321b80 | contents=UIExtendedSRGBColorSpace 1 1 1 1>

Crash when loading unsupported file

On the following line

const struct aiScene *aiScene = aiImportFile(pFile, postProcessFlags);

even if aiScene is not NULL, aiScene->mRootNode can be, and makes [AssimpImporter makeSCNNodeFromAssimpNode:inScene:atPath:] crash.

I am not sure if aiGetErrorString() has anything when this happens, but if it does, printing it can also be useful.

Add tests

Use assimp model files, also update the license accordingly.

Import each model file using the assimp API. Loop through assimp scene graph and check the generated SCNScene using AssimpImporter has all the nodes with the correct geometry, materials, lights, cameras and animations. No need to test the granular details such as that of geometry or animation.

Fix clang formatting

After upgrade to Xcode 8, clang formatting is broken as 3rd party extensions are not allowed due to SIP.

Enable toggling of logs

Add logging support and convert all of NSLog statements so that they are logged with the appropriate log level.

Integrate Doxygen with Sphinx

Currently, sphinx generates user and developer docs while Doxygen generates API docs. It is better to integrate Doxygen with Sphinx and just host on readthedocs, using Breathe.

[Question] Is it possible to catch Assimp exceptions?

Hi @dmsurti . I'm trying to catch Assimp C++ exceptions using @try {} @catch (...) {} block but for some reason exceptions do not reach it and application just crashes instead.

Sample model: https://s3-eu-west-1.amazonaws.com/show-it/candle.dae

Sample code in GameViewController.m using AssimpKit_Process_ValidateDataStructure step:

    SCNAssimpScene *scene = nil;
    // Load the scene
    @try {
        scene =
        [SCNScene assimpSceneWithURL:[NSURL URLWithString:self.modelFilePath]
                    postProcessFlags:
        AssimpKit_Process_FlipUVs |
        AssimpKit_Process_Triangulate |
        AssimpKit_Process_ValidateDataStructure
         ];
    } @catch (...) {
        NSLog(@"CATCH");
    }

Stack Trace:
image

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x0000000112882d42 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00000001128ba457 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00000001125420e7 libsystem_c.dylib`abort + 127
    frame #3: 0x000000011250a778 libsystem_c.dylib`__assert_rtn + 320
    frame #4: 0x000000010c4e9794 AssimpKit`Assimp::ValidateDSProcess::ReportError(char const*, ...) + 548
    frame #5: 0x000000010c4eb0ec AssimpKit`Assimp::ValidateDSProcess::Validate(aiMesh const*) + 892
    frame #6: 0x000000010c4ea5f4 AssimpKit`void Assimp::ValidateDSProcess::DoValidation<aiMesh>(aiMesh**, unsigned int, char const*, char const*) + 180
    frame #7: 0x000000010c4e9cc9 AssimpKit`Assimp::ValidateDSProcess::Execute(aiScene*) + 121
    frame #8: 0x000000010c3ff682 AssimpKit`Assimp::BaseProcess::ExecuteOnScene(Assimp::Importer*) + 274
    frame #9: 0x000000010c4175e4 AssimpKit`Assimp::Importer::ReadFile(char const*, unsigned int) + 7028
    frame #10: 0x000000010c3ca439 AssimpKit`aiImportFileExWithProperties + 745
    frame #11: 0x000000010c3ca147 AssimpKit`aiImportFileEx + 39
    frame #12: 0x000000010c3ca10f AssimpKit`aiImportFile + 31
  * frame #13: 0x000000010c3c131b AssimpKit`-[AssimpImporter importScene:postProcessFlags:](self=0x0000600000478780, _cmd="importScene:postProcessFlags:", filePath=@"/Users/mac-246/Library/Developer/CoreSimulator/Devices/9362EE01-7550-4A4B-BE56-2F7003A37995/data/Containers/Data/Application/A981F6DE-1092-4BC2-AF24-2E9D54AD53FA/Documents/candle.dae", postProcessFlags=8389640) at AssimpImporter.m:131
    frame #14: 0x000000010c3c9e63 AssimpKit`+[SCNScene(self=SCNScene, _cmd="assimpSceneWithURL:postProcessFlags:", url=@"/Users/mac-246/Library/Developer/CoreSimulator/Devices/9362EE01-7550-4A4B-BE56-2F7003A37995/data/Containers/Data/Application/A981F6DE-1092-4BC2-AF24-2E9D54AD53FA/Documents/candle.dae", postProcessFlags=8389640) assimpSceneWithURL:postProcessFlags:] at SCNScene+AssimpImport.m:120
    frame #15: 0x000000010c0cfdad iOS-Example`-[GameViewController viewDidLoad](self=0x00007fec7050c720, _cmd="viewDidLoad") at GameViewController.m:51
    frame #16: 0x000000010f2838a5 UIKit`-[UIViewController loadViewIfRequired] + 1235
    frame #17: 0x000000010f283cf2 UIKit`-[UIViewController view] + 27
    frame #18: 0x000000010f2b5d4e UIKit`-[UINavigationController _startCustomTransition:] + 954
    frame #19: 0x000000010f2cc5a4 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 686
    frame #20: 0x000000010f2cd8c3 UIKit`-[UINavigationController __viewWillLayoutSubviews] + 150
    frame #21: 0x000000010f526a49 UIKit`-[UILayoutContainerView layoutSubviews] + 231
    frame #22: 0x000000010f1af6f5 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1439
    frame #23: 0x000000011213a3ee QuartzCore`-[CALayer layoutSublayers] + 153
    frame #24: 0x000000011213e4dd QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 401
    frame #25: 0x00000001120c6ded QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 365
    frame #26: 0x00000001120f2704 QuartzCore`CA::Transaction::commit() + 500
    frame #27: 0x000000010f108ca3 UIKit`_afterCACommitHandler + 272
    frame #28: 0x000000010e5e5d37 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    frame #29: 0x000000010e5e5c8e CoreFoundation`__CFRunLoopDoObservers + 430
    frame #30: 0x000000010e5ca254 CoreFoundation`__CFRunLoopRun + 1572
    frame #31: 0x000000010e5c99b9 CoreFoundation`CFRunLoopRunSpecific + 409
    frame #32: 0x00000001154729c6 GraphicsServices`GSEventRunModal + 62
    frame #33: 0x000000010f0de5e8 UIKit`UIApplicationMain + 159
    frame #34: 0x000000010c0d11cf iOS-Example`main(argc=1, argv=0x00007fff53b30190) at main.m:43
    frame #35: 0x000000011246fd81 libdyld.dylib`start + 1

Is there any way to prevent application crash on exception?

Add documentation

  • Host on github pages
  • Add API documentation in code and generated doc set
  • Update README
  • Add installation guide, with high level instructions in README
  • Add user documentation/tutorial
  • Add macOS example app README
  • Add iOS example app README
  • Add developer documentation

Crash Loading Large STL file - iOS-Example

The iOS-Example program is crashing when loading one particular large STL model (26.9 MB). I don't know if it's crashing because of the size or because the mesh is wonky, but it does open in other editors, so the importer should be able to handle weird meshes without crashing.

Running on physical iPhone 6s, iOS 11.
Running version since commit (most recent at time of writing): 8d5997c

It gets EXC_BAD_ACCESS at line 583 in AssimpImporter.m

Some variables from the debugger:

(short []) scnIndices = {}
indicesCounter = 1
(unsigned int) mNumIndices = 3

BrainyWalt.stl.zip
From: https://www.thingiverse.com/thing:828

Error in AssimpImporter when loading DAE model

Hi @dmsurti,

I am trying to load house.dae with AssimpKit but during the loading there is an error. XCode stops in

(SCNGeometrySource *)
makeVertexGeometrySourceForNode:(const struct aiNode *)aiNode
                        inScene:(const struct aiScene *)aiScene
                  withNVertices:(int)nVertices
{
    float scnVertices[nVertices * 3];
    int verticesCounter = 0;
    for (int i = 0; i < aiNode->mNumMeshes; i++)
    {
        int aiMeshIndex = aiNode->mMeshes[i];
        const struct aiMesh *aiMesh = aiScene->mMeshes[aiMeshIndex];
        // create SCNGeometry source for aiMesh vertices, normals, texture
        // coordinates
        for (int j = 0; j < aiMesh->mNumVertices; j++)
        {
            const struct aiVector3D *aiVector3D = &aiMesh->mVertices[j];
            scnVertices[verticesCounter++] = aiVector3D->x;
            scnVertices[verticesCounter++] = aiVector3D->y;
            scnVertices[verticesCounter++] = aiVector3D->z;
        }
    }

in AssimpImporter

On the row
scnVertices[verticesCounter++] = aiVector3D->z;
with
Thread 27: EXC_BAD_ACCESS (code=2, address=0x1700fc000)

During loading, there is also message printed in the console:
[SceneKit] Error: C3DMeshElementSetPrimitives invalid index buffer size AssimpKit was compiled with optimization - stepping may behave oddly; variables may not be available.

I am able to open dae in Blender 2.79 and in Cinema4D R18. Command line assimp info can load the dae and give this result house_info.txt.

I would appreciate any kind of clue. What could be wrong and where? Can it be fixed in model file, AssimpKit, or in Assimp library?

Add file extension descriptions

Update SCNScene.allowedFileExtensions to return a tuple with (extension, formatName) such as (dae, Collada), (fbx, Autodesk fbx).

Add assimpkit framework

Add a framework that ships the AssimpKit static library and it's public headers, for ease of installation and usage in the applications that use the AssimpKit library. We need a framework for both macOS and iOS.

Update iOS example app

Update the iOS Example app so that it has files loaded via iTunes file sharing and lets the user select a model file, an animation file and view the model with/without the animation.

Broken textures when loading complex Collada dae

Hi Deepak,

I am trying to load quite complex house in Collada dae format into SCNSceen. It works but textures are broken. When I open model in Apple Preview or in Open3mod its loaded fine and textures are correct.
house.zip

Screenshot of broken textures
img_1017

Relative paths for textures.

Seems that it does not matter if I put a relative path for textures and I load the SCNScene using AssimpKit, the texture always has a absolute path. I'm using AssimpKit for importing our models in FBX format and then save the SCNScene to .scn files. Problem is that now all textures have absolute paths since AssimpImporter seems to take the texture path from the scene file path. Would it be possible to add support for using only the path set in the model and not change it at all?

Update macOS example app

Update macOS example app so that the user can select a model file, an animation file and view the model with/without the animation.

fbx not supported

when I load a fbx file, it will print following errors:

2017-11-02 14:50:19.971128+0800 OSX-Example[12918:245460] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}

iOS-Sample Crash when I click ViewModel

I run iOS Sample in iPad Air2, copy my.obj and my.mtl to app-Document. When I selected the obj in tableview. Then I click view model , it crashed.

Xcode 8.3.2, iPad Air2 - iOS10.3.3
Myobj file is here. You can unpack and put them in.
myObj.zip

jietu20170810-111138

Integrate Model IO

This should use Model IO for these files: obj, stl, ply, usd, abc instead of Assimp.

-[ ] Need to check if these files are processed internally just like dae files. If not, then we can directly use Model IO for the files it supports.

Serialization

Add support for SCNAssimpScene serialization by implementing NSCoding protocol methods. We need to do this for the animations SCNAssimpAnimation objects which hold all CAKeyframeAnimation per channel's position, rotation and scale in the animation.

'AssimpKit/PostProcessingFlags.h' file not found

Hello,

I'm getting an error message saying, "'AssimpKit/PostProcessingFlags.h' file not found" .

I copied the file AssimpKit.framework generated by carthage in my project per instructions but I'm not sure why I'm still getting this error message. Please help when you get a chance.

Thanks,
Leo

Add animation to a SCNNode

After PR #43 which has support to add SCNScene animation to a given SCNScene, same API is needed to allow adding animation to a given SCNNode.

This is important for composite SCNScene which nodes have other SCNScene or SCNSceneSource nodes.

Add assimp framework

Add a framework that ships the static assimp library and it's public headers, for ease of installation a and usage in the applications that will use the AssimpKit library.

Add support for embedded textures

FBX, blend files for example can contain embedded textures. Implement the detection of such embedded textures and applying those.

Creating DAE files with embedded textures

Hi @dmsurti ,

may I ask how did you manage to create DAE files, in your example app, which have embedded textures ? I tried Blender 2.78 but it always put them aside, and I'm not even able to read them in AssimpKit. Yours DAE files work fine though.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.