Dreikblack Posted May 11 Share Posted May 11 1. Create brush 2. Select face. 3. Apply texture: local texture = LoadTexture("/Materials/Developer/trigger.dds") local material = CreateMaterial() material:SetTexture(texture) local faces = program.facepanel:GetSelectedFaces() if (#program.facepanel:GetSelectedFaces() > 0) then for n = 1, #faces do local currentFace = faces[n] if currentFace ~= nil then currentFace:SetMaterial(material) currentFace:GetBrush():Build() end end return end 4. Select other face and apply other texture: local texture = LoadTexture("/Materials/Developer/grid01.dds") local material = CreateMaterial() material:SetTexture(texture) local faces = program.facepanel:GetSelectedFaces() if (#program.facepanel:GetSelectedFaces() > 0) then for n = 1, #faces do local currentFace = faces[n] if currentFace ~= nil then currentFace:SetMaterial(material) currentFace:GetBrush():Build() end end return end 5. Save map and open again Maps.zip Same for prefabs Also editor starts behave clunky after that - slow with delays and freezes Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted July 15 Author Share Posted July 15 Old bug when even without extra textures and faces material is gone returned": 1. Create and select brush 2. local texture = LoadTexture("/Materials/Developer/trigger.dds") local material = CreateMaterial() material:SetTexture(texture) local selected = program:GetSelection() for n = 1, #selected do local currentBrush = Brush(selected[n].entity) if currentBrush ~= nil then currentBrush:SetMaterial(material) currentBrush:Build() end end 3. Save map 4. Change something like brush scale 5. Save and reload map - material is gone Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17 Share Posted July 17 I think there is a problem here. A benefit of JSON is I can make changes to the scene file format very easily without any effort. A problem of JSON is I can make changes to the scene file format very easily without any effort. Materials-stored-in-maps, as this is, are something I have not strictly defined because it is something that has never been used. Since the created material has no path associated with it, this is functionality that is completely different from how the editor normally works. There is some working in the format that indicate this was an idea that did not get used, as many things are. There are many ideas for Ultra I had that I decided were not worth the added complexity, and so they never made it into the final feature set. Is it possible to apply a material that has a defined path, so that the editor know where to find it? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Dreikblack Posted July 18 Author Share Posted July 18 5 hours ago, Josh said: Is it possible to apply a material that has a defined path, so that the editor know where to find it? Do you mean using usual mats? I have to creating a material in this way via scripts because i'm using quake textures from a pak. But i just realized that probably i should tried to save such materials as files. If it's possible to use pak textures in mat files it would make things dozen times easier. I thought mats have textures inside them and only now i tried to open them with Notepaded++ and saw it was a json Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted July 18 Solution Share Posted July 18 If you save the material, then load it again from the path, it will now be a "normal" material with a path, like any other material the editor uses. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.