Search Unity

Can't save scenes into packages, can't load scenes from packages

Discussion in 'Package Manager' started by Kylotan, Nov 30, 2018.

  1. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    1. The Unity editor does not allow me to save a scene outside of the Assets directory, so creating and working on packages with scenes included is difficult. It's possible to manually move it (and the meta file) to a package but then...
    2. ...if I have a scene in a package visible in the Project view and double-click it, nothing happens and it does not load. (It is, however, possible to drag the scene into the current scene to load it additively, and then remove the other scenes that were loaded. This might be a feasible workaround for getting the scene into the build or working on it, but it's very inconvenient.)
    Are these known issues, and are there plans to fix?
    (Forgot to mention, this was tested on 2018.2.17f1)
     
    Last edited: Nov 30, 2018
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Kylotan,

    Scenes are not supported in packages. If you could share your use case, it would be helpful to understand why you need them in a package.

    Thank you!

    Pascal
     
  3. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    Sample use cases:
    1. to distribute a demo scene with my code package to demonstrate how it works
    2. to sell an asset package that contains a full environment that you can open up and play
    3. to use the package system to share a scene across different programs (e.g. a separate client and server app that reference the same zones, each zone stored as a scene)
    You can hack around some of this with prefabs, but it's nowhere near as convenient - you get a superfluous object you don't want, you can't load them asynchronously, you need to create another scene to inject them into, etc.
     
    Novack likes this.
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Package Manager UI will support samples. We are building a complete UX for this use case. I'll make sure you can edit the scene when embedding your package for authoring the samples.

    Thanks for sharing your use case!

    Pascal
     
  5. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    My issue isn't really with the Package Manager UI, just about the package system in general, so I'm not really sure how to interpret the comment above in the context of my needs.
     
  6. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hum. I may have pushed the _send_ button to quickly. I read your use cases again and I understand why my comment is a bit out of context. Sorry.

    Your use case #3 is a bit more complex. My previous comment applied only to #1 and probably #2. I would say #3 is the type of use cases that we will address after enabling the new package format on the asset store. I cannot give you an ETA at this time though.

    So to repeat, for #1 and #2 we have plans to support these use cases (either through interfaces in the Package Manager UI or somewhere else in the editor).

    Regards,

    Pascal
     
  7. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    I'd like to mention that I was surprised big time when read here that scenes are not supported. I have script assets in the store that include scenes for tutorials, demos, or examples. Scenes are widely used on the asset store packages.

    @okcompute_unity would you elaborate on what "samples" are, and how they relate to the need of including scenes on the packages? I still dont understand how it all relates to the PM UI.

    Thanks :)
     
  8. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Novack,

    Packages are *read-only*. The content cannot be altered by users. This is not nice for samples. To enable package authors to provide samples with their package, the can bundle assets inside a special *Samples~* folder (This folder is not visible in the project browser). Note that this pattern will soon be documented. The Package Manager UI will expose an interface to select and copy sample assets into the project. This mimics the behaviour of the previous package manager system (.unitypackage). Once an asset is under the *Assets* folder, users have complete ownership and they can alter it as they wish.

    In that context, scenes will be allowed and this will cover your use cases I believe.

    Notes that scenes can be opened in an *embedded* packages since they are not *read-only*. Embedded packages are packages physically located under your project *Packages* folder (Doc on this topic is coming soon too :) ).

    Does this help you?

    Regards,

    Pascal
     
    Novack likes this.
  9. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    What about packages located elsewhere on your disk, but not in the package cache? As I wrote earlier in the thread, these usages weren't supported by the editor either.
     
    Novack likes this.
  10. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Pascal, thank you very much for the extended explanation. Indeed, those looks like some great solutions to the scenario.

    Both, samples and embedded packages, look like things that will solve the use cases I was worried about. Im looking forward to get access to it, and its docs. :)

    Thanks again!

    @Kylotan the UPM UI already lets you load any package from disk (at least on 2018.3), if that is what you're asking. So you can manually add the package to the manager and from that point on, the solutions described by @okcompute_unity above would handle the rest.
     
  11. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    @Kylotan, yes I forgot about *local packages*. As *embedded* packages, these are writable packages. Opening a scene from these packages will work too.
     
    Novack likes this.
  12. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    You say it will work but as I noted in my first post, several aspects of that do not work, at least with 2018.2. However I have not tried with 2018.3 yet. Are the 2 problems in my first post fixed?
     
  13. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    @Kylotan When answering the question, I looked at the *latest* source code in our repo. Opening a scene in an *embedded* or *local* package was fixed recently and will be available starting in Unity 2019.1.x release. Sorry for the confusion and thanks for making me clarify the timeline!

    Pascal
     
    Kylotan likes this.
  14. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    Thanks Pascal, looking forward to seeing it in a future release, even if I might not be able to use it on this project. :)
     
  15. supron

    supron

    Joined:
    Aug 24, 2013
    Posts:
    67
    What about packages hosted in git repository? I'd like to modify scene and then push to git as package.
     
  16. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    @supron It will fail. Git packages are treated as *immutable* like a registry package.

    Internally, we allow distribution of scene in packages only for the _sample_ use case. We have a flow for that in the Package Manager UI that is undocumented for now. If this is interesting for you, I would not mind explaining to you how to set up samples in a package and make the sample button show up in the package manager UI.

    Pascal
     
    Novack likes this.
  17. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    I am definitively interested! (Also, please clarify the Unity version in which that is available :) )
     
  18. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    @Novack Ok, Let me see what I can do.
     
    Novack likes this.
  19. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
  20. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Thanks a ton Pascal.