we want to implement a tool which extracts the information of a snapshot. To be more specific, we would need the position, layer state and visibility of an object in a snapshot. Also we would like to compare snapshots, if there is a difference in transformation of an object. So it would be great if we could retrieve this information without restoring the snapshot and analyze the document.
My question: is there a way to get this information via C++ SDK?
another approach would be to implement our own snapshot client. Unfortunately the documentation is not that clear to understand how to use IRhinoSnapshotsClient. I achieved to register it and to get the callbacks. But i’m struggling to save the snapshot data in the document with the buffer. Do you have any example in C++ for this?
about 2) how about the RestoreObject, SaveObject and ObjectTransformNotification. i got it working for one snapshot, but if there are more snapshots everything gets messed up. Do you have any example there?
Remove the code from the ObjectTransformNotification function. You can use the transform xformObject which is getting passed into the RestoreObject function instead. xformObject are all transforms which got applied to the object since it got into contact with Snapshots. In RestoreObject you could read your xform out of the buffer as you already do and multiply it with the inverse of xformObject.
Wow, it’s so easy if you know what the parameters are for.
@lars i have still on point to finalize my feature: i need to know this specific data in the “buffer” from the SaveObject in relation to the snapshot itself, so that i can say “Snapshot 01” has the same transformation as “Snapshot 02”.
At the moment i could store the information of the buffer in an array, but i have no idea which snapshot belongs to which transformation in the array? Because the interface IRhinoSnapshotsClient does not give me a name of the snapshot. Also i’m not aware if the name of a snapshot changes.
Do you have any clue how i can fill the gap and find a link between the “buffer” data and the snapshot, or to be more specific: do you know how i can find the current saving and restoring snapshot name in SaveObject and RestoreObject?