Edit Bezier Curve
Moderators: Víctor Paredes, Belgarath, slowtiger
- hayasidist
- Posts: 3672
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Edit Bezier Curve
There was a request for a script that would allow you to grab a curve and drag it about, automatically updating the bezier handles... http://www.lostmarble.com/forum/viewtop ... =5&t=33883
here's an INITIAL version -- use with care .. it has been tested in a benign environment, but I'm fairly sure that active use will find a way to break it...
https://www.mediafire.com/file/vhxz93hn ... r.zip/file
It will run on 12.0 and later -- it is compatible with 13.5 .. only a few hours to go for that now!
What it does:
- click on a curve segment, then drag the mouse -- the segment arc will follow the mouse and the bezier handles will get updated automatically.
- the segment has six zones:
--- too close to a moho mesh point (and the tool will silently refuse to do anything)
--- in the next 1/6th of the segment - when only the nearest bezier handle will be affected
--- from there to the middle where both handles are (proportionally) affected
and the same three zones on the way to the other end point of the segment...
IOW: too close to a moho point: no action
close to a moho point -- just the one Bezier handle moves
elsewhere -- both handles move
===
I've noticed a couple of "not quite as tidy as I'd have liked" behaviours: sometimes the mouse / pointer will not stay "stuck" to the curve -- the segment still moves in response, but there's a visual gap often when the resulting Bezier handle becomes "very long" ... if this becomes a significant problem let me know please..
Unlike Krita, it does not show the handles moving; and does not give a visual indication that a segment is selected - and I'm planning on leaving it that way unless there's a clamour for such..
As ever - let me know how it works for you / bugs etc / requests for enhancements..
here's an INITIAL version -- use with care .. it has been tested in a benign environment, but I'm fairly sure that active use will find a way to break it...
https://www.mediafire.com/file/vhxz93hn ... r.zip/file
It will run on 12.0 and later -- it is compatible with 13.5 .. only a few hours to go for that now!
What it does:
- click on a curve segment, then drag the mouse -- the segment arc will follow the mouse and the bezier handles will get updated automatically.
- the segment has six zones:
--- too close to a moho mesh point (and the tool will silently refuse to do anything)
--- in the next 1/6th of the segment - when only the nearest bezier handle will be affected
--- from there to the middle where both handles are (proportionally) affected
and the same three zones on the way to the other end point of the segment...
IOW: too close to a moho point: no action
close to a moho point -- just the one Bezier handle moves
elsewhere -- both handles move
===
I've noticed a couple of "not quite as tidy as I'd have liked" behaviours: sometimes the mouse / pointer will not stay "stuck" to the curve -- the segment still moves in response, but there's a visual gap often when the resulting Bezier handle becomes "very long" ... if this becomes a significant problem let me know please..
Unlike Krita, it does not show the handles moving; and does not give a visual indication that a segment is selected - and I'm planning on leaving it that way unless there's a clamour for such..
As ever - let me know how it works for you / bugs etc / requests for enhancements..
Re: Edit Bezier Curve
I am so honoured and happy you made this script.
wowwww.
this is sooooooo useful.
Thanks a million
testing it out now
wowwww.
this is sooooooo useful.
Thanks a million
testing it out now
hayasidist wrote: ↑Mon Apr 26, 2021 12:08 pm There was a request for a script that would allow you to grab a curve and drag it about, automatically updating the bezier handles... http://www.lostmarble.com/forum/viewtop ... =5&t=33883
here's an INITIAL version -- use with care .. it has been tested in a benign environment, but I'm fairly sure that active use will find a way to break it...
https://www.mediafire.com/file/vhxz93hn ... r.zip/file
It will run on 12.0 and later -- it is compatible with 13.5 .. only a few hours to go for that now!
What it does:
- click on a curve segment, then drag the mouse -- the segment arc will follow the mouse and the bezier handles will get updated automatically.
- the segment has six zones:
--- too close to a moho mesh point (and the tool will silently refuse to do anything)
--- in the next 1/6th of the segment - when only the nearest bezier handle will be affected
--- from there to the middle where both handles are (proportionally) affected
and the same three zones on the way to the other end point of the segment...
IOW: too close to a moho point: no action
close to a moho point -- just the one Bezier handle moves
elsewhere -- both handles move
===
I've noticed a couple of "not quite as tidy as I'd have liked" behaviours: sometimes the mouse / pointer will not stay "stuck" to the curve -- the segment still moves in response, but there's a visual gap often when the resulting Bezier handle becomes "very long" ... if this becomes a significant problem let me know please..
Unlike Krita, it does not show the handles moving; and does not give a visual indication that a segment is selected - and I'm planning on leaving it that way unless there's a clamour for such..
As ever - let me know how it works for you / bugs etc / requests for enhancements..
Re: Edit Bezier Curve
Good stuff. I had a quick play. It mostly works, but kinda does not feel quite right. I will need to play more...
Moho 14.2 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
- alanthebox
- Posts: 216
- Joined: Sat Feb 03, 2018 5:31 pm
- Contact:
Re: Edit Bezier Curve
I didn't realize how much I missed this functionality until now! Thanks for putting this together!
Re: Edit Bezier Curve
Nice
I've bumped into some weird behaviour, but for quickly bending a straight line to a curve this is really userful!
I've bumped into some weird behaviour, but for quickly bending a straight line to a curve this is really userful!
- hayasidist
- Posts: 3672
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Edit Bezier Curve
if you can somehow post / describe the weirds I'll take a look --- one thing I found was that the "just this handle" zone can both cause and remedy odd "peaky" behaviours in the segment...
Re: Edit Bezier Curve
Experimented with the Script on MH 13.5 (Demo Version)
I don't know if this is caused by the script but after making using of it to reshape the curves, I deleted the shape entirely and when I drew another shape (tested with a circle and a rectangle) with the DRAW SHAPE. the BEZIER handles begin to act weirdly.: not responding when i click on them also the bezier handles support on the TRANSFORM POINTS panel disappears entirely.. However, on returning to the reshape curve script, i can still bend curves with ease. You can see in this gif I uploaded.
I don't know if this is caused by the script but after making using of it to reshape the curves, I deleted the shape entirely and when I drew another shape (tested with a circle and a rectangle) with the DRAW SHAPE. the BEZIER handles begin to act weirdly.: not responding when i click on them also the bezier handles support on the TRANSFORM POINTS panel disappears entirely.. However, on returning to the reshape curve script, i can still bend curves with ease. You can see in this gif I uploaded.
- hayasidist
- Posts: 3672
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Edit Bezier Curve
Demo Version?! In the (factory) Transform points tool, the bezier handles icons are only displayed in the Pro version... I wonder if demo means no pro features??
from a cold start, do you see the Bezier handle icons?
from a cold start, do you see the Bezier handle icons?
Re: Edit Bezier Curve
Yes...I see the Bezier Handles from a cold start...
- hayasidist
- Posts: 3672
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Edit Bezier Curve
hmm -- I can't yet reproduce that here -- possibly dumb q: you are using the LM version of Transform Points? -- the only way those icons don't appear is if IsMohoPro() is "false". And LM's Shape?
could you install this simple script -- I ran it from Custom Content / Scripts / Menu / script writing, but anywhere sensible will do.
run before and after the weird behaviours please. I'm half expecting it to say both times that it's 13.5 Pro and "show handles" but ...
[EDIT]: code updated to reflect the mediafire version...
could you install this simple script -- I ran it from Custom Content / Scripts / Menu / script writing, but anywhere sensible will do.
run before and after the weird behaviours please. I'm half expecting it to say both times that it's 13.5 Pro and "show handles" but ...
Code: Select all
ScriptName = "HS_ReportMoho"
HS_ReportMoho = {}
local thisUUT = "D"
function HS_ReportMoho:Test()
return true
-- return false
end
function HS_ReportMoho:Name()
return "Report Moho"
end
function HS_ReportMoho:Version()
return "version 1.02"
end
function HS_ReportMoho:IsBeginnerScript()
return false
end
function HS_ReportMoho:Description()
return "Report basic info about Moho"
end
function HS_ReportMoho:Creator()
return "Hayasidist"
end
function HS_ReportMoho:UILabel()
return "Report Moho " .. HS_ReportMoho:Version()
end
function HS_ReportMoho:ColorizeIcon()
return true
end
function HS_ReportMoho:Run(moho, view)
-- HS_Test_harness:diagnosePrint (thisUUT, self:Name(), self:Version())
local i, j, k, n, p, q, s
local err
print (self:Name() .. " " .. self:Version())
if type (MOHO.ScriptInterface.AppVersion) == "function" then
if MOHO.IsMohoPro() then
s = "Moho Pro"
else
s = "Debut"
end
if moho:IsPro() ~= MOHO.IsMohoPro() then
s = "Unclear if " .. s
end
q = "show bezier handles"
if not LM_TransformPoints.showHandles then
q = "do not " .. q
end
print (s .. " version " .. moho:AppVersion() .. ". Transform Points - " .. q)
print (LM_TransformPoints:Name() .. " version " .. LM_TransformPoints:Version() .. " by " .. LM_TransformPoints:Creator())
print (LM_Shape:Name() .. " version " .. LM_Shape:Version() .. " by " .. LM_Shape:Creator())
else
print ("unsupported version")
end
end
Last edited by hayasidist on Sun May 02, 2021 7:00 pm, edited 2 times in total.
Re: Edit Bezier Curve
Do i copy this into a notepad text ?I am a complete noob to scripting
- hayasidist
- Posts: 3672
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Edit Bezier Curve
ah - ok ... sorry - trying to be efficient and skipping an upload - yes - any text editor will do -- and save it as HS_ReportMoho.lua (make sure you get the extension right - Notepad tries hard to make you call it .txt - even after you call it .lua)
If you're struggling, or just plain put off by the idea I'll upload a version to mediafire.
[EDIT] -- here's a link to a slightly newer version - with a couple of extra "this info might just help" fields... https://www.mediafire.com/file/edtivppq ... o.lua/file
If you're struggling, or just plain put off by the idea I'll upload a version to mediafire.
[EDIT] -- here's a link to a slightly newer version - with a couple of extra "this info might just help" fields... https://www.mediafire.com/file/edtivppq ... o.lua/file
- lucasfranca
- Posts: 162
- Joined: Sat Oct 07, 2017 11:47 pm
Re: Edit Bezier Curve
Too bad it doesn't work on a non-zero frame!
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.
I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.
https://youtube.com/animai2D
Passionate about animation, after getting old, he decides to make it his hobby.
I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.
https://youtube.com/animai2D
- hayasidist
- Posts: 3672
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Edit Bezier Curve
works fine in the timeline here ... win10 Moho 13.5.x
if you have an example file that you can share, I'll take a look
- lucasfranca
- Posts: 162
- Joined: Sat Oct 07, 2017 11:47 pm
Re: Edit Bezier Curve
The tool does not appear in a non-zero frame. Do I have an old version of it? My version is 1.8.hayasidist wrote: ↑Sun Apr 24, 2022 5:08 pmworks fine in the timeline here ... win10 Moho 13.5.x
if you have an example file that you can share, I'll take a look
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.
I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.
https://youtube.com/animai2D
Passionate about animation, after getting old, he decides to make it his hobby.
I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.
https://youtube.com/animai2D