2.99 PDB API: gimp-brush-new throws critical
Reproduce
In SFConsole:
(gimp-brush-new "foo")
In a debug window expect:
GIMP-CRITICAL: gimp_data_get_identifier: assertion 'private->internal || private->file != NULL' failed
But it returns a seemingly correct resource. You can call some other methods like
(gimp-brush-get-angle "foo")
And it appears to work.
(Note this is with the current ScriptFu binding of a resource to a string name. I plan to make ScriptFu bind a resource to its ID, an integer in Scheme. In my branch for that, then (gimp-brush-new "foo") seems to return an ID like 2180, but (gimp-resource-get-name 2180) also throws the above critical.)
There are two assertions like that in app/core/gimpdata.c.
Discussion
This area has recent changes and may still be under development. I might not have a correct mental model of how it should work. Maybe further development changes are coming, that I should wait for.
I understand that names need no longer be unique, and that only a collection:name pair need be unique. Anyway, I am not sure that works for the current API, unless you also require a collection name when newing. Is it possible a script wants to create a temporary brush that could be deleted before saving it in a collection? If a new brush is not internal and doesn't have a collection, will there be a method to save it in a collection? You can't get its name until it is saved in a collection?