# Inconsistent Block Coloring Behavior in Multiblock Inspector for PartitionedDataSetCollection

**URL:** https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984
**Category:** ParaView Support
**Created:** [January 15, 2025, 9:24am UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984 "2025-01-15T09:24:04Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![cRobert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/87869e/32.png) [@cRobert](https://discourse.paraview.org/u/cRobert)
#### Post date: [January 15, 2025, 9:24am UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/1 "2025-01-15T09:24:04Z")

</div>

**Description:**  
I am working with a `PartitionedDataSetCollection` that has an assembly with a large number of nodes. I select specific nodes from the tree to load only certain blocks in the hierarchy.  
When I change the Block Coloring for the assembly in the Multiblock Inspector, I encounter several inconsistent behaviors:

1. **Loss of Block Coloring when switching between assembly and hierarchy:**

If I switch from the assembly view to the hierarchy view, the block coloring disappears, even when switching back to the assembly.

- Since the assembly is aware of its block hierarchy, the block coloring should be transferred, right?
- The most frustrating part is that the block colors do not reappear when returning to the assembly view.

1. **Block Coloring reset after applying a different selection:**

If I apply a different selection to add or remove block hierarchies, the previously set block colors are no longer available.  
This means I have to recreate the block colors each time, even though the assembly tree structure remains unchanged.I am unsure if this is intended behavior, but it is causing significant issues in my workflow.

**Steps to Reproduce:**

Case1:  
Create a PartitionedDataSetCollectionSource.Select Number Of Shapes = 9 for example.  
Change the Block Coloring for the assembly in the Multiblock Inspector.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/33fe35854114f15b9e2cb06e1d98c64813a07b67.png)

Switch between the assembly and hierarchy views.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/7/736a28079c9cade0e62f868fbd759ac567969ec9.png)

Return on assembly.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/c/cdf2a7e5816eb8de8c93a7c27b7f3b34ed9fdc93.png)

Case2:  
Create a PartitionedDataSetCollectionSource.Select Number Of Shapes = 9 for example.  
Change the Block Coloring for the assembly in the Multiblock Inspector.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/33fe35854114f15b9e2cb06e1d98c64813a07b67.png)  
Apply a different “Number Of Shapes” and observe the block coloring behavior.  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/a/af7be6bc761eda9efecb0520dbe095cdfeebe546.png)

---

<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: [January 15, 2025, 10:37am UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/2 "2025-01-15T10:37:08Z")

</div>

I confirm the issues, could you open them here: [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues) ?

---

<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: [January 15, 2025, 10:37am UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/3 "2025-01-15T10:37:35Z")

</div>

FYI @spyridon97

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 15, 2025, 3:10pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/4 "2025-01-15T15:10:12Z")

</div>

That is not a bug, but an expected behavior based on the current implementation

You describe two cases that both have the same root problem.

Some Glossary:  
There are two assembly options:

1. Hierarchy (its label is Hierarchy): It’s created based on the structure of your dataset.
2. Data Assembly (its label is Assembly): User provided that can be arbitrary

