[JW Lua] Added glissando smartshape always appears at the wrong position in the score
Jan Angermüller
jan at angermueller.com
Fri Jan 16 12:05:44 CET 2015
Jari,
I haven't succeeded yet in adding a glissando smartshape at the correct
position.
Probably it's the following sentence from FCSmartShape:SaveNewEverything()
that I am missing or that I don't understand:
"For note-attached smart shapes, the frame collection that
contains the entries need to be saved after the successful return from
this method."
The code snippet is below. It creates a glissando between two half notes
in measure 1 on staff 1. The glissando does appear in the score after
the execution,
but at the wrong position (see screenshot: it's placed far above the staff).
I tried to set as many properties as possible (Endpoints, CtrlPoints,
etc. - not all of them are required here, I know).
But the glissando always appears at the /same /wrong position -
no matter which endpoint offsets I enter.
I also tried it with FCNoteEntryCell and FCNoteEntryLayer instead of
eachentrysaved(),
but that shouldn't and didn't make a difference.
What's the possibly required call for "saving the frame collection"
after SaveNewEverything() ?
Or is there a problem with the endpoint assignment ?
I used JW Lua 0.29 / Finale 2014c / Windows 7.
And another question in this context:
I don't understand the meaning of "preset/custom" here.
I thought that a glissando would be a preset shape as it is one of the
SMARTSHAPE_TYPES
<http://www.finaletips.nu/frameworkref/group__lua__classes.html#ga29b94a28426154f61cb5bf57d14a8b42>.
But it only appears as a glissando in the score, if I also set the
correct LineID which
is defined as "Returns the line style ID for /custom /smart shapes."
So what is a preset / custom in this context ? And does
SetPresetShape(true) have any meaning here ?
Thanks a lot for your hints in advance !
Best regards,
Jan
for e in eachentrysaved(finenv.Region()) do
if (e.MeasurePos==0) and (e.Measure==1) then --first note on
measure pos 0 in measure 1
for e2 in eachentrysaved(finenv.Region()) do
if (e2.MeasurePos==2048) and (e2.Measure==1) then --second
note on measure pos 2048 in measure 1
--create glissando smartshape and attach it to e and e2
local smartshape = finale.FCSmartShape()
smartshape:SetShapeType(finale.SMARTSHAPE_GLISSANDO)
smartshape:SetEntryBased(true)
smartshape:SetPresetShape(true)
smartshape:SetVisible(true)
smartshape:SetLineID(1)
smartshape:SetEntryAttachedFlags(true)
local leftseg = smartshape:GetTerminateSegmentLeft()
leftseg:SetMeasure(e.Measure)
leftseg:SetStaff(e.Staff)
leftseg:SetEndpointOffsetX(0)
leftseg:SetEndpointOffsetY(0)
leftseg:SetControlPoint1OffsetX(0)
leftseg:SetControlPoint1OffsetY(0)
leftseg:SetControlPoint2OffsetX(0)
leftseg:SetControlPoint2OffsetY(0)
local rightseg = smartshape:GetTerminateSegmentRight()
rightseg:SetMeasure(e2.Measure)
rightseg:SetStaff(e2.Staff)
rightseg:SetEndpointOffsetX(0)
rightseg:SetEndpointOffsetY(0)
rightseg:SetControlPoint1OffsetX(0)
rightseg:SetControlPoint1OffsetY(0)
rightseg:SetControlPoint2OffsetX(0)
rightseg:SetControlPoint2OffsetY(0)
smartshape:SaveNewEverything(e,e2)
end
end
end
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150116/4964dc6e/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: addingglissando.jpg
Type: image/jpeg
Size: 19180 bytes
Desc: not available
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20150116/4964dc6e/attachment.jpg>
More information about the JWLua
mailing list