[Paraview] applied texture is not in trace (Habbinga, Sonja)

Ryan Danks Ryan.Danks at rwdi.com
Thu Mar 8 07:53:03 EST 2012


Hi Sonja,
I struggled to get a texture applied through python for quite a while and I finally got it working with a plane source in 3.12. I never tried it with a TextureMapToSphere object but I don't see why it wouldn't work the same way. This is how I did it, I hope it's helpful. 
 
from paraview import servermanager
Plane1 = Plane()
Plane1.Origin = Org
Plane1.Point1 = PlaneX
Plane1.Point2 = PlaneY
Plane1.UpdatePipeline()
Render()
SetActiveSource(Plane1)
PlaneRep= GetDisplayProperties(Plane1)
PlaneRep.Representation = 'Surface'
texProxy = servermanager.CreateProxy("textures","ImageTexture")
texProxy .GetProperty("FileName").SetElement(0, pathToTextureImage)
texProxy .UpdateVTKObjects()
PlaneRep.Texture=texProxy 
Plane1.UpdateVTKObjects()
Render()
 
 
 
>Hi,
>
>I'm still trying to get texture on a sphere animated over time. My new approach is to start a trace and see what happens when I change the texture in the Display dialog >(with the intention to generate a python script which does this automatically for all of my timesteps). Unfortunately, the texture is not specified in the trace...
>
>try: paraview.simple
>except: from paraview.simple import *
>paraview.simple._DisableFirstRenderCameraReset()
>
>TextureMaptoSphere3 = GetActiveSource()
>DataRepresentation8 = GetDisplayProperties(TextureMaptoSphere3)
>DataRepresentation8.Texture = []
>
>Render()
>
>
>
>
>Any ideas how I can specify a texture out of a jpeg in a python script?
>
>Thanks for your help!
>Sonja
 
 
Ryan Danks, B.A.Sc., E.I.T.
Project Coordinator
Rowan, Williams Davies & Irwin Inc. (RWDI)
Consulting Engineers & Scientists
 
650 Woodlawn Road West
Guelph, Ontario, Canada N1K 1B8
T (519) 823-1311 x 2282
F (519) 823-1316
email: ryan.danks at RWDI.com
web: www.rwdi.com


     RWDI - One of Canada's 50 Best Managed Companies
     www.rwdi.com/50_best/

This communication is intended for the sole use of the party to whom it was addressed and may contain information that is privileged and/or confidential. Any other distribution, copying or disclosure is strictly prohibited. If you received this email in error, please notify us immediately by replying to this email and delete the message without retaining any hard or electronic copies of same. 

Outgoing emails are scanned for viruses, but no warranty is made to their absence in this email or attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120308/8be39512/attachment.htm>


More information about the ParaView mailing list