Thread Tools Display Modes
01-13-10, 12:15 PM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
need a 3D model expert

Working on the 3d models and i have a weird problem. i did a setmodelscale as well as tried using set position and both work fine when you log in but for some reason when you sheath/unsheath weapons or change armor the scale and position reset to default.

the code is small and simple right now....
lua Code:
  1. -- 3D model frame
  2.  
  3. local playerModelEventFrame = CreateFrame("Frame", nil, UIParent)
  4. playerModelEventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
  5. playerModelEventFrame:RegisterEvent("UNIT_MODEL_CHANGED", "player")
  6. playerModelEventFrame:RegisterEvent("PLAYER_LEVEL_UP")
  7. playerModelEventFrame:RegisterEvent("PLAYER_SKINNED")
  8.  
  9. GrimUI.playerModelEventFrame = playerModelEventFrame
  10.  
  11. local playerModelFrame = CreateFrame('PlayerModel', "playerModelFrame", playerModelEventFrame)
  12. playerModelFrame:SetHeight(175)
  13. playerModelFrame:SetWidth(200)
  14. playerModelFrame:SetPoint("BOTTOMRIGHT", GrimPlayerFrame, "TOPRIGHT", 0, 0)
  15. playerModelFrame:SetFrameStrata("HIGH")
  16. playerModelFrame:SetFrameLevel("2")
  17.  
  18.  
  19. playerModelEventFrame:SetScript("OnEvent", function(self)
  20.     playerModelFrame:SetUnit("player")
  21.     playerModelFrame:RefreshUnit("player")
  22.    
  23.     playerModelFrame:SetRotation(0)
  24.     playerModelFrame:SetPosition(-12, 0, -2)
  25. end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-13-10, 07:46 PM   #2
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Huh so i figured out what was going on before, sort of. It would appear that PLAYER_ENTERING_WORLD has some sort of dif data for the charmodel size/scale/position info available then ADDON_LOADED. I changed the player_entering_world to read addonloaded how ever now a new problem arises. now it seems as though i can not set the size at all with addonloaded or model changed events. its like the position settings are set by player entering world and thats the only event that you can do that with. and doing a unitrefresh function on another event resets the position settings but you cant include another setposition?

btw setscale works but that then scales all the child frames along with it and thats no good. not to mention the only reason im worried about it even since you can scale the picture down by just changing the frame size... is so that all weapons/head items/ those big cow heads are all visible within the frame space allotted. so i need to set JUST the 3d model scale or the position so the 3d model itself changes within its frame. Zmob makes it look so easy to lol...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-13-10, 08:09 PM   #3
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
nm heh has nothing to do with the events... has to do with unitrefresh and the fact that when you do the unitrefresh you cant do another setposition?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 01-13-10 at 08:17 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » need a 3D model expert

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