Garry's Mod

Garry's Mod

3,113 个评价
Map Retexturizer
3
2
3
3
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
插件标签: 建筑, 快乐
文件大小
发表于
更新日期
492.651 KB
2018 年 4 月 10 日 上午 10:14
3 月 4 日 下午 1:33
45 项改动说明 ( 查看 )

订阅以下载
Map Retexturizer

在 Xalalau 的 4 个合集中
Brasil - Supremacia
172 件物品
GMod Gold Animator's Collection
98 件物品
Gravação
58 件物品
Bombermano
33 件物品
描述
-----------------------------------------------------------
BRASIL, Junte-se: https://discord.gg/ytkXGNU
GMBR, criadores BR de addons e vídeos e tudo.
-----------------------------------------------------------

Introduction

Hello, there!

I've created Map Retexturizer for players to play around, for server owners to make unique outdoors / advertisement / maps and for filmmakers to reinvent their scenes more freely.

It's important to note that changing materials of a map doesn't change the original files on the disk, they're always intact. What I do is manipulate the materials in RAM and backup files, having everything managed by custom saving, loading and synchronizing systems.

That's it, and it took me a LOT of work to get to where we are!

Thank you very much for being here and I hope you have a good experience with the tool.

> TO-DO + Requests and bug reports
> Source code on GitHub[github.com]
> My other tools
> my HL1 mod, Hu3-Life



Features
  • Copy, paste and restore materials;
  • Manipulate materials of brushes, models and decals;
  • Change many material properties;
  • Tool gun and undo support for almost everything;
  • Works with any mounted game and manually installed vmt/vtf files;
  • Fully prepared for singleplayer, listen servers and dedicated servers;
  • Full support for GMod saves;
  • Save / Autosave / Load / Autoload;
  • Change all map materials at once (but water and models);
  • Full cleanup by categories;
  • Preview mode;
  • Material Browser;
  • Console commands.

Server Owners / Admins

Here are our commands:

mr_admin 1/0 = Turn on/off the admin protections; mr_materials = List all the map materials; mr_cleanup = Clean all the modifications; mr_browser = Open the Material Browser; mr_list = List the saved game names; mr_load "name" = Load the saved game called "name"; mr_autoload "name" = Set a saved game called "name" to load when the server starts; mr_save "name" = Save the current tool modifications into a file called "name"; mr_autosave 1/0 = Enable/Disable the autosaving; mr_delete "name" = Delete the save called "name"; mr_delay = The delay between each materiall application on a load; mr_dup_cleanup 1/0 = Enable/Disable cleanup before starting a load; mr_progress_bar 1/0 = Enable/Disable the progress bar; mr_instant_cleanup 1/0 = Clear the map as fast as possible (may cause a temporary freeze); mr_notifications 1/0 = Enable/Disable tool chat notifications mr_add_disp "material" = Add displacement to the menu; mr_rem_disp "material" = Remove displacement from the menu.

Changing the Skybox

You can apply any material on the skybox using the tool gun.

If you want to use a 6-sided sky, install it and write the name in the skybox path, omitting the suffix. For example, on sigleplayer:

1) Download: https://gamebanana.com/textures/4446 2) Place in the addons folder; 3) Open the game (or disconnect, run reload_legacy_addons and restart); 4) Go to the tool skybox textbox and write:
skybox/jungle_csgoft
Then you are going to see the material repeated. Just remove the suffix "ft" and try again:
skybox/jungle_csgo

Result:


Note: Check the documentation if you want to create your own sky materials
Note 2: If the map has a customizable skybox like the one in gm_construct, changing it has a small impact on performance, otherwise the impact is null.

Adding Materials

You can use your own materials by correctly creating[gamebanana.com] and placing them in the folder:

[...]\steamapps\common\GarrysMod\garrysmod\addons\mystuff\materials

In the above path, change "mystuff" as desired.

