Repository navigation
Client Rendering and Camera
kltyton edited this page Dec 1, 2026
·
6 revisions
Client-side helpers live in com.kltyton.interactiveanimation.client.playback and com.kltyton.interactiveanimation.client.render.
Preview default assets or client-bound objects directly on the render/client game thread without server packets:
SceneHandle handle = ClientScenes.playLocal(subject, sceneId);
SceneHandle bound = ClientScenes.playLocal(subject, sceneId, Bindings.named(Map.of("prop", stack)), options);Mods building custom camera rigs, vehicle render hooks, or contact filters can inspect active client scenes at any time:
-
ClientActor ClientScenes.actor(Entity entity, float partialTick)Returns the interpolatedClientActorforentityif it is currently driven by a scene (either as primary or participant), ornull. -
Entity ClientScenes.subjectFor(Entity participant, String role)Returns the tracked subject entity for a participant currently playingrole(used by mods such as Superb Warfare: Boarding to coordinate camera tracking and collision contact). -
List<ClientActor> ClientScenes.extras(float partialTick, Predicate<Entity> submitted)Returns non-world preview actors (defaultitem,block, ormodelparticipants) for extra render passes. -
ClientScene.CameraPose ClientScenes.camera(Entity player, float partialTick)Returns the current scene camera pose if a scene is controlling the camera forplayer.
When a participant uses "type": "model", register its client-side preview factory during client initialization:
ClientAssets.registerModel("example:ritual_blade", level -> new ItemStack(ExampleItems.RITUAL_BLADE.get()));The factory must return an Entity, ItemStack, or BlockState instance that Minecraft's renderer pipeline can draw.
| Mode | Behavior |
|---|---|
AUTO |
Uses the scene's camera track if authored; otherwise applies smooth follow framing for participating players. |
VANILLA |
Leaves camera control to vanilla Minecraft or the calling mod's custom camera controller. |
FOLLOW |
Keeps the current first- or third-person view while following the participant's root motion. Ignores the authored camera track. |
LOCKED |
Locks camera orientation to the scene's authored camera track. |
-
Player Bone Names: Standard humanoid bones (
head,body/torso,left_arm,right_arm,left_leg,right_leg) are synchronized across both inner geometry and second-layer player skin overlays (hat,jacket,left_sleeve,right_sleeve,left_pants,right_pants). -
PAL & PAL More Rotation (
1.21.1,26.1.2,26.2): When Player Animation Library is installed, player poses are applied through PAL's animation layer (PalSceneLayer/PalScenePose). When PAL More Rotation is also installed, multi-axisbendcurves onbody/ limbs are forwarded automatically viaPalMoreBends. -
PlayerAnimator & bendy-lib (
1.20.1): When PlayerAnimator (player-animator/playeranimator) is installed on1.20.1, AnimCue automatically registersPlayerAnimatorSceneLayer(POSITION,ROTATION, andBEND) and preserves AnimCuescaletracks; whenbendy-lib(alone or withplayeranimationlibrarymorerotation) is present, AnimCue automatically applies single-axis or full 3-axisbenddeformations to limbs and second-layer player skin overlays cleanly after draw. Without PlayerAnimator installed, poses continue falling back cleanly through vanillaPlayerModelchannels.
-
GeckoLib 4 (
1.20.1,1.21.1) & GeckoLib 5 (26.1.2,26.2): Participant bone channels are applied after GeckoLib's native controller sampling, preserving native idle/walk/wheel/turret animations on untouched bones. -
SimpleBedrockModel (SBM v1 & v2, all targets): Zero-hard-dependency
@Pseudomixins automatically compose matching AnimCue bone tracks (position,rotation,scale) onto SBM v1 legacy (1.4.0), SBM v1 common (2.0.0–2.6.x), and SBM v2 (BakedModelInstance/TreeModelInstance) models insiderenderToBufferand restore the original bone transforms right after drawing. Renderers using deferred queues (such as26.xSubmitNodeCollector.submitCustomGeometry) can also invokeSbmScenes.apply(actor, model)directly. -
KBR Renderers (
26.x): When KBR addon entity renderers are present, AnimCue applies interactive bone channels after native pose composition on both the main body and extra geometry passes. -
Custom Model Hooks (
LegacyActorRenderer/ActiveActorRenderContext): Downstream custom renderers can also readLegacyActorRenderer.current()/ActiveActorRenderContext.current()and register post-draw cleanup callbacks viarestoreAfterDraw(Runnable).