Jump to content
The Dark Mod Forums

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


R Soul

Recommended Posts

A few hours after the first upload it occurred to me that I might have uploaded an older version of this (which didn't account for some situations), so I re-uploaded the file. To be sure you have the latest version, the zip file has a modified date/time of 27th November, 7:27 and the py file is 27th November 0:26.

Link to comment
Share on other sites

This seems really awesome, although admittedly I haven't tried it, still wish to thank you for the efforts. This is something that could be insanely useful for more than just TDM, with a couple of simple tweaks.

 

Just wanted to point out a typo on the webpage - "A pre-made material-texture list can be downloaded from here" = does the 404 dance.

URL should be - http://catmanofiowa.com/RSoul/TDM/TDM_Material_List.zip

Link to comment
Share on other sites

I've made a minor update. I hadn't taken into account that some material name lines have comments in them, so these were being partially added to the material name. That's now been corrected. The download link is the same as before.

 

The best way to replace an addon is vis User Preferences > search for addon (the letters TDM should reveal it), click on the Remove button and then Install From File.

Edited by R Soul
Link to comment
Share on other sites

...

 

It'll be interesting to see how this is in the wild.

 

Recently i was playing around with darkradiant and blender. Saw this post and tried the plugin. Here's some feedback.

 

First of all, good idea to try and make this stuff easier. However it's not working that well for me I'm afraid. The best result i got was that sometimes the correct textures got loaded. But it never changed the material names... I use blender 2.79. And the textures are in a root folder of the c: disk.

 

Looking at the TDM materials i notice the following:

  • some material names are too long for blender. You mention in the readme that there are some but in my tests i already discovered several so i wonder how many there are. Perhaps more than some, perhaps a lot?
  • some material names don't follow the desired virtual folder convention but just use short names (many model materials it seems).
Edited by Tinkerer
Link to comment
Share on other sites

If you want to make it more user friendly you might want to check the length of the mat. name first and if it's too long name the mat. 'TOO LONG!. Just a thought...

 

Short names. E.g. import dungeon/torturechair.lwo. You see it has two short material names.

 

As for examples, dunno. I got a folder c:\dm_textures with the dds folders like stone, wood, roof etc. And also inside that map a MTR folder with the mat. files and your text file. That should work right?

 

 

Link to comment
Share on other sites

I think most of these problems are caused by me thinking all material names start with 'textures/darkmod', and wanting to use the pre-generated list to simplify the code for the two main functions. I'm currently redoing the code for 'Load Textures' to take the objects material names and look in the mtr files themselves.

 

The other one, assigning a material name based on the texture, may be harder due to having to go backwards through the file, but I've done hard things before.

Link to comment
Share on other sites

I've updated this, and called is version 2 because of the changes.

 

It no longer uses the simple material-texture list; it scans the mtr files each time. This is much more reliable.

 

It makes it clear if a material name is too long, and puts the attempted name in a custom property so you can easily search for it in the original files and make a copy with a shorter name.

 

If a texture is used by several materials, the addon will always stop at the first one it finds. You can now set the correct name and use a custom property to prevent that material being renamed again (see the readme).

Link to comment
Share on other sites

OK, just tested this. Still doesn't work for me... :(

 

First of all, the optional fields are not optional. Only when i gave those fields the same path as the default locations did i get some results.

The results are that some textures got loaded. Only the materials that start with textures/darkmod got their textures loaded.

The material names never changed.

 

Now it could just be a problem with my setup. Someone else should test it as well to make sure.

Let's assume it's your code though. I advise the following assuming you have not done so already.

That is to use another system that has default settings for testing purposes. Perhaps use a virtual machine.

Just install blender and don't change things. Perhaps use different folder names also. A different setup than you use now.

This way you should be able to make sure it works like expected on another system.

Edited by Tinkerer
Link to comment
Share on other sites

The problem with the optional folders was a code error - I was checking the wrong variable. That's fixed.

 

Regarding other problems, I didn't mention in my last post that the readme has been updated. Please use that to ensure you've extracted everything that's necessary. On my machine I tried the addon with those files in other locations and it worked fine.

 

For the second update I've made an addition to the optional FM paths system: They no longer have to be blank. They can also begin with a semicolon, which has the same effect while allowing you to keep some text in there.

 

I've also tweaked the error reporting, so if you still have problems it may be easier to see what it thinks it should be looking for.

 

Links (same as in the first post)

Download:

http://catmanofiowa.com/RSoul/TDM/TDM_MaterialManager.zip

 

Readme:

http://catmanofiowa.com/RSoul/TDM/MMReadme.html

Edited by R Soul
Link to comment
Share on other sites

Getting similar results as before. I'm starting to think it's because my directory structure is different than yours.

Already fixed one error i noticed in my folders. Perhaps there's more but i don't know.

This part of the plugin requirements seems tedious and error prone.

The most obvious solution seems to be... more work on your part. That is to also code the pk4 extraction part..

The question of course is if you want to spend more time on it.

I must say that i'm not very interested in testing this over and over again. And most people/users will want it to work immediately i think. It's meant to make life easier.

So if they must first navigate all the pk4's and make sure everything gets extracted the right way... probably will be a barrier and gives room for error.

 

Link to comment
Share on other sites

I must say that i'm not very interested in testing this over and over again. And most people/users will want it to work immediately i think. It's meant to make life easier.

 

There's no obligation, but testing is for your benefit. Can you give me some examples of your folder setups?

E.g. where is your copy of architecture\windows\warehouse_window_dark_d.dds?

What about tdm_models_kitchen.mtr?

 

There may be something in the path that is causing problems, but I don't know where to start. I already have a function that ensures paths are absolute, and that should ensure they are the right format (e.g. windows or linux)

 

I had a look at extracting from the files, but while Blender can load zip files, it's not able to open pk4, which I assumed were just renamed zips.

Link to comment
Share on other sites

Very cool plugin tool, R Soul. :-) I might make a blender model for the game in the near future, so this will definitely come in handy once it's thoroughly tested.

