dmsurti / AssimpKit

A library (macOS, iOS) that converts the files supported by Assimp to Scene Kit scenes.
http://assimpkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
477 stars 54 forks source link

'AssimpKit/PostProcessingFlags.h' file not found #82

Closed Leo-Kuyaco closed 7 years ago

Leo-Kuyaco commented 7 years ago

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

dmsurti commented 7 years ago

@Leo-Kuyaco Are you sure, your Carthage build succeeded? Ensure you have p7zip installed, this is a recent change in the build process.

It will be easier to help, if you can push a sample project that shows the problem.

There is a sample project that uses AssimpKit as an external dependency; may be that can help.

Leo-Kuyaco commented 7 years ago

Hi @dmsurti,

Thanks for your immediate reply. I'm certain that the Carthage build succeeded because I can see the files that were created after the carthage update. I'm also certain that I installed p7zip because I was getting an error message when I was doing the carthage update and it went away after I installed the p7zip.

What I've done are as follows: (1) Copied original project (2) Installed p7zip (3) Did carthage update with github "dmsurti/AssimpKit" in the cartfile (4) Copied/Dragged and dropped assimpkit.framework file from Carthage\Build\iOS folder to both the assimpkit.xcworkspace and iOS-Example.xcodeproj. (4) I build/run the xcworkspace file. No errors on the build. (5) I build/run the iOS-Example.xcodeproj file then get the error, "'AssimpKit/PostProcessingFlags.h' file not found".

Not sure if I'm doing something wrong here or missing any steps. I hope I gave you enough information to decipher the issue. Attached is the screenshot showing where the files were created after I did the carthage update.

screen shot 2017-10-10 at 8 49 27 am

Thanks in advance!

dmsurti commented 7 years ago

Sorry, but I don't understand; what is your goal? To work on the AssimpKit source itself or to use AssimpKit.framework as a dependency in some app of yours.

For the former, just build the targets; see #77. You don't use Carthage when you work on AssimpKit source itself.

To use AssimpKit.framework in your app, you just add the Cartfile to your app sources, build and drop AssimpKit.framework to your app's libraries section; see the sample project I referenced earlier.

Hope this helps.

Leo-Kuyaco commented 7 years ago

I just want to use Assimpkit to convert fbx files to scn files. I was under the assumption that you need the Assimpkit.framework to do this. When I ran the sample project you mentioned above, I still get the same error message. I didn't do anything else but copy the project and run it. Should I be doing something else?

screen shot 2017-10-10 at 10 07 09 am
dmsurti commented 7 years ago

@Leo-Kuyaco You have to run carthage update in the directory of the cloned sample project. I just did a fresh clone and I get no such build error.

Your screenshot also shows AssimpKit.framework in red which implies it is not yet built.

Similar to this project, in your project, add a Cartfile, run carthage update and add the AssimpKit.framework to your project's embedded binaries section.

Screenshots:

screenshot 2017-10-10 21 40 12 screenshot 2017-10-10 21 40 34
Leo-Kuyaco commented 7 years ago

Got it working! Thank you for you patience! This is awesome!

I guess my next question is, does AssimpKit actually generate an scn file after you load your projects in it? I was under the assumption that AssimpKit is an asset converter.

img_1778

dmsurti commented 7 years ago

Great 👍

I was under the assumption that AssimpKit is an asset converter.

Definitely, it is a converter that converts the supported file formats to SceneKit files. It gives you SCNScene instances which you need to serialize.

SCNAssimpScene holds native SCNScene model and animation scene objects, so you can just use these regular options to archive these to .scn files on disk.

Leo-Kuyaco commented 7 years ago

I'm going to admit... Objective-C is not my strong suit. I've been working on serializing the scene file but haven't had any luck. Can you look at my code below and see what I'm doing wrong? All I want is for the scn file to be generated in the same location where it's reading the files from. I'd really appreciate it if you can do me a solid and help me with this last request. Thanks so much!

screen shot 2017-10-10 at 2 17 54 pm
dmsurti commented 7 years ago

You are writing to the docsDir, instead you have to write to a file in the docsDir with the file scheme PS: I am writing this off the top of my head and the code below might need some minor fixes in Xcode.

NSString *bobScnFile = [docsDir stringByAppendingString:@"/Bob.scn"];
NSURL *bobURL = [NSURL URLWithString:bobSCNFIle];
if(![bobURL isFileURL]) {
   bobURL = [NSURL URLWithString: [@"file://"  stringByAppendingString:bobURL.absoluteString]];
}

Now use the above URL in your writeToURL method. Note that you will have to fetch the bobScnFile via iTunes files sharing as we are writing it to the docs dir. The above definitely works. Hope this helps.

Leo-Kuyaco commented 7 years ago

You the man @dmsurti! I truly appreciate all your help. Couldn't have done it without you :).

screen shot 2017-10-10 at 3 12 44 pm