Quantcast How to get *textured* PlayerModel frame of shapeshift forms? - WoWInterface
Thread Tools Display Modes
09-17-19, 01:03 PM   #1
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 116
How to get *textured* PlayerModel frame of shapeshift forms?

I want to put the 3D models of shapeshift forms into a frame, but SetModel() with the ModelFileID as returned by GetModelFileID() only gives me the model without a texture.

How can this be achieved?


Here is my code so far:

Code:
local playerModelFrame = CreateFrame("PlayerModel")

playerModelFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)

playerModelFrame:SetBackdrop({ bgFile = "Interface/Tooltips/UI-Tooltip-Background",
                      edgeFile = "Interface/DialogFrame/UI-DialogBox-Border",
                      tile = true, tileSize = 16, edgeSize = 16,
                      insets = { left = 4, right = 4, top = 4, bottom = 4 }})
playerModelFrame:SetBackdropColor(0.0, 0.0, 0.0, 1.0)

playerModelFrame:SetWidth(300)
playerModelFrame:SetHeight(600)

-- playerModelFrame:SetModel(926251)   -- Shaman Ghost Wolf
playerModelFrame:SetModel(1270180)  -- BloodElf male Havoc
playerModelFrame:SetModelScale(1)

And this is the result:


Last edited by LudiusMaximus : 09-22-19 at 06:53 PM.
  Reply With Quote
09-17-19, 04:26 PM   #2
JDoubleU00
A Scalebane Royal Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 427
This may not be what you are looking for, but it might give you ideas on how to accomplish your goal.

https://wowinterface.com/downloads/i...delViewer.html
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
09-19-19, 07:33 AM   #3
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 116
Thanks, but rIngameModelViewer uses playerModelFrame:setDisplayInfo(displayID).
If I wanted to do this, I would first need the displayID. So my questions would be:

How to get the displayID of shapeshift forms?

When I do

Code:
playerModelFrame:SetUnit("player")
print(playerModelFrame:GetDisplayInfo())
I always get 0.


UPDATE: OK, this has already been answered 3 years ago...

Last edited by LudiusMaximus : 09-22-19 at 04:00 PM. Reason: Found explanation elsewhere.
  Reply With Quote
09-22-19, 03:57 PM   #4
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 116
After some research (particularly this thread), I am smarter now.

Using SetModel(fileID) seems to be pretty useless for any purpose I could think of.
What you need is SetDisplayInfo(displayID).

There are basically two ways of finding the displayID of your playerModelFrame:setUnit() created model:
  • If you know the name of what you are looking for, search for it in the wowhead NPCs. (You will also find druid forms etc. there even though they are technically not NPCs.) Look at the model in the wowhead 3d model viewer, then inspect the model viewer's HTML source code in your browser and search for "displayId".
  • If you have no idea what to search for, do GetModelFileID() on your playerModel frame. You can then look up the resulting fileID in a table like this (suggested here). There you will find all displayIDs using this fileID. In the case of Ghostwolf (fileID 926251) there are actually 64 displayIDs using it. So you have to try them all until you find the one you are after.
  Reply With Quote
09-22-19, 06:22 PM   #5
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by LudiusMaximus View Post
After some research (particularly this thread), I am smarter now.

Using SetModel(fileID) seems to be pretty useless for any purpose I could think of.
What you need is SetDisplayInfo(displayID).

There are basically two ways of finding the displayID of your playerModelFrame:setUnit() created model:
  • If you know the name of what you are looking for, search for it in the wowhead NPCs. (You will also find druid forms etc. there even though they are technically not NPCs.) Look at the model in the wowhead 3d model viewer, then inspect the model viewer's HTML source code in your browser and search for "displayId".
  • If you have no idea what to search for, do GetModelFileID() on your playerModel frame. You can then look up the resulting fileID in a table like this (suggested here). There you will find all displayIDs using this fileID. In the case of Ghostwolf (fileID 926251) there are actually 64 displayIDs using it. So you have to try them all until you find the one you are after.
