I was tasked to implement an additional dialog when exporting an Animated Scene (with File > Export Animated Scene...) kind of like the one we see when using the Export Scene feature. In the case of exporting a .vtkjs animated scene we want to be able to toggle the option of ignoring the camera of the scene.
For context, see the thread here.
Now the quick-and-dirty fix would probably be something like this:
- add a boolean ignoreCameraAnimationtovtkSMAnimationSceneWebWriter, which is passed tozipAllTimeStepshere.
- implement a new Qt dialog, which is opened in the pqAnimatedExportReaction.cxxand setsignoreCameraAnimation.
To illustrate the problem with this approach let’s have a look at how “Export Scene…” (not “Animated Scene”) is implemented. After the user chooses the extension of the file to export, the next dialog shows some options depending on that extension. This dialog is built with the pqProxyWidget and the fields are defined in Remoting/Export/Resources/exporters.xml.
So the problem with the above approach is that we then have two different dialogs for pretty much the same thing. The vtkSMAnimationSceneWebWriter uses the vtkJSONSceneExporter to save individual frames, so for .vtkjs the options shown in the “Export Animated Scene…” dialog are a super-set of the ones shown in “Export Scene…”.
The reason why we can’t use the pqProxyWidget for the vtkSMAnimationSceneWebWriter is because the latter isn’t a proxy.
- Why isn’t vtkSMAnimationSceneWebWritertreated as avtkExporter?
- Why is “Export Animated Scene…” a separate option in the first place? Why not have it all in “Export Scene…” and have an additional option animatedfor cases like.vtkjs?
Would the following approach make sense?
- Implement vtkAnimatedExporter, which inherits fromvtkExporterin VTK (not ParaView)
- Implement vtkAnimatedJSONSceneExporter, which inherits fromvtkAnimatedExporter
- Remove vtkSMAnimationSceneWriter
- Replace vtkSMAnimationSceneWebWriterwithvtkAnimatedJSONSceneExporterin ParaView
- Merge pqExportReactionandpqAnimatedExportReaction(This may be tricky)
I may be missing some key points here, which is why I’d like to ask some ParaView experts for input.