shish / blender-ikea-browser

Import 3D models from ikea.com into your scene!
20 stars 1 forks source link

Avoid reloading data in draw()? #4

Closed shish closed 3 months ago

shish commented 3 months ago

IkeaProductPanel.draw() calls get_pip() which will reload product JSON from disk every time, which feels suboptimal... Not sure how to do it better, and cleanly?

We could have a pair of global variables for current product ID and current product data, and reload the data from disk when the product ID changes, but that feels messy...

shish commented 3 months ago

I ended up doing the globals thing, which is bad and I feel bad, but it works and is fairly self-contained if somebody wants to replace it with a better idea