Currently not for textures, no, just for other material properties. There’s an open issue for it Support for `.mtl` Files with Textures · Issue #6924 · processing/p5.js · GitHub and the main technical difficulty that needs to be overcome is the fact that one model in p5 cannot have multiple textures referenced within it, so we need to make an entity to import the 3D file as which can have multiple components with multiple textures and that can still be drawn with the same APIs.
Yep, my mistake - I didn’t read your question properly, and thought you were asking about colours in .mtl!. (This, despite the work “texture” being used 4 times… )
No, no, I’m interested in knowing if the colors indicated in an mtl file are read correctly with the loadModel() function that’s why I was asking this.
in fact I would like to look your obj and mtl files to see how it is written (in the mtl file).
In my project, I’m beginning to think about the 3D version (that’s why I”m beginning to study this) among other things.
hey, wanted to chime in here, this has been a known architectural limitation for a while. it is something i have been really interested in and spending time thinking about, so hopefully if things line up, i might get to work on it in the next few months. fingers crossed things go well and obj + mtl with textures just works out of the box soon!
This would be a huge and really useful improvement (especially in the case where there are several textures and colors instead of textures)!!!
That can’t be easy to do!!!
Hi! Hopefully you were able to find the .mtl file in the openprocessing project no problem. It is pretty minimal - this is all of it - generated in the pair with the .obj file by blender.
# Blender 4.3.2 MTL File: 'None'
# www.blender.org
newmtl tree_bark_brown
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.201011 0.130373 0.101419
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl tree_green
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.072576 0.297737 0.074483
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.500000
d 1.000000
illum 2
(I notice the same sketch doesn’t load on the web editor due to asset renaming. I mention it just in case you try there. I’ve never had any problem on openprocessing with this .obj + .mtl setup, though)