[Paraview] RescaleTransferFunctionToDataRange Doesn't Seem to Work in Python Script

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Apr 6 23:31:42 EDT 2017


Ryan,

Try this: before calling *RescaleTransferFunctionToDataRange*, call
*UpdatePipeline()
*or *UpdatePipeline(proxy=concentric_cylinderse)*. As you change properties
on the reader, the reader won't rexecute/update until the data is rendered
on *UpdatePipeline* is called. Unless the reader updates, you won't have
updated array ranges etc. As a result when you call
*RescaleTransferFunctionToDataRange* which uses current data ranges, it
ends up using the ranges from the most resent update -- which probably
happened in *Show()*.

Utkarsh

On Thu, Apr 6, 2017 at 7:22 PM, Jamison, Ryan Dale <rdjamis at sandia.gov>
wrote:

> Hello Everyone,
>
> I’m trying to use RescaleTransferFunctionToDataRange to scale my data
> range in a python script. When I run a trace and use the “Rescale to Data
> Range” button, the trace echoes the RescaleTransferFunctionToDataRange
> command. When I run that same command fro the Python Shell or when using
> pvpython, the command doesn’t work (i.e. the range is not changed).
>
> Now, if I use the builtin Python Shell and run the commands, nothing
> happens when the commands are run. But, if I run the commands and then move
> the model at all, the command then works. It seems to me that though the
> command was issued, it wasn’t executed until I moved the model.
>
> Question is, how do I get this same behavior when I run in batch mode
> (pvpython)? I’ve attached an example. The image (image.png) produced is in
> the correct orientation but the max and min values for the stress_xx labels
> are incorrect. The correct max is 58.07 and the min is -18.85. I’d
> appreciate any help!
>
> This is the command I’m running:
>
> /Applications/ParaView.app/Contents/bin/pvpython script.py
>
> This example was generated on OS X 10.11.6 using ParaView 5.3.0. I get the
> same behavior on Linux 5.3.0 too!
>
> Thanks, Ryan
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170406/5b01d4a4/attachment.html>


More information about the ParaView mailing list