[Paraview] paraview3.3.0: Glyph filter ignores ScaleFactor in ascript?
Sylvester Gerardson
sylvester.gerardson at gmail.com
Wed Jun 18 10:59:16 EDT 2008
Concerning scalar bars:
http://www.paraview.org/pipermail/paraview/2008-January/006766.html
The opacity is a property of the representation, I expect. (repGlyph01 is
the example below)
Not only is the public documentation sparse on this subject, but the new
ParaView Guide as well. I am really disappointed in it, as contains hardly
any more information (if any at all) on python scripting than in the
Servermanager2.pdf file available in the Wiki.
Sylvester
-----Original Message-----
From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
On Behalf Of Robert Cimrman
Sent: 18 June 2008 15:27
To: paraview at paraview.org
Subject: Re: [Paraview] paraview3.3.0: Glyph filter ignores ScaleFactor in
ascript?
Whoops, now I can see what was wrong... I should stop today.
arrows.ScaleFactor = 0.001
instead of
arrows.SetScaleFactor = 0.001
It works now, thanks Sylvester!
BTW. how do I color the glyphs according to their magnitude?
If you happen to have a complete example code with colorbars, opacity
setting, etc. that you could share I would be very happy. :) The public
documentation is a little bit terse (I do not have the manual).
Is it possible to force paraview to report something/raise an error if
one sets an attribute that is not a valid property name? The mistake
that I made is very difficult to detect for a paraview newbie...
cheers,
r.
Sylvester Gerardson wrote:
> Hi Robert,
>
> To create a glyph filter using python scripting I always use something
like:
>
> sourceArrow = servermanager.sources.ArrowSource()
> sourceCone = servermanager.sources.ConeSource()
> sourceCube = servermanager.sources.CubeSource()
> sourceCylinder = servermanager.sources.CylinderSource()
> sourceLine = servermanager.sources.LineSource()
> sourceSphere = servermanager.sources.SphereSource()
> sourceGlyph2D = servermanager.sources.GlyphSource2D()
> sourcePoint = servermanager.sources.PointSource()
>
> Glyph01 =
>
servermanager.filters.Glyph(registrationGroup='sources',registrationName='Gl
> yph01',Input=SurfVec01)
> propertyGlyph01 = Glyph01.GetProperty('Source')
>
> domainGlyph01 = propertyGlyph01.GetDomain('proxy_list');
> domainGlyph01.AddProxy(sourceArrow.SMProxy)
> domainGlyph01.AddProxy(sourceCone.SMProxy)
> domainGlyph01.AddProxy(sourceCube.SMProxy)
> domainGlyph01.AddProxy(sourceCylinder.SMProxy)
> domainGlyph01.AddProxy(sourceLine.SMProxy)
> domainGlyph01.AddProxy(sourceSphere.SMProxy)
> domainGlyph01.AddProxy(sourceGlyph2D.SMProxy)
>
> Glyph01.Source = sourceArrow
> Glyph01.SetScaleFactor = 0.02
> Glyph01.RandomMode = 0
> Glyph01.UseMaskPoints = 0
> Glyph01.SetScaleMode = 3
> repGlyph01 =
>
servermanager.CreateRepresentation(Glyph01,view,registrationGroup='represent
> ations')
>
> This works fine for me.
>
> Regards,
> Sylvester
>
> -----Original Message-----
> From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
> On Behalf Of Robert Cimrman
> Sent: 18 June 2008 14:23
> To: paraview at paraview.org
> Subject: [Paraview] paraview3.3.0: Glyph filter ignores ScaleFactor in
> ascript?
>
> Hi all,
>
> I try to visualize a point vector field 'u' using arrow glyphs, but no
> matter how I set 'ScaleFactor' property the arrows stay the same (too
> big). The relevant part of the code is below - what I am doing wrong? I
> have even created the scene in the GUI, saved it into .pvsm file, loaded
> into another script, examined the Glyph proxy and set the Glyph
> properties in my script accordingly. No change :(
>
> ...
> reader = servermanager.sources.LegacyVTKFileReader( FileNames =
> [inFileName] )
>
> view = servermanager.CreateRenderView()
>
> arrows = servermanager.filters.Glyph( Input = reader )
> arrows.SelectInputScalars = [ '', '', '', '', 'p' ]
> arrows.SelectInputVectors = [ '1', '', '', '', 'u' ]
> arrows.ScaleMode = 1
> arrows.Orient = 1
> arrows.ScaleFactor = 0.001
> arrows.Source = servermanager.sources.ArrowSource()
>
> arep = servermanager.CreateRepresentation( arrows, view )
>
> view.StillRender()
> view.ResetCamera()
> camera = view.GetActiveCamera()
> camera.Elevation( 45 )
> view.StillRender()
> ...
>
> r.
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
>
_______________________________________________
ParaView mailing list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
More information about the ParaView
mailing list