Jump to content

Resaving a map in editor removes materials that were applied via script


Dreikblack
 Share

Recommended Posts

1. Create a brush.

2. Apply a texture  with console commands:

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 - material can be seen in .ultra file.

4, Save map again - material is gone, Brush still have a line in .ultra: "material": 1

Link to comment
Share on other sites

  • Dreikblack changed the title to Resaving a map in editor removes materials that were applied via script

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...