I presume you are referring to the code in the command "vr":

@g.command('vr')
def viewrendered(event):
    """Open render view for commander"""
    global controllers, layouts
    if g.app.gui.guiName() != 'qt':
        return None
    c = event.get('c')
    if not c:
        return None
    h = c.hash()
    vr = controllers.get(h)
    if not vr:
        controllers[h] = vr = ViewRenderedController(c)

I had slightly modified this code.  But when I restored it to your version, 
I still found that a new ViewRenderedController3 object gets instantiated 
each time the rendering panel gets hidden and then shown.  What's more, I 
find that the same happens with the current no-docks version of the VR 
plugin, too.

I think this is inevitable.  When VR/VR3 gets shown again, its new layout 
calls ns_provide() to get the widget to populate the panel.  That call 
instantiates a new VR/VR3 widget.  The other day, I tried caching the 
widget outside the layout and controllers, and returning the cached object 
when ns_provide() was called.  But I got errors from pyqt saying that the 
c/c++ wrapper had already been torn down.

On Monday, October 5, 2020 at 12:33:23 PM UTC-4, Thomas Passin wrote:
>
> OK, I'll take a look at that.
>
> On Monday, October 5, 2020 at 11:45:31 AM UTC-4, Edward K. Ream wrote:
>>
>>
>>
>> On Sat, Oct 3, 2020 at 7:41 AM [email protected] <[email protected]> 
>> wrote:
>>
>>> There are two widgets involved here.  One is the actual displayed 
>>> widget, such as a QWebView.  That's the one checked by 
>>> vr3.ensure_text_widget(). The other one is the ViewRenderedController3 
>>> itself, which is not a display widget in itself. The latter is the one 
>>> I was surprised to see is getting re-created every time I toggle the VR3 
>>> panel off and then on again.  I hadn't expected that, although I suppose I 
>>> should have.
>>>
>>
>> This is likely a bug in the VR3 plugin.  I did a cff on 
>> ViewRenderedController3 and found that vr3.setup does not save the new 
>> controller in the global "controllers" dict. This bug does not exist in the 
>> VR plugin.
>>
>> Edward
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/949bd9b1-bad5-480a-ac0b-183817e6b8aco%40googlegroups.com.

Reply via email to