User talk:^Ben: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Initial edit.)
m (Reverted edit of last, changed back to last version by cur)
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==PreLude==
http://www.student.kun.nl/rvanhoorn/Optimization.htm


FacePoser is valve software's tool to lipsync characters and control facial animations. Lipsyncing in face poser is done automatically which if done manually usually looks sub par and if the animator wanted to get it to the level that faceposer can output its lipsyncing at, it would take a great deal of time and effort.
[[Valve Developer TidBits]]


The lipsyncing in faceposer works on a set of rules based on phonemes, phonemes are how each word is constructed out of individual sounds. The mouth has a shape for each of theese sounds, so by combining theese you get perfect lipsyncing.
modevents.res


More on phonemes here [[link]]
Here be good stuff


==Start Screen==
Game Event System


This is the screen you are presented with (-gman) when you first start faceposer. To start off load a model from the file->load model dialog. I chose gman because i'm going to be using some of his speech for the recognition.
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 );


<center>[[Image:Initialscreen (Medium).jpg]]</center>
Capturing Events
void CMapOverview::FireGameEvent( IGameEvent *event )
{
const char * type = event->GetName();
if ( Q_strcmp(type, "player_death") == 0 )
{
}
}


== My Notes ==


==Getting it to lipsync==
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 -


First you need to have an actual wav file and to know the location of said file, you also need to know what was said in the wav file. The contents of my wav file "Rise and shine Mr Freeman, Rise and shine" Also note that you need in  the case  of abreviated words spell it out properly, so Mr would be spelt as Mister.
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = UTIL_PlayerByIndex( i );
        EHANDLE pPlayerHandle = pPlayer;
        engine->ClientCommand(gEntList.GetEdict(pPlayerHandle), "r_cleardecals");
        }


Open up the "Phoneme Editor" tab you will be presented with a blank slate, right click inside of that slate and select load, then navigate to your wav file. When you open it you will be presented with this.
Here's my source:&mdash;'''[[User:Ts2do|ts2do]]''' 23:00, 19 Jun 2006 (PDT)
 
: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:Phonemestart.jpg]]</center>
 
 
Right click again and select redo extraction, you will be presented with an textbox where you must enter the speech the wav file contains.
 
 
<center>[[Image:Wordlist.jpg]]</center>
 
 
Once it has finished extracting, you will be presented with this screen.
 
 
<center>[[Image:Phoenemeeditorend.jpg]]</center>
 
 
You will notice if you click the play button, it will play the sound but the lips of the character will not be moving, you need to commit the extraction. Right click and commit extraction.
 
The character will now move their lips perfectly with the original voice.

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]