Models with Multiple Meshes

Posted By: 82RJZAE

Models with Multiple Meshes - 06/01/13 05:28

Hi, how easy is it to swap out models with multiple meshes? I know it's possible to attach models to each other via vertex attachment, but how can I swap out certain meshes in a model without removing them from the model itself (ie: hide/show meshes by script)?
Posted By: Superku

Re: Models with Multiple Meshes - 06/01/13 05:47

I've used vmask ( http://www.conitec.net/beta/vmask.htm ) before and it works pretty well, just give it a try:

if(key_1) my.vmask = 0; // reset
if(key_2) my.vmask |= (1<<0); // hide meshes that have the 1st skin attached
if(key_3) my.vmask |= (1<<1); // 2nd skin
...
Posted By: 82RJZAE

Re: Models with Multiple Meshes - 06/01/13 06:27

Thanks Superku! Can meshes be removed at runtime to save memory? I have a large model with high res textures & many meshes and they will not need to be active all at once.

I have not worked with models with multiple meshes before and I'm a little uncertain how to best approach this one. I noticed ent_setmesh but my model is animated and it says in the remarks that "meshes can be set only for nonanimated entities."
© 2024 lite-C Forums