I've fabricated a table for displayID to actualy filePath:
https://raw.githubusercontent.com/Re...isplayPath.lua
  Reply With Quote
09-22-19, 06:49 PM   #6
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 116
Originally Posted by Resike View Post
I've fabricated a table for displayID to actualy filePath:
https://raw.githubusercontent.com/Re...isplayPath.lua
That's great!

Maybe you can help me with another thing!

I want to bring the Demon Hunter Vengeance BloodElf model into a playerModel frame.
But this does not have a displayID of its own. It is instead the NightElf model (creature/dhmaletank/dhmaletank.m2) with the creature/dhmaletank/demon_tankbodybelf.blp skin.

The displayIDs using dhmaletank.m2 in your file
Code:
[65309] = "creature/dhmaletank/dhmaletank.m2",
[66406] = "creature/dhmaletank/dhmaletank.m2",
[68671] = "creature/dhmaletank/dhmaletank.m2",
[70373] = "creature/dhmaletank/dhmaletank.m2",
all use the NightElf skin (creature/dhmaletank/demon_tankbody.blp).

Any idea how I can display this with the "belf" skin?


I saw that your Power Auras 4 Addon allows you to apply different textures to the same model, so I wanted to try it for this. But I did not know how to set your "Model" slider (going from 1 to 2742) to get the dhmaletank.m2 model. Entering "creature/dhmaletank/dhmaletank.m2" in the "Custom" field did not do anything at all...
  Reply With Quote
09-24-19, 05:22 PM   #7
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by LudiusMaximus View Post
That's great!

Maybe you can help me with another thing!

I want to bring the Demon Hunter Vengeance BloodElf model into a playerModel frame.
But this does not have a displayID of its own. It is instead the NightElf model (creature/dhmaletank/dhmaletank.m2) with the creature/dhmaletank/demon_tankbodybelf.blp skin.

The displayIDs using dhmaletank.m2 in your file
Code:
[65309] = "creature/dhmaletank/dhmaletank.m2",
[66406] = "creature/dhmaletank/dhmaletank.m2",
[68671] = "creature/dhmaletank/dhmaletank.m2",
[70373] = "creature/dhmaletank/dhmaletank.m2",
all use the NightElf skin (creature/dhmaletank/demon_tankbody.blp).

Any idea how I can display this with the "belf" skin?


I saw that your Power Auras 4 Addon allows you to apply different textures to the same model, so I wanted to try it for this. But I did not know how to set your "Model" slider (going from 1 to 2742) to get the dhmaletank.m2 model. Entering "creature/dhmaletank/dhmaletank.m2" in the "Custom" field did not do anything at all...
Hmm i'm not sure then.

Last edited by Resike : 09-24-19 at 05:30 PM.
  Reply With Quote
09-24-19, 05:25 PM   #8
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 116
Originally Posted by Resike View Post
This custom skin support only work for creatures, if you are looking for a way to dress up a player even if that's a shapeshift form then i'm not sure which way to go.
I just need some way to bring the DH Vengeance model into some frame.
(It does not need to be a "PlayerModel" frame at all. Just any kind of frame would be fine.)

Could this be done with your "custom skin support"?
  Reply With Quote
09-24-19, 05:41 PM   #9
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by LudiusMaximus View Post
I just need some way to bring the DH Vengeance model into some frame.
(It does not need to be a "PlayerModel" frame at all. Just any kind of frame would be fine.)

Could this be done with your "custom skin support"?
Well i have no clue how does that looks like give me a picture.
  Reply With Quote
09-24-19, 05:58 PM   #10
LudiusMaximus
A Flamescale Wyrmkin
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 116
Originally Posted by Resike View Post
Well i have no clue how does that looks like give me a picture.
Thanks for your help! That would be:



and




The textures on the female version are looking a bit odd in the model viewer. Here are two youtube videos showing the models in game.

https://youtu.be/bJQuj1Akyvc?t=21

https://youtu.be/w_xNCaoGTq4?t=92
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to get *textured* PlayerModel frame of shapeshift forms?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off