Page 1 of 2

Importing OBJ won't use MTL

Posted: 02 Nov 2016, 11:42
by RootPC
Hello again. I can't seem to get Cubik Studio to use the included MTL file generated by Metasequioa. I've tried several different ways, but can't get it to work. Can anyone help me please?

Re: Importing OBJ won't use MTL

Posted: 02 Nov 2016, 15:18
by epicskymi
is this even possible if so id like to know as well

Re: Importing OBJ won't use MTL

Posted: 02 Nov 2016, 15:56
by Zorigami
I'm having this issue as well.

Re: Importing OBJ won't use MTL

Posted: 02 Nov 2016, 18:29
by Sphax
When you import a OBJ, Cubik also imports MTL and PNG(s).

To proceed, Cubik needs to know where to look for MTL and PNG(s) files. Most of the time, MTL and PNG files are aside OBJ file or in a folder aside with valid paths indicated in the OBJ file (on top) but some 3D software do not create OBJ files with valid relative paths...

Please, post your OBJ+MTL+PNG files (in a ZIP) or open your OBJ file (with a text editor) and verify the line beginning with "mtllib" followed by the name of the MTL file. If this line is missing or name or path is invalid, Cubik can't import MTL.

Several times, the problem can also happen because texture paths are invalid in the MTL file itself. To be sure that texture paths are valid, open MTL file (with text editor) and look for lines beginning with "map_Ka" and "map_Kd". Both should be followed by your texture name. MTL file can contain several lines like that. Be sure to verify validity of each one.

:3d:

Re: Importing OBJ won't use MTL

Posted: 03 Nov 2016, 00:11
by WizardCM
Hi Sphax, the files we're working with have been attached below.

From what I can gather, our models mostly use material colours rather than texture files. Let me know what we could be doing differently to fix this.

Re: Importing OBJ won't use MTL

Posted: 03 Nov 2016, 07:39
by Sphax
Material colors is not supported currently

Re: Importing OBJ won't use MTL

Posted: 03 Nov 2016, 08:46
by WizardCM
Sphax wrote:
03 Nov 2016, 07:39
Material colors is not supported currently
That explains it. As long as it's on the to do list.

In the meantime, we'll find a way to make ourselves a temporary bypass. Thanks!

Re: Importing OBJ won't use MTL

Posted: 03 Nov 2016, 11:52
by WizardCM


I put together a python script to read mtl files and convert the material to a texture. Huzzah!

But I've run into a new issue - it seems the correct textures are displayed, but aren't actually loaded. When any edit is made, or when trying to convert the file to voxels, it resets to one colour. Any suggestions?

Re: Importing OBJ won't use MTL  [Solved]

Posted: 03 Nov 2016, 18:59
by Sphax
Currently Cubik only fully supports meshes with one texture. Multiple textures on one mesh will cause some issues like the one you have. To avoid that, use only one texture or use multiple meshes with one texture per mesh in your model.

Re: Importing OBJ won't use MTL

Posted: 03 Nov 2016, 22:28
by RootPC
We have the model and colours working perfect now. Bit of a workaround, but it works and gets us going forward with our project. Thanks Sphax for the continued support, very helpful. I do hope in the near future the process will be simplified, but doing it this way has taught us a lot about the programs we use.

Image