how to reset geometry with on actors with trame

I’m iterating through pvd time steps where the geometry changes drastically. I need o update the actors accordingly. If I remove the actor and add new actors, I get VTK pipeline errors

vtkDataSetMapper (0x3d09490) has 0 connections but is not optional.
JS Error => 2025-10-01 08:30:10.800 ( 25.825s) [ 4B5474]vtkDemandDrivenPipeline:677 ERR| vtkCompositeDataPipeline (0x1886fa0): Input port 0 of algorithm vtkDataSetMapper (0x1869fb0) has 0 connections but is not optional.

If I do the following, the colors update from the new dataset – strangley, since the point data sizes are different but the geometry doesnt update


    @change("selected_pvd_point")
    def _on_selected_pvd_point(self, selected_pvd_point, **_):
        if self.first_render:
            print("First render, ignoring selected_pvd_point change")
            return
        print("Selected PVD point changed:", selected_pvd_point)
        self.pvd_reader.set_active_time_value(selected_pvd_point)
        dataset = self.pvd_reader.read()   
        flattened = dataset.flatten()
        block_ids = [i for i in self.block_id_to_mesh.keys()]
        print(f"Updating {len(flattened)} blocks")
        for mesh, block_id in zip(flattened, block_ids):
            self.block_id_to_mesh[block_id] = mesh
            self._block_id_to_actor[block_id].mapper.SetInputData(mesh)
            mesh.cell_data.VTKObject.Modified()
        self.update_actor_scalars(self.server.state.visible_blocks, self.server.state.selected_loadcase, self.get_result_field_id())
        print("Rendering after PVD point change")
        self.plotter.reset_camera()
        self.plotter.render()
        self.ctx.view.update()
        

Any help would be appreciated!

Best Regards

Joe