[Paraview] Setting the representation to Volume doesn't work in Python script.

Junyi Han demonmerlin at gmail.com
Mon Nov 25 17:52:27 EST 2013


Thanks! It helps a lot!


2013/11/25 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>

> You're missing the setting up of ScalarOpacityFunction. I'd suggest
> using the Tools | Start Trace/Stop Trace to generate a trace for what
> happens when one sets up a volume rendering and then use the generate
> code as  a guide.
>
> Utkarsh
>
> On Mon, Nov 25, 2013 at 3:09 PM, Junyi Han <demonmerlin at gmail.com> wrote:
> > Hi all,
> >
> > I want to set the representation to 'Volume' instead of 'Surface'. But
> the
> > result shows the representation is still the 'Surface' after I modified
> my
> > code as shown below. Thanks ahead for any help!
> >
> > Best wishes,
> > Junyi Han
> >
> >
> > CODE:
> >
> >     reader = OpenDataFile(VTKFile)
> >     reader.PointData
> >     view = GetRenderView()
> >
> >     dp = GetDisplayProperties()
> >     dp.Representation = 'Volume'
> >     lut = CreateLookupTable()
> >     lut.RGBPoints  = [0.0, 0.0, 0.0, 1.0,
> >                         3.3, 1.0, 1.0, 1.0,
> >                       6.674, 1.0, 0.0, 0.0]
> >
> >     readerRep = GetRepresentation()
> >     readerRep.ColorArrayName = 'scaler_name'
> >     readerRep.LookupTable = lut
> >
> >     Show(reader)
> >     Render()
> >
> > # Get a nice view angle
> >     if count == 0:
> >         cam = GetActiveCamera()
> >         cam.Elevation(30)
> >         cam.Azimuth(30)
> >         Render()
> >
> > _______________________________________________
> > 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
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.paraview.org/mailman/listinfo/paraview
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20131125/1530fd43/attachment.htm>


More information about the ParaView mailing list