• Model materials manipulation
    1 replies, posted
So i need to change whole color of the player model's ragdoll. But some models, like alyx,breen,ely, else change only head color normaly. To fix this, i have used this code, founded on one thread: [CODE] local matt = ent:GetMaterials() for k,v in pairs(matt) do local mat=Material(v) mat:SetString("$blendtintbybasealpha","0") mat:SetString("$blendtintcoloroverbase","0") mat:Recompute() end [/CODE] then if i change it color like normally SetColor(color) it change whole model color, BUT else models, that uses this material change it too, without color of course. If it was for player only, i can simply change mat strings before render player and change it back after, but... I can't find any hook to pre/post render ragdoll entity. There is hook for pre render opaques, but i need only one entity, that i want. I have tried to overwrite DrawModel function, nothing happend... function doesn't change. So i think of some variants, how to do, but i can't figure it out: 1. Get a hook of pre render and post render of this entity. 2. Create a skin to model with changed material, then just change to skin and do what i want. Simple SetMaterial() will not work for models with multimaterial. There is function GetMaterials() wich return all used materials but no Set function.
ehm... no suggestions?
Sorry, you need to Log In to post a reply to this thread.