[Paraview] How to run a python script in every interaction
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Mon Oct 23 10:29:00 EDT 2017
For camera interaction, you can add an observer to
vtkCommand::[InteractionEvent|StartInteractionEvent|EndInteractionEvent]
fired by vtkRenderWindowInteractor.
e.g.
def callback(caller, event):
print ("ineraction")
from paraview.vtk import vtkCommand
view = GetActiveView()
view.GetInteractor().AddObserver(vtkCommand.InteractionEvent, callback)
There's no event fired on "Apply", however. Another option is to
observe vtkCommand::StartEvent and/or vtkCommand::EndEvent on the view
itself. This is fired at start/end of each render. Since that happens
as a consequence of any interaction including moving camera or hitting
apply or advancing timestrep, that may be a reasonable approach.
Utkarsh
On Mon, Oct 23, 2017 at 9:36 AM, Léo Pessanha
<leonardopessanha74 at gmail.com> wrote:
> Hi!
>
> How can I run a python script in every interaction?
>
> By interaction I mean camera movements, hitting apply buttons and etc
>
> I don't know if an approach like running the script every N frames is the
> ideal, but if that's possible it would be a great start too
>
> Best regards,
> Leonardo Pessanha
> Laboratory of Computational Methods in Engineering
> Federal University of Rio de Janeiro - COPPE
> Rio de Janeiro, RJ, Brasil
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
More information about the ParaView
mailing list