![image](https://discourse.paraview.org/uploads/default/original/2X/b/b136c48fdc9609a37770fa4182ae81e0d36bef30.png)

![image](https://discourse.paraview.org/uploads/default/original/2X/3/3c5ac007635c8f3329d7bacdf67898bc27c9e810.png)

Case 1:

In the same dataset, you change which kind of assembly you use between the Data Assembly and the Hierarchy. There is no mapping to transfer from the Data Assembly to Hierarchy, because there are hard cases to deal with:

1. The Data Assembly can omit certain blocks.
2. The hierarchy has paths on partitioned datasets, but the user provided Data Assembly can organizes these partitioned datasets in many different ways (see picture above)

Since there is no direct mapping between the Hierarchy and the Assembly to be able to transfer your block properties from one assembly to another, we reset the properties each time you switch. Also, we only have a BlockColor property, not AssemblyBlockColor and HierarchyBlockColor, therefore when you switch back you can’t have access to what you assigned before.

Case 2: You change your dataset, including your DataAssembly and Hierrachy. Since this happens your block properties have to reset since they no longer apply to the same assembly (either choice).

Suggestions: Stick to one of the two organizations. During the exposure of the Data Assembly we had thought of hiding the Hierarchy if there is a Data Assembly, but we kept it in case someone prefers one or the other, but using both interchanably is not possible based ont he current implementation and it would add a lot of code complexity to support what you suggest which we deemed unnecessary.

I hope this helps.

cc: @cory.quammen

---

<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: [January 15, 2025, 3:37pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/5 "2025-01-15T15:37:53Z")

</div>

I agree for Case2, Case1 behavior is very surprising for users. Changing a tab of a docker widget should not impact anything.

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 15, 2025, 4:36pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/6 "2025-01-15T16:36:04Z")

</div>

If you refer to the properties panel of a filter, yes i agree, but if you refer to any representation setting that has auto-apply, then in my mind. and considering the current implementation, it makes sense.

---

<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: [January 15, 2025, 4:45pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/7 "2025-01-15T16:45:34Z")

</div>

From a UI/UX POV, selecting a tab of a dock widget is not a “property change” and should not have an impact to what is being rendered.

But maybe the selection of assembly/hierarchy is more than selecting a tab, but that was how I understand it.

---

<div class="post-metadata">

### Author: ![cRobert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/87869e/32.png) [@cRobert](https://discourse.paraview.org/u/cRobert)
#### Post date: [January 15, 2025, 4:55pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/8 "2025-01-15T16:55:27Z")

</div>

Thank you for your detailed response and for taking the time to investigate this issue.

**Regarding case 1:**

You’ve correctly identified a potential ambiguity when multiple blocks in a hierarchy have different colorings and belong to the same assembly node. I agree that introducing separate `AssemblyBlockColor` and `HierarchyBlockColor` attributes could provide a more flexible and intuitive way to handle these cases.

I would be delighted if you ever decide to improve the block coloring feature.

**Regarding case 2:**

I understand that in my current workflow, I am primarily working with block colors at the assembly level and have not encountered scenarios where the assembly structure changes significantly between apply.

**new question**  
While developing a ParaView plugin, I’m encountering an issue with applying colors to blocks. The colors are applied on the first call (in RequestData) no reset ?  
but on subsequent apply calls, the colors are reset after.  
Is there a way to intervene after this reset and reapply the colors at that moment?

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 15, 2025, 4:55pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/9 "2025-01-15T16:55:34Z")

</div>

I can maybe add a note when you hover over it?

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 15, 2025, 4:58pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/10 "2025-01-15T16:58:18Z")

</div>

From a development cost point of view, i don’t foresee the addition of Assembly and Hierarchy specific properties. But we would be open to implementing it assuming there is a funding option, or you want to contribute these changes yourself.

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 15, 2025, 4:59pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/11 "2025-01-15T16:59:36Z")

</div>

As far as your question, you would need to be more specific to which RequestData do you refer to and what you are trying to do,

---

<div class="post-metadata">

### Author: ![cRobert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/87869e/32.png) [@cRobert](https://discourse.paraview.org/u/cRobert)
#### Post date: [January 17, 2025, 11:36am UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/12 "2025-01-17T11:36:19Z")

</div>

My question regarding RequestData might not be related to my previous post. I’ll open a new ticket if necessary.

But based on the responses, I’m still confused. Let me explain with an example.

Create a PartitionedDataSetCollectionSource.Select Number Of Shapes = 12 for example and switch to hierarchy views.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/3dfe9f2c2963b6cb8cd544897db8bfbacf60c9c1.png)

In Python Shell

> partitionedDataSetCollectionSource1 = GetActiveSource()  
> SetActiveSource(partitionedDataSetCollectionSource1)  
> renderView1 = GetActiveViewOrCreate(‘RenderView’)  
> partitionedDataSetCollectionSource1Display = GetDisplayProperties(partitionedDataSetCollectionSource1, view=renderView1)

Next always in Python Shell

