phantom-camera icon indicating copy to clipboard operation
phantom-camera copied to clipboard

Phantom Camera Host script environment/attributes duplicate() seems rerolling resource IDs in .tscn muddying git commits.

Open JelaMiraj opened this issue 6 months ago • 1 comments

Issue description

I'm using Godot 4.3 dotnet release on windows 11. Everytime I load or save a scene (including caused by just by reopening the project in godot editor) backed by .tscn with my phantom camera setup the random slug ending of the name of the resource id of duplicated camera attributes and environment property nodes get rerolled causing that as a detected change by git. Most likely a result of how lines 598 to 602 of the phantom_camera_host.gd script plays out.

` if _active_pcam_3d.attributes != null: camera_3d.attributes = _active_pcam_3d.attributes.duplicate()

		if _active_pcam_3d.environment != null:
			camera_3d.environment = _active_pcam_3d.environment.duplicate()

` I have 3 phantom cameras wide, main, and close with different priorities and leave the 2 i'm not currently using set to hidden. the scene has just one normal camera3d with the phantomcamerahost node with attached script as a child node.

Hopefully either some workaround that I've yet to find or an actual change in the addon can prevent this issue while preserving need functionality of different camera shots needing different physical camera attribute resources and pbr lighting needing environments...

I have minimal bug demo project options included while we sort this out. Hopefully the solution will be relatively easy to work through! 😻 👍

Steps to reproduce

  1. have a godot project backed by git scm with no pending changes.
  2. Have a scene saved as a .tscn.
  3. add camera3d node.
  4. add phantom camera node.
  5. add environment resource and camera attributes resource to phantom camera node properties. (I chose ones backed by external files).
  6. save scene and the git pending changes to narrow the list later.
  7. attach phantomcamerahost node with its script as a child of camera3d node. (it's first activation will make the random ID's resource in the scene and subseqently brand new ones with new names for git to detect endlessly.)
  8. save or (re)load the .tscn and check git pending changes.
  9. if no randomly renamed environment or camera attributes resource id in .tscn try again save/(re)load the .tscn and check git pending changes.

(Optional) Minimal reproduction project

Reproduction minimal demo project with commits: Linked until I private when I know resolved Attached zip of git repo of min bug demo project at same commit at that time. PhantomCam_TScene_Save_HCam_AttrEnv_Glitch_Example-main.zip

JelaMiraj avatar Aug 21 '24 08:08 JelaMiraj