Quote:
|
Originally Posted by DarthMan
I've been looking all over the internet without any luck.
|
There's a reason for that: I don't think anyone has ever needed
to or done anything like that before. It's easy to do in C++:
Code:
int GetNumSkins( edict_t *pEntity )
{
void *pmodel = GET_MODEL_PTR( pEntity );
studiohdr_t *pstudiohdr;
pstudiohdr = (studiohdr_t *)pmodel;
if (!pstudiohdr) return 0;
int iRet = pstudiohdr->numskinfamilies;
if( iRet < 0 ) iRet = 0;
return iRet;
}
It's not so easy to do in PAWN. You would have to open the MDL file in binary mode
then fseek to the part of the file that contains the model data (i.e. an offset
value from the beginning of the file since the model data is stored after bone,
animation and sequence data). Then you could either fseek directly to skin data if
you know the offset value OR you could read the entire model studiohdr_t data
structure into an enumerated "struct" and extract the skin info from there.
EDIT:
numskinfamilies is the correct skin count data variable.
See this thread for reference:
https://forums.alliedmods.net/showthread.php?t=178658
__________________