mmSolver.tools.setviewportdisplaypreset#

Set Viewport Display Preset tool for mmSolver

This tool allows users to quickly cycle between different viewport display modes for optimised workflows.

Tool#

Main tool implementation for the Set Viewport Display Preset tool.

mmSolver.tools.setviewportdisplaypreset.tool.active_viewport_cycle_forward()#

Cycle forward through viewport display presets.

Returns:

True if successful, False otherwise.

Return type:

bool

mmSolver.tools.setviewportdisplaypreset.tool.active_viewport_cycle_backward()#

Cycle backward through viewport display presets.

Returns:

True if successful, False otherwise.

Return type:

bool

mmSolver.tools.setviewportdisplaypreset.tool.set_active_viewport_display_preset(display_preset_name)#

Set a specific viewport display preset by name.

Parameters:

display_preset_name (str) – The name of the preset to set.

Returns:

True if successful, False otherwise.

Return type:

bool

Library#

Library functions for tool’s operations.

mmSolver.tools.setviewportdisplaypreset.lib.set_viewport_display_preset(model_panel, preset)#

Apply a specific viewport preset to the model_panel.

Sets the renderer, renderer override, display mode, and hold-outs state. If any setting fails, reverts all changes to maintain consistency.

Parameters:
  • model_panel (str) – The model panel name.

  • preset (dict) – Preset dictionary containing ‘name’, ‘renderer’, ‘display_mode’, and ‘hold_outs’ keys, and optionally the ‘renderer_override’ key.

Returns:

True if all settings were successfully applied, False otherwise.

Return type:

bool

mmSolver.tools.setviewportdisplaypreset.lib.cycle_viewport_presets(model_panel, presets, direction=1)#

Cycle viewport presets in the specified direction.

Parameters:
  • model_panel (str) – The model panel name.

  • presets (list) – List of preset dictionaries to cycle through.

  • direction (int) – 1 for forward, -1 for backward.

Returns:

Tuple of (success, next_preset) where success indicates if the preset was applied successfully, and next_preset is the preset dictionary that was attempted.

Return type:

tuple of (bool, dict)

mmSolver.tools.setviewportdisplaypreset.lib.show_viewport_message(message, fade_time=None, position=None, warning=None)#

Show a message in the viewport.

Parameters:
  • message (str) – The message to display.

  • fade_time (float) – How long to show the message.

  • position (str) – Where to position the message.

Constant#

Constants and configuration for the Set Viewport Display Preset tool.