llSetKeyFramedCamera
tracked
Nexii Malthus
## Proposal
Very familiar syntax per
llSetKeyframedMotion
but for moving a camera through space with various options.* Client-side moves smoothly through the keyframes specified
* KFM mode equivalent options available for e.g. forward, reverse, loop, ping pong
* KFM command equiv to pause, resume, stop
* Meant to be a single elegant function that achieves several usecases and familiar syntax
llSetKeyframedCamera
overrides (higher priority) but does not replace llSetCameraParams
. If llSetCameraParams
is set then pressing ESC should disable the keyframed camera and resume back to llSetCameraParams
over KFC_EASE_OUT
or CAMERA_*_LAG
.llSetKeyframedCamera( list keyframes, list options );
Keyframes is a strided list of keyframe same as per
llSetKeyframedMotion
.KFC_*
constants duplicate of KFM_*
s or reuse the KFM constants.Requires
PERMISSION_CONTROL_CAMERA
or experience permissions.Keyframe list is uploaded to client with the options. Ping / time of function call / region time dilation should all be taken into account: Viewer skips/seeks forward to the appropriate frame between keyframes based on when function was called. Also the time delta between frames is affected by region dilation. This is so that a good attempt is made so that scripts can sync up in terms of
llGetTime()
.Calling
llSetKeyframedCamera
again should take into account the last keyframed camera position when it comes to KFC_EASE_IN
.Camera should obey roll rotations on keyframes. For mouselook this is similar to sitting on a tilted object.
Additionally:
* An option to specify absolute/local coordinates instead of relative deltas (as client-side has no physics engine tie-in to require the deltas, default to non-delta for ease of use)
*
KFC_EASE_IN, float time
— ease-in camera from current mode (mouselook, third person, alt-cam) over float seconds across beginning keyframes (equivalent to ZoomTime
debug setting but for easing into the keyframed camera, default to ZoomTime
, e.g. 0.4s)*
KFC_EASE_OUT, float time
— ease-out over float seconds across end keyframes (similar per above)*
KFC_MOUSELOOK, integer enabled
— whether user can look around in mouselook, rotation keyframes will still affect the base rotation unless decoupled*
KFC_MOUSELOOK_FORCE, integer force
— whether to force into mouselook (equivalent to llForceMouselook but might be from a HUD)*
KFC_MOUSELOOK_DECOUPLED, integer decoupled
— whether to decouple mouselook camera to prevent it from being rotated by keyframe rotations / target (usecase: if user does not enter mouselook to look around and instead uses third person camera and lets the keyframes rotate their camera; usecase #2: vehicle mouselook camera decoupling without mouslook steering)*
KFC_TRACK_SIT, integer enabled
— whether camera motion is coupled to sitting object, so keyframed camera moves relative to sat object (default TRUE)*
KFC_TRACK_TARGET, integer enabled
— similar to above but target an object/avatar by UUID to move keyframed camera relatively to*
KFC_TRACK_ROTATE, integer enabled
— whether keyframes should be rotated relatively to targets orientation instead of only position (default TRUE)*
KFC_EASE_CUBIC, integer enabled
— whether to use cubic interpolation between keyframes (default FALSE)* (and/or implement something like B-Spline Interpolation with weight/bias/tension parameters, e.g.
KFC_EASE_SPLINE, float bias
)## Usecases
- Smooth scripted camera movements through region coordinates
- Smooth camera movement relatively to object, avatar or sat object
- Smooth movement between static camera coordinates (via new call to llSetKeyframedCamerawithKFC_LOOP&KFC_EASE_INto ease into new static, looping camera keyframe pos)
- Camera that follows an object / avatar (KFC_TRACK_TARGET)
- Camera that orbits an object / avatar (keyframe list of positions around the target with rotations set to look at the center point)
- Camera follow/orbit an object / avatar but only in terms of position (e.g. if the object / avatar rotates it won't cause the camera to rotate, via KFC_TRACK_ROTATE, FALSE)
- Vehicle mouselook repositioning (KFC_LOOP,KFC_TRACK_SIT,KFC_MOUSELOOK)
- Pausing, stopping or resuming keyframed camera similar to KFM_COMMAND— (however take into account the time of function call to ease into the frame it was supposed to pause at or resume from)
- Vehicle mouselook cameras that move along a scenic orbit around the vehicle for an occupant
- KFC_TRACK_TARGETcan target an individual child prim of a linkset, or an attachment of an avatar to follow specifically
- Keyframed camera that follows a keyframed motion object
- ??? Many more usecases via creative parameter mixing
Some usecases like being able to reposition vehicle mouselook cameras for occupants relatively to the vehicle is achievably by looping a position and enabling mouselook on the keyframed camera.
Log In
Spidey Linden
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.
Nexii Malthus
Phew had to cut some stuff due to 5000 character limit, but uh yeah. It's not perfect by any means but it does neatly capture some particular usecases and also gives the feature an identity, "Keyframed Camera"
There are some related feedbacks that usecases are meant to relate to or capture part of or fully:
- https://feedback.secondlife.com/scripting-features/p/llsetmouselookparams-mouselook-camera-controls
- https://feedback.secondlife.com/scripting-features/p/please-make-llsetvehicleflagsvehicle-flag-camera-decoupled-not-require-mouselook
...and many requests in the past in regards to a scripted camera control that we didn't know how it should look or feel like -- I think this function actually matches the vision closest so far.
The tricks that can be done by looping a single keyframe such as allowing mouselook cameras to be repositioned is especially useful. For example such as a third person mouselook camera for aircraft, cars, etc.
Or even programmatically switching between first person, third person, scenic or orbiting camera views easily as a vehicle programmer. Optionally with being able to ease into the new location instead of instant changes, or vice versa optionally instantly change to the new camera. While retaining the usefulness of being able to use multiple keyframes when you need to -- this is something that all the other previous feature requests did not account for.