Mac OS X 10.11.4: Model I/O exportAssetToURL loses materials when writing to .OBJ format

Originator:iosdeveloperzone
Number:rdar://26531102 Date Originated:27-May-2016 11:37 PM
Status:Open Resolved:
Product:OS X Product Version:Mac OS X 10.11.4 (15E65)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
Creating a SceneKit scene, exporting it via Model I/O to an .OBJ file and reimporting it causes the materials associated with the model to be lost. The export does write a material file (.MTL) but it does not contain correct information and the exporter does not write image file.

Steps to Reproduce:
1) Run the attached playground. 
2) Notice on the timeline that the lower view contains a plane of the default material. The texture from the original model were not exported and the export/import cycle caused that information to be lost.

Expected Results:
The exporter should write out a correct material file and any needed image files.

Actual Results:
While the mesh is correctly written to the .OBJ file, the .MTL file that is written does not reflect the materials used in the model.

Regression:
Occurs on Mac OS X 10.11.4 and iOS 9.3.

Comments

Attachment available on github

https://github.com/iosdevzone/Radars/tree/master/26531102-ModelIOExportLosesMaterials

By iosdeveloperzone at May 28, 2016, 6:59 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!