aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
655 stars 203 forks source link

Added clone and remove entity to the Edit menu #197

Closed fernandojsg closed 8 years ago

fernandojsg commented 8 years ago
ngokevin commented 8 years ago

Is the Edit Menu the best place? There's a lot of distance between the Entity in the SceneGraph to the Edit Menu, so the mapping is not immediate. Can we move these actions to the SceneGraph (right-click contextual menu or action icons)

fernandojsg commented 8 years ago

@ngokevin regardless the position on the UI I think it's good idea to keep all the options in the menu too, so people could access them even if some of the panels are collapsed for example. In any case I also think the best place to have the icons is also in the scenegraph, maybe you could click an entity and the delete button will be aligned to the right in the same row. I also like the contentmenu option, probably even on the viewport too, so you could click on the entities and see some options related to them. This PR is more about adding the functionality, and then I could add another two one for context menu and another for icons in scenegraph.

ngokevin commented 8 years ago

We don't have collapsible panels at the moment, so right now it's not ideal to address that case. I think even then, we'd just prescribe to open up the Scene Graph to do entity-level management.

dmarcos commented 8 years ago

What about a contextual menu (with clone, delete) as well on the viewport when right-click on an entity?

dmarcos commented 8 years ago

If we add the delete, clone on both the viewport and the scene graph we might be able to get rid of the edit menu. Edit menu feels indirect while a contextual menu / icon feels more like direct manipulation which reinforces the mapping between action and target of that action.

fernandojsg commented 8 years ago

Yep, I was more on the way to keep all the actions on the menus as most of the apps does, like firefox you've context menu to copy, paste, whatever but you have also shortcuts and at the end you can always go to the menu. I believe for me the most confortable will be probably contextmenu on viewport and shortcuts but this is more for "power" users. About adding icons to the scenegraph, probably delete it's the most common that you can have there, and maybe clone too? What I mean is that there's no problem in duplicate places where you can do the same action so isn't? so we could have them all in the menu

fernandojsg commented 8 years ago

Btw from the discussion in https://github.com/aframevr/aframe-editor/pull/203 Do you think we should include the clone icon too in next to the delete icon on the selected entity?

screenshot 2016-07-14 00 28 16
dmarcos commented 8 years ago

How do you create a child of a given entity? If you select one and click on the + icon?

dmarcos commented 8 years ago

What about copy and paste for entities instead of clone? You copy an entity and can click on another one to paste it as a child. That would allow for easy creation of hierarchies.

fernandojsg commented 8 years ago

Copy/paste should be on the contextmenu instead of icons right? I'm not sure about to create a child of the selected entity with just pressing +. Because typically you'll have always one entity selected (instead of a-scene) Unity/3DS and so on typically works that way, you just add an entity at the end of the scenegraph and then you decide where to locate it. One option could be having two + buttons one to add an entity at the end of the scenegraph and another one (just enabled if one entity is selected) to add an entity inside the current selected entity. Another option is that + will be always add at the end, and we could add an option in the contextmenu for each entity to add a child entity (or whatever)

dmarcos commented 8 years ago

Copy / paste could be accessed on:

  1. Keyboard shortcut ctrl+c / ctrl + v.
  2. Contextual menu or icons associated to the entity.
  3. Maybe also next to the + icon in the scenegraph.

We can also add a create child and paste actions to the contextual menu of the entity.

fernandojsg commented 8 years ago

Ok, so I'll split all this things into different issues and PR and we could keep discussing them there, as there many little things going here

fernandojsg commented 8 years ago

What do we do with this PR? Just merge the way it works right now with the Edit menu? and create another PR adding the clone and remove buttons on the scenegraph`s entity, or modify this PR to include these button too?

dmarcos commented 8 years ago

Are you going to include html elment + id in the scenegraph in this PR?

dmarcos commented 8 years ago

We can add clone and remove in this PR too I think.

fernandojsg commented 8 years ago

Are you going to include html elment + id in the scenegraph in this PR?

No, I'll leave that for another PR

fernandojsg commented 8 years ago

We can add clone and remove in this PR too I think.

Ok, so I'll add clone and remove buttons next in the scenegraph in this PR and leave the rest for other PRs/issues

fernandojsg commented 8 years ago

Btw how do you feel about select the newly created element after clone, or keeping selected the element to be clone?

dmarcos commented 8 years ago

I think + or clone should select the new element.

fernandojsg commented 8 years ago

Updated with the clone and remove icon added to the scenegraph. When cloning an entity it will select the new entity by default and when removing it will select the closest entity (first looking forward and then backward): removeclone

ngokevin commented 8 years ago

Do we keep the Edit Menu? Don't know if we want more than one way to do something.

ngokevin commented 8 years ago

r+wc

fernandojsg commented 8 years ago

@ngokevin re leaving the options in the edit menu, let's leave them there until we'll decide which icons we'll show on the scenegraph. As one of the next things that I'll do is to copy/paste, probably we don't want to have copy, paste, clone and delete in the scenegraph, so we could arrange it in another PR/issue

ngokevin commented 8 years ago

The same thing still applies to copy/paste though, you want to keep the direct mapping between the entity and its actions.

fernandojsg commented 8 years ago

Yep, but what if we have like 10 actions for the entity, we should leave some of them in the context menu and just the two/three more common on the icons next to the entity data on the scenegraph right?

ngokevin commented 8 years ago

Maybe, maybe not. But that's assuming we have 10 actions, which we don't at the moment.