• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Asset - Scripts [FREE] 3D OBJ MTL Multi-Texture Importer

Sigh, Okay guys I was originally going to put this for a $4.99 asset on the marketplace but after wrestling for weeks trying to upload it and it instantly being rejected I finally said enough is enough!, I will just upload it for free.

So what this script set is is a way of loading multi textured 3d .OBJ with its corresponding mtl file and textures. It is really easy to use and set up and only requires one script to load the files and one script for the draw event. You are all welcome to modify these scripts and use for your own purposes, I also encourage any mods or improvements made to it to be posted here if you so wish :)

anyway I will include the download link below and a video explaining its use :)
Enjoy guys!

yoyo_logo_200.png 11.JPG 22.JPG vlcsnap-2018-05-07-21h54m20s194.png


Download Link: https://mega.nz/#!FQUkVRQa!pSyiUCZZ_ktju_NyH3KCQJqYCy8XszEfHjAJj0LJxxg

Regards
James
 
Last edited:
M

Misty

Guest
This does not work. For larger models it freezes and never loads the model. For smaller models it gives errors such as this: d3d_model_vertex_normal_texture_colour argument 9 incorrect type (undefined) expecting a Number (YYGF). Even in the video it takes 10 seconds just to load a tiny low poly model.
 
Last edited:
This does not work. For larger models it freezes and never loads the model. For smaller models it gives errors such as this: d3d_model_vertex_normal_texture_colour argument 9 incorrect type (undefined) expecting a Number (YYGF). Even in the video it takes 10 seconds just to load a tiny low poly model.
It does work!. Your 3d obj file or mtl file must be damaged. How about showing us your 3d model files, rather then stomping your feet and yelling?? the error you told me seems to indicate a malformed 3d file, I litterally just tested it then on 5 different obj exported sketchup files and runs flawlessly.

Also its not that slow and if your worried about speed switch to writing games in c++ like i do now.
 
Last edited:
M

Misty

Guest
It does work!. Your 3d obj file or mtl file must be damaged. How about showing us your 3d model files, rather then stomping your feet and yelling?? the error you told me seems to indicate a malformed 3d file, I litterally just tested it then on 5 different obj exported sketchup files and runs flawlessly.

Also its not that slow and if your worried about speed switch to writing games in c++ like i do now.
Try other things that are not sketchup. I made my own obj importer before so I have some experience. Each obj has its own varied format so its not as easy as it sounds. The models I downloaded was from this site. https://www.models-resource.com/gamecube/

My other concern is the speed. In your video you did not list how many polygons it was, and it took many seconds to load. From what my eyes can tell, the models looked low poly. I think GM's file reading functions are slow, so you should first convert it to Buffer format. However I did not look at your code deeply, so there may be other ways to optimize besides that.
 
Last edited:
S

Sam (Deleted User)

Guest
This does not work. For larger models it freezes and never loads the model. For smaller models it gives errors such as this: d3d_model_vertex_normal_texture_colour argument 9 incorrect type (undefined) expecting a Number (YYGF). Even in the video it takes 10 seconds just to load a tiny low poly model.
You sure it ain't your old computer you complain about often? ;)
 
M

Misty

Guest
You sure it ain't your old computer you complain about often? ;)
My new computer loads online maps about the same as the other top computers in the lobby.

Also in his own youtube video there is a huge lag of many seconds while loading what seemingly looks like low poly models.
 
fair enough
My new computer loads online maps about the same as the other top computers in the lobby.

Also in his own youtube video there is a huge lag of many seconds while loading what seemingly looks like low poly models.
Oh misty such a good machine but ypu dont dare tell anyone the specs.... oooohhhh. Ive never had an issue loading models with these scripts and to my knowledge this is the only .obj .mtl loader made in gm. All the others just load one texture and reject the mtl entirely.... also buddy I work at a company that is all about 3d graphics. The entire company is founded on voxels and other 3d file formats to convert to voxel format. I write model loaders in c++ all the time. Believe me when I say i know how this stuff works. .obj is a wild format with MANY different valid save configurations. Before you came here and stamping your feet did you try loading the objs in other 3d file reading software and save it out as another obj and try again?? I very much doubt it. Now i will try and load the models you have provided. And lag loading??? You mean the game maker splash screen?? What timestamp in the video does it lag misty??
 
Last edited:
I second this.

Arguing with Misty is like playing chess with a pigeon. It will knock over all the pieces, crap all over the board, and then strut around like it

don't waste your time being upset with misty or defending your position - it's not worth it
After looking over his forum posts I agree... quite childish. But I have downloaded his models and found the issue, the mtl files all have some very strange character game maker didnt want to remove with its string commands, so i have added a fix that removes whitespace characters.

here is the updated version and a screenshot for good measure.
https://mega.nz/#!AJE2nSTB!pz_HzpnGDRPU3lpSv300s2ICNwm5Qd1zPPVuMaKMWNI

PS. Misty: In the future if you want people to help you, dont go stomping in throwing up a fuss, simply say: Hey, I downloaded your scripts, they look good but i am having an issue with "ABC" ect, could you please help me out?

