Extract model properties
Hi all!
I'm still trying to get the bugs out of my 3d models, and for that I need to be able to extract the height, width and depth of every model in WoW. Is it possible to extract this info from the MPQ's and if yes, how? An example can be found in the _NPCScan addon, like this: Code:
--- @description Key is lowercase, value = "[Scale]|[X]|[Y]|[Z]", where any parameter can be left empty |
iirc, that's not the height, width, and depth of the models. That's a custom point for the camera on the model. MazzleUI had a huge database for every model in the game which took him and those helping him a long time to compile. ZMobDB allows users to change the position of the camera for a model and then stores that data in the sv's (last I checked, at least).
|
Quote:
|
It seems like Blizzard has done a fair bit of work on PlayerModels in the beta. Most of the models in that list from _NPCScan don't need custom camera offsets anymore; they look fine with no change. Also, Blizzard added a couple interesting methods:
Well I was about to log in and print them, but the beta's offline. I can't remember the method name, but there was one function that seemed like it had potential. Something like SetPortraitZoom... It took a value from (-inf, inf) where 0 showed a full body portrait, 1 showed only the head (I might have these backwards), and any value in between would smoothly shift between the two. Values above one would continue to shrink the model towards the bottom of the frame, and negative values would shrink the model towards the top. I ran a Wacky Waving Inflatable Arm Flailing Tube-Man zoom demo and it looks fine; It doesn't interrupt animations and doesn't seem to affect performance much. I'm looking forward to dramatic zooming portraits! Anyway, my point was that if you do try to write a script for getting optimal camera positions, do it on the beta or PTR, since it's so different. |
Quote:
I'm dying fo a solution on displaying any kind of wisp model. Everyhting I tried didn't work out. Best I had was (1) Code:
local m = CreateFrame("Model",nil,UIParent) (2) Code:
local m = CreateFrame("PlayerModel",nil,UIParent) (2) Works, but only when the pet is cached. Questions: - Can I apply skinds to models? If yes how. So this should bring me my wisp... Code:
local m = CreateFrame("PlayerModel",nil,UIParent) Interesting is this aswell: http://www.wowhead.com/spell=24740 It applies "Apply Aura: Change Model (3681)" That leads to: http://www.wowhead.com/npc=3681 I finally want my wisp animation. Damn'it. |
View source from the creature's page on WowHead and search for "displayId:" (the 3D view button uses it). Spirit of Summer is DisplayID 16587, and the wisp is 10045.
|
Thanks, that 3D model tip is awesome.
I will gather them up: Code:
summer pet: modelviewer.show({ type: 1, typeid: 16701, displayid: 16587 }) *edit* It is finally working! Code:
local addon = CreateFrame("Frame", nil, UIParent) |
Model viewer
http://www.wowinterface.com/download...delViewer.html *edit* There are actually some Blizzards scripts that use SetDisplayInfo oder SetPortraitZoom SetDisplayInfo http://github.com/tekkub/wow-ui-sour...Frame.lua#L401 SetPortraitZoom http://github.com/tekkub/wow-ui-sour...rent.lua#L2814 http://github.com/tekkub/wow-ui-sour...Frame.xml#L255 http://github.com/tekkub/wow-ui-sour...Frame.xml#L853 There seems to be a new API function aswell for questgivers that will contain their displayid. Will return -1 if not found. Code:
local questPortrait, questPortraitText, questPortraitName = GetQuestPortraitGiver(); Code:
GetQuestPortraitTurnIn There seems to be a new config option aswell Code:
QuestLogShouldShowPortrait What's kinde of interesting is that the tutorialframe works with SetCreature. http://github.com/tekkub/wow-ui-sour...e.lua#L795-798 A little dataming reveals this in TutorialFrame.lua Code:
local TUTORIAL_QUEST_ARRAY = { Code:
local displayNPC = CURRENT_TUTORIAL_QUEST_INFO.displayNPC; Even more cool stuff found in UIParent.lua Code:
function Model_OnMouseWheel(self, delta, maxZoom) Code:
<Scripts> Code:
model:SetScript("OnMouseWheel", function(s,d,...) Code:
SetCamDistanceScale |
Ok tested a bit, gonna update the modelviewer in some hours...
Check the tooltip for values: New version is online! http://www.wowinterface.com/download...o.php?id=18079 It allows you to manipulate the model to check what values work best. @nightcracker Saiket is correct. A SetPortraitZoom value of 1 will focus any model available to show the face unless the SetCameraDistance value is not that much out of place. |
Oh, but I don't want a face portrait, I want a full body portrait :D
Also, does this mean were finally shipping cache files with our UI's now? |
Did you try Model:SetCamera(1)?
http://wowprogramming.com/docs/widgets/Model/SetCamera |
Quote:
Ofcourse I did, my 3d models are working fine except that some models are either too big or have an offset so I have to move/scale the camera. That was what my initial post was about. |
No, I'm not "kidding" you. Your original post said nothing about having used SetCamera. No one is psychic, and no one knows everything - maybe you didn't try it. Get over it. Excuse me for trying to help. :p
|
tagging!
Okay, modelviewer is bad ass, thumbs up Zork for making it. Bloody useful.
However, there's a huge thing it's missing, and I'll gladly do my part in making it true if need be. That is: tagging. Of some sort, anyway. The models range from characters to environment fixtures to light effects, and it'd be tremendous help if the viewer could display models in a particular group only. Of course, if that data cannot be mined from any DBC file, then it'd require manual tagging - and this is what I'd code in myself, if you were interested, a simple pushbutton doohickey allowing for quick tagging of the models displayed. Then, you could have people submit chunks of tagged data to compile into one big model database. Interested? Already on it? Minable? |
I like the idea. Would be only possible if a table with all displayIDs for that type is in the background. Otherwise the calculation of the pages would be impossible.
Just checked. I think have an even easier solution. What I did is Code:
print(displayid..": "..self:GetModel()) Example for displayid: 17120 Character\Human\female\humanfemale.m2 This would basically would add sth like this to the savedvariables: Code:
[tags] = { If you would like to generate that list feel free to do so. I will edit the viewer once that is in place. Maybe it's even possible to gather all data, save it to a temp table aswell and when that is done calculate all the tags and save stuff to the savedvariable. Code for the addon would be sth like this: for i=1; i<40000 do local self = mymodel --etc... self:SetModel("Interface\\Buttons\\talktomequestionmark.mdx") --in case setdisplayinfo fails self:SetDisplayInfo(i) --print(id..": "..self:GetModel()) --do stuff end |
Yup, done.
Here's the tag database - it's pretty freakin' huge, and perhaps could be compacted somehow, but I don't think it's worth the effort - the viewer is only a development/exploration tool and wouldn't be expected to operate at minimum resource requirements, I guess.
http://www.mediafire.com/file/j8dsa863xnz5pjk/tags.zip Also, I did some cosmetic modifications to your addon, use these if you wish - the first hides models that are missing (though some models show up as blank but are there if you zoom in or out): Code:
local function rIMV_setModel(self,id) Code:
GameTooltip:AddDoubleLine("GetModel", self:GetModel(), 1, 1, 1, 1, 1, 1) |
Post me the script you used to generate the result aswell please.
I added the GetModel now aswell. It is indeed useful. Code:
--bring the model to life and set the displayID That is my idea: Not sure if it will work out though. Plus is that you can copy stuff out of TinyPad. Code:
|
But there's also a :Show() at the start of the function, it works as expected :)
I didn't use a standalone script, I just added a "logging" function to your rIMV_setModel function and skipped through pages. I'm lazy. ;P I edited it out already, sorry ^^; And meanwhile, I also added full filtering support, though it's slash-command based. Oh, and the data I gathered must be loaded under a 'IMVtags' variable for this to work. Code:
local filtered Code:
local function rIMV_setModel(self,id) Code:
SLASH_IMV1 = "/imv" /imv (no filtering) /imv creature (one tag) /imv spell* (spells,spellportals etc.) /imv ? (lists HUGE tags list) |
I don't like lazy people. :p
The filter options are nice. Extracted the displayid list as csv http://code.google.com/p/rothui/down...q=#makechanges Current max displayid: 36877 Model count: 32540 ~4300 models are not set, or have displayids that do not return a model. I'm not that skilled in using savedvariables or using tables. Normally I just do graphics. |
All times are GMT -6. The time now is 04:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI