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:
-- 3D model frame
local playerModelEventFrame = CreateFrame("Frame", nil, UIParent)
playerModelEventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
playerModelEventFrame:RegisterEvent("UNIT_MODEL_CHANGED", "player")
playerModelEventFrame:RegisterEvent("PLAYER_LEVEL_UP")
playerModelEventFrame:RegisterEvent("PLAYER_SKINNED")
GrimUI.playerModelEventFrame = playerModelEventFrame
local playerModelFrame = CreateFrame('PlayerModel', "playerModelFrame", playerModelEventFrame)
playerModelFrame:SetHeight(175)
playerModelFrame:SetWidth(200)
playerModelFrame:SetPoint("BOTTOMRIGHT", GrimPlayerFrame, "TOPRIGHT", 0, 0)
playerModelFrame:SetFrameStrata("HIGH")
playerModelFrame:SetFrameLevel("2")
playerModelEventFrame:SetScript("OnEvent", function(self)
playerModelFrame:SetUnit("player")
playerModelFrame:RefreshUnit("player")
playerModelFrame:SetRotation(0)
playerModelFrame:SetPosition(-12, 0, -2)
end)