* Solved, sort of * Accessing DzInstanceNode causes viewport flickers
Totte
Posts: 13,972
I'm working on a script that accesses DzInstanceGroupNodes and pick information from them, it also does things with "normal" instances, and adds objects to the Scene Hierarchy.
FYI: The DzInstanceGroupNodes (and the items around them ) are all created with the UltraScatter plugin, instances view set to boundingbox.
The issue I'm having is that even if the DzInstanceGroupNode is hidden, the items it uses are hidden, the group is set in editmode with beginItemEdit() accessing the group data and items causes the whole group to flicker in the viewport.
Is there any smart trick to turn off viewport updates while the script is executing as I can't do more that hide them but they still flickers.
Post edited by Totte on
Comments
It flickers when you enter edit mode, not when you cancel/exit?
It flickers every iteration in this loop.... Even when oIGBase (the DzInstanceGroupNode) is set to setVisible(false)
oIGBase.beginItemEdit();
var items = oIGBase.getNumberOfGroupItems();
for (idx=0; idx<items; idx++) {
var oIGItem = oIGBase.getGroupItem(idx);
var oiPos = oIGItem.getLocalPos();
var oiRot = oIGItem.getLocalRot();
var oiScale = oIGItem.getLocalScale();
this.doSomething(oiPos, oiRot, oiScale);
}
oIGBase.finishItemEdit();
Well, I would expect it to flciker when you call finishItemEdit as it has to update the display for possibly new shaping or other properties.
I filckered before I added the begin/end edit, and as I said, flicker every loop iteration.
OK, it looks like the flicker is only happening on OS X, on Windows it's nicely silent and still.