*NEW* Bezier Group

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW* Bezier Group

Post by hayasidist » Mon Dec 31, 2018 6:32 pm

Thanks Wes. Another for your consideration: as it stands the tool will also make cycle and other non-"translate" keys (e.g. elastic) into Bezier ones - which could be "as wanted" ... or not!?!
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Mon Dec 31, 2018 7:50 pm

hayasidist wrote:Thanks Wes. Another for your consideration: as it stands the tool will also make cycle and other non-"translate" keys (e.g. elastic) into Bezier ones - which could be "as wanted" ... or not!?!
Yeah, that's why I put in the feature to only convert selected keyframes. So the user can avoid some keys if desired. Do you think that needs to be strict...that only selected keyframes should ever be converted?

Or maybe require selecting any keyframe with a user-set parameter interpolation? That sounds kind of obscure.
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Mon Dec 31, 2018 9:05 pm

Updated the same link: https://sites.google.com/site/synthsin/ ... ects=0&d=1

I had added something unnecessary that broke the last one.
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW* Bezier Group

Post by hayasidist » Tue Jan 01, 2019 12:27 pm

Thanks Wes, that's sorted the sync issue I was having.

about converting only selected keys: How about, if the user hasn't actually selected keys (i.e. it's "all" to convert) and there are keys of a "questionable" type then ask the user with allowed replies (Y/N) x (Ask me again next time / Don't ask me again) (and a tool reset will undo the "don't ask me again"). Questionable types = cycle; elastic; bounce; noisy; pose. ???

==
another one for your consideration:

same setup as before (http://lostmarble.com/forum/viewtopic.p ... 70#p185994)

now on frame 125 - one point selected. right click the red (selected point) channel and add keyframe.
moho correctly creates a (smooth) key (I have "copy previous" as the default)
TWO pop-up windows: "Keys not the same..." and I reply "create" to both - keys correctly created as Bezier for the other 3 points; but the smooth key persists.
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Tue Jan 01, 2019 7:50 pm

hayasidist wrote:Thanks Wes, that's sorted the sync issue I was having.

about converting only selected keys: How about, if the user hasn't actually selected keys (i.e. it's "all" to convert) and there are keys of a "questionable" type then ask the user with allowed replies (Y/N) x (Ask me again next time / Don't ask me again) (and a tool reset will undo the "don't ask me again"). Questionable types = cycle; elastic; bounce; noisy; pose. ???
I've already done this (minus the don't ask again), but I'm still testing it. But thanks for reminding me about pose interpolation, I'll add that.
another one for your consideration:

same setup as before (http://lostmarble.com/forum/viewtopic.p ... 70#p185994)

now on frame 125 - one point selected. right click the red (selected point) channel and add keyframe.
moho correctly creates a (smooth) key (I have "copy previous" as the default)
TWO pop-up windows: "Keys not the same..." and I reply "create" to both - keys correctly created as Bezier for the other 3 points; but the smooth key persists.
I'll look into it. It may already be fixed.
User avatar
Víctor Paredes
Posts: 4874
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Re: *NEW* Bezier Group

Post by Víctor Paredes » Wed Jan 02, 2019 4:50 pm

Thank you very much, Wes!
This will be very useful!
Víctor Paredes
Former Moho Product Manager
Animator in Cartoon Saloon
My Youtube Channel - My webinars
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Fri Jan 04, 2019 3:53 am

I need a little feedback, guys.

I seem to be having trouble with removing points from the selection that are not keyframed the same as the others (keep chasing grass fires). Is this worth the trouble, or is the add keyframe option enough?

I'm thinking that I'd always want to adjust the beziers of all the points I've selected together, so for me it would be pointless to drop some point(s).


Still a work in progress, Victor.
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW* Bezier Group

Post by hayasidist » Fri Jan 04, 2019 8:22 am

synthsin75 wrote:I'm thinking that I'd always want to adjust the beziers of all the points I've selected together, so for me it would be pointless to drop some point(s).
same for me... I'd be totally fine with just the two options: add new keys or cancel -- I'd need the ability to "cancel" then manually change the selection if I'd made an error selecting the points (this tool might be useful for selecting points: viewtopic.php?f=12&t=31612&p=180193&#p180193 -- click on a keyframe and it'll select the points or bones keyed at that frame)
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW* Bezier Group

Post by hayasidist » Sat Jan 05, 2019 10:43 am

quick test on the "frame 125" scenario:

- timeline cursor on frame 60 - edit beziers on the frame 50 key -- that works fantastically!
- timeline cursor still on frame 60 - motion graph editor still in view - right click add key on the x channel on frame 125 - smooth key created for the selected point - two "mismatched keys" pop-ups - Bezier keys created for the 3 "missing" points, smooth stays for the selected point

I haven't kicked the other new tyres yet! ;-)
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Sat Jan 05, 2019 12:28 pm

Updated same link.

I'm much more confident of this build. I simplified a bunch of the code and figured out how to keep the layerscript from invoking the "Add keyframes" dialog again before you get a chance to answer it. :roll:


EDIT: Nope, I broke the code to keep customized interpolation types.
EDIT: No, it does work. I just had the keyframe selected...so it convert to bezier as intended.
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Sun Jan 06, 2019 5:01 am

Updated again. I just forget to reenable layerscript compression.

Unless someone finds a major bug, this should be the final release. Thanks for the help and patience.
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW* Bezier Group

Post by hayasidist » Tue Jan 08, 2019 12:08 pm

I've given this version a fair thrashing over the last couple of days - and it works pretty well! Nice one Wes.

One reproducible feature -- not sure if this is a case of mis-use or not but …

4-point shape - smooth keys on frames 0, 25, 50, 75 - select the fame 50 keys - run your tool - frame 50 becomes Bezier - all works fine
now in the channels view of timeline with just the one point selected - Bezier group and layerscript still there - right click / add keyframe on the "all points" channel on frame 100 - Moho creates smooth keys (copy previous - 75 is smooth) for all points as expected - select all points - select the frame 100 keys - run the tool: keys on 100 not converted to Bezier, but one point is selected
User avatar
synthsin75
Posts: 7127
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Bezier Group

Post by synthsin75 » Tue Jan 08, 2019 8:00 pm

hayasidist wrote:I've given this version a fair thrashing over the last couple of days - and it works pretty well! Nice one Wes.

One reproducible feature -- not sure if this is a case of mis-use or not but …

4-point shape - smooth keys on frames 0, 25, 50, 75 - select the fame 50 keys - run your tool - frame 50 becomes Bezier - all works fine
now in the channels view of timeline with just the one point selected - Bezier group and layerscript still there - right click / add keyframe on the "all points" channel on frame 100 - Moho creates smooth keys (copy previous - 75 is smooth) for all points as expected - select all points - select the frame 100 keys - run the tool: keys on 100 not converted to Bezier, but one point is selected
Again, thank you for putting it through its paces, Paul.

The issue you're seeing is expected. When you select all points of an existing bezier group, it just toggles to single-point selection so the bezier handles show on the motion graph. If you want to convert more keys to bezier, you'll need to clear the bezier group by hitting the button with no points selected (or alternatively, delete the bezier group manually). Then when you set a new bezier group, the selected keys will be converted.

If I didn't do it that way, it would try to convert all keys, or selected, every time you toggled the point/group.

This did lead me to fixing a problem where automatically adding mismatched keyframes was indiscriminately making them all bezier.
Now it will only convert keyframes that have some bezier keys in the selection and/or are selected.
https://sites.google.com/site/synthsin/ ... ects=0&d=1
hayasidist
Posts: 2132
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW* Bezier Group

Post by hayasidist » Wed Jan 09, 2019 12:01 am

oh! sorry to do this --

--- smooth keys on frame 0, 25, 50 with translation between 25 and 50. make the frame 50 key cycle / relative 24 / additive - shape moves across the screen as expected.

keys on 25, 50 selected - run the tool - dialogue re "you have a cycle" - whether I respond "yes" or "no" the cyclic keys on 50 are converted to Bezier. (with no keys selected works as expected)

====
And a thought for your consideration - this keeps your copyright notice in the layerscript and adds eyeball-able version ident (and, should the future need arise, coupled with the comment-stripping idea here: viewtopic.php?f=12&t=32570#p185980 that should optimally compress the actual layerscript file)

Code: Select all

function Syn_BezierGroup:Layerscript()
	local header = [[
-- **************************************************
-- Syn_BezierMatch (c)2018 J.Wesley Fowler (synthsin75)
]]

.. "-- version " .. Syn_BezierGroup:Version() .. "\n" ..

[[
-- For use with syn_bezier_group.lua
-- **************************************************
]]

	local layerscript = [[
function LayerScript(moho)
--<<<snip>>>
end
]]
	return (string.gsub(header, "%s+", " ") .. string.gsub(layerscript, "%s+", " ")) --compress whitespace

end
Post Reply