<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Jari,<br>
<br>
I had written about several problems with glissando smartshapes in
some mails in February 2015.<br>
But AFAIK nothing has been fixed since then. Below is a script for
testing these three bugs.<br>
<br>
To run the script, you need an empty document. Then add a half note
on beat three in the last measure of the first system.<br>
Add another note on the first beat of the next measure (first
measure of second system).<br>
The script will create a glissando line with system break between
these two and print some buggy properties.<br>
The huge break offset that the script tries to create is not
visible.<br>
<br>
The three problems I noticed with this script:<br>
1.) When I set the custom offset manually (by dragging for example),
the smartshape will still be "not beat-attached".<br>
When I change the custom offset with JW Lua, the smartshape flag
"BeatAttached" will immediately become true, so that both EntryBased
AND BeatAttached are true.<br>
(In the script below the endpoints values will actually not be
changed, but only set to custom offset.<br>
This doesn't affect the bug, but reduces the test script size.)<br>
<br>
2.) The metrics (i.e. the endpoints) of the glissando can't be
calculated through CalcLeft(Right)EntryMetricPos.<br>
The calculation always returns false.<br>
Could it be that both 1.) + 2.) are the result of JW Lua handling
these smartshapes as note-attached instead of note<b>head</b>-attached
?<br>
I.e. both SetCustomOffset and metrics calculation should work
differently than on for example slurs which are note-attached ?<br>
<br>
3.) The BreakOffset values can't be changed visually. The values are
indeed stored internally. <br>
But they don't affect the score. Maybe a similar update flag like
SetCustomOffset is missing here ?<br>
<br>
Best,<br>
Jan<br>
<br>
Test script:<br>
function GetEntryToSmartshape(id,segment)<br>
local region=finale.FCMusicRegion()<br>
region.StartMeasure=segment.Measure<br>
region.EndMeasure=segment.Measure<br>
region.StartMeasurePos=0<br>
region:SetEndMeasurePosRight()<br>
region.StartStaff=segment.Staff<br>
region.EndStaff=segment.Staff<br>
<br>
local entrynumber=-1<br>
for e in eachentry(region) do<br>
if (e.EntryNumber == id)then<br>
result=e<br>
entrynumber=e.EntryNumber<br>
break<br>
end<br>
end<br>
return result,entrynumber<br>
end<br>
<br>
function AddEntrySmartShape(e,e2)<br>
local smartshape = finale.FCSmartShape()<br>
smartshape:SetEntryAttachedFlags(true)<br>
smartshape:SetShapeType(finale.SMARTSHAPE_GLISSANDO)<br>
smartshape:SetLineID(1)<br>
smartshape:SetVisible(true)<br>
<br>
local leftseg = smartshape:GetTerminateSegmentLeft()<br>
leftseg:SetMeasure(e.Measure)<br>
leftseg:SetStaff(e.Staff)<br>
leftseg:SetNoteID(e:GetItemAt(0).NoteID)<br>
print("BeatAttachedBeforeSetCustomOffset",smartshape.BeatAttached) <br>
leftseg:SetCustomOffset(false)<br>
print("AfterAttachedBeforeSetCustomOffset",smartshape.BeatAttached)<br>
local rightseg = smartshape:GetTerminateSegmentRight()<br>
rightseg:SetMeasure(e2.Measure)<br>
rightseg:SetStaff(e2.Staff)<br>
rightseg:SetNoteID(e2:GetItemAt(0).NoteID)<br>
rightseg:SetCustomOffset(true)<br>
rightseg.BreakOffsetX=300<br>
rightseg.BreakOffsetY=300<br>
<br>
smartshape:SaveNewEverything(e,e2)<br>
end<br>
<br>
finenv.Region():SetFullDocument()<br>
for e in eachentry(finenv.Region()) do<br>
if (e.MeasurePos==2048) and not e:IsRest() then --get start
entry<br>
tempe=e<br>
elseif (e.MeasurePos==0) and not e:IsRest() then -- get end
entry<br>
AddEntrySmartShape(tempe,e) --attach glissando smartshape<br>
end<br>
end<br>
<br>
local marks=finale.FCSmartShapeMeasureMarks()<br>
marks:LoadAll()<br>
for m in each(marks) do<br>
local smartshape=m:CreateSmartShape()<br>
local leftseg=smartshape:GetTerminateSegmentLeft()<br>
local rightseg=smartshape:GetTerminateSegmentRight()<br>
local
leftentry=GetEntryToSmartshape(leftseg:GetEntryNumber(),leftseg)<br>
local
rightentry=GetEntryToSmartshape(rightseg:GetEntryNumber(),rightseg)<br>
local pointL=finale.FCPoint(1,1)<br>
local pointR=finale.FCPoint(1,1)<br>
print("EntryBased",smartshape.EntryBased)<br>
print("BeatAttached",smartshape.BeatAttached)<br>
print("CalcLeftEntry
OK?:",smartshape:CalcLeftEntryMetricPos(leftentry,pointL))<br>
print("CalcRightEntry
OK?:",smartshape:CalcRightEntryMetricPos(rightentry,pointR))<br>
print("Invalid Glissando
Metrics:",pointL.X,pointL.Y,pointR.X,pointR.Y,leftentry.Measure,leftentry.MeasurePos,rightentry.Measure,rightentry.MeasurePos)<br>
print("BreakOffsets",rightseg.BreakOffsetX,rightseg.BreakOffsetY)<br>
break --only print smartshape from first measure, not the
smartshape after the line break as it is identical<br>
end<br>
<br>
It produces this output:<br>
<br>
Running [Unnamed Script] ======><br>
BeatAttachedBeforeSetCustomOffset false<br>
AfterAttachedBeforeSetCustomOffset true<br>
EntryBased true<br>
BeatAttached true<br>
CalcLeftEntry OK?: false<br>
CalcRightEntry OK?: false<br>
Invalid Glissando Metrics: 1 1 1 1 3 2048 4 0<br>
BreakOffsets 300 300<br>
<======= [Unnamed Script] succeeded (Processing time: 0.004 s).<br>
</body>
</html>