Files
animation/tools/tailor/md_view_probe.py
T

33 lines
1.1 KiB
Python
Raw Normal View History

# Probe: load a .zprj and shoot it from every camera view point.
#
# python tools/md_bridge.py --exec "ZPRJ=r'...zprj'" ; then --file this
# or set ZPRJ below. Every screenshot in this repo is SetCamViewPoint(2) = front,
# so back-side defects have never been looked at. This finds the back index and
# gives us a full set.
import os
import tempfile
ZPRJ = globals().get("ZPRJ", r"C:\Users\Jeremy\tinqs\animation\tools\tailor\lena_pari_v3.zprj")
report = {"zprj": ZPRJ}
try:
report["load"] = import_api.ImportZprj(ZPRJ)
except TypeError as e:
zop = ApiTypes.ImportZPRJOption()
report["load_retry"] = "%s -> ImportZPRJOption" % e
report["load"] = import_api.ImportZprj(ZPRJ, zop)
utility_api.Refresh3DWindow()
shots = {}
for vp in range(8):
try:
utility_api.SetCamViewPoint(vp)
utility_api.Refresh3DWindow()
path = os.path.join(tempfile.gettempdir(), "tinqs_md_view_%d.png" % vp)
export_api.ExportSnapshot3D(path)
shots[vp] = path
except Exception as e:
shots[vp] = "%s: %s" % (type(e).__name__, e)
report["shots"] = shots
result = report