[Paraview] Apply Transform Filter within pybatch (ParaView Digest, Vol 52, Issue 27 Message 7)
Tobias Froebel
tfroebel at gmx.de
Thu Jan 15 06:41:21 EST 2009
Hello,
meanwhile my colleague (oliver.borm at web.de) and I found a possible solution for the attached problem. One way to instance a new transform filter is using the function NewProxy() to instance the Transform Property
#!/usr/bin/python
# -*- coding: utf-8 -*
import sys
sys.path.insert(0 ,"/usr/lib/paraview-3.4")
from paraview import servermanager
sm=servermanager
sm.Connect()
#create simple cone
cone = sm.sources.ConeSource()
#create transform filter
transF = sm.filters.TransformFilter( Input = cone)
#Instance Transform Property with NewProxy()
transF.Transform = sm.servermanger.Proxymanager().SMProxyManager().NewProxy("transforms","Transform2")
#for example, set Rotation or Position Property
transF.Transform.GetData().SetPropertyWithName("Rotation",[0.0,90.0,0.0])
transF.Transform.GetData().SetPropertyWithName("Position",[1.0,5.0,0.0])
Regards, Tobias.
------------------------------
Message: 7
Date: Thu, 14 Aug 2008 13:09:41 +0200
From: Tobias Froebel <tfroebel at gmx.de>
Subject: [Paraview] Problem: Apply Transformation Filter in pybatch
To: paraview at paraview.org, berk geveci <berk.geveci at kitware.com>
Message-ID: <48A41275.8050500 at gmx.de>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Hello everybody,
I'm really a paraview newbie so please excuse my simple questions.
I want to run paraview with python batch mode to perform off-screen
post-processing. That's why I include the servermanger python module in
the following python script:
#!/usr/bin/python
# -*- coding: utf-8 -*
import sys
sys.path.insert(0 ,"/usr/lib/paraview-3.3")
from paraview import servermanager
sm=servermanager
sm.Connect()
#create simple cone
cone = sm.sources.ConeSource()
#create transform filter
transF = sm.filters.TransformFilter( Input = cone)
#debug
print transF.Transform
print type(transF.Transform)
Actually the transform filter doesn't d o anything since the
proxyProperty transF.Transform has no value.
I tried to set a sm.vtk.vtkTransform -object to the transF.Transform
Property but unfortunately it does not work:
>>> >>> trafo = sm.vtk.vtkTransform()
>>> >>> transF.Transform = trafo
>>>
Traceback (innermost last):
File "<stdin>", line 1, in <module>
File "/usr/lib/paraview-3.3/paraview/servermanager.py", line 1503, in
setProperty
return self.SetPropertyWithName(propName, value)
File "/usr/lib/paraview-3.3/paraview/servermanager.py", line 163, in
SetPropertyWithName
prop.SetData(arg)
File "/usr/lib/paraview-3.3/paraview/servermanager.py", line 487, in
SetData
self.SMProperty.AddProxy(value_proxy)
TypeError: function takes exactly 2 arguments (1 given)
I guess the types of both objects do not match.
Maybe anybody knows how to set an appropriate transform value to the
TransformFilter's Property Transform.
Thanks a lot for your attention, Tobias
paraview-request at paraview.org schrieb:
> Send ParaView mailing list submissions to
> paraview at paraview.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.paraview.org/mailman/listinfo/paraview
> or, via email, send a message with subject or body 'help' to
> paraview-request at paraview.org
>
> You can reach the person managing the list at
> paraview-owner at paraview.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ParaView digest..."
>
>
> Today's Topics:
>
> 1. Will using RPath interfere with CPack on a Mac? (Samuel Crow)
> 2. Re: Will using RPath interfere with CPack on a Mac? (Berk Geveci)
> 3. Re: CVS not installing pvpython (Orion Poplawski)
> 4. Re: Will using RPath interfere with CPack on a Mac? (Samuel Crow)
> 5. Re: Will using RPath interfere with CPack on a Mac? (Mike Jackson)
> 6. Problem: Apply Transformation Filter in pypatch (Tobias Froebel)
> 7. Problem: Apply Transformation Filter in pybatch (Tobias Froebel)
> 8. Re: Will using RPath interfere with CPack on a Mac? (Berk Geveci)
> 9. Re: Will using RPath interfere with CPack on a Mac? (Berk Geveci)
> 10. Re: Will using RPath interfere with CPack on a Mac? (Mike Jackson)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 13 Aug 2008 13:04:20 -0700 (PDT)
> From: Samuel Crow <samuel_crow_work at rocketmail.com>
> Subject: [Paraview] Will using RPath interfere with CPack on a Mac?
> To: paraview at paraview.org
> Message-ID: <494617.32519.qm at web59515.mail.ac4.yahoo.com>
> Content-Type: text/plain; charset=us-ascii
>
> I remember seeing a note somewhere in the ParaView build files that there was a problem associated with installation of dynamic libraries that were installed using RPath. Does that mean that I can't distribute my reader plugins using CPack without having to manually execute install_name_tool -change on all of the library dependencies internally used by the reader .dylib files?
>
> What I'm trying to do is make my readers work on user systems that have a binary install of ParaView on them. I'd like to use CPack to generate a .dmg file for the readers as a package.
>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 13 Aug 2008 16:29:02 -0400
> From: "Berk Geveci" <berk.geveci at kitware.com>
> Subject: Re: [Paraview] Will using RPath interfere with CPack on a
> Mac?
> To: samuel_crow_work at rocketmail.com
> Cc: paraview at paraview.org
> Message-ID:
> <45d654b0808131329j4a61e415r20db9a9a8b166dd7 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hmmm. Tricky. Where will the users insall the plugin?
>
> On Wed, Aug 13, 2008 at 4:04 PM, Samuel Crow
> <samuel_crow_work at rocketmail.com> wrote:
>
>> I remember seeing a note somewhere in the ParaView build files that there was a problem associated with installation of dynamic libraries that were installed using RPath. Does that mean that I can't distribute my reader plugins using CPack without having to manually execute install_name_tool -change on all of the library dependencies internally used by the reader .dylib files?
>>
>> What I'm trying to do is make my readers work on user systems that have a binary install of ParaView on them. I'd like to use CPack to generate a .dmg file for the readers as a package.
>>
>>
>>
>>
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 13 Aug 2008 15:24:26 -0600
> From: Orion Poplawski <orion at cora.nwra.com>
> Subject: Re: [Paraview] CVS not installing pvpython
> To: Berk Geveci <berk.geveci at kitware.com>
> Cc: "paraview at paraview.org" <paraview at paraview.org>
> Message-ID: <48A3510A.1050604 at cora.nwra.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Ah, yes. I think this is the third time I've asked this. I'll try to
> remember in the future. Problem is, I'm going to need rpath on in the
> build. Indeed:
>
> $ paraview
> /usr/lib64/paraview/paraview-real: symbol lookup error:
> /usr/lib64/paraview/libpqCore.so: undefined symbol:
> _ZN11QFormLayout16staticMetaObjectE
> [orion at test ~]$ ldd /usr/lib64/paraview/paraview-real
> linux-vdso.so.1 => (0x00007fffa79fe000)
> libpqComponents.so => not found
> libQtPython.so => not found
> libpqCore.so => not found
> ....
>
> and so on.
>
> I need to install libs in /usr/lib64/paraview and
> /usr/lib64/paraview-mpi to keep the mpi and non-mpi versions separate.
>
>
> Berk Geveci wrote:
>
>> Hmm. That's weird. I am not seeing this. Are you building with
>> VTK_USE_RPATH off? For some reason I haven't tracked down, some
>> installation targets do not work unless VTK_USE_RPATH is off. This is
>> not an issue for release versions (even versions) because we force it
>> to be off but it is an issue for development versions (odd versions)
>> because the default it RPATH on. This is on my list of things to track
>> down.
>>
>> -berk
>>
>> On Fri, Jul 18, 2008 at 6:53 PM, Orion Poplawski <orion at cora.nwra.com> wrote:
>>
>>> My current CVS builds are not installing pvpython and
>>> vtkSMExtractDocumentation though they are getting built. Any ideas?
>>>
>>> --
>>> Orion Poplawski
>>> Technical Manager 303-415-9701 x222
>>> NWRA/CoRA Division FAX: 303-415-9702
>>> 3380 Mitchell Lane orion at cora.nwra.com
>>> Boulder, CO 80301 http://www.cora.nwra.com
>>> _______________________________________________
>>> ParaView mailing list
>>> ParaView at paraview.org
>>> http://www.paraview.org/mailman/listinfo/paraview
>>>
>>>
>
>
>
--
Tobias Fro"bel
tfroebel at gmx.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090115/703c6a56/attachment-0001.htm>
More information about the ParaView
mailing list