WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Playing with models (https://www.wowinterface.com/forums/showthread.php?t=59190)

maqjav 08-07-22 12:58 AM

Playing with models
 
Hello.

This is something i've been struggling with for a long time, and I don't know if maybe nowsdays there is a solution to the problem.

I'm trying to display models dinamically in a frame and I want the model to fit perfectly in the frame.

For example:

Lua Code:
  1. local model = CreateFrame("PlayerModel", "mxpplayermodel", UiParent)
  2. model:SetPoint("CENTER")
  3. model:SetSize(120, 120)
  4. model:SetCamera(1)
  5. model:SetDisplayInfo(89822)
  6. model:Show()

This will draw a human model that fits perfectly in the frame, however if I use the DisplayID 1698 that belongs to a gigant, it shows only a portion of its body.

I know I can change the camera distance scale to show it completely like this:

Lua Code:
  1. local model = CreateFrame("PlayerModel", "mxpplayermodel", UiParent)
  2. model:SetPoint("CENTER")
  3. model:SetSize(120, 120)
  4. model:SetCamera(1)
  5. model:SetCamDistanceScale(4)
  6. model:SetDisplayInfo(1698)
  7. model:Show()

However... I don't know which models will require a modification of the camera distance scale and I don't want to check one by one and do a personal database with that information. Is is possible to solve this problem using other methods? or is it possible to know the model's size before showing it so I can adjust its scale?

Thanks.


All times are GMT -6. The time now is 10:32 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI