Skip to content

Commit

Permalink
fixed #442, put line that updates view in viewer back in
Browse files Browse the repository at this point in the history
removed debug output, commented unused function
  • Loading branch information
RebeccaNowak committed Nov 6, 2024
1 parent 7e2d961 commit 0be0364
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
43 changes: 22 additions & 21 deletions src/PRo3D.Core/SequencedBookmarks/BookmarkAnimations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -324,28 +324,29 @@ module BookmarkAnimations =
// let m = {m with originalSceneState = Some (Optic.get lenses.sceneState_ outerModel)}
// outerModel, m

let smoothPathAllBookmarks (m : SequencedBookmarks)
(lenses : BookmarkLenses<'a>)
(outerModel : 'a) =
let bookmarks = orderedLoadedBookmarks m
let animation =
bookmarks
|> smoothBookmarkPath m.animationSettings.smoothingFactor.value
|> List.ofArray
|> List.map (Animation.onStart (fun name x m ->
Log.line "selected bm %s" x.name
Optic.set lenses.selectedBookmark_ (Some x.key) m
))
|> Animation.path
let animation =
animation
|> addGlobalAttributes m lenses outerModel
/// This function does no work with focal length therefore it is not in use
//let smoothPathAllBookmarks (m : SequencedBookmarks)
// (lenses : BookmarkLenses<'a>)
// (outerModel : 'a) =
// let bookmarks = orderedLoadedBookmarks m
// let animation =
// bookmarks
// |> smoothBookmarkPath m.animationSettings.smoothingFactor.value
// |> List.ofArray
// |> List.map (Animation.onStart (fun name x m ->
// Log.line "selected bm %s" x.name
// Optic.set lenses.selectedBookmark_ (Some x.key) m
// ))
// |> Animation.path
// let animation =
// animation
// |> addGlobalAttributes m lenses outerModel

let outerModel =
outerModel
|> Animator.createAndStart AnimationSlot.camera animation
//let m = {m with savedSceneState = Some (Optic.get lenses.sceneState_ outerModel)}
outerModel, m
// let outerModel =
// outerModel
// |> Animator.createAndStart AnimationSlot.camera animation
// //let m = {m with savedSceneState = Some (Optic.get lenses.sceneState_ outerModel)}
// outerModel, m

let pathWithPausing (m : SequencedBookmarks)
(lenses : BookmarkLenses<'a>)
Expand Down
5 changes: 2 additions & 3 deletions src/PRo3D.Viewer/Viewer/ViewerLenses.fs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ module ViewerLenses =
or delete and create new bookmark."
let newState = {state with stateSurfaces = m.scene.surfacesModel.surfaces}
BookmarkUtils.getValidState newState
Log.line "m.origin = %s, state.origin = %s" (string m.scene.referenceSystem.origin) (string state.stateReferenceSystem.origin)
let scaleBars = // check scale bars; using old segments for performance reasons
if haveSameKeys state.stateScaleBars.scaleBars
m.scene.scaleBars.scaleBars then
Expand Down Expand Up @@ -227,8 +226,6 @@ module ViewerLenses =
),
(fun sb m ->
let update (sb : SequencedBookmarkModel) =
// update camera to bookmark's camera
//let m = Optic.set _view sb.cameraView m

// update the scene state if the bookmark contains one
let inline updateSceneState sb m =
Expand Down Expand Up @@ -266,6 +263,8 @@ module ViewerLenses =
| None ->
m
| None ->
//update camera to bookmark's camera
let m = Optic.set _view sb.cameraView m
m

m
Expand Down

0 comments on commit 0be0364

Please sign in to comment.