Thread Tools Display Modes
12-19-12, 06:16 AM   #1
tinystomper
A Murloc Raider
 
tinystomper's Avatar
Join Date: Dec 2012
Posts: 4
DressUpModel

when using the "DressUpModel" as a frame type:
Code:
local model = CreateFrame("DressUpModel", "Model".. nmodels, parent ) ;
  model:SetAllPoints( parent ) ;
  model:SetModelScale(1) ;
  model:SetUnit( name ) ;
  model:SetPosition(0,0,0) ;
the model only seems to show up when the target passed to SetUnit is within close proximity.

is there any way to cache the model for members of my own party? what am i missing?

does anyone know if the models for players in my group/raid should be available, even though they are not within range? what about players in my group/raid that are on another realm?

i'm calling model:SetUnit( name ) with a player's name (ie: grog-magtheridon). i've tried using 'target' or 'party1' and the model still won't show up unless i'm within range.

alternatively, is there some way to 'dress' a model myself? is there a way to get the various settings that specify the options that make the model... then setting the various items on a new model, thereby building it myself.

thoughts?
  Reply With Quote
12-19-12, 01:00 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,322
As a rule, only a unit that passes a UnitIsVisible() check can be loaded in a ModelFrame of any type by Model:SetUnit(). What the function does is look through unit model memory and feed the result to the ModelFrame. If a unit is out of the client's visible range, the unit's model will not be available and if it was in there, it's freed as they leave range.

As for "dressing" a model, DressUpModel:Undress() and DressUpModel:TryOn(itemLink) will be helpful for you. This can only be used on an existing model you've loaded. Modifying or "building" a model yourself is not possible as controls for such things have not been made available yet. Even the process of using Model:GetModel() and Model:SetModel() screws up on player and creature models. It tends to load the mesh, but not any skins and the mesh cannot be modified.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-19-12 at 01:45 PM.
  Reply With Quote
12-19-12, 04:26 PM   #3
tinystomper
A Murloc Raider
 
tinystomper's Avatar
Join Date: Dec 2012
Posts: 4
this is where i'm at:


both models working fine... if i'm within visual range.

if i reload and move out of visual range, i get:


the lock is within orgrimmar and the shammie was in outland. i did an inspect on the shammie and was able to pop up the box on the left, but the character model was just the horde symbol.

if i could get the core model components (race, gender, look specs, etc)... then be able to set them on the model, i could 'build' the look myself, in theory

thoughts?
  Reply With Quote
12-19-12, 06:06 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You won't be able to build a model of the character with the same features, I think the best you can do is use a default model for each race and dress it up.

There's a reason it doesn't display their actual portrait when they're out of range, the portrait is made from the model and that information isn't available.
  Reply With Quote
12-19-12, 07:19 PM   #5
tinystomper
A Murloc Raider
 
tinystomper's Avatar
Join Date: Dec 2012
Posts: 4
how would i specify the components of the base model? race, gender, etc ... is it possible?

also, how do i set an item slot? like shoulders?
i've tried model:TryOn( iid ) but that doesn't seem to appear on the model. do i have to make another call after model:TryOn to have it take effect?

local fname = model1:GetModel() ;
local iid = GetInventoryItemID("player", 3);

model2:SetModel( fname ) ;
model2:TryOn( iid ) ;

this results in a white model without the specified iid (shoulders).

and how do i 'paint' the model? it needs a skin

  Reply With Quote
12-19-12, 07:47 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Methinks it has to do with what SDPhantom already posted.

Originally Posted by SDPhantom View Post
As for "dressing" a model, DressUpModel:Undress() and DressUpModel:TryOn(itemLink) will be helpful for you. This can only be used on an existing model you've loaded. Modifying or "building" a model yourself is not possible as controls for such things have not been made available yet. Even the process of using Model:GetModel() and Model:SetModel() screws up on player and creature models. It tends to load the mesh, but not any skins and the mesh cannot be modified.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-20-12, 02:12 AM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
This appears only capable of using the player's gender, but I'll leave it here anyway..
Lua Code:
  1. local RaceIDs = {
  2.     Human = 1,
  3.     Orc = 2,
  4.     Dwarf = 3,
  5.     NightElf = 4,
  6.     Scourge = 5,
  7.     Tauren = 6,
  8.     Gnome = 7,
  9.     Troll = 8,
  10.     Goblin = 9,
  11.     BloodElf = 10,
  12.     Draenei = 11,
  13.     Worgen = 22,
  14.     Pandaren = 24,
  15. }
  16.  
  17. local dum = CreateFrame('DressUpModel', nil, UIParent)
  18. dum:SetPoint('CENTER')
  19. dum:SetSize(300,300)
  20. dum:SetUnit('player')
  21. dum:SetScript('OnUpdate', function(self, elapsed)
  22.     self.e = self.e and self.e + elapsed or 0
  23.     if not self.race then self.race = next(RaceIDs) end
  24.     if self.e > 0.8 then
  25.         self:SetCustomRace(RaceIDs[self.race])
  26.         self.race = next(RaceIDs, self.race) or next(RaceIDs)
  27.         self.e = 0
  28.     end
  29. end)

The closest I could get to swapping the gender was getting the correct gender model with the player's gender's texture which lead to some horrifying results.

*cough*



Last edited by semlar : 12-20-12 at 03:04 AM.
  Reply With Quote
12-20-12, 02:40 AM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,322
After doing a metamethod scan, it seems they started work on the ability to build a player model from scratch, but never finished the job. Perhaps we'll see this completed at a later date?
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-20-12 at 02:42 AM.
  Reply With Quote
12-20-12, 02:49 AM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Originally Posted by semlar View Post
HOLY CRAP[/highlight]
HOLY CRAP! That dwarf image freaked me out. Don't do that!

Marked the thread. I'm very much into transmogging and an item set comparsion tool would be awesome.

Not sure if this is any helpful but have you tried
http://wowprogramming.com/docs/widgets/Model/ClearModel
http://wowprogramming.com/docs/widge...el/RefreshUnit


I know from my experiments that if you had a model loaded in first place you need to change the values, clear it and reload the unit.

Thus I would give this a try:

Lua Code:
  1. self:SetCustomRace(RaceIDs[self.race])
  2. self:ClearModel()
  3. self:SetUnit("player")
  4. self:RefreshUnit()

But maybe the gender thing is just not yet in. You would need to change the basemodel from "male" to "female".
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 12-20-12 at 02:59 AM.
  Reply With Quote
12-20-12, 03:13 AM   #10
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
It doesn't work, SetCustomRace appears to be based on your character's attributes regardless of what unit the model is set to.

I can't help but think if you could figure out what model the "out of range" portraits use you could pull this off, unless those are really just textures in the interface files..

Last edited by semlar : 12-20-12 at 03:24 AM.
  Reply With Quote
12-20-12, 05:36 AM   #11
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
I'm very much into transmogging and an item set comparsion tool would be awesome.
Try MogIt, if you haven't already.
  Reply With Quote
12-20-12, 03:56 PM   #12
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,322
Originally Posted by semlar View Post
I can't help but think if you could figure out what model the "out of range" portraits use you could pull this off, unless those are really just textures in the interface files..
They're default textures based on race/gender. As to their location in the MPQs, I haven't bothered to track them down.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
12-20-12, 11:21 PM   #13
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
They are just textures, though, not models.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » DressUpModel

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