Animated Model Frames

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
I had spent a few days trying to figure out how to work with setting a model to a frame via BlzFrameSetModel() and finally was able to figure out all that is needed to make this work. I present a sample of working models implemented as a frame. Feel free to use this as a sample to create your own animated frames.

Criteria for the model to work for this:
1. The models themselves must be facing up, close to 0,0,0; which is also the bottom left corner of the model frame extents.
2. There cannot be any cameras attached to the model.
3. There must be 1 animation labeled "Stand", which must be the first animation, and no other animations are allowed.

*This is just an example proof-of-concept so others may be able to use it as well*
Contents

Animated Model Frames (Map)

Animated Model Frames (Map)

Reviews
MyPad
As a spell/system resource, I do not think that this fits the mold currently. I would suggest exploring the concept even further in the Advanced Scripting Section. Cool bundle though.
Hey this is pretty cool! Any chance you can translate it to Lua?

I tried using this to translate it, but I'm getting some compile errors....

Screenshot_1.png

Code:
-- MasterFrame    [email protected] framehandle    

[email protected] nothing
function Trig_ModelFrame_Actions()
    framehandlechildFrame
    
    --  Create Master Frame
    MasterFrame = BlzCreateFrameByType("SPRITE", "Master Frame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", -1)
    BlzFrameClearAllPoints(MasterFrame)
    BlzFrameSetAbsPoint(MasterFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(MasterFrame, 5, 5)
    BlzFrameSetModel(MasterFrame, "war3mapImported\\SampleModel.mdx", 0)    --  put path for master frame here
    
    --  Create Child Frame for Master Frame
    childFrame = BlzCreateFrameByType("SPRITE", "Child Frame", MasterFrame, "", 1)
    BlzFrameClearAllPoints(childFrame)
    BlzFrameSetAbsPoint(childFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(childFrame, 5, 5)
    BlzFrameSetModel(childFrame, "war3mapImported\\SampleCloud.mdx", 0)    --  put path for child frame here
    
    BlzFrameSetVisible(MasterFrame, false)
end
-- ===========================================================================
[email protected] nothing
function InitTrig_ModelFrame()
    gg_trg_ModelFrame = CreateTrigger()
    TriggerRegisterTimerEventSingle(gg_trg_ModelFrame, 0.00)
    TriggerAddAction(gg_trg_ModelFrame, Trig_ModelFrame_Actions)
end
 
Last edited:
Level 3
Joined
Dec 24, 2010
Messages
9
Hey this is pretty cool! Any chance you can translate it to Lua?

I tried using this to translate it, but I'm getting some compile errors....

View attachment 380292
Code:
-- MasterFrame    [email protected] framehandle   

[email protected] nothing
function Trig_ModelFrame_Actions()
    framehandlechildFrame
   
    --  Create Master Frame
    MasterFrame = BlzCreateFrameByType("SPRITE", "Master Frame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", -1)
    BlzFrameClearAllPoints(MasterFrame)
    BlzFrameSetAbsPoint(MasterFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(MasterFrame, 5, 5)
    BlzFrameSetModel(MasterFrame, "war3mapImported\\SampleModel.mdx", 0)    --  put path for master frame here
   
    --  Create Child Frame for Master Frame
    childFrame = BlzCreateFrameByType("SPRITE", "Child Frame", MasterFrame, "", 1)
    BlzFrameClearAllPoints(childFrame)
    BlzFrameSetAbsPoint(childFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(childFrame, 5, 5)
    BlzFrameSetModel(childFrame, "war3mapImported\\SampleCloud.mdx", 0)    --  put path for child frame here
   
    BlzFrameSetVisible(MasterFrame, false)
end
-- ===========================================================================
[email protected] nothing
function InitTrig_ModelFrame()
    gg_trg_ModelFrame = CreateTrigger()
    TriggerRegisterTimerEventSingle(gg_trg_ModelFrame, 0.00)
    TriggerAddAction(gg_trg_ModelFrame, Trig_ModelFrame_Actions)
end
Sure, I'll get working on that in just a little bit. Expect a response here in the next few days!
 
Level 3
Joined
Dec 24, 2010
Messages
9
Hey this is pretty cool! Any chance you can translate it to Lua?

I tried using this to translate it, but I'm getting some compile errors....

View attachment 380292
Code:
-- MasterFrame    [email protected] framehandle   

[email protected] nothing
function Trig_ModelFrame_Actions()
    framehandlechildFrame
   
    --  Create Master Frame
    MasterFrame = BlzCreateFrameByType("SPRITE", "Master Frame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", -1)
    BlzFrameClearAllPoints(MasterFrame)
    BlzFrameSetAbsPoint(MasterFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(MasterFrame, 5, 5)
    BlzFrameSetModel(MasterFrame, "war3mapImported\\SampleModel.mdx", 0)    --  put path for master frame here
   
    --  Create Child Frame for Master Frame
    childFrame = BlzCreateFrameByType("SPRITE", "Child Frame", MasterFrame, "", 1)
    BlzFrameClearAllPoints(childFrame)
    BlzFrameSetAbsPoint(childFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(childFrame, 5, 5)
    BlzFrameSetModel(childFrame, "war3mapImported\\SampleCloud.mdx", 0)    --  put path for child frame here
   
    BlzFrameSetVisible(MasterFrame, false)
end
-- ===========================================================================
[email protected] nothing
function InitTrig_ModelFrame()
    gg_trg_ModelFrame = CreateTrigger()
    TriggerRegisterTimerEventSingle(gg_trg_ModelFrame, 0.00)
    TriggerAddAction(gg_trg_ModelFrame, Trig_ModelFrame_Actions)
end
I have finally got back to this and created the LUA version, sorry it took so long. Cheers!
 
Level 3
Joined
Dec 24, 2010
Messages
9
Hmm, I think this would suit the Advanced Scripting Section better than here. No doubt this
is a well done proof-of-concept, but I fail to see the usability of this bundle as it is currently.
Hello,
Thanks for taking the time to read and inspect my sample, I'm a bit flattered you believe it belongs in the Advanced Scripting Section. Here is an example of how it can be used, this is for my current project.

As for the usability, the mdx model provided took me about 8 hours to perfectly fit on the screen, so that's where I'd argue it has usability, but it is all in the hands of the user.
 
Last edited:
I have finally got back to this and created the LUA version, sorry it took so long. Cheers!
Awesome, thanks!

EDIT: So I tried making a model and it works perfectly. Is there a way to reference the models, and change the animation speed in real time for example?

I made a watch model that takes 15 minutes to do one rotation, but I also want it to transfer between campaign maps and have the time remaining stored and reapplied in the next map. Normally I'd do this by setting the animation speed to fast forward until it has reached its desired time left value, but since this is a model within a frame I'm not sure how to directly reference it.

Video showcase;

Watch model is attached.
 

Attachments

  • SampleCloud.mdx
    4.4 KB · Views: 8
  • 8hu_kultiras_trinketmap01.blp
    49.3 KB · Views: 6
  • stormwind_clock.blp
    60.3 KB · Views: 27
Top