Finding certain settings (eg. rotatetexture 0) in a larger bunch of tiles (MDLs)? [KIND OF SOLVED]

Greetings all! I have here an elderly tileset (from DLA) and some of the tiles are not uniform regarding their settings for certain trimeshes. As written in the title: Some terrain-tile-grass meshes have rotatetexture 1, some have rotatetexture 0, event though they should be 1. Now, there are lots of tiles to check and I don’t want to spend my time checking all of them one by one.

So my question: Is there a method to let some tool run through all the (ASCII) MDLs and identify, if a mesh with the texture “xyz01_grass01” has rotatetexture set to 0?

Notepad++ has a very helpful search engine for this, but I only managed to use it for one item to find (in that bunch of tiles) eg. a wrong texture. To search for “rotatetexture 0” wouldn’t help much, because there could be more than one object/mesh with this setting in a tile-MDL. But the search mentioned above involves some kind of “if the texture is XYZ” → check within this mesh “if rotatetexture is 0” → print out the MDL.

Is there a way to accomplish that? (Must not be with Notepad++, but if it’s possible with it, I’d could use that program.)

GrepWin can find and replace any text in multiple files and also lets you use regular expressions. Pretty much like grep for Linux, I guess. Though grepWin also has an UI.
This would only help you if the order of lines is always the same. If you have “bitmap xyz” and then “rotate texture x” so and so many lines after it, you can use the regular expressions to search for it and replace it, but if the order of the lines isn’t the same, there might not be a way even with reg exps, unless someone could write you a shell script for this purpose.

Good morning from my side and thanks @Zwerkules! I’ll check GrepWin, but I fear, that I have not the case, that the order of the lines is always the same. Bannor used Max, DLA too, some tiles were run through CleanModels and I use Gmax with NWmaxPlus… Well, I need to check. If they match, it’d be an option.

If not, the search engine would have to do something like find “bitmap grass”, then move up until it hits the first “node trimesh” (without the name, because they also differ throughout the tiles) above “bitmap” and from there search down again to find “rotatetexture 0”. I guess, that that would need a custom script, as Zwerkules wrote.

Edit: And the texture reference always comes after rotatetexture, so the search would need to go up from the texture anyways.

I have a tool (Excel) to query a specific value within a specific node (somewhere, hopefully I find it again …). If you still have trouble, I can do the analyses…

Consider one of these -

5 Tools to Find & Replace Text in Multiple Files [2023 List]

If you only wanted to find and not replace then I would have recommended the free version of-

Agent Ransack


The tool needs to find and replace only within a specific part of the text. Rotate Texture could be correct in other nodes.

Thanks @Tarot_Redhand and @Mmat. @Zwerkules thought of CleanModels and is right: There is an option to “just” check for the ground texture and set rotatetexture 1 just here. It also did some more “fixes” eventhough I set everything else to “no”… I don’t like that… But anyway: That would be a solution regarding rotatetexture. BUT I also need to set shadow 0 only for this ground mesh (some have 0, some have 1 ATM). CM can set/remove shadows, but it applies to all mesh-parts within this model and I don’t want that!
So… Maybe MMat’s approach will help? Meanwhile I found out, that I need to check around 90 tiles.

Can you name the tileset (if it’s available at the vault)?

@Mmat No, it’s the Solace set I’m still trying to find the time to finalize. I identified the tiles though and could sort them out. Well, I bet my “Witcher 1 rural set” (Witching NWN1 - A Witcher area conversion project for NWN1 - Rural set | The Neverwinter Vault) would have the same issue because it uses the same base (IIRC).

@Tarot_Redhand WildReplace (from your link) already helps alot with finding, if a tile has “my issues”:

Sadly, I can’t edit it right away within that tool, but it opts to open the file with a texteditor. If I chose Notepad++ I get the row numbers right away, too.
So, if Mmat doesn’t have a kind of “batch”-solution, this one is already a great help!

OMG! I failed before to make Notpad++ use “my” RegEx-string, but now, that I found it for WildReplace, I managed to do the same for Notepad++:

Now I just have to figure out, if I can edit straight into the findings (or a similar quick way)…

No, I don’t manage to. Only way I found so far is to right click → Open all → then X the “Find result”-window → and tab through all opened files finding the right lines and edit them. Would be cool to have the search result window next to the opened MDLs, so it’d be faster to find the according lines, but as written: I don’t manage that. So, if there is no other solution, probably run WildReplace and Notepad++ at the same time and use WildReplace as orientation…

Addon: WinGrep can also handle that RegEx-string and spits out the same results. But WildReplace and Notepad++ are visually better IMO.

Notepad++ Search result + MDL-file(s) visible at the same time: After you get the search results and right click → Open all: Just click and hold into the bar, where it says “Find results” and drag it somewhere else - even outside the Notepad++ -window.
You can than double-click an entry in the search results and it will highlight within the opened/active MDL-file! :smiley:

:bangbang: Edit: You even don’t need to do “open all”! Just double click the wanted line in the search result and the according MDL-file will be opened! :face_with_monocle:

Not a batch work, but at least a light at the end of the tunnel!

It is done! But not by me! @Mmat used his Excelmethod he mentioned above and I have now all the correct entries for shadow and rotat texture for the ground texture. So special thanks to @Mmat!

So this is kind of solved. :smiley: