Garry's Mod

Garry's Mod

1,147 ratings
Material URL Tool (Beta)
4
3
3
10
5
4
2
2
3
3
3
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun
File Size
Posted
Updated
65.159 KB
Jul 28, 2021 @ 4:00am
Sep 5, 2021 @ 3:00am
17 Change Notes ( view )

Subscribe to download
Material URL Tool (Beta)

Description
Material URL is a tool that allows you to use images from the internet as materials! SubMaterial feature!
v0.8.3
Please be aware that the development of this addon is currently slowed/stopped because I'm studying.

If you enjoy the addon, consider supporting it by leaving a like and sharing it with your friends, and please let me know your thoughts in the comments!
You can use this tool whether it's for memeing with your friends or simply for building!

This addon is still a Beta, so there is room for improvement and there are maybe bugs. I'll gladly appreciate any feedback!

How to use it?
How to copy an image's URL: https://i.imgur.com/yUP2g7C.png
  1. Subscribe to the addon / Make sure the addon is in your server's collection
  2. Make sure it's enabled then start a game / Start your server (then connect to it)
  3. Go to the "Render" section of the tool menu and select "Material URL"
  4. Enter a URL leading to an image in the URL field, the URL must lead to a PNG/JPEG file (e.g. https://i.imgur.com/C5ilAHq.png)
  5. (Enter a name in the Material name field)
  6. Press the button named "Upload to the server"
  7. Wait for the material to upload, then select it in the list below
  8. Click on an entity with the tool to apply your material

In order to access the SubMaterial mode, select the tool and press E and R at once. The display on the toolgun should change to SubMaterial mode. You'll just have to use your scrollwheel to switch submaterials while looking at a prop.

When your material is uploaded, everyone can see it in the list and use it.
For practical reasons, materials will be named '!maturl_[given name]_[SteamID64 of the uploader]' (in the console).

By default, the URL whitelist[pastebin.com] is on. If you want to turn it off execute this command in the game host's/server's console: "sv_materialurl_whitelist 0"

Please keep in mind that all the materials uploaded on a server will be deleted when it shuts down/changes level. Ditto for single-player mode.

Features
This addon allows you to:
  • Check if a given URL leads to a valid material
  • Upload custom materials with a direct URL to a PNG/JPEG file and a custom name and material parameters
  • Apply custom materials/submaterials on entities
  • Delete your own uploaded materials from the list (admins can delete anyone's materials)
  • Copy the materials' URL from the list
  • Report materials to admins
  • Add materials you like to a favorite list
  • Duplicate and save entities that have custom materials

When pasting a duplication that contains custom materials, all the materials will be uploaded at once and the player's cooldown will be set to the server's multiplied by the number of materials the dupe uploaded.

Client Convars
  • cl_materialurl_enabled (def. 1): Enables/disables Material URL clientside
  • cl_materialurl_keepfiles (def. 0): This allows you to keep the downloaded materials upon disconnection (they won't stay uploaded, it's just the images that are kept, they're located in the garrysmod/data/materialurl_materials/ folder)
  • cl_materialurl_preview (def. 1): Enables/disables previews in the material list
  • cl_materialurl_showmine (def. 0): Only show the materials that you uploaded in the list

Server Convars
  • sv_materialurl_adminonly (def. 0): Prevents normal players from using Material URL
  • sv_materialurl_deletedisconnected (def. 1): Enables/disables the automatic deletion of disconnect players' materials
  • sv_materialurl_whitelist (def. 1): Enables/disables the URL whitelist[pastebin.com]
  • sv_materialurl_reportingenabled (def. 0): Enables/disables the reporting feature
  • sv_materialurl_limitedsize (def. 0): Enables/disables the material size limit
  • sv_materialurl_filesizelimit (def. 1000): Sets the material size limit in kilobytes
  • sv_materialurl_limitedmaterials (def. 1): Enables/disables the material limit
  • sv_materialurl_materiallimit (def. 5): Sets the material limit (each player has their own count)
  • sv_materialurl_cooldown (def. 10): Sets the cooldown in seconds between each time a player wants to upload a material

Current problems
Discord image links must not start with 'cdn.discordapp.com/attachments'. They have to start with 'media.discordapp.net/attachments' to work.

Animated pictures aren't supported. I might not add support for this, as it might be hard for people to actually upload functional animated pictures.

Please report bugs/problems in the appropriate discussion.

Future updates features
These are the features I intend to implement in future updates (suggest here):
  • Add PermaProps support
  • Add E2 support
  • Add a way to restrict a player from using Material URL (just ban 'em)
  • Quit the Beta (v1.0)

Last v0.x update changelog (Sep. 5th)
v0.8
- Added a SubMaterial feature with duplication support, with its own display on the toolgun
- Added a button to reset the material parameters in the menu

v0.8.1
- Fixed Lua errors when looking at map entities
- Fixed the toogun display not refreshing correctly in singleplayer
- Disabled the size limit by default and changed the default maximum file size to 1000 kb (see Server Convars)

v0.8.2
- Added Material X and Y offset parameters (texture translation)

v0.8.3
- Fixed a bug with the whitelist
- Added a website to the whitelist

Disclaimer
This addon allows players to upload materials from any link when the URL whitelist[pastebin.com] is off, people might use it for nefarious purposes.
Please refrain from complaining about people misbehaving with this addon on your server. If you believe something is missing, post a suggestion.
I will not be held responsible for any cases of illicit/illegal/dangerous content uploaded on your server. Use at your own risk! I highly recommend you keep the whitelist on if you're a server owner.

Please do not reupload/edit/improve this addon without my permission.

Thanks for your support!
Popular Discussions View All (5)
65
Apr 25 @ 5:23pm
PINNED: Suggestions
Some1else{}
57
Apr 25 @ 5:25pm
PINNED: Bug Reporting
Some1else{}
4
Sep 5, 2021 @ 4:23pm
I currently make a page on imgur.com for WAC Aircraft skins.
wolfy.hunter9111
319 Comments
Jack's cold sweat Mar 25 @ 6:19am 
Will it ever work with prop2mesh?
INF-Scanner Man Mar 13 @ 9:52pm 
[Material URL Tool (Beta)] bad argument #4 to CreateConVar (string expected, got number)
1. unknown - lua/weapons/gmod_tool/stools/materialurl.lua:65
2. include - [C]:-1
3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua:154
4. include - [C]:-1
5. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:378
6. include - [C]:-1
7. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua:11
In the last update of March 13, I now get these errors in the console
troit5ky Dec 7, 2023 @ 5:51am 
[Material URL Tool (Beta)] bad argument #4 to CreateConVar (string expected, got number)

unknown - lua/weapons/gmod_tool/stools/materialurl.lua:65
include - [C]:-1
unknown - gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua:154
include - [C]:-1
unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:372
include - [C]:-1
unknown - gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua:11
|KB| >KEKSQUAD Dec 5, 2023 @ 3:18pm 
bad argument #4 to CreateConVar (string expected, got number)
1. unknown - lua/weapons/gmod_tool/stools/materialurl.lua:65
2. include - [C]:-1
3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua:154
4. include - [C]:-1
5. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:372
6. include - [C]:-1
7. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua:11
Adacho Nov 24, 2023 @ 3:32pm 
[Material URL Tool (Beta)] bad argument #4 to CreateConVar (string expected, got number)
1. unknown - lua/weapons/gmod_tool/stools/materialurl.lua:65
2. include - [C]:-1
3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua:154
4. include - [C]:-1
5. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:372
6. include - [C]:-1
7. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua:11
Adacho Nov 24, 2023 @ 3:32pm 
[Material URL Tool (Beta)] bad argument #4 to CreateConVar (string expected, got number)
1. unknown - lua/weapons/gmod_tool/stools/materialurl.lua:65
2. include - [C]:-1
3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/stool.lua:154
4. include - [C]:-1
5. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:372
6. include - [C]:-1
7. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/init.lua:10
PC22 Sep 25, 2023 @ 2:26pm 
ANY IMAGE!? servers just got funnier
...................
PC22 Sep 25, 2023 @ 2:26pm 
scouts mother.......
edl411 Aug 9, 2023 @ 7:45pm 
Is he still studying?
LucaXtagVtag Aug 8, 2023 @ 11:15am 
Alright, I've read the text upon your addon... I will listen.