mesh_plugin_demo.zip ~ 5mb

(the demo has a 777 polygon limitation and displays a demo message at each function call. if you would like to have an unlimited version you can write me a pm or email.)

this plugin makes it possible to use two uv-sets on your models. since the mdl7 format doesn't support two uv-sets, you will need two versions of your model. one with the first uv-set and one with the second uv-set. with the ent_loadseconduvset() function you can load the uvs of the second model into the second uv-set of the first model.

* the two models must have the same triangle count
* the vertices must be at the same positions
* the triangles must have the same vertex order
(these points usually are the case if you export them from the same application)
* the plugin requires engine version 6.6 or higher
* you can't use vec_for_mesh/vec_to_mesh anymore with a replaced mesh

the most common use of two uv-sets is light mapping. the example models and the script examples show how to use a baked light map on your models.

Code:
	you = ent_create("landscape.mdl", nullvector, 0); // load model with texture uv-set
you.material = mtl_lightmap; // assign light map material

tempentity = ent_create("landscape_lm.mdl", nullvector, 0); // load model with light map uv-set
ent_loadseconduvset(you, tempentity); // generate and assign a new mesh with both uv-sets
ent_remove(tempentity); // tempentity isn't needed anymore