# Possible improvement for MultiBlock deep copies

**URL:** <https://discourse.vtk.org/t/possible-improvement-for-multiblock-deep-copies/9152>\
**Category:** Development\
**Created:** [August 15, 2022, 7:43pm UTC](https://discourse.vtk.org/t/possible-improvement-for-multiblock-deep-copies/9152 "2022-08-15T19:43:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick-laurin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/patrick-laurin/32/5517_2.png) [@patrick-laurin](https://discourse.vtk.org/u/patrick-laurin)\
**Post date:** [August 15, 2022, 7:43pm UTC](https://discourse.vtk.org/t/possible-improvement-for-multiblock-deep-copies/9152/1 "2022-08-15T19:43:08Z")

</div>

Hi all,

Today, I was questioning myself on the deep copy mechanism of the vtkMultiBlockDataSet vs. the shallow copy one.

In the Shallow Copy, there is preservation of the metadata even if the child block’s data object is nullptr

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

It looks like it is not the case for Deep Copy here: [VTK/vtkDataObjectTree.cxx at 732d680d307699d4c6a1a10ae17f7202b300cd6d · Kitware/VTK · GitHub](https://github.com/Kitware/VTK/blob/732d680d307699d4c6a1a10ae17f7202b300cd6d/Common/DataModel/vtkDataObjectTree.cxx#L539)

In other words, block metadata does not get transferred when the data object is nullptr.

I believe there are reasons behind this, but if there aren’t any, can I issue an MR that fixes this?

Thanks

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [August 29, 2022, 4:56am UTC](https://discourse.vtk.org/t/possible-improvement-for-multiblock-deep-copies/9152/2 "2022-08-29T04:56:19Z")

</div>

Looks like an oversight, however we may change mbds::ShallowCopy soon, so lets hold unto this for a few days.

@spyridon97
