[SOLVED] Tutorial for writing a PlayCanvas Editor Extension

Hi @Patrick_Munster, indeed it is relatively easy to start extending the PlayCanvas editor. Even though there isn’t any documentation right now and as @vaios said the API is prone to change, you can get started now.

The PlayCanvas editor source code is not minified on purpose:
https://playcanvas.com/editor/scene/js/editor.js

You can open up the browser console and type in Javascript that will directly run in the context of the editor. Try this, a simple script that will return a list of all children entities to your Root element:

var itemRoot = editor.call("entities:root"); 

itemRoot.entity.children;

And this will give you access to the pc.Application instance running in the editor:

var pcApp = editor.call("viewport:app");

Here are a couple of useful threads to find more info:

And some example scripts you can find here:

3 Likes