godot-resources-as-sheets-plugin icon indicating copy to clipboard operation
godot-resources-as-sheets-plugin copied to clipboard

Godot v4.2.1.stable.official [b09f793f5] Errors on opening table view

Open tivec opened this issue 1 year ago • 6 comments

Hello, I am getting a lot of errors whenever I open up the tab for the ResourceTables.

Plugin version reported as 2.7 in the plugins view, installed from the Godot AssetLib Using Godot v4.2.1.stable.official [b09f793f5]

 res://addons/resources_spreadsheet_view/import_export/formats_edit/edit_tres.gd:8 - Invalid get index 'entries' (on base: 'Resource (BattleUpgradeTechUnlock)').
 res://addons/resources_spreadsheet_view/typed_cells/cell_editor_array.gd:18 - Invalid call. Nonexistent function 'size' in base 'Nil'.

The errors are all in the shape as above. I have removed all filters, but this seems to happen whenever I select a directory that contain mixed resource types or in its sub folders.

It also corrupts the view whenever the errors happen, see below video where I switch to a directory that only contains one type, and then as I switch back to its parent that has a lot of different types in its subdirectories: https://github.com/don-tnowe/godot-resources-as-sheets-plugin/assets/717574/01e3acb8-8695-4cb5-a3f2-bd6eb718f4a0

tivec avatar Feb 23 '24 07:02 tivec

mixed resource types

Yeah, that's not here yet.

#38

don-tnowe avatar Feb 23 '24 11:02 don-tnowe

mixed resource types

Yeah, that's not here yet.

#38

Yes, I am aware of this. However, this error continues to happen even if I put in a filter that would filter down to the type I want...

https://github.com/don-tnowe/godot-resources-as-sheets-plugin/assets/717574/c8449b25-6802-436d-bf92-58e4eff2d6dc

tivec avatar Feb 23 '24 14:02 tivec

I just implemented editing with several types, so I'd like to know if it works now. Branch:

https://github.com/don-tnowe/godot-resources-as-sheets-plugin/tree/Godot-4

Does it work fast if you have lots of resources? Does it create any errors when opening/editing/multi-selecting?

don-tnowe avatar Feb 23 '24 14:02 don-tnowe

I just implemented editing with several types, so I'd like to know if it works now. Branch:

https://github.com/don-tnowe/godot-resources-as-sheets-plugin/tree/Godot-4

Does it work fast if you have lots of resources? Does it create any errors when opening/editing/multi-selecting?

With a directory of 71 .tres files, it takes a few seconds for it to refresh, but after that everything is snappy. Trying to open up a folder with around 150 .tres files of a variety of types, some with a lot of fields, takes... a long time and finally spit out: res://addons/resources_spreadsheet_view/main_screen/selection_manager.gd:89 - Out of bounds get index '93' (on base: 'Array[Object]')

Would it be possible to somehow collect the types of resources and put it in a dropdown so you only edit one type at a time, or is that a limitation until we are able to use the 4.3 goodies of getting class names?

tivec avatar Feb 23 '24 17:02 tivec

Hmm, you made me test it for performance myself - it does seem to be worse than the old method, but only because of 2x as many cell editors being instantiated. Adding more rows has the same reload time, but merging another folder made it 2x slower.

The error indicates that a cell editor didn't instantiate. But also that you have at least 93 properties, wow, which is likely causing the performance hit. I'll work on making column hiding (arrow on column header -> Hide) improve performance. I've detected a handful more problems, and will try to fix these.

A dropdown of resource types is actually planned and in fact already possible, but it might need more work as a proper feature. One might need to filter for a class AND all subclasses, so the feature might require more work to detect if a resource's class is a subclass of the filtered class. Didn't know of that 4.3 feature, though - that might allow querying ClassDB for inheritance! Or just read the script contents without using that.

don-tnowe avatar Feb 23 '24 18:02 don-tnowe

You're doing good work, absolutely appreciate this addon :) I'll keep an eye on the upcoming changes :)

tivec avatar Feb 23 '24 19:02 tivec