SpiderPig Posted December 17, 2023 Share Posted December 17, 2023 Can we assign a splat map / mask to a terrain in the editor rather than painting by hand? I'd like to use a RGBA map made in world machine that defines four layers. Quote Link to comment Share on other sites More sharing options...
Josh Posted December 17, 2023 Share Posted December 17, 2023 There is always a way: https://www.ultraengine.com/learn/Terrain_SetLayerWeight It should be possible to use that to add an editor extension that does this... 1 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...
SpiderPig Posted December 17, 2023 Author Share Posted December 17, 2023 I'll give it a try, thanks. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted December 17, 2023 Author Share Posted December 17, 2023 Are there any docs relating to creating an extension? Quote Link to comment Share on other sites More sharing options...
Josh Posted December 18, 2023 Share Posted December 18, 2023 Today is not a great time but we can work this out over the next week. It will probably require some additions in the editor to expose more things to Lua. 1 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...
Josh Posted December 24, 2023 Share Posted December 24, 2023 I will have some updates tomorrow that expose some new functionality in the editor to help with this. 1 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...
Josh Posted December 24, 2023 Share Posted December 24, 2023 Okay, you now have access to the terrain material layer list: listbox = program.terraineditor.materiallist So you could listen for a WIDGETMENU event and make a popup menu appear when the user right-clicks on an item. That could show a menu that says "Load Splat map" and you could open a file open dialog, load a pixmap, and then apply it to all the selected objects with this: local sel = program:GetSelection() for n = 1, #sel do local terrain = Terrain(sel[n].entity) if terrain ~= nil then -- apply splat map here... end end Maybe you would want to have some menu items like this: Load Red Channel... Load Green Channel... Load Blue Channel... Load Alpha Channel... I'm just thinking of ways to make it handle more than four layers. On the other hand maybe you want to add a button to just load a splat map onto the first four layers: local panel = program.terraineditor.panel local savebutton = panel:FindChild("Save") local button = CreateButton("Splat", savebutton.position.x + savebutton.size.x, savebutton.position.y, savebutton.size.x, savebutton.size.y, panel) 1 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...
SpiderPig Posted December 24, 2023 Author Share Posted December 24, 2023 That's terrific thanks! I'll get into it this week. Quote 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.