Jump to content
The Dark Mod Forums

Blender TDM Material Manager Plugin - updated to version 2.8.0 (Blender 2.80 update)


Recommended Posts

Posted (edited)

Updated to version 2.8.0, which is for Blender 2.80 and onwards.

 

The version for 2.79 is here:

https://github.com/RSoul82/Blender-TDM-Material-Manager/tree/Blender-2.79-archive

 

Download (for Blender 2.80):

Go to the GitHub page: https://github.com/RSoul82/Blender-TDM-Material-Manager

Right click the .py file, then go to Save As and put it in some folder.

(Or go to Clone or Download and save it as a zip file to your computer).

 

Be aware that this file isn't synchronised with the one on my PC, and the latter is the one that gets uploaded to Github, not the other way round.

Edited by R Soul
Posted

A tiny update, same links as above.

 

I found that the material name scanner woun't go to the first line in an .mtr file, so this wouldn't have found the extremely rare occurrence of the material you want being defined right at the start of the file. Most files begin with a comment. I discovered the bug due to writing some custom materials.

  • Like 1
  • 3 weeks later...
Posted

Thats brilliant work man, its a shame I cant seem to find any time to work on blender these past few months. Any help with setting up materials is such a blessing, its the single most annoying aspect of modeling for me, all the paths and materials and placing the textures here and there...

  • 8 months later...
Posted (edited)

I've updated this addon. Now, when a texture is shared by multiple materials, it lists each of them as values of a set of custom properties. You can then paste the correct value to your Blender material name, and set the NoChange custom property to keep the chosen material.

 

It does this for collision textures too. You'll end up with 36 custom properties to choose from.

 

Same link as before, but reposting anyway:

Go to the GitHub page: https://github.com/RSoul82/Blender-TDM-Material-Manager

Reinstalling it is very easy. Just download the above, in Blender go to User Preferences > Addons >Install from file. Select the zip file and it'll overwrite the previous version.

Edited by R Soul
  • Like 1
Posted (edited)

I'm having a little issue with it finding me a wrong texture. The shader name is textures/darkmod/stone/brick/rough_big_blocks02 (copied from DR), but it chooses the texture from the file rough_big_blocks02_cornerstone_light.dds, instead of rough_big_blocks02.dds.

 

Meanwhile, is there a way to lock a texture so it doesn't change it when I load textures for new materials?

 

EDIT: I just installed the new version, btw, but it still chooses that wrong texture.

Edited by Skaruts

My FMs: By The Cookbook

My tools: FM Packer  |  TDM Packer 2

Posted (edited)

The material can be locked by giving it a custom property called NoChange with a value of 1.

 

I'll look in to the example you gave and see if it's a code bug or if it's an error that can't be avoided. I'll edit this post with my findings, unless there's another reply to this thread in the meantime.

 

edit: On my PC the correct texture is assigned. Does your 'extracted textures' folder have the same structure as the pk4 files. E.g. some_path/stone/brick, some_path/wood/panels etc?

Edited by R Soul
  • 2 months later...
Posted

I've uploaded the files on to Github which may make it easier for people to view, and to make suggestions etc. I don't have any auto-snyching going on, but I don't expect to be making any changes in the near future. See the first post.

  • 2 weeks later...
Posted

Thanks for putting this on GitHub, that's a big improvement over ZIP files on download sites.

 

I'm happy to have a look at updating this for Blender 2.80, but I noticed that you haven't included a license with the code, which means that by default the code is "all rights reserved" and modifications (from other people) aren't allowed. Assuming this isn't the intention, would you mind choosing a license and putting it in a LICENSE file in the repository root? GitHub's default suggestions of either GNU GPL v3 or MIT seem pretty sensible, depending on whether you care about the "share-alike" protection or not.

Posted (edited)