> partitionedDataSetCollectionSource1Display.BlockColors = [‘/vtkPartitionedDataSetCollection/Boy’, ‘0.000000’, ‘0.764706’, ‘1.000000’]

 ![image](https://discourse.paraview.org/uploads/default/original/2X/a/a6652c2c5e77421513076f1a75cd526a53ee33c1.png)  
=\> No change on hierarchy or assembly views.

now let’s return to the hierarchy view an in Python Shell:

> partitionedDataSetCollectionSource1Display.BlockColors = [‘/Assembly/NonOrientableSurfaces’, ‘0.000000’, ‘0.764706’, ‘1.000000’]
> 
> ![image](https://discourse.paraview.org/uploads/default/original/2X/e/eba5d82176af7ae46d91ed7fda1ed6e0b2b89cb7.png)  
> =\> No change on hierarchy view

Switch to assembly view:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/d3e14fb961dd6466256d14452dcfcc3e762d50b8.png)

=\> The coloring option is visible.

Could it be that I’m not using Python correctly to alter the block colors in the hierarchy?

---

<div class="post-metadata">

### Author: ![cRobert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/87869e/32.png) [@cRobert](https://discourse.paraview.org/u/cRobert)
#### Post date: [January 17, 2025, 1:01pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/13 "2025-01-17T13:01:46Z")

</div>

I’ve figured out why my command didn’t update the hierarchy view.

with block color value: ‘/Root/Boy’, ‘0.066667’, ‘0.000000’, ‘1.000000’ it’s ok

The first element in the XML actually determines the view name:  
For the hierarchy view:

\< **Root** type=“vtkDataAssembly” version=“1.0” id=“0” vtk\_type=“38” vtk\_category=“hierarchy” label=“vtkPartitionedDataSetCollection”\>

=\> / **Root** /

For the assembly view:

\< **Assembly** type=“vtkDataAssembly” version=“1.0” id=“0”\>

=\> / **Assembly** /

Is this correct?  
If so, considering that we know the difference between hierarchy and assembly, why does ParaView need to perform a reset when switching from hierarchy to assembly or from assembly to hierarchy?

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 17, 2025, 3:42pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/14 "2025-01-17T15:42:46Z")

</div>

That is correct, the name of the root node is /Root/ not but its label is vtkPartitionedDataSetCollection. In the paths you should always use the names.

What do you mean we know the difference between hierarchy and assembly?  
It needs to perform a reset because we don’t have assembly specific and hierarchy specific properties. We only have block properties that apply to both.

---

<div class="post-metadata">

### Author: ![cRobert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/87869e/32.png) [@cRobert](https://discourse.paraview.org/u/cRobert)
#### Post date: [January 17, 2025, 4:02pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/15 "2025-01-17T16:02:53Z")

</div>

The XML name of the parent node for both the hierarchy and the assembly should be different, allowing for distinct paths between the hierarchy and assembly.

This would enable ParaView to have separate block colors for the hierarchy and the assembly within the same ‘blockColor’ property.

Consequently, there would be no need for a reset between the two, as the property would unambiguously hold the colors for both.

ParaView could ignore the links between the assembly and the hierarchy as they are too complex to implement.

For example:  
partitionedDataSetCollectionSource1Display.BlockColors = [‘/Assembly/NonOrientableSurfaces’, ‘0.000000’, ‘0.764706’, ‘1.000000’,‘/Root/Boy’,‘0.000000’, ‘0.1’, ‘1.000000’]

=\> Assembly view = 1 color on node “NonOrientableSurfaces” and Hierarchy view = 1 color on node “Boy”

---

<div class="post-metadata">

### Author: ![spyridon97](https://discourse.paraview.org/user_avatar/discourse.paraview.org/spyridon97/32/11569_2.png) [@spyridon97](https://discourse.paraview.org/u/spyridon97)
#### Post date: [January 17, 2025, 4:46pm UTC](https://discourse.paraview.org/t/inconsistent-block-coloring-behavior-in-multiblock-inspector-for-partitioneddatasetcollection/15984/16 "2025-01-17T16:46:04Z")

</div>

Nobody can guarantee that they will be different, nor can we mandate it.

Also, each property needs to be a valid property with respect to the select assembly (Data Assembly or Hierarchy)

Therefore,

1. ‘/Root/Boy’,‘0.000000’, ‘0.1’, ‘1.000000’ is not valid for Assembly view
2. ‘/Assembly/NonOrientableSurfaces’, ‘0.000000’, ‘0.764706’, ‘1.000000’, is not valid for hierarchy view
