WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Legion Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=177)
-   -   PlayerModel:SetDisplayInfo (https://www.wowinterface.com/forums/showthread.php?t=53428)

maqjav 05-13-16 10:56 AM

PlayerModel:SetDisplayInfo
 
Hello.

I'm testing PlayerModel:SetDisplayInfo and it seems it doesn't show the model any longer if you haven't seen the npc before. Once it's in your cache it does work as expected. Is there any new method to achieve this?

Thanks

semlar 05-13-16 11:00 AM

SetDisplayInfo was added specifically to display models without requiring them to be cached; what code are you using to test this?

maqjav 05-13-16 11:23 AM

Quote:

Originally Posted by semlar (Post 314721)
SetDisplayInfo was added specifically to display models without requiring them to be cached; what code are you using to test this?


Hello, I was just playing with the next code:
Code:

myFrame:modelFrame = _G.CreateFrame("PlayerModel", "mxpplayermodel", myFrame)
myFrame.modelFrame:SetHeight(120)
myFrame.modelFrame:SetDisplayInfo(26711)
myFrame.modelFrame:Show()

The ID 26711 belongs to the Time-Lost Proto-Drake.

It didn't work before, but after restarting the game it started working. I've used different IDs and it seems to work only sometimes, perhaps it's a little bit buggy right now?

False alarm though :)

semlar 05-13-16 11:31 AM

I doubt it's bugged, you probably just aren't displaying your frame correctly. The model needs a height, a width, an anchor, and a visible parent to be shown.

You only have a height listed there, no anchor and we can't tell what condition "myFrame" is in.

If you open your character pane you can just type /run CharacterModelFrame:SetDisplayInfo(26711) to test whether the function is actually functioning.

myrroddin 05-13-16 12:08 PM

Assuming a copy & paste, your first line has a typo. You have a : where instead you should have a . like your other lines.

MunkDev 05-13-16 06:06 PM

It might actually be bugged. I have a PlayerModel frame just for some extra effect, and if I assign the points to match the parent on creation it doesn't seem to show the model frame. Assigning the points in the show script of the parent shows the model, but I'm not entirely sure why this is happening.

Lua Code:
  1. Frame:HookScript("OnShow", function(self)
  2.     self.Model:ClearAllPoints()
  3.     self.Model:SetAllPoints()
  4. end)

zork 05-14-16 06:09 AM

I installed my model viewer just now. Need to fix some stuff but my murloc is showing fine.

My problem is that self:GetModel() does not work. Seems to be removed.

Uploaded the model viewer for Legion beta.

http://www.wowinterface.com/download...delViewer.html

Resike 05-14-16 11:26 AM

How can you get the model path then?

semlar 05-14-16 11:38 AM

Quote:

Originally Posted by Resike (Post 314763)
How can you get the model path then?

You can't, they aren't using paths internally any more.

Resike 05-14-16 02:24 PM

Quote:

Originally Posted by semlar (Post 314766)
You can't, they aren't using paths internally any more.

It makes no fucken sense. We are forced to build a id-path table for 500k models then?

TOM_RUS 05-14-16 02:28 PM

Why you need path?

Resike 05-15-16 04:40 AM

Quote:

Originally Posted by TOM_RUS (Post 314775)
Why you need path?

I don't need the path specifically, i need some id or whatever based on what i can load a saved model. And since not every model have a id for SetDisplayInfo() and SetModel() requires a path, it would makes sense the path would be the best.

It's like removing GetTexture().

Resike 05-15-16 05:37 AM

I also have some other questions about other model functions. Why do the models look so blurry on the beta? Also what changed with SetLight()? Seems like the parameters did'nt changes however the same code which runs flawlessly on live drops an error in the beta.

MunkDev 05-15-16 05:44 AM

Quote:

Originally Posted by Resike (Post 314812)
I also have some other questions about other model functions. Why do the models look so blurry on the beta? Also what changed with SetLight()? Seems like the parameters did'nt changes however the same code which runs flawlessly on live drops an error in the beta.

First two arguments are boolean now, instead of 0-1 range.

TOM_RUS 05-15-16 06:10 AM

Quote:

Originally Posted by Resike (Post 314810)
I don't need the path specifically, i need some id or whatever based on what i can load a saved model. And since not every model have a id for SetDisplayInfo() and SetModel() requires a path, it would makes sense the path would be the best.

There's also SetCreature, SetItem, SetItemAppearance, SetDisplayInfo along with SetModel. Those API's cover a broad range of models. Also you don't need any GetXXX API's at all, since that widget only displays whatever you set to it, just store that information yourself somewhere.

Resike 05-15-16 08:46 AM

Quote:

Originally Posted by TOM_RUS (Post 314815)
There's also SetCreature, SetItem, SetItemAppearance, SetDisplayInfo along with SetModel. Those API's cover a broad range of models. Also you don't need any GetXXX API's at all, since that widget only displays whatever you set to it, just store that information yourself somewhere.

The issue is that you won't be able to pair DisplayIDs with their proper model paths like this:

Lua Code:
  1. local function ExtractModelData()
  2.     index = index + 1
  3.     print("Model: ", index)
  4.     model:ClearModel()
  5.     model:SetDisplayInfo(index)
  6.     if model:GetModel() and model:GetModel() ~= "" then
  7.         modelData[index] = model:GetModel()
  8.     end
  9. end

Which kills the ability to categorize/use/select multi textured models.

ceylina 05-18-16 08:07 AM

Looks from another link that getModel is now GetModelAlpha?

Resike 05-18-16 08:13 AM

Quote:

Originally Posted by ceylina (Post 314927)
Looks from another link that getModel is now GetModelAlpha?

Nope, thats the model's alpha.

ceylina 05-18-16 08:44 AM

Quote:

Originally Posted by Resike (Post 314928)
Nope, thats the model's alpha.

Got it from this

https://www.diffchecker.com/il1di4ac

playermodel, methods, getmodel is now mapped to getModelAlpha. Doesn't make sense but neither does half the changes they are making.

Resike 05-18-16 09:57 AM

Quote:

Originally Posted by ceylina (Post 314929)
Got it from this

https://www.diffchecker.com/il1di4ac

playermodel, methods, getmodel is now mapped to getModelAlpha. Doesn't make sense but neither does half the changes they are making.

No it's not. Log in on the beta and check the return values it's gonna be a number from 0-1.


All times are GMT -6. The time now is 03:42 PM.

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