I've done that now. The master branch now has the GPL license. I also reuploaded the file addon in a "2.79 archive" branch to preserve that version while the master gets updated for 2.80. I recently thought about updating it but read about 2.80 not being finished yet, but if you're willing and able, then you have my sword.

Edited by R Soul
  • Like 1
Posted

Excellent, thanks. I might have a look at this next week, although don't let me discourage you if you were interested in working on Blender 2.80 support yourself — it is your project, after all.

 

You are right that Blender 2.80 is still in beta, but they are saying the API is mostly stable now, with only minor tweaks expected before release, so it should be fine for script developers to start updating their scripts to 2.80.

  • 1 month later...
Posted (edited)

I've begun the process of updating this to work in Blender 2.80. I've got the panel and buttons showing up and am working my way though the errors I get when I try to run things. Material textures seem to have a different structure. Google results may be sparse for now because it's so new, so advice/assistance welcome.

 

Current file on Github: https://github.com/RSoul82/Blender-TDM-Material-Manager

 

edit: Because it's not ready, it's not quite in the Addon format (no 'info' at the start of the file) - it has to be run from Blender's text editor. The controls show up on the right (N menu, under a 'TDM' tab).

 

edit2: It set the correct name for test material I'd set up.

Edited by R Soul
  • Like 1
Posted

I did actually make a start on the 2.8 update in my Gitlab repository, but did not post anything yet because it wasn't complete. You're welcome to pull changes from there if they would be useful. The script should now load as an Addon in 2.8, and I fixed a couple of the path-based operations to work on Linux (which I'm guessing is not the platform you're working on). I also moved the controls to the Materials panel rather than the Tools panel, since in my tests with 2.8 the Tools panel is far too narrow to contain all of the widgets (it's basically designed just for icon buttons in the new UI).

 

https://gitlab.com/orbweaver/tdm-material-manager

Posted (edited)

Thanks. I've added your changes to my file (on GitHub).

 

Notable changes from 2.79 to 2.80:

The code for checking object visibility has changed

Reading mtr files would crash with one particular file, so I did something to do with encoding.

 

Now that I've got going and we're over the UI hurdle I'm happy to continue. So far I've made the assumption that the the texture is assigned via a material node called 'Image Texture' (the code checks for the file path not just the texture name).

Edited by R Soul
Posted
Now that I've got going and we're over the UI hurdle I'm happy to continue. So far I've made the assumption that the the texture is assigned via a material node called 'Image Texture' (the code checks for the file path not just the texture name).

 

That seems sensible. It looks like the default for new materials is Use Nodes enabled with a Principled BSDF shader, which can then have an Image Texture applied to various properties such as Base Color. The old-style system of assigning textures without nodes enabled seems like it has been removed altogether, and turning off nodes just gives an extremely primitive material settings panel that does not appear to have any support for texturing.

Posted

It feels like the ability to load textures is close. The existing code still finds material slots. Each slot seems to contain the actual material (i.e. mat = slot_name.material). In case the user has turned off nodes, I use the code mat.use_nodes = True to ensure they're turned on.

 

if mat.node_tree.nodes.find('Image Texture') == -1: will check if there isn't such a node, in which case it needs to be added

node_tree.nodes.new("ShaderNodeTexImage") adds an image node

 

That's it for now. Why does the day have to end when I'm getting somewhere?

  • Like 1
Posted (edited)

I think it's working. I got a texture loaded and assigned. Updating the screenshots meant I had to test the other features (e.g. overly long material names, duplicate materials etc) and the results were what I expected.

 

I also gave the Material file extractor a test to make sure the zip (pk4) system still works, and it seems fine.

 

https://github.com/RSoul82/Blender-TDM-Material-Manager

Edited by R Soul
  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 3 replies
    • Goblin of Akenash

      My mapping discord if anyone is interested, its more of a general modding thing rather than just for TDM 
      https://discord.gg/T4Jt4DdmUb

       
      · 0 replies
×
×
  • Create New...