Save a copy of a scene?

From a script, is it possible to save a copy of the scene? Based on the documentation and my experiments so far, it seems like you can provide a new file name, but when the save occurs, the "main" scene becomes the last saved scene. I would like to save off a copy of the current scene under a different name, but leave the current scene itself as-is in the UI. Is that possible to do from a script? I had considered saving a subset and just including all items in the scene in the output -- would that be the equivalent of saving the whole scene or are there things that a "save subset" does not (and can not) include that a "save scene" does?

Comments

  • barbultbarbult Posts: 24,228

    V3Digitimes SuperSave does that, and more, so I'm sure it is possible. I can't tell you how, though. I bet there is a sample script available that would help. Have you looked through thoise?

  • Richard HaseltineRichard Haseltine Posts: 100,621

    File>Save As>Scene Subset would get close, but would not include some scene-level options (and by default would merge into the current scene rather than replacing it, but a right-click on the item in a content pane would give an Open option instead).

  • It looks like SuperSave does what you'd expect in that it renames the scene file to the last save name -- either provided by the user or auto-generated in the script. In either case, the scripting for it probably relies on something like oAssetIOMgr.doSaveWithOptions(). I've used this in a number of scripts, but it doesn't save a copy so much as save the current scene with a new name and use that as the name going forward (unless you change it again with a "save as"). 

    Taking a step back, I have what I'm calling a "scene roller", which is a script bound to a key that I can press every time I want to save off a particular scene as I'm working on, with an indexed filename. This is basically the same functionality as SuperSave's "incremental basic" feature. What I want  to do next is be able to "save off" a scene to a directory, without renaming the current scene. So suppose your scene is named "MySceneA". Running the script generate scene files "MySceneA_001", "MySceneA_002", etc. but the current scene is still named "MySceneA". It doesn't look like the current scripting API lets you do that -- which I guess makes sense because the "scene" object contains common information that always needs to get carried along (i.e. the scene-level options).  

  • barbultbarbult Posts: 24,228

    SuperSave will save a new version and that becomes your current scene name. I understand now that that is not exactly what you are looking for.

Sign In or Register to comment.