Garry's Mod

Garry's Mod

Material Editor Tool
Thomas 18. jan. 2017 kl. 20:44
Clearing materials does not work as intended
Hiya.

Applying a material to an entity, clearing it (via Reload), and waiting for the 30-second 'AdvMatSync' timer to iterate will result in the material being reapplied. Duping it while it's "cleared" will also result in the material being reapplied.

From a quick glance, you aren't clearing the entity's MaterialData table in materials:Set(). You'd also want to clear the duplicator data so that duping a "cleared" entity doesn't just reapply the material again.

There might be more to it, but doing at least this appears to resolve it:

-- line 26 in autorun/sh_mateditor.lua if (texture == nil or texture == "") then if (IsValid(ent)) then ent:SetMaterial(""); ent.MaterialData = nil; -- clear the table so it doesn't get reapplied duplicator.ClearEntityModifier(ent, "MaterialData"); -- clear modifier end; return; end;
Sidst redigeret af Thomas; 18. jan. 2017 kl. 20:46
< >
Viser 1-11 af 11 kommentarer
Thomas 4. feb. 2017 kl. 20:00 
Could you please look into this?
Thomas 24. apr. 2017 kl. 17:31 
Still waiting for an update concerning this bug. It's a pretty big one in terms of usability and has a really simple fix as shown above.
IvanTheRexouium 26. nov. 2019 kl. 9:19 
I thought I had an addon conflicting this entire time...this still happens, even now.
Veeanith 15. dec. 2019 kl. 11:23 
i found the github release, i might release it as a new addon and fix the issue because its really ♥♥♥♥♥♥♥ annoying when im trying to remove a texture from something i didnt mean to texture
Sanders 23. juli 2020 kl. 19:21 
Oprindeligt skrevet af VCSoldier:
i found the github release, i might release it as a new addon and fix the issue because its really ♥♥♥♥♥♥♥ annoying when im trying to remove a texture from something i didnt mean to texture
still doing it now you plan on doing what you said?
Thomas 23. juli 2020 kl. 23:50 
He did make a fork of the original code, it's at https://github.com/VCSoldier/Material-Editor

I've also got a fork of a fork here https://github.com/IJWTB/material-editor

Both repos have the fix I supplied up above.
Sanders 24. juli 2020 kl. 13:22 
Oprindeligt skrevet af IJWTB Thomas:
He did make a fork of the original code, it's at https://github.com/VCSoldier/Material-Editor

I've also got a fork of a fork here https://github.com/IJWTB/material-editor

Both repos have the fix I supplied up above.
:steamhappy:
itskenji82 27. sep. 2021 kl. 19:51 
j o e
Veeanith 9. nov. 2021 kl. 7:33 
Sorry to necro, but if anyone is still encountering this issue, i heavily recommend you just install ADV MAT 2 which has more features, and doesnt have this removal issue. (it is still a bit buggy on servers) https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2414556240
ToppyPoppy 25. juli 2023 kl. 9:59 
Yeah this is exactly what i'm dealing with
< >
Viser 1-11 af 11 kommentarer
Per side: 1530 50