Spawned prefabs not rendering in Octane

A public forum for discussing and asking questions about the Octane for Unity Alpha

Moderator: ChrisHekman

Post Reply
bwatanabe
Posts: 12
Joined: Sun Mar 03, 2019 5:18 am

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?
ChrisHekman
OctaneRender Team
Posts: 1062
Joined: Wed Jan 18, 2017 3:09 pm

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?
bwatanabe
Posts: 12
Joined: Sun Mar 03, 2019 5:18 am

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!
bwatanabe
Posts: 12
Joined: Sun Mar 03, 2019 5:18 am

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?
ChrisHekman
OctaneRender Team
Posts: 1062
Joined: Wed Jan 18, 2017 3:09 pm

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.
bwatanabe
Posts: 12
Joined: Sun Mar 03, 2019 5:18 am

Great, thanks for this information, Chris.
Post Reply

Return to “Octane for Unity”