Is there a way to take an object out of one scene, say a companion scene, and move it into the primary scene?
I've tried:
Code:
NovaScene nScene = PluginHelper.ActiveScene;
NovaScene companion = NovaEngine.CreateScene("CompanionScene");
companion.Load("source.mxb");
nScene.CompanionScene = companion;
NovaObject testObj = companion.GetObject("testBox");
NovaObject newObj = (NovaObject)testObj.Clone(true, Vertice.Nova.NovaResourceManager.GenerateGuid( i, nScene ));
nScene.Objects.Add(newObj);
That seems like it works, when I refresh the entities browser the new objects are listed, but nothing new is rendered. Perhaps there is another step beyond nScene.Objects.Add?
I also tried:
Code:
NovaObject obj = nScene.CreateObject("new");
obj.CreateFromMesh(testObj.OriginalMesh, true);
But I get a null reference error somewhere in the DirectX code. I am thinking it is because obj.Indices is empty, however I cannot assign to that, so I'm not sure how else to go about creating a new mesh.
?
I guess in the meantime I'll just go back to having everything in one scene and managing objects there, I kind of liked the flexibility of having a "source objects scene" and then an empty scene that could be populated via code though...