Skip to content

Commit

Permalink
render install
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcToussaint committed Oct 19, 2023
1 parent 8939ca5 commit 446adfb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _build_utils/CMakeLists-ubuntu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 7 additions & 3 deletions robotic/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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(
Expand All @@ -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'])
Expand Down

0 comments on commit 446adfb

Please sign in to comment.