Request: IPC events documentation

Request: IPC events documentation
0.0 0

#1

TL;DR: Please give us documentation on every IPC event that is broadcast by the editor.

It is documented here: Introduction to IPC that in scripts we can broadcast and listen to IPC messages to send messages between panels. This is based on the Electron framework, and works well for extensions.

However, for building more advanced extensions, it would be very nice to be able to listen to the events created by the editor itself. For example, let’s say my extension needs to import assets into the project assets folder. As documented in the old 0.71 API reference, we can use code like this:

Editor.assetdb.import( [
‘/file/to/import/01.png’,
‘/file/to/import/02.png’,
‘/file/to/import/03.png’,
], ‘db://assets/foobar’ );

But how do I know when it is done importing? Or even if it was successful or failed? There is no callback function.

Probably, the editor broadcasts events on certain channels over IPC. Like in the above example maybe “Assets:Created”. If we could have a list of all editor broadcast events that we can listen to, that would make it much easier to extend the editor.

Thanks.


#2

Not sure anyone cares about this (because no replies) but I finally found this info in the Chinese version of the documents.

File System

Asset-db: assets-created
(When a new file is created, assetDB will send this event.)

Asset-db: assets-moved
(This event is sent if a file is moved within the project folder.)

Asset-db: assets-deleted
(This event is sent when a file is deleted.)

Asset-db: asset-changed
(If the file is modified, this event will be sent.)

Asset-db: script-import-failed
(This event notification is sent when an error occurs while importing a script.)

Scenes

Scene: enter-prefab-edit-mode
(This message will be sent when the scene enters the prefab edit state)

Scene: saved
(When the scene is saved, it will send the message)

Scene: reloading
(This message is sent when the scene is refreshed for special reasons)

Scene: ready
(When the scene is ready it will send this message)

Compile

Editor: build-start
(It will send this message when it begins to compile)

Editor: build-finished
(It will send this message when it is done compiling)

Builder: state-changed
(When the compiler state is changed, this message is sent)

Builder: query-build-options
(When the build options are viewed)

There is more info on the page about some hidden messages that are sent to open panels and the like. You can check it out at the page address linked above and translate using Chrome / Google Translate.I find that there is much more info in the Chinese version of the docs, and am learning things, even with spotty translation.


#3

In fact, I do not care, since I do not use Cocos Creator.
BUT it always causes respect when people share a solution to a problem, found documents, etc.


#4

Hi, I dont need IPC events for my game production process, but I do appreciate the work you’ve done. And thank you for sharing it!. Thanks!!


#5

Glad to provide a little info, hopefully someone finds it useful. :+1: