[JW Lua] FCSmartShapeSegment.BreakOffsetX can only be changed for hairpins if it had been manually changed before
Jan Angermüller
jan at angermueller.com
Mon May 30 14:04:07 CEST 2016
Jari,
if a smart shape segment from a hairpin with a line break doesn't have a
(manual) BreakOffsetX (i.e. its value is 0), then a change to the
BreakOffsetX doesn't "get active". I.e. the new value is stored, but not
shown in the hairpin. I assume that there is a function like
SetCustomOffset(true/false) missing especially for the BreakOffset.
SetCustomOffset seems to effect EndpointOffset only.
See test code below (create a score with hairpin with a line break and
select the area, then run the script).
The script writes new values to the BreakOffsetX values which are
stored, but no visual change happens.
A similar problem seems to exist with the glissando BreakOffset (see my
very old mail from the 3rd of February 2015).
Best,
Jan
local region = finenv.Region()
local marks = finale.FCSmartShapeMeasureMarks()
marks:LoadAllForRegion(region)
marks:RemoveDuplicateReferences()
for mark in each(marks) do
local smartshape = mark:CreateSmartShape()
if (smartshape:GetShapeType() == finale.SMARTSHAPE_DIMINUENDO)
or (smartshape:GetShapeType() == finale.SMARTSHAPE_CRESCENDO) then
local rightseg=smartshape:GetTerminateSegmentRight()
local leftseg=smartshape:GetTerminateSegmentLeft()
rightseg:SetCustomOffset(true) --doesn't have any effect here
rightseg.BreakOffsetX=-24
leftseg:SetCustomOffset(false) --doesn't have any effect here
leftseg.BreakOffsetX=24
smartshape:Save()
smartshape = mark:CreateSmartShape()
rightseg=smartshape:GetTerminateSegmentRight()
leftseg=smartshape:GetTerminateSegmentLeft()
print(leftseg.BreakOffsetX,rightseg.BreakOffsetX)
end
end
Running [Unnamed Script] ======>
24 -24
<======= [Unnamed Script] succeeded (Processing time: 0.067 s).
More information about the JWLua
mailing list