[Paraview] Mimicking the 'set view plane direction' GUI buttons in Python script

Jean M. Favre jfavre at cscs.ch
Thu Jul 9 05:18:33 EDT 2009


Adriano Gagliardi wrote:

> //=======================================
> 
> Is it possible Render() calls ResetCamera()? 
> 
> ===================================

You may look at the source code in
/Utilities/VTKPythonWrapping/paraview/simple.py

def Render(view=None):
    """Renders the given view (default value is active view)"""
    if not view:
        view = active_objects.view
    view.StillRender()
    if _funcs_internals.first_render:
        view.ResetCamera()
        view.StillRender()
        _funcs_internals.first_render = False
    return view


So, it would seem that if a first rendering has not been done, then yes,
it calls ResetCamera. Try doing a Render call before setting your
camera, and then follow your usual procedure

Jean--
Swiss National Supercomputing Center


More information about the ParaView mailing list