/extras/usd/tutorials/helloWorld/helloWorldRedux.py

https://github.com/PixarAnimationStudios/USD · Python · 31 lines · 5 code · 2 blank · 24 comment · 0 complexity · 5cbdbe16ecfce7ed18b65adf56d8bff5 MD5 · raw file

  1. #!/pxrpythonsubst
  2. #
  3. # Copyright 2016 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. from pxr import Usd
  26. stage = Usd.Stage.CreateNew('HelloWorldRedux.usda')
  27. xform = stage.DefinePrim('/hello', 'Xform')
  28. sphere = stage.DefinePrim('/hello/world', 'Sphere')
  29. stage.GetRootLayer().Save()