Assign attributes to the blocks of a vtkMultiBlockDataSet

I know that we have PointData with attributes, CellData with attributes and FieldData, but I am not aware of anything like BlockData: This would be the thing that I would actually like to use if possible!

But maybe there are other ways to attach informations to the blocks that I do not understand yet!?

I have seen and used so far the possibility to assign labels to these blocks that will appear in the “Multi Block Manager” panel with this:

block->GetMetaData(inx)->Set(vtkCompositeDataSet::NAME(), "Label");

I must admit that I have not really understood the logic of this vtkInformation system that seems to be very tricky and powerful, but maybe that would be a way to somehow attach information to blocks that can be evaluated by some other functions later on, or even “survive” being written to a vtm file (file set)?

The easiest option is probably to simply add whatever arrays you want o add to block to the FieldData of actual vtkDataSet assigned to that block.

Well yes - FieldData may be the thing that I am looking for! FieldData of the vtkMultiBlockDataSet would do because the idea is to have the same array names and types for each one of the blocks.


Right now I have for example a multiblock dataset (MBDS) containing 6 blocks that are all vtkPolyData. Plus there is now a FieldData object attached to the MBDS with a number of arrays and 6 rows, each one corresponding to one of the blocks.

So far so nice: I can save and reload this MBDS and recover the FieldData, and programmatically I can do something with the FieldData like I want.

However I do not understand the handling of these Field Data in ParaView:

  • viewing the MBDS in a render view, I can select any one of the arrays like I can do also for cell or point attribute arrays, I see a legend that corresponds to the data in the array - and that’s it! I know that the fact that I have 6 rows corresponding to the 6 blocks is just my own specification, so I do not expect to see any colored objects - but why then the legend?

  • viewing the MBDS in a spreadsheet view, I can switch to “field data” - and see nothing! Why?

I know that I can attach FieldData also to each one of the data blocks, and maybe this would be good for the one or other purpose that I do not know yet, but so far I do attach it to the MBDS object itself.

I just see that the thing is explained here:

Only the link to the example data set “tube.xii” is not any more valid: It would be nice to have that example to fully understand the explanations!

Thanks for reporting the bad, link @cobo. I have updated the link. It points to a file named for the external data SHA-1, so you’ll want to save it as tube.exo to make it easier to find on your system.

Thanks - works now!