13 Replies Latest reply on May 16, 2015 9:12 AM by marcus j potter :)

    Setting a marker duration

    Kelly Anderson Level 1

      Hello,

       

      I'm using the PProPanel as a base.  In the 'Add Sequence Markers' there is code that can set a marker.  It looks like this:

       

      var new_web_marker  = markers.createMarker(14.345);

      new_web_marker.name = 'Web marker created by PProPanel.';

      new_web_marker.comments = 'Here are some comments, inserted by PProPanel.';

      new_web_marker.end.seconds = 15.6789;

      new_web_marker.setTypeAsWebLink("http://www.adobe.com", "frame target");

       

      The piece that is not working for me is the duration or marker.end.

       

      Has anyone tried this with success?

       

      thanks,

      Kelly

        • 1. Re: Setting a marker duration
          Bruce Bullis Adobe Employee

          Try this line instead:

           

          new_comment_marker.end= 15.6789;
          • 2. Re: Setting a marker duration
            Kelly Anderson Level 1

            Thanks for the quick reply.  So this did add a duration for the marker, but the duration of the marker is not correct.  It appears to me that the duration is calculated from the beginning of the timeline and not the marker in point.

             

            Here is a better description with photos of what I'm trying to do.  Thanks for any and all help.

             

            I have a timeline with a start time of 59:50:00

            My Clip is at timecode 1:00:00:00 to 1:00:30:00 (Reference Photo 1)

            1.BeforeRunningScript.png

             

            After I run my script (Script at end of email)

            I see the Marker with a duration of 20:00 (Reference Photo 2 and Photo 3)

            2.AfterRunningScript.png3.MarkerInfoAfterRunningScript.png

             

            What I'm trying to accomplish is a Marker at a user-defined in point with a duration of the user marked in point to out point (Reference Photo 4)

            4.WhatIWant.png

             

            SCRIPT:

            markSpotWithMarkers : function() {

                    app.enableQE();

                    var active_seq = app.project.activeSequence;

                    var active_seq1 = qe.project.getActiveSequence();

              

                 if (active_seq != null) {

                        var markers = active_seq.markers;

                    }

             

             

                    var spotName = prompt("Please enter spot name", "spot name");

             

             

                    var in_point                = active_seq1.inPoint.secs;

                    var out_point                = active_seq1.outPoint.secs;

                    var duration                = out_point - in_point;

             

             

                    var spot_marker   = markers.createMarker(in_point);

                    spot_marker.name = spotName;

                    //spot_marker.comments = 'User will add title of spot here';

                    spot_marker.end = duration;

              },

            • 3. Re: Setting a marker duration
              Bruce Bullis Adobe Employee

              Crafty! Sorry about requiring the QE DOM for that information; we're working on it.

               

              I propose the following:

               

                      app.enableQE();

               

               

                      var activePlainOldSeq = app.project.activeSequence;

                      var activeQESeq = qe.project.getActiveSequence();

               

                   if ((activePlainOldSeq != null) && (activeQESeq != null) ) {

                          var markers = activePlainOldSeq.markers;

                      var spotName = prompt("Please enter spot name", "spot name");

               

                      var in_point                = activeQESeq.inPoint;

                      var out_point              = activeQESeq.outPoint;

                      var spot_marker   = markers.createMarker(in_point.secs);

               

               

                      spot_marker.name            = spotName;

                      spot_marker.comments    = 'User will add title of spot here';

                      spot_marker.end = out_point.secs;

              }

              • 4. Re: Setting a marker duration
                Kelly Anderson Level 1

                Okay, we are getting somewhere…...

                The code you provided works great for setting the Marker and the correct duration.  Thank you.

                Now I see some strange things happening.  Any thoughts???

                 

                When I lay out 4 identical clips in one timeline (there all 30:00 duration)  I get differing numbers in a exported Markers file.

                Here is my layout

                Timeline.png

                In PPro the Timecode reports that Spot 1 is in at 1:00:00:00 and has a duration of 30:00.  The Marker reflects this correctly.

                In PPro the Timecode reports that Spot 2 is in at 1:00:45:00 and has a duration of 30:00.  The Marker reflects this incorrectly.  The Marker says my duration is 29:29. The out is 1:01:15:01 (Which makes it a 29:29)

                It gets stranger...

                In PPro the Timecode reports that Spot 3 is in at 1:01:30:00 and has a duration of 30:00.  The Marker reflects this incorrectly.  In fact, when I hover over the Marker in PPro the popup window says the Marker is at 1:01:29:29 and the duration is 29:29. 

                In PPro the Timecode reports that Spot 4 is in at 1:02:15:00 and has a duration of 30:00.  The Marker reflects this incorrectly.  When I hover over the Marker in PPro the popup window says the Marker is at 1:02:15:00 and the duration is 29:29. 

                 

                Here is the exported Marker file.

                MarkersList.png

                • 5. Re: Setting a marker duration
                  Bruce Bullis Adobe Employee

                  Crud, you may be finding/hitting a known bug...[checking]

                  • 6. Re: Setting a marker duration
                    Kelly Anderson Level 1

                    Hello bbb_999,

                     

                    Any new information on the Markers "bug"?

                     

                    thanks,

                    Kelly

                    • 7. Re: Setting a marker duration
                      Bruce Bullis Adobe Employee

                      It bore a family resemblance, but no, I think it's something different.

                       

                      Were those 'one frame short' markers human-made, or script-generated?

                      • 8. Re: Setting a marker duration
                        Kelly Anderson Level 1

                        They were script generated (from the script you helped me write), but based on human-made in-point and out-point. 

                         

                        The interesting piece to me is the in-points and out-points are whole numbers.  Maybe this has something to do with the problem, I don't know.

                         

                        I added some alerts to see this.

                         

                        markSpotWithMarkers : function() {

                           

                                app.enableQE();

                                var activePlainOldSeq = app.project.activeSequence;

                                var activeQESeq = qe.project.getActiveSequence();

                         

                                if ((activePlainOldSeq != null) && (activeQESeq != null) ) {

                                    var markers = activePlainOldSeq.markers;

                                    var spotName = prompt("Please enter spot name", "spot name");

                                    var in_point                = activeQESeq.inPoint;

                                    alert("in point = " + in_point.secs);

                                    var out_point              = activeQESeq.outPoint;

                                    alert("out point = " + out_point.secs);

                                    var spot_marker   = markers.createMarker(in_point.secs);

                                   

                                    spot_marker.name            = spotName;

                                    //spot_marker.comments    = 'User will add title of spot here';

                                    spot_marker.end = out_point.secs;

                                }

                          }

                         

                        Here is some output based on my previous post that shows my Timeline.

                         

                        Screen Shot 2015-02-04 at 3.24.50 PM.pngScreen Shot 2015-02-04 at 3.24.55 PM.pngScreen Shot 2015-02-04 at 3.25.15 PM.pngScreen Shot 2015-02-04 at 3.25.19 PM.pngScreen Shot 2015-02-04 at 3.25.39 PM.pngScreen Shot 2015-02-04 at 3.25.44 PM.png

                        • 9. Re: Setting a marker duration
                          Kelly Anderson Level 1

                          Sorry, the line should read:

                          The interesting piece to me is the in-points and out-points are not whole numbers.

                          • 10. Re: Setting a marker duration
                            Bruce Bullis Adobe Employee

                            Agreed—interesting! Will look into it further.

                            • 11. Re: Setting a marker duration
                              marcus j potter :) Level 1

                              @bbb_999


                              Hey bruce Just been checking updates from GIT
                              - I installed 'PProPannel.zxp' I see some possible discrepancies between imported markers in sample plugin with EXPORT > Markers - CSV

                               

                              1. Expected values import via plugin

                              var new_comment_marker = markers.createMarker(12.345);
                              new_comment_marker.name  = 'Marker created by PProPanel.';
                              new_comment_marker.comments = 'Here are some comments, inserted by PProPanel.';
                              new_comment_marker.end = 15.6789;
                              var new_web_marker = markers.createMarker(14.345);
                              new_web_marker.name  = 'Web marker created by PProPanel.';
                              new_web_marker.comments = 'Here are some comments, inserted by PProPanel.';
                              new_web_marker.end = 15.6789;
                              new_web_marker.setTypeAsWebLink("http://www.adobe.com", "frame target");

                               

                              2. Markers added to premiere (as expected)

                              Screenshot-2015-05-07-01.17.54_900.png

                              Full screen version

                               

                              CSV Export output (issues as highlighted)

                              Marker NameDescriptionInOutDurationMarker Type
                              00:20:59:1800:20:59:1800:00:00:00Comment
                              00:40:55:0000:40:55:0000:00:00:00Comment

                               

                              Remarks
                              Im on cc 2014.1/PPro Version: PPro 8.1.0x81 (so couple of updates behind).

                              Hope this is enough to be useful (01:37 here ; )

                              • 12. Re: Setting a marker duration
                                Bruce Bullis Adobe Employee

                                Adding the .zxp to the depot was a good idea gone wrong.

                                 

                                I added it to the depot to be able to point non-technical people to an example they could load.

                                Instead, it's become an opportunity for divergence between the code in the depot project, and the code embedded in the .zxp.  
                                You'll notice that the Quick Start Guide makes no reference to installing it...

                                 

                                Based on your later comments, I think you have it sorted...?

                                • 13. Re: Setting a marker duration
                                  marcus j potter :) Level 1

                                  Bruce Bullis

                                  Yes - all sorted, thanks!

                                  For anyone else reading my previous post.

                                  - The issue was caused by 'my' human error of importing the same markers twice by the CEP/HTML plugin. So the results were as expected!

                                   

                                  KellyAnderson

                                  Did you get expected results (or find the cause of possible issues) from your previous reports.

                                  Just curious to follow this thread, as we're looking at using the new marker API in a project.

                                   

                                  thanksall