<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Jari,<br>
<br>
there may be a bug in JW Lua with changing endpoints of slur
smartshapes.<br>
Probably it has to do with FCSmartShapeSegment:SetCustomOffset().<br>
<br>
This is what happens:<br>
When I have a smartshape slur with its original endpoint and control
point offsets <br>
(not custom-defined, but just the way Finale created the slur
originally - see image 1 in screenshot)<br>
Then in JW Lua I create the ctrlpoint and left/right segments of the
smartshape slur<br>
and change their offsets (i.e.
leftseg:SetControlPoint1OffsetX(...),
rightseg:SetControlPoint1OffsetX(..),<br>
ctrlpoint:SetControlPoint1OffsetX(...) etc.)<br>
Then I add:<br>
<br>
ctrlpoint:SetCustomShaped(true)<br>
leftseg:SetCustomOffset(false) -- i.e. not rightside<br>
rightseg:SetCustomOffset(true) -- i.e. rightside<br>
smartshape:Save()<br>
<br>
The result is a slur with new controlpoints,<br>
but not with new leftseg/rightseg endpoints (see image 2 in the
screenshot).<br>
<br>
Then in comparison I do the following:<br>
I go back to the original slur and change one of the endpoints (left
or right)<br>
by dragging it manually. So Finale internally sets the shape to
"custom offset=true".<br>
Then I remove the lines leftseg:SetCustomOffset(false) and
rightseg:SetCustomOffset(true)<br>
from the code and run the same function again.<br>
Now the results are correct: both ctrlpoint and leftseg/rightseg
endpoints have changed<br>
according to the new values (see image 3 in screenshot).<br>
So I guess there is a problem with the
FCSmartShapeSegment:SetCustomOffset<br>
function.<br>
<br>
Below you find the function to test.<br>
<br>
Jan<br>
<br>
<br>
local marks = finale.FCSmartShapeMeasureMarks()<br>
marks:LoadAllForRegion(finenv.Region(), true)<br>
for mark in each(marks) do<br>
local smartshape = mark:CreateSmartShape()<br>
if (smartshape ~= nil) and smartshape:IsSlur() then<br>
local leftseg=smartshape:GetTerminateSegmentLeft()<br>
local rightseg=smartshape:GetTerminateSegmentRight()<br>
local ctrlpoint=smartshape:GetCtrlPointAdjust()<br>
<br>
ctrlpoint:SetCustomShaped(true)<br>
leftseg:SetCustomOffset(false) --i.e. left-side
adjustment --2nd time remove this line of code<br>
rightseg:SetCustomOffset(false) --i.e. right-side adjustment
--2nd time remove this line of code<br>
<br>
ctrlpoint:SetControlPoint1OffsetX(0)<br>
ctrlpoint:SetControlPoint1OffsetY(-100)<br>
ctrlpoint:SetControlPoint2OffsetX(0)<br>
ctrlpoint:SetControlPoint2OffsetY(-100)<br>
<br>
leftseg:SetEndpointOffsetX(50)<br>
leftseg:SetEndpointOffsetY(-50)<br>
rightseg:SetEndpointOffsetX(50)<br>
rightseg:SetEndpointOffsetY(-50)<br>
<br>
smartshape:Save()<br>
end<br>
end<br>
<br>
</body>
</html>