verify_eyedomelighting.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. r"""verify Eyedome lighting view"""
  2. from . import internals
  3. from ..simple import *
  4. from .. import print_info as log
  5. def Execute(opts):
  6. log("initialize pipeline")
  7. view = CreateView('RenderViewWithEDL')
  8. view.ViewSize = [400, 400]
  9. layout = CreateLayout()
  10. layout.AssignView(0, view)
  11. layout.SetSize(400, 400)
  12. Sphere()
  13. Show()
  14. log("begin render")
  15. Render()
  16. log("end render")
  17. if opts.interactive:
  18. Interact()
  19. if opts.output:
  20. log("save test image")
  21. SaveScreenshot(opts.output, ImageResolution=[400, 400])
  22. if opts.baseline:
  23. log("compare baseline image")
  24. internals.compare(opts.output, opts.baseline)
  25. elif opts.baseline:
  26. raise RuntimeError("baseline (-v) specified without output (-o)")
  27. def main(args=None):
  28. import argparse
  29. parser = argparse.ArgumentParser(description='Test Eye-Dome Lighting.')
  30. parser.add_argument("-i", "--interactive", help="enable interaction", action="store_true")
  31. parser.add_argument("-o", "--output", help="output image file", type=str)
  32. parser.add_argument("-v", "--baseline", help="baseline image (for comparison)", type=str)
  33. Execute(parser.parse_args(args))
  34. if __name__ == "__main__":
  35. main()