python code from the pipeline

i am trying to get the segmented output of the mesh after generating contour tree of elevation.

I tried to get it from the python file generated from the paraview but it seems to have hardcoded value and in mose of the code has hardcoded value used for the specitifc input in the pipeline, it doesnot seems useful for generic case.

is there anyway i can generate that kind of code because it doesnot seems like i can change the code generated by paraview to fit the generic case because it’s so big and i dont understand what those parameter mean where a hard-coded value is passed !

or, anyone could please suggest a way to make it more generic?

my pipeline:

and i want to output this scene as gltf:

This is the code that i got from the exporting python or trace.

Can anyone please help me !!

Hi @Pravin_Poudel ,

This question does not seems very different than your previous get paraview pipeline into python. It is not necessary to open new post so quickly after the first :wink:

I added some information there.

i followed and tried the things stated in that article and still i am not able to do that.

is there anything that i am doing wrong or anything extra that i should do that you suggest.

Why don’t you use pvpython to run your python code that use the ParaView library?