Unable to select models from the Project folder and model materials and textures are not copied

I am working on a Craft project and I am having some issues with models.

1: When I copy a model that is obj type to another folder using the asset chooser, only the .obj file is copied and not the .mtl file nor the textures used in the the .mtl file. It is not too big of an issue since I can move them by hand using the Files app.

2: I am able to copy models and model material shaders into the Project folder. I can choose shaders from the project folder with the asset popup, but when I try to choose a model from the asset popup, the Project folder is not listed. Dropbox and Documents are there though.

If you have time please look in to it! :slight_smile:

EDIT: After adding the file using the asset popup to the Project folder, I can’t select it from the asset popup. However, I was able to enter the name manually ”Project:model_name” and it works.

@exomut - in many models the mtl file and the texture file details are contained within the text of the files and are not always given the same names, in particular with mtl files as the textures are very often named differently. In addition there may be several obj files and texture files to create the full 3D model.

Codea would have to interrogate the files to be able to transfer the correct files with the obj/mtl files. So I transfer them by hand. Also there not always visible within the Codea file viewer - you usually get the 3D textured model view.

You can edit the text files yourself but need to be careful to name everything correctly.

Just read your edit, nice find.

@Bri_G I wish we could import our .obj models as a .zip file that included the (obj, mtl, tiff, png, etc) so Codea would only have to deal with one file to move around. And so my Dropbox assets folder doesn’t get so messy. If I delete a model from within Codea, the mtl files always get left behind, so I have to use Files to clean up afterwards.

I guess I should right it as a feature request, but they seem so busy with the new version of Codea and all of its exciting new features. I don’t want to put any pressure on them.

@exomut good idea on how to handle obj files. I don’t know what the best solution is — zip is kind of neat especially now that it’s natively supported in the iOS 13 Files app

@exomut, @Simeon, yes i just hit the same issue. Previously my Project assets were in dropbox, today i copied them into Project (using edit and add to from the asset picker). Even though it works it does not seem possible to view the models associated to the Project.

@Simeon, would it be possible that the assets viewer on the main Codea startup screen could allow one to look at the assets associated to a selected project? Also would be nice if the asset picker for models/images displayed the filetype extension.

@Bri_G @exomut did you succeed to get a .mtl file to work with your .obj in craft? Everything i tried so far generates the ‘grey’ model without the material.

@piinthesky yeah I’ve wanted the same thing for a while. To be able to view project assets from the main screen.

I’m re-doing assets entirely at the moment. Supporting subfolders properly, showing all file types regardless of whether Codea loads them, and focusing on keeping all assets in your projects

@piinthesky - managed to get 3D model loaded from my I’m just playing with 3.1(197) and loaded this to show you. I’m still a novice with Craft. This image is from a project using a model on my Dropbox.After syncing you can see this image in the top row of the Dropbox files in the Codea assets Dropbox list.

What system are you on, can you post some of your Codea d I’ll try to find your problem

@Bri_G in the asset picker i do see the .obj model correctly i.e. coloured, but when loaded with craft.model and displayed in Codea, the colours are no longer present. I can subsequently add a texture or change its colour, but the .mtl info seems to not be used? I am using the XWing model we were playing with before. As the asset picker shows the mtl, the files must be okay and in the correct location. Do your .obj/.mtl objects work for you when displayed in the Codea program?

@piinthesky - the model shows up correctly in the preview/selection documents folder and in the project.
Again, what system are you using iPad model, Codea version?

@Bri_G ahha, found the problem-now it works! I had an entity.material = craft.material(“Materials:Specular”) further down my code. This seems to overwrite the intrinsic .mtl information. Thanks for your help.