DModelPanel's model animations screwey

http://fuckspencer.com/porn/Qh6K.png

This is what i’m experiencing right now…
Even if no animations are applied it looks as if they’re looking backwards. Standard vanilla code.
Am I missing something?

I cant even see the picture :C

http://fuckspencer.com/porn/Qh6K.png

[editline]9th January 2012[/editline]

and now you can!

That looks weird. I only have problem getting them in the right position, always makes me rage. But I have no idea why it does that, and it doesn’t happen to me :confused:

It’s the Source update. I guess we’ll need to wait.

Everywhere I go I see this… I open my derma panel I created and he stands straight and looks the proper way, I close it and open it again and he’s looking backwards… I thought I was the only one with this problem but apparently not.

It seems to be if the model has been precached.

For example, in my gamemode I have a list of player models, followed by:


for k,v in pairs(PLAYER_MODELS) do
	util.PrecacheModel("models/player/"..v)
end

If I comment out this for satement all model panels function normally. Can’t explain why this happens, but I’d rather my players experience one small freeze than models on the UI not paying attention throughout the entire game. :stuck_out_tongue_winking_eye:

–Edit

Unfortunately, once the model has been seen somewhere in game, that model will start doing it again. So if you’re trying to display player models, just a case of waiting for a fix. Sucks.

Sorry for double post, but I found a workaround for yah, wanted you to notice. xD


self.Entity:ClearPoseParameters()

Call this in your modelpanel’s paint function, eg;


function PANEL:Paint()

	if ( !IsValid( self.Entity ) ) then return end
	
	local x, y = self:LocalToScreen( 0, 0 )
	
	self:LayoutEntity( self.Entity )
	
	cam.Start3D( self.vCamPos, (self.vLookatPos-self.vCamPos):Angle(), self.fFOV, x, y, self:GetSize() )
	cam.IgnoreZ( true )
	
	render.SuppressEngineLighting( true )
	
	render.SetLightingOrigin( self.Entity:GetPos() )
	render.ResetModelLighting( self.colAmbientLight.r/255, self.colAmbientLight.g/255, self.colAmbientLight.b/255 )
	render.SetColorModulation( self.colColor.r/255, self.colColor.g/255, self.colColor.b/255 )
	render.SetBlend( self.colColor.a/255 )
	
	for i=0, 6 do
		local col = self.DirectionalLight[ i ]
		if ( col ) then
			render.SetModelLighting( i, col.r/255, col.g/255, col.b/255 )
		end
	end
	
	self.Entity:ClearPoseParameters() //Add this here... Fixed.
	
	self.Entity:DrawModel()
	
	render.SuppressEngineLighting( false )
	cam.IgnoreZ( false )
	cam.End3D()
	
	self.LastPaint = RealTime()
	
end

Of course, this is a work-around, as it should be fixed in the future. So don’t forget to keep checking as to whether still actually need it.
Also, you should probably precache your models again, if you stopped due to my previous post. :stuck_out_tongue_winking_eye:

You don’t need to clear the pose parameters EVERY frame, just once since you may want to modify the params in the later use.

You say that, but try it yourself. I tried clearing once after setting sequence, it had no affect. I believe that this bug is causing all pose params to be set to minimum every frame, which of course means that they need to be reset each frame until the bug is fixed. (Or manually overwritten each frame.)