Godot: Remove TextureRegion popping when Sprite is Selected

Created on 27 Mar 2019  路  20Comments  路  Source: godotengine/godot

Godot version: 3.1-stable

OS/device including version: Solus 4.0

Issue description:

This is a huge decrease in usability. Every single time you select a Sprite the TextureRegion panel will pop on the screen and take focus, so if you were animating some Sprites, switching from one to another, you would have to switch back the AnimationPlayer every-single-time, the Pin option on AnimationPlayer doesn't seem to make any difference. It gets even worse if you are just trying to to setup the rest position of a character composed on many sprites.

ezgif com-video-to-gif

Steps to reproduce:

  1. Create a scene
  2. Add some Sprite nodes (3+)
  3. Add a Texture to the Sprites
  4. Set region_enabled to true
  5. Add an AnimationPlayer
  6. Try to animate the Sprites without getting super mad about the TextureRegion Panel popping every time
3.2 discussion enhancement editor usability

Most helpful comment

I agree, it also annoys me very much

All 20 comments

I agree, it also annoys me very much

@akien-mga this is not fixed on Godot 3.2.beta

Could you reopen the issue?

CC @bojidar-bg

@henriiquecampos Would be nice if you could prepare a quick gif, so that I can guess the error faster :smiley:

@bojidar-bg here:
04

A smoother workflow, what we had in 3.0 iirc, is:

  1. You click on the AnimationPlayer
  2. You click on the Node, e.g. Sprite
  3. You key the properties you want

Currently the workflow is

  1. You click on the AnimationPlayer
  2. You click on the Node
  3. If it is a Sprite you lose the Animation context and you are into the TextureRegion context
  4. You can either click back on the Animation tab or (what I was doing before I remembered just today that you can change back to the Animation tab) repeat the process and instead of clicking you CTRL+LMB on the Node

I think the issue might be a bit deeper, since this happens (albeit less obnoxiously) with the Shader editor context tab as well.
Indeed the issue is not present in 3.0, probably because there most context tabs do not popup automatically whenever you select a node matching them (and Animation is the exception rather than the norm there).

Hm, can you confirm that step 3 does not occur any more after either closing the TextureRegion tab or opening the Animation tab manually from the buttons on the bottom row?

@bojidar-bg yep in 3.2.beta2 the workflow is:

  1. Click on the AnimationPlayer
  2. Click on a Sprite node
  3. TextureRect tab will pop
  4. Click on the Animation tab
  5. After that you can select Sprite nodes normally without the TextureRect popping.

So it would be working as intended after my last PR. I'm not sure how to handle things better, without changing how bottom docks work. Maybe if TextureRegion never popped up automatically?

I think it could pop when you enable the "region_enabled", but like, literally right when it is turned true, so that this context is explicit to the user. And it can pop whenever region_enabled becomes true.

Otherwise, it doesn't pop, but is there. Wachu think?

This way the workflow to enable the region is:

  1. Select the Sprite
  2. Enabled region_enabled
  3. TextureRegion pops
  4. You draw the rect

Consider making the tabs draggable, whichever is furthest to the right is active.

@henriiquecampos That's a good idea indeed, but while Sprite and Sprite3D have a region_enabled property, NinePatchRect, StyleBoxTexture, and AtlasTexture do not.
StyleBoxTexture, and AtlasTexture are resources, so the editor can freely pop up for them (similar as other resource editors).
So, NinePatchRect is odd with this proposal.

Should there not be a variable that remembers the last bottom panel sorted on top?

  • So if I last had the Animation Panel on top, and I click on a Sprite with Region, it should show the Animation Panel on top.
  • Elif I had the Region Panel on top last, and click on a Sprite with Region, it should show the Region Panel on top.
  • Elif the Node I click on has no Region, but the Region was the last panel on top, it would show the second last panel that was on top
  • Elif the second last is also not applicable to the Node I click on (maybe the second last Panel on top was a Shader and the Node has no material assigned), then the third last panel is shown on top .... and so on.

Exceptions I can think of right now is when you enable/add something new, like a Shader or Region, the corresponding panel pops up immediately, as well as if you click on the AnimationPlayer Node in the Scene Panel, the Animation Bottom Panel should pop on top. There may be more exceptions, maybe clicking on Material in the Inspector should pop up Shader Bottom Panel if a shader is already assigned ...

@bojidar-bg I think that with the exception of Sprite (which need the region_rect_enabled == true first) all other could pop the TextureRegion every time they are being inspected (i.e. opened in the inspector) and region_rect == Rect(0, 0, 0, 0).

This comes from the assumption that if region_rect == Rect(0, 0, 0, 0) the region rect wasn't set yet, the TextureRegion pops as kinda of a "reminder". But once you set it, you don't need it to pop again, because you don't need to be reminded again, since you already defined it. If you need to redesign the region_rect you can either manually click on the TextureRegion tab and define the Rect or you can reset region_rect to the default value (Rect(0, 0, 0, 0)) in the later case the TextureRegion tab would automatically pop again.

So the "popping" of the TextureRegion acts as a handful reminder that only pops when you need to be reminded that, currently, rect_region isn't defined. And this principle is true to every thing that has region_rect property. In the case of the Sprite node you just need region_rect_enabled == true first.

What do you think?

@henriiquecampos This sounds like a good suggestion (even for sprite, where it could again pop up only for Rect(0,0,0,0)). I will try to implement it one of those days :smiley:

Very dificult to control. If one has a sprite a texture region and a shader at the same time and the editor insists on showing only the shader, there is no way to edit the region.

There are other problems:

  1. If the sprite as a region and a shader and the editor insists on showing the shader, there seems to be no way to edit the region
  2. If the sprite has a shader, the shortcut keys act on the shader. As an example, to duplicate a sprite, its necessary to close the shader and then press Ctrl+D. Otherwise, the editor duplicates a code line from the shader.

There are other problems:

1. If the sprite as a region and a shader and the editor insists on showing the shader, there seems to be no way to edit the region

2. If the sprite has a shader, the shortcut keys act on the shader. As an example, to duplicate a sprite, its necessary to close the shader and then press Ctrl+D. Otherwise, the editor duplicates a code line from the shader.

I really think we should just integrate the shader editor in the Script Editor for once.

@henriiquecampos This means one wouldn't be able to preview the shader in real-time anymore, though.

Hmm that's true, it would need to be saved and to switch to the 3d/2d view, right? 馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spooner picture Spooner  路  3Comments

ducdetronquito picture ducdetronquito  路  3Comments

EdwardAngeles picture EdwardAngeles  路  3Comments

RebelliousX picture RebelliousX  路  3Comments

gonzo191 picture gonzo191  路  3Comments