Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

PGR4 list files mesh material export to mtl custom need help

Featured Replies

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.

Capture22.JPG

untitled.rar Tokyo_night_materials.rar

  • 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 by shak-otay

  • 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.

Capture1.PNG

Capture2.PNG

Capture3.PNG

  • 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.

  • 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.

 

  • 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.:classic_biggrin:)

You might want to test this app:

 

 

mat_scan.zip

  • 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!

Capturem1.JPG

Capturem2.JPG

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.