How to detect whether a SceneNode/layer has been modified using XD API?

Hey there,

Given a reference to a SceneNode, I’d like to check whether it has been modified since the last time I checked it. I’ve checked all API docs to no avail. Is there any property which would track the last modified timestamp or a change count for each SceneNode?

The use case:
The user can select and upload a renditions of a layer which is then shown within the plugin. If the user then modifies the actual layer in the document, the plugin should detect the change and allow the user to upload the latest version of the layer. Ideally, the SceneNode modified timestamp/change count could be stored when uploading and then simply checked to see if it’s different.

Hopefully avoidable workaround:

  • Create a new rendition of each uploaded layer at an interval and compare the pixel data of stored rendition with new rendition

Thanks in advance!

1 Like

Another thought:

Is it possible to somehow get a unique hash for the layer in its current state without creating a rendition?


1 Like

Hi Lukas,

You can use the update() command to see what scenenode has been selected.

It may or may not have changed though. You could do a changed properties check on each update and create your own hash.

If you’re wanting to compare pixel data you might have to wait for a native API to be added. There are external libraries that can do it but they are relatively slow (some notes on the forums here) and it may interfere with the user interaction to run a compare on each update. YMMV