Garry's Mod

Garry's Mod

Material Editor Tool
Thomas 2017 年 1 月 18 日 下午 8: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;
最后由 Thomas 编辑于; 2017 年 1 月 18 日 下午 8:46
< >
正在显示第 1 - 11 条,共 11 条留言
Thomas 2017 年 2 月 4 日 下午 8:00 
Could you please look into this?
Thomas 2017 年 4 月 24 日 下午 5: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 2019 年 11 月 26 日 上午 9:19 
I thought I had an addon conflicting this entire time...this still happens, even now.
Veeanith 2019 年 12 月 15 日 上午 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 2020 年 7 月 23 日 下午 7:21 
引用自 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 2020 年 7 月 23 日 下午 11: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 2020 年 7 月 24 日 下午 1:22 
引用自 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 2021 年 9 月 27 日 下午 7:51 
j o e
Veeanith 2021 年 11 月 9 日 上午 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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2414556240
ToppyPoppy 2023 年 7 月 25 日 上午 9:59 
Yeah this is exactly what i'm dealing with
< >
正在显示第 1 - 11 条,共 11 条留言
每页显示数: 1530 50