Does Anyone know if/why DModelPanels share the same entity

I’m adding PAC parts to them and it seems that when I do the part is added to all of the Models.

The only conclusion I can come to is that GMod shares Entities when a DModelPanel uses the same model…

I could be wrong and it could just be something up with my paint function, but I’m not sure.

They don’t, each panel has it’s own entity.

so will it have something to do with me adding

pac.ForceRendering( true )
pac.EyePos = preview:GetCamPos( )
pac.EyeAng = (preview.vLookatPos-preview.vCamPos):Angle()

pac.PostDrawOpaqueRenderables( )
pac.PostDrawTranslucentRenderables( )

To the panels paint function?

The items paint function looks the same, just with item instead of preview.

I’m not familiar with PAC, but if you’re calling all of those in a panel’s paint hook, why are you surprised that it’s drawing all the PAC items?

It’s not drawing all the the items, it’s drawing the same item on all of the panels. :confused:

If you override Panel:Paint in DModelPanel.lua, then obviously it will do that.

But that’s the only way I can get the parts to appear…

what are you trying to do

So given a layout as such;

I wanna have the panels on the left show a preview of the outfit, and then when they hover over the outfit is applied to their preview on the right.


When I hover the outfit is applied to each one.

Definitely not applying the outfit to each panel, for sure. So I think it’s something with the code I posted above, as the outfits don’t show at all without that code.