In CModelPanel::Paint() the panel simply does m_hModel->SetAbsAngles, though
with a prior check for NULL on m_hModel.
So I'd say, as it also was suggested by Andrew, that you're accessing an
NULL-pointer.

On Sat, Oct 24, 2009 at 7:17 AM, Bob Somers <[email protected]> wrote:

> 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

Reply via email to