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분
< >
전체 댓글 11개 중 1~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
< >
전체 댓글 11개 중 1~11개 표시 중
페이지당 표시 개수: 1530 50