Руководство по графу анимаций/Основы условного воспроизведения

Материал из CryWiki Russia

Перейти к: навигация, поиск

Основы условного воспроизведения анимации

Это руководство, поможет создать Animation Graph с одним state который воспроизведёт определённую анимацию после определённого сигнала. В руководстве опишется основной процесс использования 'Animation Graph'.

  • Создайте вид с именем 'Tutorial0'

CryEngine AGT ConditionalPlayback add view.png

  • Создайте state с именем 'FooAni'

CryEngine AGT ConditionalPlayback add state.png

  • Создайте нод и имя для него it

CryEngine AGT ConditionalPlayback state view setup.png

  • Выберите general properties(общие свойства)

CryEngine AGT ConditionalPlayback general prop setting.png

  • Set the parent state to 'Alive'.
  • Check 'Allow selection', 'Include in game' and 'Can mix'.
  • Set a template and its properties

CryEngine AGT ConditionalPlayback template select.png

CryEngine AGT ConditionalPlayback template prop setup.png

A template is an xml file which specifies some essential parameters and exposes some configurable properties.

  • The 'IdleOneShot' is a template for playing an animation once in an idle state.

To check details of a template, you can click on 'Show template xml file...'.

  • Here we specify the 'animation' property to some animation of the character.
  • Set up the input we need and the selection criteria of the state
  • Set up the 'Signal' input

CryEngine AGT ConditionalPlayback signal input setup.png

Here we'll use the 'Signal'* input.

  • Add 'PlayFooAniOnce' to the 'Key Properties'.
  • Set up the state's selection criteria

CryEngine AGT ConditionalPlayback sel crit setting.png

CryEngine AGT ConditionalPlayback sel crit final.png

  • You can see there are already some criteria inherited for the parent state.
  • Now change the 'Signal' criterion from 'Use Parent State' to 'Specified Value'.
  • As a value, set 'PlayFooAniOnce' which we added before.
  • Check it with the 'State Query'

CryEngine AGT ConditionalPlayback state query setting.png

CryEngine AGT ConditionalPlayback state query result.png

Click 'Compile and load graph'* . NOTE: You'd better specify at least 'Action', 'Health', 'Item', 'Signal' and 'Stance' criteria for the query to work correctly.

  • Set the 'Signal' criterion to 'PlayFooAniOnce'.

Now click 'Perform search'. Our 'FooAni' state is in the result(the number after ':' means the match rank. If there are several matches, one of the higher rank is preferred).