1#!/pxrpythonsubst 2# 3# Copyright 2018 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. 24from pxr import Usd, UsdSkel, UsdGeom 25import unittest 26 27 28class TestUsdSkelRoot(unittest.TestCase): 29 30 def test_ComputeExtentPlugin(self): 31 """Tests plugin for computing extents on a UsdSkelRoot.""" 32 33 testFile = "root.usda" 34 stage = Usd.Stage.Open(testFile) 35 36 boundable = UsdGeom.Boundable(stage.GetPrimAtPath("/Root")) 37 38 for time in range(int(stage.GetStartTimeCode()), 39 int(stage.GetEndTimeCode())+1): 40 UsdGeom.Boundable.ComputeExtentFromPlugins(boundable, time) 41 42 stage.GetRootLayer().Export("root.computedExtents.usda") 43 44 45if __name__ == "__main__": 46 unittest.main() 47