Using ClientsideModel inside pre-existing DModelPanel

Hello, currently I use a system in PostPlayerDraw that renders other models onto players.

I want to allow these to be draw inside a DModelPanel, the same way they’re draw onto players. So far I’ve had no luck getting it to draw properly.

I’ve tried this inside the PANEL:LayoutEntity() aswell as the PANEL:Render() with no avail.



test = ClientsideModel('models/error.mdl', RENDER_GROUP_VIEW_MODEL_OPAQUE)
test:SetPos( mdl.Entity:GetPos() )
test:SetAngles( mdl.Entity:GetAngles() )
test:SetParent( mdl.Entity )


Is there any direct way to do this? Am I doing something wrong here?

Inside PANEL:Paint()
do test:DrawModel()

[editline]31st July 2016[/editline]

@edit: inside Paint() func, inside Cam.3D() put test:DrawModel()