! plays an expression for a character @param pszMorphTarget name of morph-target @param fAmplitude amplitude-scale @param fBlendIn blend-in time in seconds @param fLength hold time in seconds @param fBlendOut blend-out time in seconds */
| 4769 | @param fBlendOut blend-out time in seconds |
| 4770 | */ |
| 4771 | int CScriptObjectEntity::DoExpression(IFunctionHandler *pH) |
| 4772 | { |
| 4773 | CHECK_PARAMETERS(5); |
| 4774 | const char *pszMorphTarget; |
| 4775 | CryCharMorphParams MorphParams; |
| 4776 | pH->GetParam(1, pszMorphTarget); |
| 4777 | pH->GetParam(2, MorphParams.fAmplitude); |
| 4778 | pH->GetParam(3, MorphParams.fBlendIn); |
| 4779 | pH->GetParam(4, MorphParams.fLength); |
| 4780 | pH->GetParam(5, MorphParams.fBlendOut); |
| 4781 | MorphParams.fStartTime=0.0f; |
| 4782 | if(m_pEntity && m_pEntity->GetCharInterface()) |
| 4783 | { |
| 4784 | ILipSync *pLipSync=m_pEntity->GetCharInterface()->GetLipSyncInterface(); |
| 4785 | if (!pLipSync) |
| 4786 | { |
| 4787 | m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0, |
| 4788 | 0,"Could not create lip-sync interface ! Does this entity %s have a character ?",m_pEntity->GetName() ); |
| 4789 | return pH->EndFunctionNull(); |
| 4790 | } |
| 4791 | if (!pLipSync->DoExpression(pszMorphTarget, MorphParams)) |
| 4792 | { |
| 4793 | m_pISystem->Warning( VALIDATOR_MODULE_SYSTEM,VALIDATOR_WARNING,0, |
| 4794 | 0,"CLipSync::DoExpression failed, Entity: %s",m_pEntity->GetName() ); |
| 4795 | return pH->EndFunctionNull(); |
| 4796 | } |
| 4797 | } |
| 4798 | return pH->EndFunction((int)1); |
| 4799 | } |
| 4800 | |
| 4801 | /*! says dialog (lip-synced); must be a character |
| 4802 | @param pszFilename name of dialog-filename (*.lsf is expected in the same folder) |
nothing calls this directly
no test coverage detected