GhCanvasViewport icon indicating copy to clipboard operation
GhCanvasViewport copied to clipboard

Functionality Overhaul

Open GrimblyGorn opened this issue 3 years ago • 4 comments

Added numerous new menu items, features, and options. Please see my Readme for a detailed breakdown of the changes along with numerous images detailing the new feature set.

GrimblyGorn avatar Jan 04 '21 02:01 GrimblyGorn

Thanks for the PR. There are a lot of changes here so it is pretty difficult to review.

I'm not a big fan of ini files for storing persistent data and would rather not add another file that people need to track. We could either use grasshopper's settings or store data directly in GH definitions depending on what needs to be stored.

sbaer avatar Jan 04 '21 21:01 sbaer

Originally I was just planning to add a menu icon to the display menu item and then see if I could add the Set View options for named views so I could easily switch to them. As I kept going it grew into this more exhaustive overhaul and I think it's become even more useful than I had originally intended so I thought I'd share it. It is a lot to look through and review though.

The ini file is generated in the users AppData folder on the fly using Grasshoppers Folders.AppDataFolder method and is updated as the variables it stores are changed or modified. This operates as a global variable storage so the same viewport settings will persist across all of your definitions including new un-saved files. This should be entirely automated for the user and never require any effort or modification on their part. I suppose I could look into changing it to "use grasshopper's settings" if you could elaborate more on what you mean by that. As for storing it directly in GH definitions that is of course an option as well, but then starting up new definitions wouldn't be as fluid as it is now with the global settings being rolled over already.

I've attached a copy of my current ini file so you can see exactly what it's storing and how. In case you were curious. Though I did have to change the extension to .txt cause Github doesn't allow ini apparently. GhCanvasViewport.txt

GrimblyGorn avatar Jan 05 '21 05:01 GrimblyGorn

I got curious about the grasshopper settings you referred to and started looking around a bit then ran across (this) post from David on the Discourse forum that references the GH_SettingsServer Class which seems to be what you were speaking of...maybe. I looked into it a bit more and it does seem to be a much cleaner alternative to the ini implementation I went for so I think I'll go ahead and change my code to use this now instead.

I'm not really sure how that affects this Pull Request since this is actually my first one but I should have the changes done tonight or tomorrow night if something comes up and I'll upload them to my fork after.

GrimblyGorn avatar Jan 05 '21 07:01 GrimblyGorn

This new implementation for persistence seems to be functioning correctly and I've not run into any issues with it thus far. I did look briefly into adding an option for users to switch between global settings and settings for specific files but I see no good way of making such an option that would be intuitive and relatively self-explanatory. Personally, I prefer the global settings over any file specific ones so I've scrapped that idea for now. I also looked into adding tooltips to some of the menu items but the MenuItems Class doesn't seem to have a means of adding tooltips so that idea got benched as well. The only thing remaining that I was hoping to resolve is the issue I mentioned on the Readme regarding transparency for my Simple icon set on certain Display Modes. I still have had no luck with fixing that at this point though so for now I'm calling that "good enough" I think.

All of the new changes seem to have reflected onto this PR so I believe it should be ready for review again now.

GrimblyGorn avatar Jan 06 '21 23:01 GrimblyGorn