VGUI ModelPanel

From Valve Developer Community
Jump to navigation Jump to search

The ModelPanel allows the drawing of various 3D models on a VGUI Panel.

It will play Activities/Sequences on the set model.

You can also set which skin to use on this model (Index value, zero based).

This VGUI class is found in basemodelpanel.cpp

Example

The following is used in a resource script, and placed inside of a VGUI Panel.

"CModelPanel"
{

//Basic Panel settings
"ControlName"		  "CModelPanel"
"fieldName"		    "CModelPanel1"
"xpos"		        "61"
"ypos"		        "12"
"wide"		        "150"
"tall"		        "200"
"autoResize"		  "0"
"pinCorner"		    "0"
"visible"		      "1"
"enabled"		      "1"
"tabPosition"		  "0"

//Model
//
//This contains information about the model in the panel
"model"
{
//The dir/name of the model (.MDL)
"modelname"       "models/Weapons/w_smg1.mdl"

//The dir/name of a 'HWMorph Model'
"modelname_hwm"   ""

//Skin number
"skin"            "0"

//Rotation in X
"angles_x"        "0.0"

//Rotation in Y
"angles_y"        "0.0"

//Rotation in Z
"angles_z"        "0.0"

//Position in X
"origin_x"        "0.0"

//Position in Y
"origin_y"        "0.0"

//Position in Z
"origin_z"        "0.0"

//Camera position in X
"frame_origin_x"  "5.0"

//Camera position in Y
"frame_origin_y"  "0.0"

//Camera position in Z
"frame_origin_z"  "0.0"

//Choreography Scene File dir/name
"vcd"             ""

//Use spotlight? (lights up the model)
"spotlight"       "1" 
}

//Animation
//
//This contains Activity/Sequence information for the model above
//I believe there can be multiples of these
"animation"
{
//Name of animation group
"name"            ""
//Sequence name for the model to play
"sequence"        ""
//Activity name for the model to play
"activity"        ""
//Should this model use this animation by default?
"default"         "0"
}

I know nothing about working with Wiki pages, but i feel this information should be on here. If someone could pretty this page up, that would be awesome. I would keep the example for reference though.

--RvIceBreaker 04:07, 15 December 2010 (UTC)