Unity-Technologies/usd-unity-sdk

Error "It is not allowed to open a scene in a read-only package" when Package added via Git URL

CraigHutchinson opened this issue · 1 comments

When a Unity Package is added via Git URL https://github.com/Unity-Technologies/usd-unity-sdk.git?path=package/com.unity.formats.usd (syntax), then the package is marked Read-Only. Presently the 'Samples' are not catalogued within the package.json so there is no import button in the package manager.
image

#320 exists to resolve this deficiency

Hi Craig, thank you for flagging this discrepancy. Unfortunately, this is a side effect of the package publishing workflow at Unity which doesn't currently allow seamless samples usage in both packages fetched by git URL and packages installed by tarball. The documentation you refer to is targeted at users writing packages without this automated flow, who write the package.json manually.

The package publishing CI fixes the package.json in the tarball version of the package to reference the samples, and modifies the Samples folder to Samples~, so that it is not imported for every installer of the package. If we change the package.json to point to the Samples folder manually, this will be broken during publishing due to the folder changing. If we also rename Samples to Samples~, this will make it less efficient to modify samples (due to them being non-importable) for developers. This may be fixed in future, but is a limitation we have to work around currently.

I'd suggest working around this for now by symlinking or copying the samples folders you're interested in into your project directly so that they import as local files. And I will update the documentation in this repo to improve the coverage on the samples :)