Skip to content

Commit

Permalink
Allow setting complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
BigRoy committed Dec 1, 2023
1 parent 8848d47 commit b4133df
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 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 @@ -309,6 +310,19 @@ def set_rendermode(action):
shading_menu.addAction(action)
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 b4133df

Please sign in to comment.