disguise-one / RenderStream-UE

RenderStream plugin for Unreal Engine
BSD 3-Clause "New" or "Revised" License
69 stars 23 forks source link

Provide an interface for dynamically spawned cameras #33

Closed ooploopl- closed 1 year ago

ooploopl- commented 2 years ago

There is no proper way provided to find copied cameras while the stream is running. Plugin copies the cameras with definitions but does not cache or expose the copied object. On top of that, even if i find the spawned camera i'm only able to adjust settings of only one camera. As of now, i'm suggesting stage operators to use multiple renderstream layers if they want to control settings of that streaming camera. Which is frowned upon.

By adjusting settings i meant; being able to reach post process settings of a spawned camera.

husberg-disguise commented 2 years ago

There's a "GetInstancedCameras" blueprint function. Is that what you're looking for?

ooploopl- commented 2 years ago

There's a "GetInstancedCameras" blueprint function. Is that what you're looking for?

I have already tried to use that function. It has the exact same problem. In fact i already implemented solution like this as i mentioned. I just wanted to suggest having such feature in this plugin will make our work easier without any quick hack that forces operators use multiple renderstream layers solely to control mapped cameras seperately.

MunWolf commented 2 years ago

"GetInstancedCameras" on the definition component does return the copied cameras, if the function is not returning cameras for you to change it may be that you are doing it too early and the cameras haven't been instanced yet.

If you have a look at the most recent release on github https://github.com/disguise-one/RenderStream-UE/releases/tag/r1.27-rc1-UE4.27.1 we also added the "OnCameraInstanced" event that gets triggered on the original camera when its copied (providing the new instance as a parameter) and an "IsInstanced" helper function that you can use on a camera to check if it is instanced or not (useful if you attach a blueprint to the camera and want it to behave differently if it's instanced)

If any of these don't work for you I would be interested in knowing the exact issue you are having with them.

ooploopl- commented 2 years ago

"GetInstancedCameras" on the definition component does return the copied cameras, if the function is not returning cameras for you to change it may be that you are doing it too early and the cameras haven't been instanced yet.

If you have a look at the most recent release on github https://github.com/disguise-one/RenderStream-UE/releases/tag/r1.27-rc1-UE4.27.1 we also added the "OnCameraInstanced" event that gets triggered on the original camera when its copied (providing the new instance as a parameter) and an "IsInstanced" helper function that you can use on a camera to check if it is instanced or not (useful if you attach a blueprint to the camera and want it to behave differently if it's instanced)

If any of these don't work for you I would be interested in knowing the exact issue you are having with them.

I will make use of the events later and share the results of my tests as soon as possible. The issue i mentioned might be related to a bug in D3 instead of Renderstream plugin.

Edit: DSOF-16425 might be related.

ooploopl- commented 2 years ago

I've tried to make use the events. It resulted in exact problem. I can only manage single camera per renderstream layer.

I made very simple test case. Using the events i captured the camera instance. Then changing the color temperature to a definitive value.

Single renderstream layer, two cameras, Color temperature should be same in this case it wasn't.

https://user-images.githubusercontent.com/8154511/142846509-fd75c332-0553-422c-a561-aef130aed48f.mp4

Multiple renderstream layer, multiple cameras

https://user-images.githubusercontent.com/8154511/142847486-ee7216e0-be8d-4042-817b-5fb6afff5f39.mp4

MunWolf commented 2 years ago

Could you please send me the minimal d3 and unreal project you have the reproduces this issue?

ooploopl- commented 2 years ago

Sure, let me know if you need anything else.

UnrealProject

D3 Project

ooploopl- commented 2 years ago

D3 r20 doesn't have this issue at all.

ooploopl- commented 2 years ago

On camera instanced event returns non related dummy camera that appears to be somehow spawned but not being used on Unreal Engine 5 with latest r21 renderstream plugin for UE5. Channel name is always the type camera plus the index of this camera. e.g. CineCameraActor_0 and so on.

I think this is likely related to Unreal Engine 5 rather than the plugin itself events were working fine UE4 and channel names were consistent.

To produce;

r1.29_UE5.0_r21.0_v3 #52 is revelant @MunWolf

MunWolf commented 2 years ago

New release with the fix for #52 is out https://github.com/disguise-one/RenderStream-UE/releases/tag/r1.29_UE5.0_r21.0_v4 Let me know if you still have any issues with it.

ooploopl- commented 2 years ago

New release with the fix for #52 is out https://github.com/disguise-one/RenderStream-UE/releases/tag/r1.29_UE5.0_r21.0_v4 Let me know if you still have any issues with it.

Issue continues channel names are ignored.

MunWolf commented 2 years ago

Yeah sorry, seems like the issue wasn't fully resolved as they changed how actor labels were handled in UE5. v5 should have it fixed.