I'm trying to follow the example from this post on Blender Stack Exchange: Example of persistent usage of «bpy.msgbus» and how to manage it?
I want to catch the event when a color has been added to a Palette. I have tried
subscribe_to = bpy.types.Palette, "colors" and subscribe_to = bpy.context.tool_settings.image_paint.palette.path_resolve("colors", False), but neither has worked. Can anyone please advise how I may detect when a Palette's colors have changed? Thank you!
subscribe_to = bpy.types.Palette, "colors"
bpy.msgbus.subscribe_rna(
key=subscribe_to,
owner=subscription_owner,
args=("a", "b", "c"),
notify=notification_handler,
options={"PERSISTENT",}
)
If anyone knows of an alternate way to listen to this change, I'd appreciate learning it! The article says message bus DOES work with changes in the Python API, so
– Dr. Pontchartrain Jul 21 '23 at 04:24bpy.context.tool_settings.image_paint.palette.colorsshould work.