# Adding metadata to a vtkOpenGLActor

**URL:** https://discourse.vtk.org/t/adding-metadata-to-a-vtkopenglactor/762
**Category:** Support
**Created:** [April 15, 2019, 7:15pm UTC](https://discourse.vtk.org/t/adding-metadata-to-a-vtkopenglactor/762 "2019-04-15T19:15:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![msmerps](https://discourse.vtk.org/user_avatar/discourse.vtk.org/msmerps/32/1559_2.png) [@msmerps](https://discourse.vtk.org/u/msmerps)
#### Post date: [April 15, 2019, 7:15pm UTC](https://discourse.vtk.org/t/adding-metadata-to-a-vtkopenglactor/762/1 "2019-04-15T19:15:46Z")

</div>

Hi VTK experts,  
I would like to add some metadata, a string, to a vtkActor (more specifically a vtkOpenGLActor) so that when a user clicks on it, I can use the metadata to identify what the object represents and act appropriately. Is adding the metadata via vtkFieldData the best way to do this?  
thank you in advance,  
-Merps

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 15, 2019, 7:40pm UTC](https://discourse.vtk.org/t/adding-metadata-to-a-vtkopenglactor/762/2 "2019-04-15T19:40:20Z")

</div>

vtkFieldData is important if you want to store custom metadata in standard VTK file formats. You may use vtkFieldData for storing metadata in memory, too, but normally it is more convenient and efficient to store metadata in separate classes and associate them with VTK data objects, processing filters, actors, etc.

---

<div class="post-metadata">

### Author: ![msmerps](https://discourse.vtk.org/user_avatar/discourse.vtk.org/msmerps/32/1559_2.png) [@msmerps](https://discourse.vtk.org/u/msmerps)
#### Post date: [April 15, 2019, 8:40pm UTC](https://discourse.vtk.org/t/adding-metadata-to-a-vtkopenglactor/762/3 "2019-04-15T20:40:06Z")

</div>

Thanks for the (always) speedy response, Andras. Do you propose doing something like making a dict whose keys are vtkOpenGLActors and whose values are the metadata?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 15, 2019, 8:53pm UTC](https://discourse.vtk.org/t/adding-metadata-to-a-vtkopenglactor/762/4 "2019-04-15T20:53:23Z")

</div>

Yes, that should work.
