[Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)

[Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue fix)

Postby AlexMozg » Wed Jun 16, 2010 7:05 pm

Overview:

When you use context menu or each command of menu "Edit" any way (including via hot key), this launches all procedural objects initialized by the UI.add_context_menu_handler method.
As a rule, this procedural objects initialize new objects by Sketchup::Menu.add_item method and UI::Command objects.
UI::Command objects, unfortunately, cannot be deleted by GC.
Eventually the menu buffer overflows and all new UI::Command objects, and objects created by Sketchup::Menu.add_item method, stop working correctly.
And you can see context menu is gray :cry: .

menu.png

Only restarting Sketchup will fix the issue.

I think the solution to this is to redefine the methods UI::Command.new and Sketchup::Menu.add_item temporarily at the time of using the Edit menu option. The redefined methods filter their arguments and prevent the initialization of new UI::Command objects, and objects creating by Sketchup::Menu.add_item method, if any have already been initialized.
My solution was to create an universal buffer for UI::Command objects (UI::COMMANDS, Hash), where each object-command has its extra methods.
The overflow of the buffer doesn't occures, because we use the same set of the universal object-commands (UI::Command) in the process of work :D .
__________________________________

By default plugin runs automatically and
requires no user intervention in his work.
When using plugin is not required to overwrite previously
created scripts that use the context menu.

The plugin control exercises in menu:
"File" -> "• AT • Utilites" -> "Context Menu Optimizer".
It includes 2 parameters:
1)on/off plugin run,
2)on/off display debug info in Sketchup Ruby Console.

settings.png

__________________________________

INSTALLATION:

The ContextMenuOptimizer plugin works
for Sketchup versions 5, 6 and 7 (Free and Pro).
To install the ContextMenuOptimizer plugin, you should unzip
the file you downloaded (ContextMenuOptimizer.zip in principle)
into the Sketchup Plugins folder.
This operation should:
• Copy one script file !!!ContextMenuOptimizer_loader.rb
to the Sketchup Plugins folder.
• Create a sub-folder ArchTools, containing the main script files.

IMPORTANT: Don't rename files!
:D
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Wed Jun 16, 2010 7:12 pm

That's might interesting.

But has anyone experienced any other than Fredo's old plugins to cause the greyouts? After updating his tools I've not experienced this issue any more.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby AlexMozg » Wed Jun 16, 2010 7:19 pm

thomthom wrote:That's might interesting.
But has anyone experienced any other than Fredo's old plugins to cause the greyouts? After updating his tools I've not experienced this issue any more.

Not only Fredo's old plugins is cause the problem.
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby Ken » Wed Jun 16, 2010 8:23 pm

thomthom wrote:That's might interesting.

But has anyone experienced any other than Fredo's old plugins to cause the greyouts? After updating his tools I've not experienced this issue any more.


Yes, I had the greyouts after installing Fredo's new plugin. However, I had just about every plugin there was. So I removed all plugins, loaded only the one I really wanted. Tried to elimate all plugins that called the content menu if I could. I even removed the content menu selection from some plugins. And plugins that had a toolbar and also listed in the plugin or contents menu selections, I would remove these two choice and only use the toolbar.

So far I have not had the trouble happen. Note, that I don't have 1/2 the menu's that I had before.

Ken
0
Fight like your the third monkey on Noah's Ark gangway.
User avatar
Ken 
Premium Member
Premium Member
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Wed Jun 16, 2010 8:25 pm

Alex, this debug mode: can that help Ken work out which plugin greys out the menus?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby AlexMozg » Wed Jun 16, 2010 8:37 pm

thomthom wrote:Alex, this debug mode: can that help Ken work out which plugin greys out the menus?

Debugging is for informational purposes and shows the number of objects (Sketchup::Menu, UI::Command) available in the current object space.
Default debug info is off.
I think my plugin will solve the Ken's problem.
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby Ken » Wed Jun 16, 2010 8:46 pm

AlexMozg wrote:
thomthom wrote:Alex, this debug mode: can that help Ken work out which plugin greys out the menus?

