diff --git a/navipy/database/__init__.py b/navipy/database/__init__.py index 5e847ad02cbb1f334dc1b0142c72b84c0a79c520..325234ff190d44ff144b1240a477fc4a157bca2a 100644 --- a/navipy/database/__init__.py +++ b/navipy/database/__init__.py @@ -133,7 +133,7 @@ class DataBase(): for col in self.normalisation_columns: self.tablecolumns['normalisation'][col] = 'real' - if self.create is False: + if (self.create is False) or (os.path.exists(filename)): self._logger.info('Connect to database') if os.path.exists(filename) or filename == ':memory:': diff --git a/navipy/sensors/renderer.py b/navipy/sensors/renderer.py index d87021cb6b6098287886ec76aaee1507d7e54772..9590ab80a84c66fa3b9702afb5f9dbccb0edcd88 100644 --- a/navipy/sensors/renderer.py +++ b/navipy/sensors/renderer.py @@ -89,7 +89,8 @@ class AbstractRender(): # Check if posorient is a valid one # otherwise skip to next position if np.any(np.isnan(posorient)): - # Skip because we can not render when night + # Skip because we can not render when nans + self._logger.info('Skip nan frame_i : {}'.format(frame_i)) continue # Avoid rerendering by checking if data already # exist @@ -110,6 +111,7 @@ class AbstractRender(): # The position-orientatios is valid (none nan) # and the cmaxminrange has not already been assigned # so the image need to be rendered + self._logger.info('Update frame_i : {}'.format(frame_i)) scene = self.scene(posorient) check_scene(scene) scene = scene[..., 0] @@ -552,6 +554,13 @@ class BlenderRender(AbstractRender): :type posorient: pandas Series with multi-index """ if isinstance(posorient, pd.Series): + # set frame + cframe = int(posorient.name) + if cframe > bpy.context.scene.frame_end: + bpy.context.scene.frame_end = cframe + if cframe < bpy.context.scene.frame_start: + bpy.context.scene.frame_start = cframe + bpy.context.scene.frame_current = cframe # set roation mode conv_found = False index = posorient.index