Skip to content

Commit

Permalink
Add Complexity options to context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
BigRoy committed Dec 1, 2023
1 parent 2ac7afd commit f42fee2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions usd_qtpy/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pxr import Usd, UsdGeom, Tf
from pxr.Usdviewq.stageView import StageView
from pxr.Usdviewq import common
from pxr.UsdAppUtils.complexityArgs import RefinementComplexities

try:
# Use C++ implementation of USD View
Expand Down Expand Up @@ -306,6 +307,18 @@ def set_rendermode(action):
action.setChecked(self.model.viewSettings.renderMode == mode)
group.addAction(action)
group.triggered.connect(set_rendermode)

# Complexity
complexity_menu = menu.addMenu("Complexity")
current_complexity_name = self.model.viewSettings.complexity.name
for complexity in RefinementComplexities.ordered():
action = complexity_menu.addAction(complexity.name)
action.setCheckable(True)
action.setChecked(complexity.name == current_complexity_name)
def set_complexity(complexity):
self.model.viewSettings.complexity = complexity

action.triggered.connect(partial(set_complexity, complexity))
# TODO: Set view settings

purpose_menu = menu.addMenu("Display Purpose")
Expand Down

0 comments on commit f42fee2

Please sign in to comment.