Page 1 of 1

Spawned prefabs not rendering in Octane

PostPosted: Mon Mar 25, 2019 6:14 pm
by bwatanabe
I'm dynamically adding prefabs to my scene using instantiate via C#, and rendering frames using Octane Recorder.
When I record, I can see the objects in the Editor, but they aren't appearing in the rendered/output image.

If I add these prefabs manually in the editor, they render as expected.

Is it possible to render dynamically spawned in Unity via Octane?

Re: Spawned prefabs not rendering in Octane

PostPosted: Tue Mar 26, 2019 10:30 am
by ChrisHekman
That is an interesting problem. I tried to recreate the issue by making a script that intantiates a prefab, but that worked on my end.
Could you share your scene with us? PM it to me?

Re: Spawned prefabs not rendering in Octane

PostPosted: Tue Mar 26, 2019 5:12 pm
by bwatanabe
Thanks Chris. I'll send a project when I get home, as well as the version of Unity and Octane that I'm using. Good to know it should work, though!

Re: Spawned prefabs not rendering in Octane

PostPosted: Wed Mar 27, 2019 1:36 am
by bwatanabe
Hi Chris, I'll still send you a project to test, but I think I found the issue.
If I put an instance of each game object into the scene Hierarchy that I want to spawn via code, the cloned / instantiated copies will appear in the Octane render. If not, the items appear in the Unity editor window but not the Octane render.
I wonder if a reference to each mesh needs to be on screen when the scene starts for Octane to render future copies?

Re: Spawned prefabs not rendering in Octane

PostPosted: Wed Mar 27, 2019 3:14 pm
by ChrisHekman
So apparently unity has a Read/Write flag for model assets. This is turned off for your model assets.
To fix the issue you need to turn it on.
MeshReadWrite.png


Otherwise unity will refuse OctaneUnity access to the mesh data.
Code: Select all
Not allowed to access triangles/indices on mesh 'Prop_Game_Console' (isReadable is false; Read/Write must be enabled in import settings)


Strangely, unity only gives this error when the mesh data is accessed from a monobehaviour script.
Since we use a unity component for the recording process to drive updates, this error only happens while recording.

I'll see if there is something I can do for the next build. But for now the fix should be to turn the read write to enabled in the import settings.

Re: Spawned prefabs not rendering in Octane

PostPosted: Thu Mar 28, 2019 6:29 pm
by bwatanabe
Great, thanks for this information, Chris.