# Get List of color transfer functions

**URL:** https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194
**Category:** ParaView Support
**Created:** [December 17, 2019, 10:34am UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194 "2019-12-17T10:34:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [December 17, 2019, 10:34am UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/1 "2019-12-17T10:34:50Z")

</div>

I need to obtain a list of active color transfer functions, but I can’t figure out how to.

Here is a minimum code that visualizes a variable named ‘Swirl’:

```
# trace generated using paraview version 5.7.0-RC2
from paraview.simple import *

renderView1 = GetActiveViewOrCreate('RenderView')
renderView1.Update()

fastUniformGrid1 = FastUniformGrid()
fastUniformGrid1Display = Show(fastUniformGrid1, renderView1)
ColorBy(fastUniformGrid1Display, ('POINTS', 'Swirl', 'Magnitude'))
fastUniformGrid1Display.RescaleTransferFunctionToDataRange(True, False)
fastUniformGrid1Display.SetScalarBarVisibility(renderView1, True)
swirlLUT = GetColorTransferFunction('Swirl')
swirlPWF = GetOpacityTransferFunction('Swirl')
fastUniformGrid1Display.SetRepresentationType('Surface')

```

What I need is a function like `GetColorTransferFunctions`:

```
ListOfLUTs = GetColorTransferFunctions() # = [GetColorTransferFunction('Swirl')] in the above example

```

Or, alternatively, a function that provides the names of variables for which there is a LUT:

```
ListOfVariableNames = GetVariableNames( withLUT=True ) # = ['Swirl'] in the above example
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 17, 2019, 11:01am UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/2 "2019-12-17T11:01:35Z")

</div>

This is not exposed. You can implement it using vtkSMSessionProxyManager::GetProxies

---

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [December 17, 2019, 12:17pm UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/3 "2019-12-17T12:17:30Z")

</div>

I’m not familiar with the `vtkSMSessionProxyManager` thing. Is it available in a python script that I would run in the shell or via `pvbatch`/`pvpython`?

---

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [December 17, 2019, 1:00pm UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/4 "2019-12-17T13:00:00Z")

</div>

@mwestphal, there is

```auto
servermanager.ProxyManager().GetProxies(groupname=?, proxyname=?)

```

but what are the arguments needed to obtain the names of the LUTs?

mmmh, `proxyname='LookupTable'` ? […](https://kitware.github.io/paraview-docs/latest/cxx/classvtkSMSessionProxyManager.html#a6006f8be4f2cf5ce588e47146ee24f02)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 17, 2019, 1:56pm UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/5 "2019-12-17T13:56:34Z")

</div>

`servermanager.ProxyManager().GetProxies("lookup_tables", "PVLookupTable")` should do the trick.

---

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [December 19, 2019, 8:12am UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/6 "2019-12-19T08:12:07Z")

</div>

it returns an empty list

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 19, 2019, 9:22am UTC](https://discourse.paraview.org/t/get-list-of-color-transfer-functions/3194/7 "2019-12-19T09:22:46Z")

</div>

My bad, there is no direct way to do that. You can do it this way :

```
proxyList = []
nProxies = servermanager.ProxyManager().GetNumberOfProxies('lookup_tables')
for i in range(nProxies):
  proxyName = servermanager.ProxyManager().GetProxyName('lookup_tables', i)
  proxyList.add(servermanager.ProxyManager().GetProxy('lookup_tables', proxyName))
```
