View Single Post
07-02-16, 05:21 PM   #58
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I'm a complete noob with models and got no clue what the FileDataID and NameHash stuff is
Recently heard on #wowuidev that the reason for the change could be a combination of performance and memory

But my question is, why does playermodel:GetDisplayInfo() return 0 after running playermodel:SetUnit("target") ?
Is it even possible to get a displayId from a specific unitId?

Maybe then it would be possible to get the modelpath from Resike's AllModels.lua if it was put in a library

It could help the Storyline addon if that was possible. There also was a recent reddit post about it
https://www.reddit.com/r/wow/comment...xt_in_the_post



Lua Code:
  1. -- from CreatureDisplayInfo.db2 or CreatureModelData.db2 (?)
  2. local paths = {
  3.     [0] = "none",
  4.     [32806] = "character\\human\\female\\humanfemale_hd.m2", -- Vanessa VanCleef
  5. }
  6.  
  7. local m = CreateFrame("PlayerModel")
  8. m:SetPoint("CENTER")
  9. m:SetSize(500, 500)
  10.  
  11. local function GetDisplayId(unit)
  12.     m:SetUnit(unit)
  13.     return m:GetDisplayInfo() -- always returns 0 ...
  14. end
  15.  
  16. -- test target
  17. local displayId = GetDisplayId("target")
  18. local modelpath = paths[displayId]
  19. print(modelpath) -- prints "none"
  20.  
  21. -- test vancleef
  22. m:SetDisplayInfo(32806)
  23. local displayId = m:GetDisplayInfo() -- gets 32806
  24. local modelpath = paths[displayId]
  25. print(modelpath) -- prints "character\\human\\female\\humanfemale_hd.m2"