kAIXMLNameChangedNotifier behaviour change
The following code worked perfectly in 2015, 2015.1, 2017 but in 2018 it broke.
My notifier is created like so :
error = sAINotifier->AddNotifier(fPluginRef, kCinewarePluginName, kAIXMLNameChangedNotifier, &fUIDChangeNotifier);
It is correctly triggered on the renaming of an art element. This then calls the following code :
ASErr ArtSelectionRenamedNotifier(AINotifierMessage message)
{
ASErr error = kNoErr;
fprintf(stderr,"ArtSelectionRenamedNotifier\n");
//First get the AiArtHandle
AIPluginGroupMessage myMessage = (AIPluginGroupMessage*)message;
fprintf(stderr,"ArtSelectionRenamedNotifier msg type[%s]\n",message->type);
//The relabelled art
AIArtHandle relabelledArt = myMessage->preEditArt;
fprintf(stderr,"ArtSelectionRenamedNotifier msg preEditArt[%p] is valid Art?[%s]\n",relabelledArt,sAIArt->ValidArt(relabelledArt, true)?"YES":"NO");
//Verify it has a UID
ai::UnicodeString relabelledArtUUID;
//The artUIDName will be empty if not yet made
if (relabelledArt)
{
error = sAIUIDUtils->GetArtUIDName(relabelledArt, relabelledArtUUID);
}
fprintf(stderr,"ArtSelectionRenamedNotifier msg preEditArt[%p] UUID[%s]\n",relabelledArt,relabelledArtUUID.asUTF8().cstr());
The above code works perfectly in 2017, 2015 and 2015.3 :
ArtSelectionRenamedNotifier
ArtSelectionRenamedNotifier msg type[AI XML Name Changed Notifier]
ArtSelectionRenamedNotifier msg preEditArt[0x157287b80] is valid Art?[YES]
ArtSelectionRenamedNotifier msg preEditArt[0x157287b80] UUID[Green]
Then in 2018 and (22.0 and 22.1) :
ArtSelectionRenamedNotifier
ArtSelectionRenamedNotifier msg type[AI XML Name Changed Notifier]
ArtSelectionRenamedNotifier msg preEditArt[0x10003e501] is valid Art?[NO]
Segmentation fault
The seg fault occurs inside the GetArtUIDName, no doubt as the art in invalid.
If this is intentional behaviour, can it be detailed how to get the arthandle that has changed?
Kind Regards,
R