also I dont know what loading speeds your expecting, however this is a much more complex .obj loader then the others, this actually allows for multiple textures if the mtl specifies it unlike any of the other .obj file loaders.
in terms of speed though it loaded the model below in 90 milliseconds, which is acceptable id say?

 
This seems to work just fine on my toaster, thanks for sharing your work, @James222 !
Your welcome :)!
I am also thinking of releasing a new project I have been working on. A super optimized multi unit pathfinder that can do 1000 unit paths on a 512x512 cell sized grid in about 18-20 milliseconds. I cant think of any other optimizations to do on it without starting over anyway :)
 
T

Taddio

Guest
Your welcome :)!
I am also thinking of releasing a new project I have been working on. A super optimized multi unit pathfinder that can do 1000 unit paths on a 512x512 cell sized grid in about 18-20 milliseconds. I cant think of any other optimizations to do on it without starting over anyway :)
Huh?!? Me want!
 
M

Misty

Guest
PS. Misty: In the future if you want people to help you, dont go stomping in throwing up a fuss, simply say: Hey, I downloaded your scripts, they look good but i am having an issue with "ABC" ect, could you please help me out?
You all are very rude. Resorting to personal insults too. Yet I'm the one who's childish? Right. Love how everyone automatically assumes my gender also.

Thinking about quitting the GMC. This is the final straw of the abuse.

Btw I was very professional and civil. Guess you aren't allowed to calmly state a software isn't working. But personal insults and name-calling is adult. Right. World is upside-down. Laughable that I have to upload my PC specs, which I stated earlier I want to remain private, but in your video you did not provide specs of the polygon count of your models.
 
You all are very rude. Resorting to personal insults too. Yet I'm the one who's childish? Right. Love how everyone automatically assumes my gender also.

Thinking about quitting the GMC. This is the final straw of the abuse.

Btw I was very professional and civil. Guess you aren't allowed to calmly state a software isn't working. But personal insults and name-calling is adult. Right. World is upside-down. Laughable that I have to upload my PC specs, which I stated earlier I want to remain private, but in your video you did not provide specs of the polygon count of your models.
Personal insults? Where? Rudeness where??

And what do you think people will actually do with said pc apecs apart from trying to help you?

And also i fixed your issue. It was a tab spacing in your mtl files that gm didnt read in as a tab for some reason. And for the model above 90 milliseconds.
 
M

Misty

Guest
Personal insults? Where? Rudeness where??

And what do you think people will actually do with said pc apecs apart from trying to help you?

And also i fixed your issue. It was a tab spacing in your mtl files that gm didnt read in as a tab for some reason. And for the model above 90 milliseconds.
"don't waste your time being upset with misty or defending your position - it's not worth it" - Samuel Venable

"I second this.

Arguing with Misty is like playing chess with a pigeon. It will knock over all the pieces, crap all over the board, and then strut around like it won." - The Sorcerer

"After looking over his forum posts I agree... quite childish." - You.

" In the future if you want people to help you, dont go stomping in throwing up a fuss," - You.



So my calm, emotionless statement of "This does not work" and emotionlessly reporting bug data=throwing up a fuss?

You respond with this:
"It does work!. Your 3d obj file or mtl file must be damaged. How about showing us your 3d model files, rather then stomping your feet and yelling?? the error you told me seems to indicate a malformed 3d file, I litterally just tested it then on 5 different obj exported sketchup files and runs flawlessly.

Also its not that slow and if your worried about speed switch to writing games in c++ like i do now."

Emotionful exclamation points. Claiming my obj file is damaged, not that your importer has a bug. Then double ?? question marks emphasizing emotions. Using the word "literally" to emphasize emotions. Vague statements about speeds instead of hard-specs of polygon counts. Telling me to quit game maker and switch to C++. Etc.
 
S

Sam (Deleted User)

Guest
could we all please stop talking about this - it's polluting this poor guy's topic. (I'm not proud of the mean things i said btw, that just added fuel the fire)
 
T

Taddio

Guest
could we all please stop talking about this - it's polluting this poor guy's topic. (I'm not proud of the mean things i said btw, that just added fuel the fire)
Bro, while I agree to stop arguing on that, after having a chat with James and trying his .obj importer AND his pathfinder scripts (gna gna gnaaa!:p), I can assure you he is not a "poor guy", but more something like a muther*****ng coding wizard:D Haahaaha!
 

Khyze

Member
Thanks for this! I wonder if it is ok to post in such an old post, I tried it on GMS1.4 but by the looks of it, it should perfectly work on newer versions.

I tweaked it and it makes vertex buffers now (well, d3d functions are outdated, that's the only change needed to make it work in future versions, it already has the code for vertex, normals and texture, so you just write a bit then copy paste the rest)

I will use it as a Obj to Vertex buffer converter (there are add-ons for blender to export the buffers directly but I use an old version and making most of it in Game Maker gives me some kind of control, specially with a shader I'm using)
 
Top