Garry's Mod

Garry's Mod

Material Editor Tool
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;
Naposledy upravil Thomas; 18. led. 2017 v 20.46
< >
Zobrazuje se 111 z 11 komentářů
Could you please look into this?
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.
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
VCSoldier původně napsal:
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?
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.
IJWTB Thomas původně napsal:
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:
j o e
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
Yeah this is exactly what i'm dealing with
< >
Zobrazuje se 111 z 11 komentářů
Na stránku: 1530 50