mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-25 13:31:37 +00:00
Refactor syncback logic for camera removal handling
- Simplified the logic for removing the current camera by using a default value for sync_current_camera, improving code readability. - Enhanced the handling of camera references within the syncback loop, ensuring that the camera is only removed when explicitly set to do so. - Updated comments for clarity on the default behavior regarding camera removal in the syncback process.
This commit is contained in:
parent
fe2bf358e7
commit
44344f4014
1 changed files with 18 additions and 14 deletions
|
|
@ -174,8 +174,13 @@ pub fn syncback_loop_with_stats(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle removing the current camera.
|
// Handle removing the current camera.
|
||||||
if let Some(syncback_rules) = &project.syncback_rules {
|
// syncCurrentCamera defaults to false, meaning we remove the camera by default
|
||||||
if !syncback_rules.sync_current_camera.unwrap_or_default() {
|
let sync_current_camera = project
|
||||||
|
.syncback_rules
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|s| s.sync_current_camera)
|
||||||
|
.unwrap_or(false);
|
||||||
|
if !sync_current_camera {
|
||||||
log::debug!("Removing CurrentCamera from new DOM");
|
log::debug!("Removing CurrentCamera from new DOM");
|
||||||
let mut camera_ref = None;
|
let mut camera_ref = None;
|
||||||
for child_ref in new_tree.root().children() {
|
for child_ref in new_tree.root().children() {
|
||||||
|
|
@ -191,7 +196,6 @@ pub fn syncback_loop_with_stats(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let ignore_referents = project
|
let ignore_referents = project
|
||||||
.syncback_rules
|
.syncback_rules
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue