3dstreet icon indicating copy to clipboard operation
3dstreet copied to clipboard

allow conversion of clones to manual entities

Open kfarr opened this issue 1 year ago β€’ 6 comments

simple ability to switch to and from manual mode. ie click on clone, and then at the segment level detach clones. or convert the entire segment to manual?

it seems easiest to allow modification at the clone component level, since that component is the one that created the clone

possible methods:

  • in the street-generated-clones component level, create a component property 'detached' where the component "releases" its children by removing data-no-transform and class autocreated on each existing cloned entity. The clone component will save and reload, however when detached is true, then it does not create or remove children.
  • segment level - a flag at street-segment level "manual" where all children
  • street level - a flag at the managed-street level like "manual" that converts everything to manual -- all components

how does a user indicate they want to move to manual mode for clone?

    1. there could be a button on the child clone property panel that upon click converts itself and all sibling clones to manual objects
    1. the child clone could allow selection with transform controls and translation property editing. when the cloned object position/rotation/scale is changed for the first time, then it triggers a detachment of itself and all of the clones from its managing component.
    1. at the segment level, there could be a button that detaches all cloned children objects; or there could be an option at each component level to convert to manual

ideally this action is undoable and includes an indication to users

kfarr avatar Dec 17 '24 21:12 kfarr

since this should be for the 20% use case, let's try to make this as simple and quick as possible...

  • i dont think you can switch to and from. it's only one direction. Maybe "undo" is the only way to reverse things, but if it's that hard to implement, i wouldn't do worry about it.
  • Should be done on the street level, not on the segment level
  • converts the entire street rather than cloning (assuming this means creating another street), which means just taking the old data structure and converting it to entities as done in the old world.
  • button should be on the street right panel somewhere. if not undoable, then there should be a popup that asks the user to confirm

rahulkgupta avatar Dec 17 '24 22:12 rahulkgupta

Here's an example case that I think is pretty common: as a user I want to change the location of telephone poles and benches that were automatically cloned on my street, or move cars a little bit to highlight elements of my street. I then want to modify the width of a street segment after I may have made those changes and I would like the flow and justification of other segments to respond to that street segment resizing. When I change the location of poles, benches, or vehicles, those cloned components could switch to manual without warning or user intervention required. Only when I attempt to modify parameters of the "detached" clones would I then receive a warning message that changing these parameters will erase my manual changes.

In any case, even to support a street level option, it needs to propagate to component-level for detachment so we can try both options and see what it's like. We can also influence the user's ability to do (or not do) these detachment actions by restricting what can be selected at the clone level.

Other questions:

  • How to indicate to a user the difference between a street / segment that are manual vs. automatically managed? An idea is to have a simple "Auto" vs. "Manual" icon green "A" or red "M"

kfarr avatar Dec 18 '24 00:12 kfarr

Here are 2 example icon treatments. One with letters only, one with letter and icon combo. The purple borders would not be visible. This icon would be used with the layer on the scene graph panel and in the property panel to indicate auto vs. manual status

image

Here's what those treatments might look like on the scene graph: image

kfarr avatar Dec 18 '24 00:12 kfarr

Before doing even that, what we should do first is to have a deterministic random of clones and saving the seed that was used the first time. That way when you open the scene again, the clones are created at the same positions. I can already for example put a taxi on a segment by selecting the segment and clicking on the taxi in the add layer panel, that taxi is created in a custom-group entity, that is kept when saving and opening the scene. Today when I open the scene again, I can have a bus overlapping that taxi.

Then I would allow transforms on the clones, and if a clone is moved by the user, then reparent it automatically to the custom-group entity (create it if it doesn't exist) and remove it from the managedClones list on the segment so it is kept. If the user change the segment type, those manually edited clones are kept and they can just remove them if they didn't want them anymore. I wouldn't do any specific UI on that.

vincentfretin avatar Dec 18 '24 09:12 vincentfretin

Here's an example case that I think is pretty common: as a user I want to change the location of telephone poles and benches that were automatically cloned on my street, or move cars a little bit to highlight elements of my street. I then want to modify the width of a street segment after I may have made those changes and I would like the flow and justification of other segments to respond to that street segment resizing. When I change the location of poles, benches, or vehicles, those cloned components could switch to manual without warning or user intervention required. Only when I attempt to modify parameters of the "detached" clones would I then receive a warning message that changing these parameters will erase my manual changes.

it's not clear how common this example is. If users want to move things around, they will first need to make the street a manual street and then move things around. I dont think they can move things around which then under the hood converts a managed street to a manual street.

In any case, even to support a street level option, it needs to propagate to component-level for detachment so we can try both options and see what it's like. We can also influence the user's ability to do (or not do) these detachment actions by restricting what can be selected at the clone level.

Other questions:

  • How to indicate to a user the difference between a street / segment that are manual vs. automatically managed? An idea is to have a simple "Auto" vs. "Manual" icon green "A" or red "M"

i dont feel strongly about how to identify this to users.

rahulkgupta avatar Dec 19 '24 16:12 rahulkgupta

Then I would allow transforms on the clones, and if a clone is moved by the user, then reparent it automatically to the custom-group entity (create it if it doesn't exist) and remove it from the managedClones list on the segment so it is kept. If the user change the segment type, those manually edited clones are kept and they can just remove them if they didn't want them anymore. I wouldn't do any specific UI on that.

Here are some challenges with this approach:

  • when a user moves one clone, the existing clones are still there and managed by the component. even if we allowed the user to move a clone and convert it to a custom object, upon save / reload the scene will re-render all the clones unless we take additional action to remove the clone component in which case we'd need to also add manual versions of the other cloned objects in order to keep the same scene for the user upon reload.
  • the ui will need to account for this somehow. for example, as a user who manually moves the positions of telephone poles, and then later returns to the street-segment custom sidepanel and attempts to change the spacing of the telephone poles how will this be handled? if the component is removed after conversion than there is no place to change the spacing and the user may be confused, not realizing those settings disappear when manually edited; if the component still exists and the user changes the value, what is the expected outcome -- do the manual objects disappear? or do the cloned ones get created again? does the user get a warning if the manual objects are cleared?
  • luckily i don't think reparenting is needed, we can just keep the converted entity exactly where it is, just remove autocreated class so that the clones are saved
  • it is proving difficult to detect when the position / rotation update is occurring because of an automatically managed creation ' change event from the clone component vs. if it a user-initiated edit to prompt conversion to manual

kfarr avatar Dec 26 '24 05:12 kfarr