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: [email protected]
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.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview