script-bakery icon indicating copy to clipboard operation
script-bakery copied to clipboard

Add Generate button to toolbar

Open carter2422 opened this issue 11 years ago • 4 comments

Mesh generation should be possible via the toolbar, allowing users to work without a keyboard if necessary.

Generate should be disabled until strokes are drawn, to clearly indicate it relies on Contour strokes.

carter2422 avatar Jul 28 '13 20:07 carter2422

I can add the button but I have no idea how to hook it up to the generate function.

carter2422 avatar Jul 28 '13 20:07 carter2422

Therein lies the rub. I'm not sure how to hook it up either. I need to discover 2 things.

  1. I need to see if I can push data into the edit mesh while the modal is running and still in editmode. If I can solve this problem, it will by naure solve the session editing feature too.
  2. Because my operator is "modal" in nature, all the settings exist "inside" the operator. It's not like the undo/redo panel where Blender literally resets to the state before the operator was called and then simply redoes the oeprator with a new set of inputs.

I know my operator can read from the panels/properties etc when it initiates (allowing for defaults) but I don't know a way to have panel interaction while the modal is running. On the other hand, I noticed that one can modify settings in another window (eg, user preferences window) and the modal operator can pick up on that (eg, the iterative alignment property). So perhaps, I need to monitor the mouse and if it goes outside the 3d view (onto the panel) then pass through the events and Blender will take care of it? Lots of branches to experiment with...

patmo141 avatar Jul 29 '13 00:07 patmo141

Well, the verdict is not good. I passed the events through when the mouse is outside the 3d view region (eg, over a panel). It will allow me to do things like collapse and expand panels, but no interaction with anything inside a panel (like a property). It appears we can have things for defaults (like cyclic, n segments etc) but nothing that be clicked on dynamically while the operator is running.

We have three options to implement this feature.

  1. restructure the addon in a way I really do not want to
  2. BGL draw a button (like pie menus) for tablet users or desktop users to click
  3. Find a different way to signal like including it in the widget (this should be 2a)
  4. Don't implement it at all (sorry, it's late ha ha)

patmo141 avatar Jul 29 '13 03:07 patmo141

That's a bummer but all seems to make sense. I'm not a big fan of the alternatives for the button, so let's shelve it for now. For the time being I'll simply move this to Contours Version 2 milestone so that we can maybe continue to investigate it.

carter2422 avatar Jul 30 '13 00:07 carter2422