Requirements:
- VTFEdit[nemesis.thewavelength.net] to edit/create .VTF; (OR Gimp[www.gimp.org] with the gimp-vtf[github.com] plug-in) - A nice text editor like Notepad++[http//Notepad%2B%2B] to edit/create .VMF.

Sharing Your Saves

The save files are organized per map and located in the folder:

[...]\steamapps\common\GarrysMod\garrysmod\data\mapret

You can zip everything up and send the file to others, that's it.

Note: in multiplayer, save files are kept only with the server owner, that is, clients don't receive copies of them (only a list of names).

Developers

I added some custom server hooks:

-- Called when any load starts hook.Add("MRStartLoading", "Unique name 1", function(loadName, ply) -- Your code end) -- Called when any load ends hook.Add("MRFinishLoading", "Unique name 2", function(loadName, ply) -- Your code end)

ply is nil if the load is being done by the tool itself.

You can initiate a load directly by calling this function in the server scope:

MR.SV.Load:Start(ply, loadName)

ply = The player who is starting the load. You can use MR.SV.Ply:GetFakeHostPly() so we'll consider the tool is applying the save;
loadName = The name of the load file.

Check this file[github.com] to see how I call the main functions.

Unfortunately the code isn't properly documented.

Limitations

Here is a list of the things that I'm struggling to do or I can't get to work:
  • Change many of the brushes material properties, including but not limited to color and bumpmap;
  • Get displacement texture paths easily with Lua[web.archive.org] (I read them from the .bsp);
  • remove and copy decals (+undo +toolgun) (We can't[github.com])
  • Change map models (They are identified as **studio**)
  • The material preview requires a current applied map material to work, so I it's kind of "disconnected" and it affects missing textures.

OMG IT ISN'T WORKING

TL;DR; Disable the Shader Cache in your NVidia Control Panel or AMD Settings.

People are having some weird errors because of graphics cards configurations optimizing the materials storage, and for some reason it's only affecting dedicated servers.

If you are copying materials with the right mouse button and they aren't rendering correctly in the preview window, you are being affected by this.

Thanks

Tags: video / cinema / youtube / vimeo / tool / addon
热门讨论 查看全部(12)
121
7 月 31 日 上午 9:59
置顶: TO-DO + Requests and bug reports
Xalalau
13
2020 年 4 月 28 日 下午 4:56
tool laggy while running skyboxes...
Seong Gi-hun
11
2020 年 8 月 12 日 上午 11:05
Let's see if you are an artist
SMG5
939 条留言
Xalalau  [作者] 11 月 1 日 下午 4:32 
Nice
MrNiceGuy518 11 月 1 日 下午 1:05 
Brilliant, thanks! I'm revamping an old version of Spacebuild to allow people to terraform planets on spacebuild maps - I wanted a way to turn barren moons into lush green landscapes once they get far enough in the tech tree. Yours is the only tool I've ever seen that can actually retexture displacements. If it turns into something cool I might release it!
Xalalau  [作者] 11 月 1 日 下午 12:47 
Hey, ty.

Sure, just take a look at lua/mr/materials/map/displacements/**_displacements.lua

There are apply/restore functions you can easily call with data structures defined in

lua/mr/general/data/sh_data.lua

You'll be able to get the detected materials with MR.Displacements:GetDetected() and build my data format with MR.Data:CreateFromMaterial().

Just so you know, I actually scan the bsps to get these names, because traces can't retrieve all displacement material info.

The whole code is open to external addons and licensed under MIT, so feel free to use it as you wish and to call me back to take a look at your project hehe. :claugh:
MrNiceGuy518 10 月 30 日 下午 10:29 
Hey, I've got a quick question I was hoping you could answer - I'm working on a script for a personal project of mine, and I'd like to find a way to trigger a displacement material swap via LUA alone, are there any functions in your project I can call or data structures I can interface with to get that done without having to dissect the whole code base? Really impressive work, by the way.
Xalalau  [作者] 10 月 24 日 上午 11:56 
Yep, but it's mainly the material swap issue as far as I know. Do you know other bugs? Disclaimer: models are not well supported because the addon is only meant to change map materials.
arlazian 10 月 19 日 下午 12:15 
lil buggy
Leo 10 月 8 日 下午 7:47 
MY WHOLE MAP TURNED INTO PURPLE AND BLACK 😭
Yuri Katrovich 8 月 7 日 下午 1:32 
[Map Retexturizer] lua/mr/materials/cl_material.lua:149: bad argument #1 to 'Material' (string expected, got nil)
1. Material - [C]:-1
2. Apply - lua/mr/materials/cl_material.lua:149
3. func - lua/mr/materials/cl_material.lua:21
4. unknown - lua/includes/extensions/net.lua:34
Biovox 7 月 27 日 下午 3:53 
this addon makes some textures wireframe,
Клоп Сергей 6 月 23 日 上午 10:51 
Decals not working, gray background all of them