XD 28 new plugin APIs

XD 28 adds a few small new APIs for plugins:

  • New SceneNode.BLEND_MODE_* constants for use with the SceneNode.blendMode property (which was introduced in XD 27).

  • Quickly look up a scenenode by its GUID with scenegraph.getNodeByGUID(guid) – useful for persistently remembering a node across plugin operations and even across document open/closes.

  • Easily check if a scenenode is currently in scope for editing with selection.isInEditContext(node) – useful if you want your plugin to traverse a whole subtree and edit as much of it as possible without risk of throwing an error.

Note: the new interaction types introduced in XD 28 (audio-file playback & “scroll to” actions) are not exposed to plugins yet. Several other interaction types already have the same caveat – see interactions API documentation for a complete list.

Further reading

As always – happy plugin building!

7 Likes

All excellent and some of them even old requests–thanks!

Is scenegraph.getNodeByGUID really fast as in hash-table-ish fast?

Is scenegraph.getNodeByGUID really fast as in hash-table-ish fast?

Yep! It is much faster than traversing the whole tree to search for the node matching that GUID, which was the only thing plugins could do before this.

3 Likes

scenegraph.getNodeByGUID(guid)

This is really useful

2 Likes

Yes, it’s deadly useful for building data structures outside the scenegraph that need to reference nodes without using real object references.

3 Likes