Garry's Mod
34 人が評価
[E2] Mesh Core
   
アワード
お気に入り
お気に入り
お気に入りから削除
Content Type: Addon
Addon Type: ServerContent
Addon Tags: Build
ファイルサイズ
投稿日
更新日
6.137 KB
2015年1月31日 8時33分
2017年3月26日 8時16分
19 項目の変更履歴 ( 表示 )

サブスクライブしてダウンロード
[E2] Mesh Core

解説
THIS IS AN EXTENSION FOR WIREMOD, NOT CONSOLE COMMANDS
Summary:
This extension allows you to create 'models' in game using the OBJ format.

Example use:
All you do is create the mesh with meshCreate(id, url)
meshCreate(1, "http://my.coolwebsite.com/supercube.obj") meshSetPos(1, entity():pos()) meshSetAng(1, entity():angles()) meshParent(1, entity())
This loads an obj file located at http://my.coolwebsite.com/supercube.obj.

Note:
MTL Files can now be referenced from the OBJ file (see the 'mtllib' line), it will attempt to fetch the file with that name WITH THE SAME URL AS THE OBJ.
For example, you have a OBJ file like 'http://my.website.com/cube.obj'.
In this file you may have
<...> mtllib mycubematerials.mtl <...>
The parser will then attempt to fetch 'http://my.website.com/mycubematerials.mtl'

Functions:

meshCreate(id, string url)
Creates the mesh, similar to holoCreate()

meshSetScale(id, vector scale)
Sets the scale of the mesh.

meshSetPos(id, vector pos)
Moves the origin of the mesh(0,0,0) to <pos>

meshSetAng(id, angle ang)
Sets the mesh rotation to <ang>

meshParent(id, entity parent)
Parents the mesh to the entity <parent>

meshSetURL(id, string url)
Loads an OBJ file from a website.

meshSetMaterial(string material)
Sets the material of the mesh to <material>, can either be a material or a URL

meshSetExtraMTL(id, string url)
Sets an extra MTL file to load additional materials from. <Not Required if 'mtllib' is used in the OBJ>


Commands:

meshcore_canuse 1-2:
Who can use the functions. 1:everyone, 2:only admins. default:1

meshcore_cooldown [sec]:
Time between meshLoadURL's. time in seconds. default:10.

meshcore_maxmesh [num]:
Maximum number of meshes per E2. default:10.

=Clientside=

meshcore_cache_cleartextures:
Clears cached materials so that they are (hopefully) re-rendered when they are requested.

meshcore_cache_clearmeshes
Clears cached meshes. This will force the parser(s) to re-read the files, even if they were not modified.
This should only be used if you updated the MTL file and not the OBJ as the mesh cache works with the OBJ file contents.
21 件のコメント
Jacbo 2020年6月15日 16時06分 
It doesn't work. Trying to use it gives this error: Expression 2 (a): addons/ulib/lua/ulib/shared/sh_ucl.lua:42: attempt to index local 'ply' (a nil value)
raizenxd 2020年5月1日 3時17分 
Cant add this to my collection
LUIGI 2019年1月26日 7時20分 
can you add a way for players to toggle on/off the models. so if it is making them lag thay can turn it off.
[C17] Red Fox 2018年11月6日 9時01分 
Will there ever be a fix / additions to this addon again? :(
Shasoleosh Boshasart 2018年9月16日 7時53分 
[C17] Red Fox 2018年3月20日 22時13分 
I have seen that theres no command/var to set the mesh color (rgb), the only way currently is to use a texture, which is what im not aiming for, is it possible to add such feature? I think it would be really nice to have it for many reasons. If you dont get what I mean, think about holoColor(number index,vector color). Thanks in advance.
Thomasims  [作成者] 2017年5月4日 13時43分 
I'm aware of this bug, it'll be fixed in the next update.
I'll upload it once I'm done with the new features.
Chessi 2017年4月28日 1時43分 
Strange bug that I've noticed, it seems to be making a small little can with the milkcrate texture even though the model works.
@name Eagle's Holo Car Modeler (E2 Mesh Core)
@inputs A
@persist E:entity Offset:vector AngOffset:angle Material:string

interval(50)

if(first()|duped()|dupefinished()){
Offset = vec(0,0,0)
AngOffset = ang(0,0,0)
Material = "models/debug/debugwhite"
E = entity():isConstrainedTo()
}
if(changed(E)&E){
meshCreate(1,"some object on my dropbox")
meshSetMaterial(1,Material)
meshSetPos(1,E:toWorld(Offset))
meshSetAng(1,E:toWorld(AngOffset))
meshParent(1,E)}
Thomasims  [作成者] 2017年3月23日 9時27分 
Ok so rewriting is done, new parser logic, etc...
I updated the description and put some info in the changelogs, Please let me know of any issues you encounter!
Thomasims  [作成者] 2017年2月14日 7時30分 
I could add simple mtl support when I get around to rewriting this, I quickly looked at the structure and I think some of it may be implmented.
I don't have much time to work on it currently so in the mean time, the meshSetURLTexture only works on raw images (png/jpg should work)