rocken wrote: ↑Sat Apr 10, 2021 7:40 pm
Do you mean you made a script on it? Would be nice to see...Very very interested please....
It's proof of concept only and runs inside my test harness, so:
it doesn't have all the "other stuff" that a script needs ...
it doesn't try to see which segment is active etc etc ...
it just finds the first hidden point and then moves it to wherever the mouse goes...
I ran it against a moho document that had one vector layer with a shape consisting of three points - stroke only, in a straight line - I hid the middle one manually
Code: Select all
local movePt
function HS_Test_Paths:OnMouseDown(moho, mouseEvent)
local mesh = moho:Mesh()
local i
local ct = mesh:CountPoints()
movePt = nil
for i = 0, ct-1 do
pt = mesh:Point(i)
if pt.fHidden then
movePt = pt
break
end
end
return
end
function HS_Test_Paths:OnMouseMoved(moho, mouseEvent)
if movePt then
movePt:SetPos(mouseEvent.vec, 0)
end
return
end
a real script would need to check the active segment to decide if it had a hidden point and either use it, or create a new hidden point... it shouldn't assume frame 0 (as done here)
it would also need a load of error / exception handling -- e.g. at present there's no meta data services in Moho to indicate reliably if a point was hidden and has now been unhidden by the user from the standard UI - as that would change the user's view of the segment count etc etc etc ...
and it would need all the "housekeeping" functionality - e.g. timeline keying, creating "undo" checkpoints ...
so - whilst the core of this is "find a point and move it" - and this can be accomplished in very few lines of code - there'll be another couple of hundred lines to make the thing robust