Run a Script on Drop From Asset Browser
As part of the asset data block, there should be an optional text block link. This would be a place to include a script to be run whenever the asset is dropped onto a scene. The primary use case would be for additional setup to go along with adding a node group to an object. However, there may be other tasks you want to do when adding an asset of other types:
A couple of use cases:
-
The object the node was dropped on needs to have some named attributes added to it.
-
The node group has a collection of objects that come with it and that collection needs to be disabled immediately.
Other issues:
There may need to be a drop session variable exposed to the script that includes ID of new datablock being dropped, Location/Rotation of drop point, ID of object being dropped on, etc.
2 Comments
File browser already program's showing
The idea is that an addon can register a handle that is being triggered when an ssset is dragged, dropped etc. This hasn’t been implemented due to priorities of the developers working in that area.
Internally this is filed under the name as asset system.