[SOLVED] Merging projects

Yes, you can use the method that the Editor uses when duplicating a material:

  1. Open up your PlayCanvas editor
  2. Fire the JS console.
  3. Copy paste the following code replacing the JSON in the data property with your material JSON.
// create a simple red material asset
// this method will work only with material assets
editor.call('assets:create',{
    type: 'material',
    name: 'Material Name',
    tags: null,
    source: false,
    data: JSON.parse('{"diffuse":[0.0,0.5,1]}'),
    preload: true
});

Note: as @yaustar noted all that is undocumented API, prone to change at any time.

2 Likes