April 24Apr 24 I wanted you to look at my texture list file for my tokyo project. Do you know how I could save time adding my 6000 lines of material addresses? . map doesn't have a file like an MTL for OBJ. So I used a coordinate list to create my own MTL file, it's not a big deal. I'll manage. I don't want to cozy and paste 6000 lines manually, it's demoralizing. I hope to know if you have a trick to fill them in automatically. I've already started filling in a few lines (in the untitled.mtl file), but the most frustrating part is the multiple textures with different material names, which are completely absurd in my opinion. So I'm wondering if you might have an idea or a tool to help me move forward. Thanks. untitled.rar Tokyo_night_materials.rar
April 24Apr 24 Supporter Hi, sounds like basic coding (though taking into account all the details will eat some time). (Doesn't work for such lines: m_2_0: material 0_0 material 0_1 material 1_0.) Handling one line in Tokyo_night_materials.txt. (Required file handling not implemented.) //#include <iostream> #include <windows.h> #include <stdio.h> //#include <stdlib.h> //using namespace std; void create_names(void) { char tmp[255], name[255]; BYTE cnt=0; int len, l=0; strcpy(tmp, "m_11_0: tex 2E81_65 tex 2E81_66 tex 2E81_67 tex 2E81_68 tex 2E81_67 tex 2E81_68 tex 2E81_67 tex 2E81_68 tex 2E81_69 tex 2E81_68"); len= strlen(tmp); do { while (tmp[l]!= 't') l++; l += 4; // skip "tex " cnt= 0; while (tmp[l]!= ' ') { name[cnt]=tmp[l]; cnt++; l++; } name[cnt]=0; // zero termination of string strcat(name, ".png"); printf("%s\n", name); } while (l<len); } int main() { //cout << "Hello world!" << endl; create_names(); printf("waiting for key pressed... "); getchar(); return 0; } Output: Quote 2E81_65.png 2E81_66.png 2E81_67.png 2E81_68.png 2E81_67.png 2E81_68.png 2E81_67.png 2E81_68.png 2E81_69.png @.png Last line is a bug - you'll need to debug the code. (For private use I ignored the fact, that strcpy and strcat are known as being unsafe.) Edited April 24Apr 24 by shak-otay
April 24Apr 24 Author Hi, sorry, I don't know how to code. Yes, lines without material will be deleted. But how can I automatically fill in the missing lines to configure my MTL? Here's what I've already started, and some more representative examples of my problem, which I have to do manually on 6000 lines. This situation is complex, I admit.
April 24Apr 24 Author Your code looks really good, even though I don't know anything about it, and I thank you for it, my friend.
April 24Apr 24 Supporter 3 hours ago, marco1990 said: Hi, sorry, I don't know how to code. To learn basic coding takes around a month but it will enhance your projects imaginably... Anyways, I processed a reduced Tokyo_night_materials.txt, the result: Quote newmtl m_0_0-material Ns 100.000015 Ka 1.000000 1.000000 1.000000 Kd 0.800000 0.800000 0.800000 Ks 1.000000 1.000000 1.000000 Ke 0.000000 0.000000 0.000000 Ni 1.500000 d 1.000000 illum 3 map_Kd C:\Users\user\Desktop\ac mod track project\textures_Tokyo_night\textures\2E81_0.png map_d C:\Users\user\Desktop\ac mod track project\textures_Tokyo_night\textures\2E81_0.png newmtl m_0_1-material Ns 100.000015 Ka 1.000000 1.000000 1.000000 Kd 0.800000 0.800000 0.800000 Ks 1.000000 1.000000 1.000000 Ke 0.000000 0.000000 0.000000 Ni 1.500000 d 1.000000 illum 3 map_Kd C:\Users\user\Desktop\ac mod track project\textures_Tokyo_night\textures\3265_1.png map_d C:\Users\user\Desktop\ac mod track project\textures_Tokyo_night\textures\3265_1.png What's map_d? And the newmtl lines seem to be wrong.
April 24Apr 24 Author I plan to switch to Basic++ as soon as possible. The `newmtl` line is defined during the creation of the mesh object (obj). It's written in the header of all MTL files, and then `m0-0` is the name of the material attached to the object. So there's no error.
April 24Apr 24 Supporter 45 minutes ago, marco1990 said: I plan to switch to Basic++ as soon as possible. Good idea. That's how I started, too. (But it didn't have ++ in its name.) You might want to test this app: mat_scan.zip
April 24Apr 24 Author Oh, but by God, who is the best in everything! You are certainly a heavyweight champion, across all categories. You have just freed me from a huge worry. I am grateful, thank you, thank you!
Create an account or sign in to comment