Garry's Mod

Garry's Mod

Material Editor Tool
Thomas 18 jan, 2017 @ 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;
Senast ändrad av Thomas; 18 jan, 2017 @ 20:46
< >
Visar 1-11 av 11 kommentarer
Thomas 4 feb, 2017 @ 20:00 
Could you please look into this?
Thomas 24 apr, 2017 @ 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.
I thought I had an addon conflicting this entire time...this still happens, even now.
Veeanith 15 dec, 2019 @ 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 jul, 2020 @ 19:21 
Ursprungligen skrivet av 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 jul, 2020 @ 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 jul, 2020 @ 13:22 
Ursprungligen skrivet av 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 @ 19:51 
j o e
Veeanith 9 nov, 2021 @ 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://steamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2414556240
ToppyPoppy 25 jul, 2023 @ 9:59 
Yeah this is exactly what i'm dealing with
< >
Visar 1-11 av 11 kommentarer
Per sida: 1530 50