Debugging is for informational purposes and shows the number of objects (Sketchup::Menu, UI::Command) available in the current object space.
Default debug info is off.
I think my plugin will solve the Ken's problem.


Note: I haven't had the problem since I reload only the plugins I wish to use. I am no longer a plugin groupie. I am being careful, not to have multi plugins for the same purpose. So here is hoping I have solved my problem just by not being a plugin in hog.

Tom thanks for the help and Alex thanks for the plugin. If I have a re-occurrence of the problem, I know where I will head.

Ken
0
Last edited by Ken on Thu Jun 17, 2010 4:26 pm, edited 2 times in total.
Fight like your the third monkey on Noah's Ark gangway.
User avatar
Ken 
Premium Member
Premium Member
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby craigbic » Thu Jun 17, 2010 3:41 pm

thomthom, I am still having the problem after updating Fredo's plugins. I do have quite a large collection of plugins that I use so I have learned to live with the context menu gray-out by going to the selection menu under Edit (not sure what this menu is actually called - Edit context menu? - so see 1st screen shot).


Can go here instead of right-click context menu if it is grayed out



Alex, your plugin is installed properly and is running

Alex, I installed your plugin, it is running (see second screen shot) but I am still having the context menu gray-out issue, at least in part (see third screen shot). Most of the options I use such as "Explode" are grayed out.


Right-click context menu is still grayed out to some degree

I'll keep using the Edit menu for now. Just thought you might appreciate the feedback. Thank you for all the hard work! :D I hope this annoying problem goes away along with toolbar migration. :o
0
Checkout the Sketchup Graphics Blog at http://sketchupgraphics.com

craigbic 
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby AlexMozg » Thu Jun 17, 2010 6:10 pm

The menu buffer overflows anyway if the number of objects UI::Command becomes more then 500-600!
And unfortunately, the predefined context menu commands
(such as Explode, Hide, Erace etc.)
are not amenable to correction :(,
but the commands of other plugins should always work :).
craigbic
:!: In your case, you can only limit the number of plugins which you use.
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Thu Jun 17, 2010 6:11 pm

AlexMozg wrote:The menu buffer overflows anyway if the number of objects UI::Command becomes more then 500-600!


So it's not really the fixed 1000 that Google said?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby craigbic » Thu Jun 17, 2010 7:05 pm

AlexMozg wrote:The menu buffer overflows anyway if the number of objects UI::Command becomes more then 500-600!
And unfortunately, the predefined context menu commands
(such as Explode, Hide, Erace etc.)
are not amenable to correction :(,
but the commands of other plugins should always work :).
craigbic
:!: In your case, you can only limit the number of plugins which you use.


Limit plugins? NEVER! Not a big deal - just an annoyance really. Thank you for the explanation and the plugin! Good work! 8-)
0
Checkout the Sketchup Graphics Blog at http://sketchupgraphics.com

craigbic 
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby AlexMozg » Thu Jun 17, 2010 8:35 pm

thomthom wrote:...
So it's not really the fixed 1000 that Google said?

Maybe...
500-600 for Sketchup 5, I have been tested it.
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby CadFather » Thu Jun 17, 2010 10:19 pm

Thom, i'm quite sure the selection toys are causing the issue on my pc - so the google fix is not working after all

when i remove S.T. the menu does not grey out even after hours of working :roll:
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Thu Jun 17, 2010 10:27 pm

That is very odd. I can not reproduce it. Nor does it have the code that Google said caused this.

How many plugins had you got installed? I wonder if one might run into this if one just has many menu items - Selection Toys has quite a few. Have you tried disabling some of the menu items?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby CadFather » Fri Jun 18, 2010 9:37 am

thanks that's a good idea, might just be it...well hope so.. after all together there must be something like 500 or 600 plugins in there by now.. :fro:
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Fri Jun 18, 2010 10:09 am

CadFather wrote:thanks that's a good idea, might just be it...well hope so.. after all together there must be something like 500 or 600 plugins in there by now.. :fro:


:!: :!: :!:
Well - that might very likely be the cause. Google said their limit of Command objects where at about 1000 - if you ahve that many you might hit some limit even without some leak like Fredo's tools.

What would be interesting is if you could install one more. (No worries no menus or anything ;) )
Then open your Ruby Console and type in stats - see what it reports.
Then do some right clicks and see what it reports afterwards.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby CadFather » Fri Jun 18, 2010 10:29 am

well, 600 was my very quick estimate of all the commands in the folder from didier's spray comps to su2kt

but the stats gives this: (cool thing) - UI:Command objects: 283 of 1000 (28.30%)

so i guess that's still not too greedy..
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Fri Jun 18, 2010 10:31 am

Does it increase during usage? After right-clicking for instance?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby CadFather » Fri Jun 18, 2010 10:36 am

not for the moment - i think it needs more work-time - i'll put it through the paces this afternoon though.

to be continued.. :thumb:
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Fri Jun 18, 2010 10:40 am

Then it can't be the same issue, because you should see increase immediately. (However, you might get different results from what you right click on, Edge,Face,Group,Component.)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby CadFather » Fri Jun 18, 2010 10:59 am

i see.. i shall let you know how i get on, i have some work later so i will be able to test it properly..
meantime i disabled the selection toys i don't use so much, so i'm preparing for sunshine through the clouds! :) :enlight:
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby AlexMozg » Fri Jun 18, 2010 11:08 am

CadFather
Do you use my plugin?
I think it should solve such issues.
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby CadFather » Fri Jun 18, 2010 12:03 pm

hi Alex

yes i did as soon as i saw it.. but the result was that only some menus 'refreshed' - some other (strangely the sketchup ones like activate section plane, reverse face etc) were still grey :?
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby AlexMozg » Fri Jun 18, 2010 4:35 pm

CadFather wrote:hi Alex

yes i did as soon as i saw it.. but the result was that only some menus 'refreshed' - some other (strangely the sketchup ones like activate section plane, reverse face etc) were still grey :?

My plugin does not allow a possible memory leak, it protects the buffer menu.
And I wrote about it:
AlexMozg wrote:...unfortunately, the predefined context menu commands
(such as Explode, Hide, Erace etc.)
are not amenable to correction,
but the commands of other plugins should always work.

My colleagues and I use my plugin and we are not experienced this issue any more. But we have limit plugins in use, basically most necessary.
0

AlexMozg 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby chango70 » Tue Jun 29, 2010 12:40 pm

OMG all my menus are greyed out from the start with or without this plugin!!! What is going on?
0

chango70 
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby TIG » Tue Jun 29, 2010 12:45 pm

You may have too many context-menu / commands running - do you have many plugins ?
Temporarily remove any you recently added and see what happens...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby thomthom » Tue Jun 29, 2010 12:49 pm

chango70 wrote:OMG all my menus are greyed out from the start with or without this plugin!!! What is going on?

Have you updated any Fredo plugins?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby TIG » Tue Jun 29, 2010 12:56 pm

Fredo's latest CurviLoft... has/needs 'Lib3.5' BUT I've found that 'Lib3.4c' [the one that was issued to stop this very problem] is still needed by Fredo's other tools to stop the dreaded graying out issue - if you don't use this 'optimizer tool'... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby chango70 » Tue Jun 29, 2010 1:26 pm

thx for the quick reply guys.

Yes I do have lots of plugins.

I will try removing them.
0

chango70 
 

Re: [Plugin]ContextMenuOptimizer v2.8 (menu gray-out issue f

Postby chango70 » Tue Jun 29, 2010 1:30 pm

TIG wrote:Fredo's latest CurviLoft... has/needs 'Lib3.5' BUT I've found that 'Lib3.4c' [the one that was issued to stop this very problem] is still needed by Fredo's other tools to stop the dreaded graying out issue - if you don't use this 'optimizer tool'... :?



Argh... Curviloft is so much fun.. I guess ill try uninstall that.
0

chango70 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 6 guests

Visit our sponsors: