Anyone played with model:SetAnimation() yet?

90 Gnome Warrior
12275
Specifically for unit frames with PlayerModels as unit portraits. 5.0.4 added PlayerModel:SetAnimation(animation[,variation]) to start a model into an animation. The usage error says its range is 0 to 802. There seems so much potential for this, I'm curious if any have done stuff with it.

For those curious, here's a script to copy/paste into chat or make into a macro to look at them on the default character sheet:

/run local c,f=CharacterModelFrame f=AmT or CreateFrame("EditBox","AmT",c,"InputBoxTemplate") f:SetSize(64,32) f:SetPoint("BOTTOMLEFT",7,-5) f:SetScript("OnEnterPressed",function(s) c:SetAnimation(s:GetText()) end) f:SetAutoFocus(nil)

After running that go to your character sheet(C) and there'll be an editbox in the lower left of your model. Enter a number 0-802 to set an animation.

One use would be adding immediate visual feedback (and a bit of character) to unit frames. Members of the party frames could do an animation for specific events like death, chatting, having/losing/gaining aggro, drinking, etc:

  • When someone joins the group, they wave (67)
  • If someone dies, they do a death animation (1) and the rest of the group cries (77)
  • When they're alive again, they can get back on their feet (101)
  • If someone says something in /p or /i, they do the talking animation (60)
  • If they're stunned or CC'ed, they can do the disorient animation (137)
  • If they get a killing blow/achievement, they can do a flex (82) or cheer (68)
  • If a boss dies, everyone cheers (68)
  • If they're drinking, it shows on their model (61)
etc
if nothing else going on, model:SetAnimation(0) to return them to an idle state.

I've been planning to add this to Adapt, and may still someday, but two other big projects have put this on hold for a bit.

Here's a few other animations. Some loop, some don't:

0 = idle
1 = death
3 = stop
4 = fast walk
5 = run
8 = take a light hit
9 = take a medium hit
10 = take a heavy hit
11-12 = turning
13 = backing up
14 = stunned
26 = attack stance
43 = swimming
60 = chat
61 = eat
62 = mine ore
63 = combine tradeskill
66 = bow
67 = wave
68 = cheer
69 = dance
70 = laugh
73 = rude
74 = roar
75 = kneel
76 = kiss
77 = cry
78 = chicken
80 = applaud
81 = shout
82 = flex
83 = flirt
84 = point
97 = sit
101 = get up
113 = salute
119 = crouching run
120 = crouch
124 = channel spell
125 = channel spell
126 = spin
137 = stunned
Reply Quote
90 Draenei Shaman
13640
Nice investigative work, Ro!

You should really put this up on wowpedia.org or wowprogramming.com!
Reply Quote
86 Gnome Priest
6005
I know I've dabbled a bit with it when I was originally playing around with Adapt never got it working the way I wanted though.
Reply Quote
More animations that I could determine.

55 - roar (non-loop)
56 - idle
57 - special attack 1H
58 - special attack 2H

64 - talk_exclamation
65 - shrug

71 - sleep, lie
72 - idle

79 - beg, grovel

87 - shield bash

89 - sheathe/unsheathe from back
90 - sheath/unsheathe from waist
91 - sitting on a mount
92 - idle
93 - idle
94 - idle
95 - kick (non-loop)
96 - sit

98 - stop
99 - sleep, lie
100 - sleep, lie

103 - sitting on mount
104 - sitting on chair
105 - nocking bow with arrow

107 - fishing cast

109 - attack idle with bow
110 - attack idle with gun or crossbow

114 - kneel
115 - kneel
116 - stand from kneeling
117 - shield bash
118 - special attack 1H

121 - knockdown
122 - idle
123 - crafting (loop)

127 - idle
128 - crafting (non-loop)
129 - stop
130 - idle
131 - drown
132 - drowned
133 - fishing
134 - fishing loop
135 - swimming loop
136 - mining, blacksmith crafting
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]