Link to comment
Share on other sites

Oh dear...any volunteers?

Well.. i was already testing it, remember. But it doesn't work for me and don't know what more to test.

 

Although you could do this: generate a list of all the folders and files as it is on your system. I can compare that to what i have.

 

In the mean time it is also good to know we can right click in DR in the media window and copy shader names and info.

Link to comment
Share on other sites

Alright, some improvement. I noticed you had a textures folder under props folder and i didn't. After fixing this most textures get loaded. Some that still not load are those in common. And i miss some sfx textures. Does loot/diamond.lwo work for you?

 

However with most of that fixed, the other problem remains: mat. names are never changed. From what i can understand from your code and my debugging experiments, the set material code block is never executed. I think the findMaterial def returns nothing. This i conclude from reporting/printing the value of matFound and inserting a mat.name = 'test' before your block and that changed the mat name to my var. So, dunno what is going on. Hope this helps.

Link to comment
Share on other sites

I had a look at the diamond object. The texture for that isn't in a standard place. The vast majority are in dds/textures/darkmod/... but a lot of the sfx textures are in textures\darkmod\sfx\. This makes the installation instructions more complicated. Currently it's tedious but fine if you're methodical (unless I missed something), but this new information annoys me.

 

I also found that I'd made an incorrect assumption with texture extensions (dds if none specified in the mtr). I've now changed that to removing dds or tga from the reference, then looking for file.dds and then file.tga. I've also set up a warning message for the texture file not being found.

Link to comment
Share on other sites

It turns out that Blender can handle the .pk4 files just fine. I don't know what I did wrong the last time I experimented, but I might have forgotten to check the file extensions, causing Blender to try to open the wrong file type.

 

I will now have a look at making some file extraction functions to help with installation.

 

edit:

The texture extractor is working fine, and I'll make an mtr extractor soon.

 

The next thing I need to consider is what to do about collision materials. So far I've been content to ignore them and just use material transparency.

Edited by R Soul
Link to comment
Share on other sites

Bump!

 

I've implemented material and texture extraction features, so this should ensure all the necessary files are in place. See the first post.

 

If that works, the remaining thing is collision materials. I didn't want to deal with them, but I think it may be necessary to make it complete.

Edited by R Soul
Link to comment
Share on other sites

Another bump.

 

The addon now handles collision and shadow materials better than before - textures are now loaded when material names are set. When material names are set from the assigned texture, be aware that collision materials share the same texture, so there's no way to know the correct material name. You have to set them manually, but with the NoChange custom property you only have to do it once per object.

 

Links in the first post.

  • Like 1
Link to comment
Share on other sites

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

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...