# PlugIn.CreatePreview called (apparently) unnecessarily

**URL:** <https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988>\
**Category:** Rhino Developer\
**Tags:** rdk, rhcommon\
**Created:** [May 27, 2020, 3:39pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988 "2020-05-27T15:39:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdhill](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jdhill/32/565976_2.png) [@jdhill](https://discourse.mcneel.com/u/jdhill)\
**Post date:** [May 27, 2020, 3:39pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/1 "2020-05-27T15:39:57Z")

</div>

Implementing PlugIn.CreatePreview, and it just seems crazy how often a preview (for a material) gets refreshed for no apparent reason.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/2/8/28852b365cc087c4f2a40161c9c18da258e58e86.jpeg)

---

<div class="post-metadata">

**Author:** ![andy](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andy/32/110490_2.png) [@andy](https://discourse.mcneel.com/u/andy)\
**Post date:** [May 27, 2020, 4:32pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/2 "2020-05-27T16:32:58Z")

</div>

It shouldn’t. Make sure you are only changing the return value of RenderHash when something is really different.

---

<div class="post-metadata">

**Author:** ![jdhill](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jdhill/32/565976_2.png) [@jdhill](https://discourse.mcneel.com/u/jdhill)\
**Post date:** [May 27, 2020, 4:35pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/3 "2020-05-27T16:35:01Z")

</div>

I am not overriding that, I am only putting my data in Fields, and setting Child content, and you should be able to reproduce this in v7 if you use Rhino as current renderer, with cycles rendering previews.

---

<div class="post-metadata">

**Author:** ![andy](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andy/32/110490_2.png) [@andy](https://discourse.mcneel.com/u/andy)\
**Post date:** [May 27, 2020, 4:36pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/4 "2020-05-27T16:36:28Z")

</div>

Ok…but I’m not seeing crazy updates in V7. Can you give me some steps to reproduce an unnecessary update?

---

<div class="post-metadata">

**Author:** ![jdhill](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jdhill/32/565976_2.png) [@jdhill](https://discourse.mcneel.com/u/jdhill)\
**Post date:** [May 27, 2020, 4:50pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/5 "2020-05-27T16:50:28Z")

</div>

Sure, using 7.0.20147.12475, 05/26/2020:

1. open v7
2. file \> new, use no template to eliminate variables
3. open materials panel, make sure preview pane is open
4. make sure rhino is current renderer
5. draw a cube
6. create a rhino plastic material (don’t even assign it)
7. move the cube, material preview is refreshed
8. hide the cube, material preview is refreshed
9. undo hiding the cube, refreshed again

In v7 I am not seeing refresh on opening properties, nor when renaming the cube.

---

<div class="post-metadata">

**Author:** ![andy](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andy/32/110490_2.png) [@andy](https://discourse.mcneel.com/u/andy)\
**Post date:** [May 27, 2020, 5:56pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/6 "2020-05-27T17:56:15Z")

</div>

[https://mcneel.myjetbrains.com/youtrack/issue/RH-58767](https://mcneel.myjetbrains.com/youtrack/issue/RH-58767)

---

<div class="post-metadata">

**Author:** ![jdhill](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jdhill/32/565976_2.png) [@jdhill](https://discourse.mcneel.com/u/jdhill)\
**Post date:** [May 27, 2020, 6:35pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/7 "2020-05-27T18:35:42Z")

</div>

Can’t see the linked page, but thanks for taking a look, Andy.

---

<div class="post-metadata">

**Author:** ![johnc](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/johnc/32/765759_2.png) [@johnc](https://discourse.mcneel.com/u/johnc)\
**Post date:** [May 27, 2020, 6:38pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/8 "2020-05-27T18:38:14Z")

</div>

Hi @jdhill,

I have adjusted the permissions so you should be able to see the page now. I will look into this problem later today.

John

---

<div class="post-metadata">

**Author:** ![brian](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/brian/32/504171_2.png) [@brian](https://discourse.mcneel.com/u/brian)\
**Post date:** [August 4, 2020, 10:34pm UTC](https://discourse.mcneel.com/t/plugin-createpreview-called-apparently-unnecessarily/102988/9 "2020-08-04T22:34:20Z")

</div>

[RH-58767](https://mcneel.myjetbrains.com/youtrack/issue/RH-58767) is fixed in the latest [WIP](https://discourse.mcneel.com/t/welcome-to-serengeti/9612)
