Hi list,
I'm in another fight with the Source SDK. Currently I'm trying to add a new panel to the HUD which shows information and a model. Drawing text on the panel works just fine and basically the CModelPanel which I create in the panel code works fine as well. Basically, because it only works with models which have already been pre-loaded, like player models or weapon view/world models. So I have tried several things to pre-load the model I want to show on the CModelPanel (in the panel's LevelInit function). modelinfo->FindOrLoadModel(), engine->LoadModel(), C_BaseEntity::PrecacheModel() and CreateEntityByName() to create a new prop_static. The entity pointer is valid, but calling SetModel on it crashes the game. The other three function calls return just fine, but a call to modelinfo->GetModelIndex() with the same model name always returns -1. The problem here is that the CModelPanel initializes the model by calling InitializeAsClientEntity() in C_BaseEntity which tries to find the index for the given model name. In my case it's always -1 which makes the function return without actually loading the model. Clearly I'm doing something wrong here so any hint on how to do it correctly would be nice. Jan
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders