@@ -462,10 +462,13 @@ public string GetMarker(int frame)
462
462
}
463
463
464
464
/// <remarks>assumes a TAStudio project is loaded</remarks>
465
- private TasMovieMarkerList MarkerListForBranch ( int ? branchIndex )
466
- => branchIndex is int i
467
- ? Tastudio . CurrentTasMovie . Branches [ i ] . Markers
468
- : Tastudio . CurrentTasMovie . Markers ;
465
+ private TasMovieMarkerList MarkerListForBranch ( string /*?*/ branchID )
466
+ {
467
+ var found = Guid . TryParseExact ( branchID , format : "D" , out var parsed )
468
+ ? Tastudio . CurrentTasMovie . Branches . FirstOrDefault ( branch => branch . Uuid == parsed )
469
+ : null ;
470
+ return found ? . Markers ?? Tastudio . CurrentTasMovie . Markers ;
471
+ }
469
472
470
473
[ LuaMethodExample ( """
471
474
local marker_label = tastudio.getmarker(tastudio.find_marker_on_or_before(100));
@@ -475,9 +478,9 @@ private TasMovieMarkerList MarkerListForBranch(int? branchIndex)
475
478
description : "Returns the frame number of the marker closest to the given frame (including that frame, but not after it)."
476
479
+ " This may be the power-on marker at 0."
477
480
+ " If branchIndex is specified, searches the markers in that branch instead." ) ]
478
- public int FindMarkerOnOrBefore ( int frame , int ? branchIndex = null )
481
+ public int FindMarkerOnOrBefore ( int frame , string /*?*/ branchID = null )
479
482
=> Engaged ( )
480
- ? MarkerListForBranch ( branchIndex ) . PreviousOrCurrent ( frame ) . Frame
483
+ ? MarkerListForBranch ( branchID ) . PreviousOrCurrent ( frame ) . Frame
481
484
: default ;
482
485
483
486
[ LuaMethodExample ( """
@@ -487,9 +490,9 @@ public int FindMarkerOnOrBefore(int frame, int? branchIndex = null)
487
490
name : "get_frames_with_markers" ,
488
491
description : "Returns a list of all the frames which have markers on them."
489
492
+ " If branchIndex is specified, instead returns the frames which have markers in that branch." ) ]
490
- public LuaTable GetFramesWithMarkers ( int ? branchIndex = null )
493
+ public LuaTable GetFramesWithMarkers ( string /*?*/ branchID = null )
491
494
=> Engaged ( )
492
- ? _th . EnumerateToLuaTable ( MarkerListForBranch ( branchIndex ) . Select ( static m => m . Frame ) )
495
+ ? _th . EnumerateToLuaTable ( MarkerListForBranch ( branchID ) . Select ( static m => m . Frame ) )
493
496
: _th . CreateTable ( ) ;
494
497
495
498
[ LuaMethodExample ( "tastudio.removemarker( 500 );" ) ]
0 commit comments