Interface: IAutoCamMax
This Core Interface exposes the new viewport navigation Pivot Ball gizmo which allows the orbiting about a hit point under the mouse cursor, or about a locked point in space. Available in in 3ds Max 2017 and higher.
Properties:
None
Methods:
<void>ShowPivotBall <HWND>hwnd <&point2>mouse <&point3>center <boolean>useMousePoint applyUIScaling:<boolean>
mouse is In and Out parameter
center is Out parameter
applyUIScaling default value: true
Shows the viewport navigation Pivot Ball in the specified viewport.
The first hwnd
argument specifies the viewport by its Windows handle – see viewport.getHWND() for details.
The second parameter (x,y) mouse
is the 2D viewport position which is used when the forth parameter useMousePoint
is flagged to true.
The third parameter center
is passed by reference to retrieve back the calculated 3D position of the pivot ball.
When the fourth useMousePoint
is set to True, the pivot ball will be located at the 3D position where 2D mouse
location is mapped into 3D space.
When useMousePoint
is set to False, the passed in x,y mouse
position is ignored and the function will use the center of the viewport (width/2, height/2) as the projection coordinate.
When applyUIScaling
is true (the default), any scaling required by HDPI displays is applied.
<void>IAutoCamMax.HidePivotBall <HWND>hwnd
Hides the viewport navigation Pivot Ball in the specified viewport.
The ‘hwnd’ argument specifies the viewport by its Windows handle – see viewport.getHWND() for details.
<void>IAutoCamMax.SetHoldPivotBallPosition <boolean>hold
Locks the viewport navigation Pivot Ball to its current 3D world position to provide a static point of interest for viewport orbit operations.
When the argument is True, the Pivot Ball will be locked to its position and will not change the position if viewport navigation operations are performed.
When the argument is False, the Pivot Ball will be unlocked and will update dynamically (default behavior).
Actions:
None
Example
(
pivotBallPos = [0,0,0]
-- Unlocks the viewport navigation Pivot Ball
IAutoCamMax.SetHoldPivotBallPosition false
--Show the Pivot Ball at [50, 50] of the active viewport
IAutoCamMax.ShowPivotBall (viewport.getHWND()) [50,50] &pivotBallPos true
-- Locks the viewport navigation Pivot Ball to 3D world position of [50, 50]
IAutoCamMax.SetHoldPivotBallPosition true
-- Print 3D Pivot Ball position
print pivotBallPos
--create a Point helper at the Pivot Ball position
point pos:pivotBallPos
-- hide the Pivot Ball of the active viewport
IAutoCamMax.HidePivotBall (viewport.getHWnd())
)