Now this might be something super easy but I have been struggling to figure this out.
I have a Combo box in the Extension that I am building for Managing/Creating variants. This Combo box is responsible for showing all “Variant” Prims in a given USD Stage and the Tree View below it gets populated based on the selection. The problem now is, that when user clicks “Add Variant prim” or makes any change to the stage, I would want to re-populate the Combo Box as well. But for some reason I could not find a simple “clearAll” method on the widget’s “model”. Any Ideas? Even if someone can point me into the direction as to how I can get the total Item count in this model, I can have custom implementation for a “clearAll” method (I guess that is what Nvidia recommends anyways), so far “variantsCombo.model.get_item_children()” and “variantsCombo.model.get_item_value_model_count()” have failed me, but I am guessing that’s not even the right methods to get it.
P.S. I could do this by just verifying and only adding the new prims in the scene if they are a valid “Variant Prim” but there are many more cases where that wouldn’t work.
In general I have never worked with a model-view UI framework in the past, even with Qt I used to mostly deal with widgets, so it might just be my understanding of how models work in general.
Any help would be appreciated, Thank you !!