• Clearing CreateMaterial Cache
    2 replies, posted
I've been using CreateMaterial to set PNG materials with specific properties on models. Issue is that once you generate a mat using CreateMaterial with a specific name, the cache doesn't get cleared on disconnect ( or even map change ) resulting in the recreation of the materials in missing textures. CreateMaterial doesn't allow itself to recreate a material if the name already exists, so it's as if the name is being saved but not the material itself. But where is that name being stored and how would I go around clearing it?
There are sadly no way of removing materials as it stands. You might want to look into RT-textures, as they allow you to re-render the texture and you can slap that on any material with IMaterial:SetTexture("$basetexture",<texture>).
Following a response you made a year ago, I was able to get it not to reset using GetTexture on the PNG material, as per here: Use a jpg/png file that is located in the data folde as a materi.. I'm going to mark you as the answer so you can get that SICK COIN since you're the one who gave the initial answer anyway :P For anyone reading however, go to that link and view the last post.
Sorry, you need to Log In to post a reply to this thread.