Toolbar Addon - bpy.ops commands context sometimes disactivates

Draise's picture
Project: 
Bforartists Tracker

Seems that some of the toolbar functions, (like set center to cursor, apply rotation, etc) have an issue with staying active, and stop working after extensive use. They stop working sometimes. I had a look at some of their python commands, and they are indeed bpy.ops. which often need a an area context. Since the toolbar view where those operators activate is disjointed from the viewport, I assume it gets confused when different viewports get made.

Maybe integrating these snippets of code into the context of the toolbars operators will help avoid the toolbar disactivating becoming somewhat.. useless eventually?

override = bpy.context.copy()
for area in bpy.context.screen.areas:
    if area.type == 'OUTLINER':
        override['area'] = area

The only fix I know is removing that toolbar and making a new one.

Status: 
Closed (fixed)
Priority: 
Major
Category: 
Bug report
Component: 
User interface
Assigned: 
Reporter: 
Created: 
Tue, 09/05/2017 - 23:19
Updated: 
Thu, 09/21/2017 - 17:54

Comments

13
Reiner's picture

Thanks for the report Draise.

They are all bpy.ops.

When an operator works, but quits working after a while then the cause cannot be the context sensitivity of this operator. Since it already worked. My suspicion is that we have a tool here in the toolbar that throws an error, and makes the other buttons in the toolbar disfunctional by that.

Is there a warning in the console or info editor area when this happens?
 

Draise's picture

I'll try dig up more info on it. It's a bit bizzare, hard to predict.

Reiner's picture

Those are the meanest! I have spent quite a bit time now to see this one happen. No success so far. We need the content of the console when this happens.

Draise's picture

Hey, sorry. Didn't mean to offend. It's a great feature and addon, just don't know why it stopped working and I'm having difficulty reproducing the error, though it has happened a number of times.

I'll keep the console going while I continue working.

Reiner's picture

Seems that my bad english striked back here. You did not offend me. And i hope i haven't offended you neither. I'm as unhappy as you about not catching the showstopper error. That's all Smile

I will have an open eye at it too.

 

 

Reiner's picture

Seems that i found one of the naggers. Investigating ...

Image: 
Reiner's picture

Assigned: Unassigned » Reiner
Reiner's picture
Reiner's picture

Next trouble maker. Haven't noticed though at which point it appeared. Investigating ...

Image: 
Reiner's picture

Was an error in the code for the surface primitives in edit mode.

Fixed in master

https://github.com/Bforartists/Bforartists/commit/954e3f6ab89392bae6725c...

Draise's picture

I have seen the second one. Though since I reported this I haven't reproduced the issue. I guess I am in a different workflow now that didin't trigger it. Good work on finding the bugs! 

 

Reiner's picture

I'm through, i have tested every button now. And those two were the only issues so far.

I will close this issue now since i hope we have catched the trouble makers. You can always reply here in case the initial trouble happens again. Hopefully then with the content of the console and more infos. Then i will reopen the issue. Or you can post it as a new bug report then. That's also okay.

Reiner's picture

Status: Active » Closed (fixed)