When you want to display a rendering of a three-dimensional object as part of the UI, a Model frame is your basic tool. These frames provide a rendering environment which is drawn into the backdrop of their frame, allowing you to display the contents of an .m2 file and set facing, scale, light and fog information, or run motions associated with the model.
It's comparatively rare to see the basic Model type used; most renderings of models in the stock UI and mods use PlayerFrame to display players, pets and mounts.
Defined Methods
- Model:AdvanceTime() - Advances to the model's next animation frame
- Model:ClearFog() - Disables fog display for the model.
- Model:ClearModel() - Removes the 3D model currently displayed
- Model:GetCameraDistance() - This function is not yet documented
- Model:GetCameraFacing() - This function is not yet documented
- Model:GetCameraPosition() - This function is not yet documented
- Model:GetCameraTarget() - This function is not yet documented
- facing = Model:GetFacing() - Returns the model's current rotation setting
- red, green, blue = Model:GetFogColor() - Returns the model's current fog color
- distance = Model:GetFogFar() - Returns the far clipping distance for the model's fog.
- distance = Model:GetFogNear() - Returns the near clipping distance for the model's fog.
- enabled, omni, dirX, dirY, dirZ, ambIntensity, ambR, ambG, ambB, dirIntensity, dirR, dirG, dirB = Model:GetLight() - Returns properties of the light sources used when rendering the model
- filename = Model:GetModel() - Returns the model file currently displayed
- scale = Model:GetModelScale() - Returns the scale factor determining the size at which the 3D model appears
- x, y, z = Model:GetPosition() - Returns the position of the 3D model within the frame
- Model:GetWorldScale() - This function is not yet documented
- Model:HasCustomCamera() - This function is not yet documented
- Model:ReplaceIconTexture("filename") - Sets the icon texture used by the model
- Model:SetCamera(index) - Sets the view angle on the model to a pre-defined camera location
- Model:SetCameraDistance() - This function is not yet documented
- Model:SetCameraFacing() - This function is not yet documented
- Model:SetCameraPosition() - This function is not yet documented
- Model:SetCameraTarget() - This function is not yet documented
- Model:SetCustomCamera() - This function is not yet documented
- Model:SetFacing(facing) - Sets the model's current rotation
- Model:SetFogColor(red, green, blue) - Sets the model's fog color, enabling fog display if disabled
- Model:SetFogFar(distance) - Sets the far clipping distance for the model's fog.
- Model:SetFogNear(distance) - Sets the near clipping distance for the model's fog.
- Model:SetGlow(amount) - Sets the model's glow amount
- Model:SetLight(enabled, omni, dirX, dirY, dirZ, ambIntensity [, ambR [, ambG [, ambB [, dirIntensity [, dirR [, dirG [, dirB]]]]]]]) - Sets properties of the light sources used when rendering the model
- Model:SetModel("filename") - Sets the model file to be displayed
- Model:SetModelScale(scale) - Sets the scale factor determining the size at which the 3D model appears
- Model:SetPosition(x, y, z) - Sets the position of the 3D model within the frame
- Model:SetSequence(sequence) - Sets the animation sequence to be used by the model
- Model:SetSequenceTime(sequence, time) - Sets the animation sequence and time index to be used by the model
Inherited Methods
- Model:AllowAttributeChanges() - Temporarily allows insecure code to modify the frame's attributes during combat
- enabled = Model:CanChangeAttribute() - Returns whether secure frame attributes can currently be changed
- canChange = Model:CanChangeProtectedState() - Returns whether protected properties of the region can be changed by non-secure scripts
- Model:ClearAllPoints() - Removes all anchor points from the region
- animationGroup = Model:CreateAnimationGroup(["name" [, "inheritsFrom"]]) - Creates a new AnimationGroup as a child of the region
- fontstring = Model:CreateFontString(["name" [, "layer" [, "inherits"]]]) - Creates a new [[docs/widgets/FontString|`FontString`]] as a child of the frame
- texture = Model:CreateTexture(["name" [, "layer" [, "inherits" [, sublevel]]]]) - Creates a new [[docs/widgets/Texture|`Texture`]] as a child of the frame
- region = Model:CreateTitleRegion() - Creates a title region for dragging the frame
- Model:DisableDrawLayer("layer") - Prevents display of all child objects of the frame on a specified graphics layer
- Model:EnableDrawLayer("layer") - Allows display of all child objects of the frame on a specified graphics layer
- Model:EnableJoystick(enable) - Enables or disables joystick interactivity
- Model:EnableKeyboard(enable) - Enables or disables keyboard interactivity for the frame
- Model:EnableMouse(enable) - Enables or disables mouse interactivity for the frame
- Model:EnableMouseWheel(enable) - Enables or disables mouse wheel interactivity for the frame
- alpha = Model:GetAlpha() - Returns the opacity of the region relative to its parent
- ... = Model:GetAnimationGroups() - Returns a list of animation groups belonging to the region
- value = Model:GetAttribute("name") - Returns the value of a secure frame attribute
- backdrop = Model:GetBackdrop() - Returns information about the frame's backdrop graphic
- red, green, blue, alpha = Model:GetBackdropBorderColor() - Returns the shading color for the frame's border graphic
- red, green, blue, alpha = Model:GetBackdropColor() - Returns the shading color for the frame's background graphic
- bottom = Model:GetBottom() - Returns the distance from the bottom of the screen to the bottom of the region
- left, bottom, width, height = Model:GetBoundsRect() - Returns the position and dimension of the smallest area enclosing the frame and its children
- x, y = Model:GetCenter() - Returns the screen coordinates of the region's center
- ... = Model:GetChildren() - Returns a list of child frames of the frame
- left, right, top, bottom = Model:GetClampRectInsets() - Returns offsets from the frame's edges used when limiting user movement or resizing of the frame
- depth = Model:GetDepth() - Returns the 3D depth of the frame (for stereoscopic 3D setups)
- Model:GetDontSavePosition() - This function is not yet documented
- alpha = Model:GetEffectiveAlpha() - Returns the overall opacity of the frame
- depth = Model:GetEffectiveDepth() - Returns the overall 3D depth of the frame (for stereoscopic 3D configurations)
- scale = Model:GetEffectiveScale() - Returns the overall scale factor of the frame
- level = Model:GetFrameLevel() - Sets the level at which the frame is layered relative to others in its strata
- strata = Model:GetFrameStrata() - Returns the general layering strata of the frame
- height = Model:GetHeight() - Returns the height of the region
- left, right, top, bottom = Model:GetHitRectInsets() - Returns the insets from the frame's edges which determine its mouse-interactable area
- id = Model:GetID() - Returns the frame's numeric identifier
- left = Model:GetLeft() - Returns the distance from the left edge of the screen to the left edge of the region
- maxWidth, maxHeight = Model:GetMaxResize() - Returns the maximum size of the frame for user resizing
- minWidth, minHeight = Model:GetMinResize() - Returns the minimum size of the frame for user resizing
- name = Model:GetName() - Returns the widget object's name
- numChildren = Model:GetNumChildren() - Returns the number of child frames belonging to the frame
- numPoints = Model:GetNumPoints() - Returns the number of anchor points defined for the region
- numRegions = Model:GetNumRegions() - Returns the number of non-Frame child regions belonging to the frame
- type = Model:GetObjectType() - Returns the object's widget type
- parent = Model:GetParent() - Returns the object's parent object
- point, relativeTo, relativePoint, xOffset, yOffset = Model:GetPoint(index) - Returns information about one of the region's anchor points
- Model:GetPropagateKeyboardInput() - This function is not yet documented
- left, bottom, width, height = Model:GetRect() - Returns the position and dimensions of the region
- ... = Model:GetRegions() - Returns a list of non-Frame child regions belonging to the frame
- right = Model:GetRight() - Returns the distance from the left edge of the screen to the right edge of the region
- scale = Model:GetScale() - Returns the frame's scale factor
- handler = Model:GetScript("scriptType") - Returns the widget's handler function for a script
- width, height = Model:GetSize() - Returns the width and height of the region
- region = Model:GetTitleRegion() - Returns the frame's TitleRegion object
- top = Model:GetTop() - Returns the distance from the bottom of the screen to the top of the region
- width = Model:GetWidth() - Returns the width of the region
- hasScript = Model:HasScript("scriptType") - Returns whether the widget supports a script handler
- Model:Hide() - Hides the region
- Model:HookScript("scriptType", handler) - Securely hooks a script handler
- Model:IgnoreDepth(enable) - Sets whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = Model:IsClampedToScreen() - Returns whether the frame's boundaries are limited to those of the screen
- isDragging = Model:IsDragging() - Returns whether the region is currently being dragged
- registered = Model:IsEventRegistered("event") - Returns whether the frame is registered for a given [[docs/events|event]]
- enabled = Model:IsIgnoringDepth() - Returns whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = Model:IsJoystickEnabled() - Returns whether joystick interactivity is enabled for the frame
- enabled = Model:IsKeyboardEnabled() - Returns whether keyboard interactivity is enabled for the frame
- enabled = Model:IsMouseEnabled() - Returns whether mouse interactivity is enabled for the frame
- isOver = Model:IsMouseOver([topOffset [, leftOffset [, bottomOffset [, rightOffset]]]]) - Returns whether the mouse cursor is over the given region
- enabled = Model:IsMouseWheelEnabled() - Returns whether mouse wheel interactivity is enabled for the frame
- movable = Model:IsMovable() - Returns whether the frame can be moved by the user
- isType = Model:IsObjectType("type") - Returns whether the object belongs to a given widget type
- isProtected, explicit = Model:IsProtected() - Returns whether the region is protected
- enabled = Model:IsResizable() - Returns whether the frame can be resized by the user
- shown = Model:IsShown() - Returns whether the region is shown
- enabled = Model:IsToplevel() - Returns whether the frame is automatically raised to the front when clicked
- enabled = Model:IsUserPlaced() - Returns whether the frame is flagged for automatic saving and restoration of position and dimensions
- visible = Model:IsVisible() - Returns whether the region is visible
- Model:Lower() - Reduces the frame's frame level below all other frames in its strata
- Model:Raise() - Increases the frame's frame level above all other frames in its strata
- Model:RegisterAllEvents() - Registers the frame for all events
- Model:RegisterEvent("event") - Registers the frame for an [[docs/events|event]]
- Model:RegisterForDrag(...) - Registers the frame for dragging
- Model:RegisterUnitEvent() - This function is not yet documented
- Model:SetAllPoints([region]) or Model:SetAllPoints(["name"]) - Sets all anchor points of the region to match those of another region
- Model:SetAlpha(alpha) - Sets the opacity of the region relative to its parent
- Model:SetAttribute("name", value) - Sets a secure frame attribute
- Model:SetBackdrop(backdrop) - Sets a backdrop graphic for the frame
- Model:SetBackdropBorderColor(red, green, blue [, alpha]) - Sets a shading color for the frame's border graphic
- Model:SetBackdropColor(red, green, blue [, alpha]) - Sets a shading color for the frame's background graphic
- Model:SetClampRectInsets(left, right, top, bottom) - Sets offsets from the frame's edges used when limiting user movement or resizing of the frame
- Model:SetClampedToScreen(enable) - Sets whether the frame's boundaries should be limited to those of the screen
- Model:SetDepth(depth) - Sets the 3D depth of the frame (for stereoscopic 3D configurations)
- Model:SetDontSavePosition() - This function is not yet documented
- Model:SetFrameLevel(level) - Sets the level at which the frame is layered relative to others in its strata
- Model:SetFrameStrata("strata") - Sets the general layering strata of the frame
- Model:SetHeight(height) - Sets the region's height
- Model:SetHitRectInsets(left, right, top, bottom) - Sets the insets from the frame's edges which determine its mouse-interactable area
- Model:SetID(id) - Sets a numeric identifier for the frame
- Model:SetMaxResize(maxWidth, maxHeight) - Sets the maximum size of the frame for user resizing
- Model:SetMinResize(minWidth, minHeight) - Sets the minimum size of the frame for user resizing
- Model:SetMovable(enable) - Sets whether the frame can be moved by the user
- Model:SetParent(frame) or Model:SetParent("name") - Makes another frame the parent of this region
- Model:SetPoint("point" [, relativeTo [, "relativePoint" [, xOffset [, yOffset]]]]) - Sets an anchor point for the region
- Model:SetPropagateKeyboardInput() - This function is not yet documented
- Model:SetResizable(enable) - Sets whether the frame can be resized by the user
- Model:SetScale(scale) - Sets the frame's scale factor
- Model:SetScript("scriptType", handler) - Sets the widget's handler function for a script
- Model:SetShown() - This function is not yet documented
- Model:SetSize(width, height) - Sets the size of the region to the specified values
- Model:SetToplevel(enable) - Sets whether the frame should automatically come to the front when clicked
- Model:SetUserPlaced(enable) - Flags the frame for automatic saving and restoration of position and dimensions
- Model:SetWidth(width) - Sets the region's width
- Model:Show() - Shows the region
- Model:StartMoving() - Begins repositioning the frame via mouse movement
- Model:StartSizing() - Begins resizing the frame via mouse movement
- Model:StopAnimating() - Stops any active animations involving the region or its children
- Model:StopMovingOrSizing() - Ends movement or resizing of the frame initiated with [[docs/widgets/Frame/StartMoving|`:StartMoving()`]] or [[docs/widgets/Frame/StartSizing|`:StartSizing()`]]
- Model:UnregisterAllEvents() - Unregisters the frame from any [[docs/events|events]] for which it is registered
- Model:UnregisterEvent("event") - Unregisters the frame for an event
Script Handlers
- OnAnimFinished(self) - Run when the model's animation finishes
- OnAttributeChanged(self, "name", value) - Run when a frame attribute is changed
- OnChar(self, "text") - Run for each text character typed in the frame
- OnDisable(self) - Run when the frame is disabled
- OnDragStart(self, "button") - Run when the mouse is dragged starting in the frame
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame
- OnEnable(self) - Run when the frame is enabled
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnHide(self) - Run when the frame's visbility changes to hidden
- OnKeyDown(self, "key") - Run when a keyboard key is pressed if the frame is keyboard enabled
- OnKeyUp(self, "key") - Run when a keyboard key is released if the frame is keyboard enabled
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area
- OnLoad(self) - Run when the frame is created
- OnMouseDown(self, "button") - Run when a mouse button is pressed while the cursor is over the frame
- OnMouseUp(self, "button") - Run when the mouse button is released following a mouse down action in the frame
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame
- OnShow(self) - Run when the frame becomes visible
- OnSizeChanged(self, width, height) - Run when a frame's size changes
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine
- OnUpdateModel(self) - Run when a model changes or animates