DModelPanel help

I’m trying to animate a DModelPanel, but it dont run the animation, if i run the function self:RunAnimation() my game crashes
EDIT: I want to run the walk animation
Code:


local model = vgui.Create("DModelPanel", DermaPanel);
model:SetSize(1000,1000)
model:SetPos(0,22)
model:SetModel("models/player/police.mdl");
--model:SetFOV(70);
	function model:LayoutEntity( ent )
	ent:ResetSequence(ent:GetSequence( ))
	local sequence = model.Entity:LookupSequence("walk_all")
	ent:SetSequence(sequence)
		ent:SetAngles( Angle( 0, 45, 0 ) );
		
	end

It should automatically do the animation. Here is how i used it, though i cannot get the angles to be setup properly.
It seems that you just didnt use it properly, and added way to much extra to it.


local model = vgui.Create( 'DModelPanel', window )
	model:SetModel( LocalPlayer():GetModel() )
	model:SetParent( teammenu )
	model:SetSize( 200, 265 )
	model:SetCamPos( Vector( 40, 4, 45 ))
	model:SetLookAt( Vector( 0, 0, 45 ))
	model:SetPos( 65, 122 )

It do the walk animation?

Oh walk animation, no. I thought you wanted it to spin. Though im sure it wouldnt be hard to add a function to that to make it walk.

EDIT:
Going to try a few things then will post here with any progress.

[editline]11th July 2014[/editline]

I think im getting somewhere though its hard to tell since all the code does is crash my game. Anyone else have any ideas with this?

-snip-