User talk:^Ben: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Reverted edit of last, changed back to last version by cur)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Quick Start Facial AnimationFP]]
http://www.student.kun.nl/rvanhoorn/Optimization.htm


== Quick and dirty: Facial animations ==
[[Valve Developer TidBits]]


So you have your character lip syncing perfectly, but he or she is just staring blankly at you. You need too animate the facial muscles contained within the model.
modevents.res


== Starting out ==
Here be good stuff


First up you need to create a choreography scene, so navigate to Choreography->New... And when it asks you to create a new actor choose the name that's displayed in the bottom right hand corner.
Game Event System


Creating Events
IGameEvent *event = gameeventmanager->CreateEvent( "player_death" );
if( event )
{
event->SetInt("userid", pVictim->GetUserID() );
event->SetInt("attacker", killer_ID );
event->SetString("weapon", killer_weapon_name );
gameeventmanager->FireEvent( event );
}


<center>[[Image:Gman.gif]]</center>
Listening for Events
gameeventmanager->AddListener( this, "player_death", false );


Capturing Events
void CMapOverview::FireGameEvent( IGameEvent *event )
{
const char * type = event->GetName();
if ( Q_strcmp(type, "player_death") == 0 )
{
}
}


You will now be presented with this in the choreography tab, this is your work area that you will use to create a scene for source to play back in the game.
== My Notes ==


r_cleardecals - by the way Ben, there are no engine hooks for this so it cannot be called by code...but if <code>r_cleardecals 1</code> is called, it will also remove permanent decals projected by infodecal.&mdash;'''[[User:Ts2do|ts2do]]'''
:Hrmmm - this was going to be for my round reset code, what I was thinking of doing was this -


<center>[[Image:Choreo.jpg]]</center>
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = UTIL_PlayerByIndex( i );
        EHANDLE pPlayerHandle = pPlayer;
        engine->ClientCommand(gEntList.GetEdict(pPlayerHandle), "r_cleardecals");
        }


 
Here's my source:&mdash;'''[[User:Ts2do|ts2do]]''' 23:00, 19 Jun 2006 (PDT)
Right click on gman_high and you will be presented with a list menu, select New->Channel.. and enter audio, and then repeat the process and enter another channel and call this flex_face.
:game_shared: [http://www.plastic-warfare.com/files/pwround_gamerules.cpp] [http://www.plastic-warfare.com/files/pwround_gamerules.h] [http://www.plastic-warfare.com/files/gameeventdefs.h]<br>dlls: [http://www.plastic-warfare.com/files/mapentityfilter.cpp] [http://www.plastic-warfare.com/files/mapentityfilter.h]
 
 
<center>[[Image:Channel.jpg]]</center>
 
 
<center>[[Image:Flex face.jpg]]</center>
 
 
Audio needs to be added to the audio channel, so right click on audio, just like you did with gman_high and find your newely created sound and add it to the choreography work area.
 
 
<center>[[Image:Sound.jpg]]</center>
 
 
Then add flex animation in the same way you added audio to your work area, you may need to move the flex animation bar to cover the audio event.
 
 
<center>[[Image:Slicer.jpg]]</center>
 
 
A usefull tip is to enable "All tools drive mouth" it's hidden away in the control panel, you can find it here.
 
 
<center>[[Mouthtools1.jpg]]</center>
 
 
You now have everything ready to start animating, make sure the flex_face bar is selected then open up the flex animation tab, you will be presented with this screen.
 
 
<center>[[Image:Image29.jpg]]</center>
 
 
Each description in the dialogs relate to a facial muscle that you can manipulate, to start manipulating double click on a muscle in the dialog and a more detailed view of that muscle will be shown, to add "keyframe" points hold control and left click in anypoint of the opened muscle and it will add a keyframe to the timeline.
 
 
<center>[[Image:Image31.jpg]]</center>
 
 
As shown FacePoser will smooth out the time line for you, now all that is needed for you to-do is add more keyframe points and you will have a superbly animated character in no time.
 
 
<center>[[Image:Timeline.jpg]]</center>
 
 
Hint: This green time bar can be manually slid just hold down left mouse button and drag.
 
 
<center>[[Image:Timeslider.gif]]</center>

Latest revision as of 06:01, 5 January 2009

http://www.student.kun.nl/rvanhoorn/Optimization.htm

Valve Developer TidBits

modevents.res

Here be good stuff

Game Event System

Creating Events

IGameEvent *event = gameeventmanager->CreateEvent( "player_death" );
if( event )
{
	event->SetInt("userid", pVictim->GetUserID() );
	event->SetInt("attacker", killer_ID );
	event->SetString("weapon", killer_weapon_name );
	gameeventmanager->FireEvent( event );
}

Listening for Events

gameeventmanager->AddListener( this, "player_death", false );

Capturing Events

void CMapOverview::FireGameEvent( IGameEvent *event )
{
	const char * type = event->GetName();
	if ( Q_strcmp(type, "player_death") == 0 )
	{
	}
}

My Notes

r_cleardecals - by the way Ben, there are no engine hooks for this so it cannot be called by code...but if r_cleardecals 1 is called, it will also remove permanent decals projected by infodecal.—ts2do

Hrmmm - this was going to be for my round reset code, what I was thinking of doing was this -


	for ( int i = 1; i <= gpGlobals->maxClients; i++ )
	{
		CBasePlayer *pPlayer = UTIL_PlayerByIndex( i );

	        EHANDLE pPlayerHandle = pPlayer;
	        engine->ClientCommand(gEntList.GetEdict(pPlayerHandle), "r_cleardecals");
        }

Here's my source:—ts2do 23:00, 19 Jun 2006 (PDT)

game_shared: [1] [2] [3]
dlls: [4] [5]