# ParaView Synchronize attribute values to the GUI

**URL:** https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520
**Category:** ParaView Support
**Created:** [September 6, 2019, 6:32am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520 "2019-09-06T06:32:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [September 6, 2019, 6:32am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/1 "2019-09-06T06:32:32Z")

</div>

Hello, I set the model transparency with the following code:

```
pqPipelineSource* source = reinterpret_cast<pqPipelineSource*>(it->second);
pqDataRepresentation* representation = source->getRepresentation(pqActiveObjects::instance().activeView());
if (nullptr == representation)
{
	return;
}
vtkPVCompositeRepresentation* composite_representation = dynamic_cast<vtkPVCompositeRepresentation*>(representation->getProxy()->GetClientSideObject());
if (nullptr == composite_representation)
{
	return;
}
vtkGeometryRepresentation* active_representation = dynamic_cast<vtkGeometryRepresentation*>(composite_representation->GetActiveRepresentation());
if (nullptr != active_representation)
{
	active_representation->SetOpacity(0.3);
}

```

**Problem** : The model transparency has changed. How do I automatically synchronize the value of the slider on the GUI?

Best regards.

---

<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: [September 6, 2019, 6:35am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/2 "2019-09-06T06:35:31Z")

</div>

**Do not use GetClientSideObject.**

Set the Opacity property on the representation proxy.

---

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [September 6, 2019, 9:29am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/3 "2019-09-06T09:29:35Z")

</div>

Is there a relevant example for this reference?  
thank you very much!

---

<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: [September 6, 2019, 9:36am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/4 "2019-09-06T09:36:10Z")

</div>

`vtkSMPropertyHelper(representation->getProxy(), "Opacity").Set(0.3);`

---

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [September 9, 2019, 10:14am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/5 "2019-09-09T10:14:40Z")

</div>

Thank you very much for your help, thank you!  
Ask another question, if I don’t use **GetClientSideObject** , is there any other way to get **vtkGeometryRepresentation** via **pqPipelineSource**? Or can I get **vtkActor** directly from **pqPipelineSource**?  
Thank you!

---

<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: [September 9, 2019, 10:17am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/6 "2019-09-09T10:17:30Z")

</div>

You are not supposed to recover the vtkObject client-side, except on very specific case.

What are you trying to achieve ?

---

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [September 9, 2019, 10:34am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/7 "2019-09-09T10:34:33Z")

</div>

For example, I added the following code to vtkPVInteractorStyle:  
vtkPropPicker\* picker = vtkPropPicker::New();  
vtkActor\* pickActor = picker-\>GetActor();  
I need to judge which pqPipelineSource is picked up based on the vtkActor.

---

<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: [September 9, 2019, 10:55am UTC](https://discourse.paraview.org/t/paraview-synchronize-attribute-values-to-the-gui/2520/8 "2019-09-09T10:55:12Z")

</div>

If you do not plan to support remote rendering in your application. You can do it this way.

If you plan to, you will need to do it like it is done in ParaView  
Take a look into `vtkSMRenderViewProxy::PickBlock`
