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…
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.
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!
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…
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!
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!
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!