MantisBT - ParaView
View Issue Details
0009423ParaViewBugpublic2009-08-14 17:372014-08-29 10:59
Alan Scott 
Utkarsh Ayachit 
normalminoralways
closedfixed 
 
4.2 
refactor_python_tracing_2
0009423: Python Trace generator doesn't do screenshots.
* ParaView trunk, XP, local server.
* Tools/ Python Shell/ Trace/ Start trace
* Sources/ Cone. Apply.
* File/ Save Screenshot. Save this somewhere.
* Tools/ Python Shell/ Trace/ Stop trace
* Tools/ Python Shell/ Trace/ Show trace
<<Bug>> - there is no save screenshot. I tested this by saving the trace, and then executing it, and it did not save a file.

<<Note - I didn't check animations, but I bet the same problem exists>>


Since this is such basic functionality, it must be fixed for 3.6.2.
PythonTrace
has duplicate 0009701closed  python trace error - save screenshot doesn't work 
Issue History
2009-08-14 17:37Alan ScottNew Issue
2009-08-17 15:42Utkarsh AyachitStatusbacklog => tabled
2009-08-17 15:42Utkarsh AyachitAssigned To => Pat Marion
2009-08-17 15:42Utkarsh AyachitPrioritynormal => urgent
2009-09-01 11:30Pat MarionNote Added: 0017278
2009-09-01 11:30Pat MarionAssigned ToPat Marion => Alan Scott
2009-09-01 11:30Pat MarionStatustabled => @20@
2009-09-01 16:34Alan ScottNote Added: 0017288
2009-09-01 16:34Alan ScottAssigned ToAlan Scott => Pat Marion
2009-09-01 16:34Alan ScottStatus@20@ => tabled
2009-09-01 20:58Berk GeveciNote Added: 0017291
2009-09-01 20:58Berk GeveciTarget Version3.6.2 => 3.8
2010-01-19 14:05Alan ScottRelationship addedhas duplicate 0009701
2010-02-01 14:28Utkarsh AyachitPriorityurgent => immediate
2010-03-17 10:30Utkarsh AyachitNote Added: 0019935
2010-03-17 10:30Utkarsh AyachitPriorityimmediate => normal
2010-03-17 10:30Utkarsh AyachitTarget Version3.8 => 4.0
2012-10-24 17:20Alan ScottNote Added: 0029506
2012-10-24 17:20Alan ScottStatusexpired => backlog
2012-10-24 17:20Alan ScottResolutionopen => reopened
2014-07-04 21:48Utkarsh AyachitAssigned ToPat Marion => Utkarsh Ayachit
2014-07-04 21:48Utkarsh AyachitTag Attached: PythonTrace
2014-07-09 21:34Utkarsh AyachitNote Added: 0032999
2014-07-18 21:00Utkarsh AyachitTopic Name => refactor_python_tracing_2
2014-07-18 21:00Utkarsh AyachitStatusbacklog => gatekeeper review
2014-07-18 21:00Utkarsh AyachitFixed in Version => git-next
2014-07-18 21:00Utkarsh AyachitResolutionreopened => fixed
2014-07-22 08:32Utkarsh AyachitFixed in Versiongit-next => git-master
2014-07-22 08:32Utkarsh AyachitStatusgatekeeper review => customer review
2014-07-22 08:32Utkarsh AyachitNote Added: 0033059
2014-07-28 20:05Alan ScottNote Added: 0033117
2014-07-28 20:05Alan ScottStatuscustomer review => closed
2014-08-29 10:59Utkarsh AyachitFixed in Versiongit-master => 4.2

Notes
(0017278)
Pat Marion   
2009-09-01 11:30   
Saving a screenshot from the gui takes advantage of the Qt based view manager class. The gui lets you capture all the views together. The current pvpython api only allows you to save a single render view. The gui lets you specify a size [x, y], but from python you must resize the render window to get the desired aspect ratio and then you can pass a magnification argument to save screenshot.

I could set it up so that trace only captures the save screenshot event if the user has chosen "Save only selected view" in the gui (and the selected view is a 3D render view).

What do you think, Alan?

(0017288)
Alan Scott   
2009-09-01 16:34   
I think that it would be OK short term, and possibly long term, to only "save only selected view". Then, the user can change the selected view, and do another "save only selected view". Thus, a user could write out each and every view serially.

I think that limiting output to only 3D render is unacceptably restrictive. Users are using XY Plot View more and more, as well as 2D View.
(0017291)
Berk Geveci   
2009-09-01 20:58   
I think that this should wait until 3.8 when we have proper multi-view/chart-view management in the server manager. Any solution we come up with now is going to be a hack and will be thrown away in 3.8. There is enough documentation here and there that explain how you can capture a 3D window from Python. For capturing the chart windows, the users will have to wait until 3.8.
(0019935)
Utkarsh Ayachit   
2010-03-17 10:30   
Pat has committed a basic version to capture screenshots in trace. Deferring the extended screenshot tracing to 4.0.
(0029506)
Alan Scott   
2012-10-24 17:20   
Making sure this does not expire.
(0032999)
Utkarsh Ayachit   
2014-07-09 21:34   
Developer note:

Current version generates the following trace:

===========================================================================
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'Cone'
cone0 = Cone()

# get active view
renderView0 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView0.ViewSize = [1387, 796]

# show data in view
cone0Display = Show(cone0, renderView0)
# trace defaults for the display properties.
cone0Display.ColorArrayName = [None, '']

# reset view to fit data
renderView0.ResetCamera()

# current camera placement for renderView0
renderView0.CameraPosition = [0.0, 0.0, 3.2036135254332487]
renderView0.CameraParallelScale = 0.8291561935301535

# save screenshot
SaveScreenshot('/tmp/sample.png', magnification=1, quality=100, view=renderView0)


WriteAnimation('/tmp/movie.png', Magnification=1, FrameRate=15.0, Compression=True)
(0033059)
Utkarsh Ayachit   
2014-07-22 08:32   
---------------------------------------------
Topics merged into master:
        0014874_fix_scalar_opacity_unit_distance
        14834_fix_representation_update
        dashboard-warnings-20140721
        refactor_python_tracing_2
(0033117)
Alan Scott   
2014-07-28 20:05   
Tested master, Linux, remote server.