Batch Converting Apple SCN files into DAE - ios

Currently I have this test iOS app that basically brute force export SCN files out of the app, basically at around 60 SCN files per second.
Since I do not have any better way to export this on device simulation, this is my current solution.
Anyhow, is there a known way to batch convert SCN file format into DAE Collada? I can do manual export using XCode, but seems to work once at time. Not gonna be fun.
Is there a quick way using Playground to actually do this?
Thanks!

You can try the xcrun command to run scntool and provide it input/output files, then the format.
xcrun scntool --convert fileIn.scn --output fileOut.dae --format dae

Related

Convert .scn scene to usdz (Swift)

I have lost a lot of sleep over this (in the past 3 years).
I was hooping that Apple would at least be able to export its own .scn Scenes to USDZ without too much problems.
Has anyone been successful in exporting a .scn scene to USDZ from within an app?
I have tried this but to no avail:
https://github.com/piemonte/obj2usdz
Have you taken a look at this:
Batch Converting Apple SCN files into DAE
xcrun scntool --convert fileIn.scn --output fileOut.dae --format dae
Or this:
https://developer.apple.com/forums/thread/104553
They mention a number of ways such as converting to a dae first, and then using the free converter.

Convert ( .obj / .fbx ) to .dae runtime which must support iOS SceneKit

I am facing trouble to find a way to convert .obj / .fbx to .dae (iOS scenefit Supported) automatically in background.
In python, it may be available to convert the file from .obj / .fbx to .dae file format. This process should run in background, immediately run after we will get .obj / .fbx file on server.
Here is the sample file, which we are trying to convert.
https://s3.ap-south-1.amazonaws.com/p9-platform/DAE/barware_s11624.obj
Please help me, if you have any suggestion.
Scenekit on IOS doesn’t support dae unless it was included in the app. So because of the “iOS Scenekit Supported” requirement there is no right answer, sort of. Although there are third party libraries (like https://github.com/dmsurti/AssimpKit ) to read and convert many 3d model formats, it won’t change the fact dae isn’t properly supported on IOS Scenekit .
That said, it is possible to convert OBJ to DAE in SceneKit using the following steps (in IOS 11.2 and later)
Load the obj file into a SCNScene.
Write the scene to a file with .dae extension using SCNScene’s writeToURL method.
That will create a .dae file SceneKit can support (but not directly, i.e. would need to be included in xcode or converted first) that starts with the following:
<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>SceneKit Collada Exporter v1.0</authoring_tool>
</contributor>
I would second the recommendation for using Assimp or AssimpKit (I’ve only used the former but the latter might be an easier starting point).
I believe the DAEs on iOS aren’t DAEs at all, they just left the suffix the same and the actual files are SceneKit archives. I’m not sure if the API to write them is exposed yet, but I think it might be now since Xcode is now willing to load DAEs and write out SceneKit archives (but it adds the “.scn” suffix, not “.dae”).
It’s possible that iOS SceneKit can just load “.scn” files — it won’t load true DAEs because the DEA-reading/writing framework was licensed from Sony and is HUGE and the iOS team just doesn’t want that giant ugly framework on its system.
Another option would be to just link the iOS app against Assimp — it can load a ton of formats natively so you could skip all the intermediate stuff. It’s not NEARLY as huge as Sony’s DAE library so it might be acceptable to ship it with your app.

COLLADA transformations in SceneKit

We try to make viewer for models in Xcode and use SceneKit to render model. If we add COLLADA (.dae) file to Xcode, it transforms the model using scntool to c3d format (found this on the Internet). But we want to load models in runtime (we download them from server to iOS device). How can we transform .dae to this format not from Mac OS? Our server running Ubuntu, we can transform model and send it already converted to iOS devices.
Thanks a lot!
you can run scntool manually but you'll need a machine running OS X to do that. The compressed format used by SceneKit on iOS is not documented and there is no other tool that you can use to make the conversion.

How to customize carrier name in iOS 6 simulator?

How can I customize the default Carrier name to something else, e.g. AT&T?
There is a way to change the carrier name without using any objective c code or image editor app: https://github.com/toursprung/iOS-Screenshot-Automator/blob/master/changeCarrierName
This solution works great with all versions of iOS (including iOS 6 and 7)
The key point is
sudo plutil -convert xml1 SpringBoard.strings
We don't necessarily have to convert it back to binary code since Mac OS accepts both formats.
After you converted your file to XML, you can easily edit the file with vim or any other editor of your choice.
UPDATE:
I uploaded a detailed description on how to update the carrier name: https://github.com/toursprung/iOS-Screenshot-Automator/blob/master/changeCarrierName
Copy and paste into terminal, replacing DERP with your carrier string:
find -E /Applications/Xcode.app -iregex '.*/en(glish)?.lproj/SpringBoard.strings' -exec sudo /usr/libexec/PlistBuddy -c 'Set :SIMULATOR_CARRIER_STRING DERP' {} \;
Finds relevant files and modifies them in place. No copying files, converting binary to xml, or editing strings in other applications.
You can use this hack, just compile the XCDFakeCarrier.m file in your project and change the FakeCarrier constant to what you want.
There is a perfect app for this called Status Magic that I was beta testing. Just trying to find a link for it...
You import a screenshot and it removes all the carrier specific text from it and replaces it with a standard status bar and you can edit the time, carrier info, etc...
Means you don't have to use Photoshop or anything.
Will be back with a link...
LINK
https://itunes.apple.com/uk/app/status-magic/id547920381?mt=12
EDIT Just found out that the app is still in review fro the Mac App Store. Should be out soon. It really is perfect for what you are wanting to do though. And really easy to use.
I don't know if that's possible with iOS Simulator (If it's even possible you have to dig deep :) ). The best way is to take the screenshot (Command+S), and change the image in Adobe Photoshop, or some image processing program like that.

Access apps with AppleScript

Is there anyway to programmatically get a list of iOS apps from iTunes?
AppleScript does not seem able to do this.
The only way I can think of is looking in the 'iTunes Media/Mobile Applications' folder. But this way a lose all metadata.
Any suggestions to get list of iOS apps including the metadata?
Thanks
I now actually went with the solution to scan the 'Mobile Applications' folder.
In order to get the metadata I had to do the following:
the *.ipa are simply archives
unzip/extract the 'iTunesMetadata.plist' inside
parse the plist
voila you got all metadata
This whole process is actually pretty straightforward in python as your already have both zipfile and plistlib.
One thing to lookout for though is that plistlib in python can not handle the new binary plist files. So you first have to convert them to their corresponding xml format. (only some *.ipa seem to be in binary form).
This can be done quite easily with the following line of code:
os.system("/usr/bin/plutil -convert xml1 %s" % file_name )
Now the only thing I still have to figure out is how to get the currently installed apps on the device...

Resources