Hi Ross, Specifying representation.ScalarOpacityFunction via the same piecewise function may be also needed: representation.ScalarOpacityFunction = CreatePiecewiseFunction(Points=[0.0, 0.0, 0.5, 0.0, 1.0, 1.0, 0.5, 0.0])
Thanks, yoshimi 2017-07-21 19:14 GMT+09:00 Ross Gardiner <ross.gardi...@ultrahaptics.com>: > Hi, > > I’m currently working on a tool that generates Python scripts which, in turn, > save a ParaView state. The state can then be loaded in ParaView. > > I am experiencing some issues with setting up the LUT for volume rendering of > some data. (I’ve already reported one issue that I’m pretty sure is a bug at > https://gitlab.kitware.com/paraview/paraview/issues/17616 ) > > I am able to set the color transfer function and opacity transfer function, > and both appear in the UI. However, while the color transfer function works, > the opacity transfer function seems to have no effect on rendering > whatsoever. After loading the state in ParaView, I can set the entire opacity > transfer function to zero and the renderered volume remains completely opaque. > > Here’s an example of the Python code I am using: > > soundfield = OpenDataFile('my_data.vti') > representation = Show(soundfield) > representation.ColorArrayName = 'ImageScalars' > representation.Representation = 'Volume' > representation.LookupTable = > AssignLookupTable(soundfield.PointData['ImageScalars'], 'Cool to Warm') > representation.LookupTable.ScalarOpacityFunction = > CreatePiecewiseFunction(Points=[0.0, 0.0, 0.5, 0.0, 1.0, 1.0, 0.5, 0.0]) > SaveState('state.pvsm') > > Is there anything special I have to do? I’ve looked over the > documentation/mailing lists/ListProperties() and I can’t see anything obvious. > > Thanks, > Ross > > _______________________________________________ > 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 _______________________________________________ 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