WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How to get *textured* PlayerModel frame of shapeshift forms? (https://www.wowinterface.com/forums/showthread.php?t=57514)

LudiusMaximus 09-17-19 01:03 PM

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:


JDoubleU00 09-17-19 04:26 PM

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

LudiusMaximus 09-19-19 07:33 AM

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...

LudiusMaximus 09-22-19 03:57 PM

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.

Resike 09-22-19 06:22 PM

Quote:

Originally Posted by LudiusMaximus (Post 333916)
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

LudiusMaximus 09-22-19 06:49 PM

Quote:

Originally Posted by Resike (Post 333917)
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...

Resike 09-24-19 05:22 PM

Quote:

Originally Posted by LudiusMaximus (Post 333918)
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.

LudiusMaximus 09-24-19 05:25 PM

Quote:

Originally Posted by Resike (Post 333964)
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"?

Resike 09-24-19 05:41 PM

Quote:

Originally Posted by LudiusMaximus (Post 333965)
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.

LudiusMaximus 09-24-19 05:58 PM

Quote:

Originally Posted by Resike (Post 333966)
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


All times are GMT -6. The time now is 11:05 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI