1#!/pxrpythonsubst
2#
3# Copyright 2020 Pixar
4#
5# Licensed under the Apache License, Version 2.0 (the "Apache License")
6# with the following modification; you may not use this file except in
7# compliance with the Apache License and the following modification to it:
8# Section 6. Trademarks. is deleted and replaced with:
9#
10# 6. Trademarks. This License does not grant permission to use the trade
11#    names, trademarks, service marks, or product names of the Licensor
12#    and its affiliates, except as required to comply with Section 4(c) of
13#    the License and to reproduce the content of the NOTICE file.
14#
15# You may obtain a copy of the Apache License at
16#
17#     http://www.apache.org/licenses/LICENSE-2.0
18#
19# Unless required by applicable law or agreed to in writing, software
20# distributed under the Apache License with the above modification is
21# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22# KIND, either express or implied. See the Apache License for the specific
23# language governing permissions and limitations under the Apache License.
24#
25
26def _modifySettings(appController):
27    import os
28    cwd = os.getcwd()
29    appController._dataModel.viewSettings.showHUD = False
30    appController._dataModel.viewSettings.cullBackfaces = True
31
32# Set the background color and refresh the view.
33def _setBackgroundColorAction(appController, action):
34    action.setChecked(True)
35    appController._changeBgColor(action)
36    appController._stageView.updateGL()
37
38# Test with a dark grey background color.
39def _testGreyDarkBackground(appController):
40    _setBackgroundColorAction(appController, appController._ui.actionGrey_Dark)
41    appController._takeShot("additive.png")
42
43# Test Additive Transparency in UsdView
44def testUsdviewInputFunction(appController):
45    _modifySettings(appController)
46    _testGreyDarkBackground(appController)
47