The first thing I would do is put the result of m_hModel.Get() into its own variable (is it returning NULL?)
Can you cast pModel to CModelPanelModel? Is 'pModel' becoming NULL? - Andrew -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Bob Somers Sent: Saturday, 24 October 2009 4:17 PM To: HLCoders Mailing List Subject: [hlcoders] CModelPanel Grief Anyone familiar with the CModelPanel? I'm trying to set up one of my models in it on a vgui panel and it's giving me nothing but trouble. I basically copied the CModelPanel out of the SDK's /resource/ui/Classmenu_Blue.res file, changing the name of the control and some positioning and size parameters. In the code, I can swap models easily with the SwapModel() method, but trying to access the model directly is crashing the game. This is basically what I'm trying to do: (m_pPreviewModel is a CModelPanel*) CModelPanelModel *pModel = dynamic_cast<CModelPanelModel *>(m_pPreviewModel->m_hModel.Get()); QAngle angles = pModel->GetAbsAngles(); // kaboom I'd like to get, and possibly set, the model's position and orientation if I could. There's no animation on this model, so I just wanted it to rotate 360 degrees slowly. Any ideas? --Bob _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

