Repository navigation
feat: SG-44467: Add support for custom brushes through a shared brush catalogue - #1496
eloisebrosseau wants to merge 13 commits into
Conversation
860e01b to
ef8900f
Compare
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
ef8900f to
6a33876
Compare
| rotateToStroke, angle, squish, hardness, flow) | ||
|
|
||
| NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(BrushEntry, name, tip, params) | ||
|
|
There was a problem hiding this comment.
Just to make sure that you really want this is to be strict: NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE requires every field. One entry missing a key (such as flow or squish) discards the whole catalogue.
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT can be used to be more resilient.
This might very well be by design. Just to make sure. Feel free to ignore.
There was a problem hiding this comment.
I thought about it but I couldn't see in what case a field would be missing since we are controlling the catalogue content, but you're right that this might be too restrictive. It think it would make sense to use NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT for BrushDefaults but I think the strict macro makes more sense for BrushEntry. Having default values there would mean other parts of the code would need to handle all those edge cases in a not so elegant way. However, I think I could catch the exception instead in parseBrushCatalogue. That way, the problematic entry would be removed from the list of available entries without making the whole thing fail. I'll try to come up with a fix!
bernie-laberge
left a comment
There was a problem hiding this comment.
Nice work @eloisebrosseau !
Thanks!
feat: SG-44467: Add support for custom brushes through a shared brush catalogue
Summarize your change.
twkpaint-srcsubmodule to get the new shaders and new custom brushes.rv_quote_file.cmakeis now takingFILENAMEinstead ofSTEMto allow differentiating between fragment and vertex shaders that are only different when looking at their extension name (i.e. .vert and .frag).in_Opacityto the vertex attributes inbuildStampQuadsthat is needed by the new texture shaders from the twkpaint-src submodule. Note thatbuildStampQuadswas cleaned up at the same time for readability purposes, so no other changes were made to its previous behaviour. The cleanup was mostly related to moving it to an anonymous namespace with itsStampQuadsstruct, renaming variables to more descriptive names, and adding named constant variables to magic numbers.BrushCatalogueclass to parse the catalogue.json file from twkpaint-src and give access to its content.Describe the reason for the change.
We need to support accessing the brushes' default values defined in https://github.com/AcademySoftwareFoundation/OpenRV-annotation to eventually expose the custom brushes feature to the new annotation UI.
Describe what you have tested and on which operating system.
Drawing with custom brushes from the catalogue was tested on macOS 26.3, Rocky Linux 9 and Windows 11. Note that this was done by calling the RV command to access the catalogue's entries and by hardcoding values for the brush properties. The real connection to the UI will be added in another PR.
Add a list of changes, and note any that might need special attention during the review.
Note that two remaining fixes will be added in follow-up PRs since they add new behaviour:
ghostOpacitywith the stroke opacity instead of overriding it for ribbon, stamp, text and shape rendering paths. Right now, the ribbon path replaces the stroke alpha withghostOpacityand the stamp path ignores it completely.twkpaint-srcsubmodule so Open RV can build its TwkMath instead of the one currently in the repo.