Skip to content

Commit

Permalink
render_json: Make compatible with stable nvisii version
Browse files Browse the repository at this point in the history
Without this commit, render_json will only work with the development
version of nvisii, not the one from pip.
  • Loading branch information
mintar committed Nov 3, 2022
1 parent 07107e0 commit cc76d1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/metrics/render_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ def create_obj(
visii.set_camera_entity(camera)

visii.set_dome_light_intensity(1)
visii.set_dome_light_color(visii.vec3(1,1,1),0)

try:
visii.set_dome_light_color(visii.vec3(1, 1, 1), 0)
except TypeError:
# Support for alpha transparent backgrounds was added in nvisii ef1880aa,
# but as of 2022-11-03, the latest released version (1.1) does not include
# that change yet.
print("WARNING! Your version of NVISII does not support alpha transparent backgrounds yet; --contour will not work properly.")
visii.set_dome_light_color(visii.vec3(1, 1, 1))

# # # # # # # # # # # # # # # # # # # # # # # # #

Expand Down

0 comments on commit cc76d1c

Please sign in to comment.