View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009044ParaView(No Category)public2009-05-18 09:472016-08-12 09:57
ReporterBoussoir J. 
Assigned ToKitware Robot 
PrioritynormalSeverityblockReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0009044: Tutorial python script don't work on paraview 3.5
DescriptionHi,
When I laught python script with pvpython (or ipython) and paraview 3.4 my script (see below in more information) is running but with paraview 3.5 I have been a Attribut Error with :
reprShrink.ColorArrayName = "Normals"

I don't know why it don't understand a attribut "Normals" on paraview 3.5
Is it a bug?

Bests,
Jona

>>> reprShrink.ColorArrayName = "Normals"

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (960, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (911, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (500, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (644, 0))

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

/home/myrrha/<ipython console> in <module>()

/home/myrrha/Desktop/paraview/paraview3.5/paraview-bin/Utilities/VTKPythonWrapping/paraview/servermanager.pyc in __setattr__(self, name, value)
    201 self.__dict__[name] = value
    202 else:
--> 203 setter(self, value)
    204
    205 def add_attribute(self, name, value):

/home/myrrha/Desktop/paraview/paraview3.5/paraview-bin/Utilities/VTKPythonWrapping/paraview/servermanager.pyc in setProperty(self, value)
   2306 propName = pName
   2307 def setProperty(self, value):
-> 2308 return self.SetPropertyWithName(propName, value)
   2309 return setProperty
   2310

/home/myrrha/Desktop/paraview/paraview3.5/paraview-bin/Utilities/VTKPythonWrapping/paraview/servermanager.pyc in SetPropertyWithName(self, pname, arg)
    250 if prop is None:
    251 raise RuntimeError, "Property %s does not exist. Please check the property name for typos." % pname
--> 252 prop.SetData(arg)
    253
    254 def GetPropertyValue(self, name):

/home/myrrha/Desktop/paraview/paraview3.5/paraview-bin/Utilities/VTKPythonWrapping/paraview/servermanager.pyc in SetData(self, value)
    661
    662 found = False
--> 663 for a in self.Available:
    664 if a[1] == arr and (not att or att == a[0]):
    665 att = a[0]

/home/myrrha/Desktop/paraview/paraview3.5/paraview-bin/Utilities/VTKPythonWrapping/paraview/servermanager.pyc in __getattr__(self, name)
    517 def __getattr__(self, name):
    518 "Unknown attribute requests get forwarded to SMProperty."
--> 519 return getattr(self.SMProperty, name)
    520
    521 class GenericIterator(object):

AttributeError: Available


My script is :

#!/usr/bin/python
# -*- coding: latin-1 -*-

from paraview import servermanager

connection = servermanager.Connect('localhost')

sphere = servermanager.sources.SphereSource(PhiResolution=20, ThetaResolution=20, Radius=0.5, Center=[0, 0, 0])

view = servermanager.CreateRenderView()

reprShrink = servermanager.CreateRepresentation(sphere, view)

# Now set up the scalar coloring. We want to color by the 1st component of the
# "Normals" array.
# Choose the attribute type. Acceptable values are "POINT_DATA" (or 0),
# "CELL_DATA" (or 1)
reprShrink.ColorAttributeType = "POINT_DATA"

# Select the name of the array to color with.
reprShrink.ColorArrayName = "Normals"

# Now create a lookup-table to map the scalar values to colors.
lut = servermanager.rendering.PVLookupTable()
lut.RGBPoints = [0.0, 0.0, 0.0, 1.0,
                  1.0, 1.0, 0.0, 0.0]
# Since we want to color by the 1st component of the normals vector
lut.VectorComponent = 1
lut.VectorMode = "Component" ;# Another acceptable value is "Magnitude" to
                              # color by vector magnitude.
# Assign the lut to the representation
reprShrink.LookupTable = lut

view.ResetCamera()
view.StillRender()
TagsNo tags attached.
Project
Topic Name
Type
Attached Files

 Relationships

  Notes
(0037648)
Kitware Robot (administrator)
2016-08-12 09:57

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2009-05-18 09:47 Boussoir J. New Issue
2009-12-09 14:49 Berk Geveci Project @3@ => ParaView
2011-06-16 13:10 Zack Galbreath Category => (No Category)
2016-08-12 09:57 Kitware Robot Note Added: 0037648
2016-08-12 09:57 Kitware Robot Status expired => closed
2016-08-12 09:57 Kitware Robot Resolution open => moved
2016-08-12 09:57 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team