01-26-2019, 01:57 PM
It's my understanding that art objects can be stored in a dictionary, either document dictionary or another art object's dictionary. I tried this two ways.
- A function is passed the argument hdi::core::Art* theArt, which is a path art object.
- Variable myDict is my dictionary with a document or art object dictionary.
Either way, recoverArt has an aiArtHandle and the original XML ID, but is empty and not valid. Ideally, I'd like to store a backup copy of art before it's transformed, to make it easy to do a perfect Undo at any time in the future. Am I misunderstanding how this works, or am I doing it wrong? Any suggestions would be much appreciated.
- A function is passed the argument hdi::core::Art* theArt, which is a path art object.
- Variable myDict is my dictionary with a document or art object dictionary.
Code:
hdi::core::Art recoverArt;
bool success = myDict.setArtEntry("XMLID_12_", *theArt);
theArt->dispose();
success = myDict.getArtEntry("XMLID_12_", recoverArt);
Code:
hdi::core::ai::Entry artEntry = hdi::core::ai::Entry::FromArt(*theArt);
success = myDict.setEntry("XMLID_12_", artEntry);
theArt->dispose();
success = myDict.getEntry("XMLID_12_", artEntry);
success = artEntry.asArt(recoverArt);
Either way, recoverArt has an aiArtHandle and the original XML ID, but is empty and not valid. Ideally, I'd like to store a backup copy of art before it's transformed, to make it easy to do a perfect Undo at any time in the future. Am I misunderstanding how this works, or am I doing it wrong? Any suggestions would be much appreciated.