Page MenuHomeFeedback Tracker

[Feature Request] Comprehensive getter for cameraEffect
New, NormalPublic

Description

Currently we have no command to get which is the main camera, or if there is an activated r2t camera.
Something I imagine:

allCameras;
/*
	[
		[camera object, effect name, effect position, r2t name, viewmode (Normal/NV/TI), TIMode, isPrimary (the primary camera)],
		...and so fourth
	]
*/

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

POLPOX created this task.Mar 25 2024, 9:13 AM
dedmen set Ref Ticket to AIII-56356.Thu, Apr 25, 3:11 PM
dedmen added a subscriber: dedmen.Thu, May 2, 12:11 PM

effect is meh.
R2T sources have their own effect, otherwise there is only one global camera effect. Not per-camera.

There also is no per-camera viewMode, there is just one global one, same for setCamUseTI..
The postprocess effect on the R2T camera, contains information about nightvision/Ti mode. So we can add that to the r2t info.

And one camera can have multiple R2T sources.
So maybe like
[camera object, [r2tInfo, r2tInfo, ...], isPrimary(, effect name, effect position, viewmode (Normal/NV/TI), TIMode)] (effect, viewMode, TiMode only available if isPrimary is true)
r2tInfo = [r2t name, effect name, effect position, viewmode (Normal/NV/TI), TIMode]

So a camera can have zero or more of r2tInfo's.

I'm not sure how to detect what camera is "primary"
Every cameraEffect has a camera assigned, so I assume when any cameraEffect is active, its assigned camera will be the primary.

efffectPosition is not viable.
"Internal" never uses it and doesn't store it.
"Chained" does store it.
"External" calculates many 3d world positions using it dependent on where the camera was when the effect started, and does not store the original input.
"Static" calculates one 3d world position using it, and doesn't store the original input
"StaticWithZoom" is same as Static.
I could give you a 3D world position for some of these, but I don't think it's worth much is it?

Also this naming mess ugh.
Wiki "FixedWithZoom" Engine1 "CamStaticWithZoom" Engine2 "CameraEffectTracking"
Getting the effect name is also hard, you would expect the config classname. But all we store is the type number.
So if some mod or campaign config adds a new one there, we wouldn't know which to choose.. I'll just hardcode the current names, if anyone edits that config it'll be wrong.

Nightvision and Ti can both be active at the same time?? wow.

There is also this thing https://community.bistudio.com/wiki/showCinemaBorder which is global only for non-r2t cameraEffect.

dedmen added a comment.EditedThu, May 2, 2:45 PM

[[5: <no shape>,[["rtt2","Internal","Thermal",7],["rtt1","Internal","Normal",0]],false]]

There might be no primary camera, if the camera is on a non-camera vehicle.
Like example 4 https://community.bistudio.com/wiki/cameraEffect

Replacing the object by camCreate yields:
[[5: <no shape>,[["rtt2","Internal","Thermal",7],["rtt1","Internal","Normal",0]],false],[6: <no shape>,[],true,"",0,0]]

I guess if the primary camera is not actually a "camera" but instead an object, it should list the object anyways

[[6: <no shape>,[["rtt1","Internal","Normal",0]],false],[12d0e3d2b00# 7: handycam_f.p3d,[],true,"",0,0]]
That means its never empty
[[B Alpha 1-1:1 (dedmen),[],true,"",0,0]]
Hunter GMG looking through gunner camera
[[B Alpha 1-1:2 (dedmen),[["rendertarget0","Internal","Normal",0],["rendertarget1","Internal","Normal",0],["rendertarget4","Internal","Mirror",0],["rendertarget5","Internal","Mirror",0]],true,"",0,0]]

I would expect the camera mode of "GUNNER" to be reflected there somehow.
But we have https://community.bistudio.com/wiki/cameraView for that

Hm objects cannot have camera effect nor nvg/ti. So passing that info is a bit useless.
But its simpler to say "if primary == true" then they are there. Even if useless.