# Update model appearance based on real-time parameter change

**URL:** <https://discourse.slicer.org/t/update-model-appearance-based-on-real-time-parameter-change/17102>\
**Category:** Support\
**Created:** [April 15, 2021, 12:15pm UTC](https://discourse.slicer.org/t/update-model-appearance-based-on-real-time-parameter-change/17102 "2021-04-15T12:15:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [April 15, 2021, 12:15pm UTC](https://discourse.slicer.org/t/update-model-appearance-based-on-real-time-parameter-change/17102/1 "2021-04-15T12:15:19Z")

</div>

Hello, in order to have appearance changes (e.g. color, transparency etc) on a model, in accordance to parameter changes in real-time, do I have to create a new vtkMRMLDynamicModelerNode which copies the model I meant to change? Any help or pointer is appreciated!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 15, 2021, 1:34pm UTC](https://discourse.slicer.org/t/update-model-appearance-based-on-real-time-parameter-change/17102/2 "2021-04-15T13:34:58Z")

</div>

It depends on what exactly you want to do.

We implemented the [Breach Warning module in SlicerIGT extension](https://github.com/SlicerIGT/SlicerIGT/#breach-warning) to change color of a model and make a warning sound when a tool gets too close to a designated model node. You may be able to use this module as is or make adjustments.

You can also very easily add an observer to any nodes (transform nodes, images, etc.) and make any changes to any nodes in the callback function. This is used for example for constructing tumor model during navigated surgeries based on real-time mass-spectrometry data.

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [April 15, 2021, 2:15pm UTC](https://discourse.slicer.org/t/update-model-appearance-based-on-real-time-parameter-change/17102/3 "2021-04-15T14:15:01Z")

</div>

Thank you, @lassoan  
I looked into the Breach Warning case, it looks too complicated for me to implement now.  
For the second suggestion, could you point to any good example script to refer to?

Thanks again!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 15, 2021, 4:21pm UTC](https://discourse.slicer.org/t/update-model-appearance-based-on-real-time-parameter-change/17102/4 "2021-04-15T16:21:01Z")

</div>

There are lots of examples for commonly needed operations in the [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository).

What would you like to achieve? What “parameter changes” you would like to observe and what appearance you would like to change in response?
