Skip to content

Commit bfecf6d

Browse files
committed
pass log level to low level libs
1 parent 18077f7 commit bfecf6d

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

plotoptix/_load_lib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _load_optix_win():
3030

3131
optix = cdll.LoadLibrary(dll_name)
3232

33-
optix.create_empty_scene.argtypes = [c_int, c_int, c_void_p, c_int]
33+
optix.create_empty_scene.argtypes = [c_int, c_int, c_void_p, c_int, c_int]
3434
optix.create_empty_scene.restype = c_bool
3535

3636
optix.get_miss_program.restype = c_int
@@ -489,9 +489,9 @@ def refresh_scene(self): self._optix.refresh_scene()
489489

490490
def destroy_scene(self): self._optix.destroy_scene()
491491

492-
def create_empty_scene(self, width, height, buf_ptr, buf_size):
492+
def create_empty_scene(self, width, height, buf_ptr, buf_size, log_level):
493493
return self._optix.create_empty_scene_ptr(width, height,
494-
IntPtr.__overloads__[Int64](buf_ptr), buf_size)
494+
IntPtr.__overloads__[Int64](buf_ptr), buf_size, log_level)
495495

496496
def get_miss_program(self): return self._optix.get_miss_program()
497497
def set_miss_program(self, algorithm, refresh): return self._optix.set_miss_program(algorithm, refresh)

plotoptix/bin/RnD.SharpOptiX.dll

0 Bytes
Binary file not shown.

plotoptix/bin/rndSharpOptiX7.dll

0 Bytes
Binary file not shown.

plotoptix/npoptix.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@ def __init__(self,
8989
self._is_started = False
9090
self._is_closed = False
9191

92+
rt_log = 0
93+
if isinstance(log_level, int):
94+
if log_level == logging.ERROR: rt_log = 1
95+
elif log_level == logging.WARNING: rt_log = 2
96+
elif log_level == logging.INFO: rt_log = 3
97+
elif log_level == logging.DEBUG: rt_log = 4
98+
if isinstance(log_level, str):
99+
if log_level == 'ERROR': rt_log = 1
100+
elif log_level == 'WARNING': rt_log = 2
101+
elif log_level == 'WARN': rt_log = 2
102+
elif log_level == 'INFO': rt_log = 3
103+
elif log_level == 'DEBUG': rt_log = 4
104+
92105
# load SharpOptiX library, configure paths ####################
93106
self._logger.info("Configure RnD.SharpOptiX library...")
94107
self._optix = load_optix()
@@ -123,7 +136,7 @@ def __init__(self,
123136

124137
if src is None: # create empty scene
125138
self._logger.info(" - ray-tracer initialization")
126-
self._is_scene_created = self._optix.create_empty_scene(self._width, self._height, self._img_rgba.ctypes.data, self._img_rgba.size)
139+
self._is_scene_created = self._optix.create_empty_scene(self._width, self._height, self._img_rgba.ctypes.data, self._img_rgba.size, rt_log)
127140
if self._is_scene_created: self._logger.info("Empty scene ready.")
128141

129142
elif isinstance(src, str): # create scene from file

0 commit comments

Comments
 (0)