Fix CameraAttributes/Environment handling in PhantomCamera3D to enables runtime animations, and prevents Git noise#620
Conversation
…detect changes to fix the current Godot Limitation
|
Can confirm it works with editing the The only thing about this PR is that it does also introduce a potential user issue where you can modify the attribute value in the Think we should still have safeguards so users don't mistakenly change other resources if we can avoid it, but open to suggestions. |
yeah i had that in mind when i did this but i don't have any clean way of doing this at the moment |
|
Sorry I have been quite busy lately. Hopefully the day after tomorrow I will be pushing a commit for this. |
|
There's no rush! Have been busy with things myself, so I likely won't be able to review it properly until towards the end of the week in any case :) |
This pull request introduces a copy-write pattern to reliably detect and apply changes to camera attributes and environment resources in
phantom_camera_host.gd, addressing limitations in Godot's change signal system. The changes ensure that updates to these resources are properly recognized both in the editor and at runtime, particularly for animations, by tracking references and property hashes.Change detection and copy-write logic for camera resources:
_last_applied_attributes,_last_applied_environment, and their hashes) to monitor the last applied camera attributes and environment, enabling detection of reference and property changes._pcam_followto detect changes in camera attributes and environment by comparing references and property hashes, applying updates via direct assignment in the editor and duplication at runtime to avoid unnecessary Git changes and ensure animation responsiveness.Resource reset on camera switch:
Screen.Recording.2026-01-17.160204.mp4