Jona,<br><br>Ah, there was an issue running in client-server mode. I've just committed a fix.<br><br>/cvsroot/ParaView3/ParaView3/Servers/ServerManager/vtkSMProxy.cxx,v <-- Servers/ServerManager/vtkSMProxy.cxx<br>
new revision: 1.114; previous revision: 1.113<br>/cvsroot/ParaView3/ParaView3/Servers/ServerManager/Resources/utilities.xml,v <-- Servers/ServerManager/Resources/utilities.xml<br>new revision: 1.174; previous revision: 1.173<br>
<br>Please update and try again.<br><br>Thanks<br>Utkarsh<br><br><br><div class="gmail_quote">On Wed, May 27, 2009 at 5:18 AM, BOUSSOIR Jonathan 167706 <span dir="ltr"><<a href="mailto:Jonathan.BOUSSOIR@cea.fr">Jonathan.BOUSSOIR@cea.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Utkarsh,<br>
Thank you for your script but I have been a error when I excute this line : dp.ScalarOpacityFunction = opacity_func<br>
Thanks in advance for your kind help.<br>
Regards,<br>
Jona<br>
<br>
dp.ScalarOpacityFunction = opacity_func<br>
ERROR: In /home/myrrha/Desktop/paraview/paraview3.7/ParaView3/Servers/Common/vtkProcessModule.cxx, line 1045<br>
vtkProcessModule (0xef5150): Object type: vtkVolumeProperty, could not find requested method: "SetScalarOpacity"<br>
or the method was called with incorrect arguments.<br>
<br>
while processing<br>
Message 0 = Invoke<br>
Argument 0 = id_value {78}<br>
Argument 1 = string_value {SetScalarOpacity}<br>
Argument 2 = id_value {662}<br>
<br>
<br>
ERROR: In /home/myrrha/Desktop/paraview/paraview3.6/ParaView3/Servers/Common/vtkProcessModule.cxx, line 1046<br>
vtkProcessModule (0xef5150): Aborting execution for debugging purposes.<br>
<br>
Abandon<br>
<br>
<br>
My script<br>
<br>
from paraview.simple import *<br>
Connect('localhost')<br>
<br>
reader = servermanager.sources.LegacyVTKReader(FileNames='wavelet.vtk')<br>
<br>
Show(reader)<br>
<br>
dp = GetDisplayProperties(reader)<br>
<br>
# Create LUT<br>
dp.LookupTable = MakeBlueToRedLT(37.35, 276)<br>
<br>
# Set array to color by<br>
dp.ColorAttributeType = 'POINT_DATA'<br>
dp.ColorArrayName = 'RTData'<br>
<br>
#dp.Representation = 'Volume'<br>
#Render()<br>
<br>
# Register PiecewiseFunction if not already available.<br>
if not "PiecewiseFunction" in dir(servermanager.rendering):<br>
servermanager.createModule("piecewise_functions", servermanager.rendering)<br>
<br>
# Setup opacity function<br>
opacity_func = servermanager.rendering.PiecewiseFunction()<br>
opacity_func.Points = [37.35, 0, 276.82, 0.5]<br>
dp.ScalarOpacityFunction = opacity_func<br>
<br>
dp.Representation = 'Volume'<br>
Render()<br>
<br>
<br>
<br>
<br>
<br>
<br>
-------- Message d'origine--------<br>
De: Utkarsh Ayachit [mailto:<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>
Date: lun. 25/05/2009 16:09<br>
À: BOUSSOIR Jonathan 167706<br>
Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
Objet : Re: [Paraview] [paraview] using with python to read file VTK in 3.7 and to show a volume representation<br>
<br>
Jona,<br>
<br>
Look at the attached script.<br>
For volume rendering you need to specify the scalar to use for volume<br>
rendering as well as the color lookup table as well as the scalar opacity<br>
function. The attached script illustrates how to do the same.<br>
<br>
Utkarsh<br>
<br>
On Mon, May 25, 2009 at 8:08 AM, BOUSSOIR Jonathan 167706 <<br>
<a href="mailto:Jonathan.BOUSSOIR@cea.fr">Jonathan.BOUSSOIR@cea.fr</a>> wrote:<br>
<br>
><br>
> Hi all,<br>
><br>
> I am new to paraview, I am using Linux. I read a lot of paraview emails<br>
> this morning. I see you have been work hard last days on python script.<br>
> I download last version and compile.<br>
> Now I can read a file VTK surface sphere. But, I have still one error when<br>
> I want to show my volume VTK file. I read a file then I tried to change the<br>
> representation and I execute Render(), I have a problem : Cell Scalars not<br>
> supported.<br>
><br>
> I link my VTK file in my email.<br>
> Thanks in advance for your kind help.<br>
><br>
> Regards,<br>
> Jona<br>
><br>
><br>
> #!/usr/bin/python<br>
> # -*- coding: latin-1 -*-<br>
><br>
> from paraview.simple import *<br>
> connection = servermanager.Connect('localhost')<br>
><br>
> # Create the reader and set the filename.<br>
> reader = servermanager.sources.LegacyVTKReader(FileNames='wavelet.vtk')<br>
><br>
> Show(reader)<br>
> Render()<br>
><br>
> dp = GetDisplayProperties(reader)<br>
> dp.Representation<br>
> #>>> : 'Slice'<br>
><br>
> dp.GetProperty("Representation").Available<br>
> #>>> : ['Outline', 'Points', 'Wireframe', 'Surface', 'Surface With Edges',<br>
> 'Volume', 'Slice']<br>
><br>
> dp.Representation = 'Volume'<br>
><br>
> Show(reader)<br>
> Render()<br>
><br>
> ERROR: In<br>
> /home/myrrha/Desktop/paraview/paraview3.7/ParaView3/VTK/VolumeRendering/vtkFixedPointVolumeRayCastMapper.cxx,<br>
> line 1467<br>
> vtkFixedPointVolumeRayCastMapper (0x2d7d650): Cell Scalars not supported<br>
><br>
> Erreur de segmentation<br>
><br>
> "When I excute this last line "Render()", I have a error, I don't<br>
> understand"<br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><br>
<br>
</blockquote></div><br>