From 446adfb29d8f3595bf27edf5ccbb2d15e9c91eb3 Mon Sep 17 00:00:00 2001 From: Marc Toussaint Date: Thu, 19 Oct 2023 15:39:49 +0200 Subject: [PATCH] render install --- _build_utils/CMakeLists-ubuntu.txt | 2 +- rai | 2 +- robotic/render.py | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/_build_utils/CMakeLists-ubuntu.txt b/_build_utils/CMakeLists-ubuntu.txt index 3206c112c..9973edc32 100644 --- a/_build_utils/CMakeLists-ubuntu.txt +++ b/_build_utils/CMakeLists-ubuntu.txt @@ -213,7 +213,7 @@ install( DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE}/robotic) install( - FILES robotic/__init__.py robotic/version.py ${CMAKE_BINARY_DIR}/ry.pyi + FILES robotic/__init__.py robotic/version.py robotic/render.py ${CMAKE_BINARY_DIR}/ry.pyi DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE}/robotic) install( diff --git a/rai b/rai index b8efb1fd6..47f73898d 160000 --- a/rai +++ b/rai @@ -1 +1 @@ -Subproject commit b8efb1fd6f43d8eca707783d814cb9aad959b086 +Subproject commit 47f73898d6f3628307bbfafc6190ed3e19fc7982 diff --git a/robotic/render.py b/robotic/render.py index 857dd4e15..b69ae6fbf 100644 --- a/robotic/render.py +++ b/robotic/render.py @@ -48,6 +48,7 @@ def __init__(self, width, height, focalLength=1.): # nvisii.disable_dome_light_sampling() def __del__(self): + print('-- shutting down Nvisii') nvisii.deinitialize() def addConfig(self, C): @@ -65,12 +66,12 @@ def addConfig(self, C): col = F['color'] if len(col) == 4: continue - if len(col) == 1: - col = [col[0], col[0], col[0]] pos = f.getPosition() quat = f.getQuaternion() if not 'temperature' in F: + if len(col) == 1: + col = [col[0], col[0], col[0]] if col == None: col = [.8, .5, .3] obj = nvisii.entity.create( @@ -92,7 +93,10 @@ def addConfig(self, C): transform = nvisii.transform.create(name=name, position=pos, rotation=flipQuat(quat)), light = nvisii.light.create(f'{name}_light') ) - light.get_light().set_intensity(1.) + if len(col) == 1: + light.get_light().set_intensity(col[0]) + else: + light.get_light().set_intensity(1.) light.get_light().set_exposure(3) # light.get_light().set_color(col) light.get_light().set_temperature(F['temperature'])