Eneroth3 / eneroth-solid-tools

Solid operations for SketchUp
MIT License
26 stars 3 forks source link

Bulk operations #3

Closed Eneroth3 closed 6 years ago

Eneroth3 commented 6 years ago

Continuing from #1, there have been many requests for bulk operations and I have been thinking about it for quite some time but never gotten around to do it. There are however a few requirements for such a feature to be added to this project:

The difficulty in designing a bulk solid operation interface lies in differentiating objects to modify (targets) from objects to use as references (modifiers) in a intuitive way. If the user clicks one object and then another, with no modifier keys or the like, they expect the operation to be carried out. The question is where additional objects, of each kind, should be specified.

In Eneroth Solid Tools targets are selected first and then modifiers. This means adding additional modifiers is quite easy, just treat the output from the previous operation as target and click more modifiers. Each click carries out a new operation.

The question is how to select multiple target objects. One way could be to treat any objects selected before activating the tool as targets, and everything selected while running the tool as modifier (expect when the tool is activated with an empty slection, then it first picks a target). This however clashes with the current functionality of having an operation carried out directly, without even activating a tool, when the toolbar button is pressed with 2 pre-selected solids.

A typical use case for this rather handy functionality is that you select two groups, press Union and they just unite with no tool being activated. With the design proposed above doing the same would result in the tool activating and wanting targets to be selected. This current functionality, although handy, can be seen as a secondary way to perform an operation, as it doesn't give the user any control of which object is the target and which is the modifier (an assumption is made based on volume). This secondary behavior could perhaps be moved to give room for multi target operations. One alternative could be to use a timer to detect double click on the toolbar, and perform the operation directly on double click, and activate the tool on single click. I'm usually against this approach as double click in menus is counter-intuitive and hard to find, but as this is just a secondary action it might in this rare case be acceptable. This is in way similar to how double click in Push/Pull and Offset has a special meaning and is used to save time by power users, but is hard to discover for beginners and something you could do without.

Anyhow, I don't think any changes should be implemented until the existing code base is cleaned up to have a solid foundation to build on, which may take some days.

Eneroth3 commented 6 years ago

Some improved planned for UI follow.

Tools can be separated into 2 groups. Those that can have multiple targets (subtract and trim) and those that can only have one target (union and intersect). Multiple objects can be trimmed by the same other objects, but multiple different objects can't be separately united with the same objects.

(If exclusion is added it's in the same group as union and intersect, having one target object, while split would probably form its own group where no container is modified, but all resulting containers created anew.)

How tool buttons should behave

Union/Intersect , clicked with less than 2 selected solids: Activate tool. Use pre-selected object, if any, as target, or use the first clicked as target. Use all clicked after that as modifiers.

Union/Intersect, clicked with 2 or more solids selected: Unite/intersect with an arbitrary solid as the target (typically the largest). Do not activate tool as. It is quite handy to perform this operation without entering a tool, and the tool has no use of differentiating pre-selected objects from objects clicked with tool.

Subtract/trim , clicked with any number of solids selected: Activate tool. As all pre-selected objects, if any, as targets, or use the first clicked alone as target. Use all clicked after that as modifiers. These tools have no option to perform operation with arbitrary target as it is redudnant. You never use these operations without specifying what object being target and what being modifier.

Note that no unconventional double click behavior is planend anymore.

Eneroth3 commented 6 years ago

Implemented in 671a32a5f720be0fa94f5996511b1b72cd616765