MR Curve Tool 4.1

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

Quick update on the Style settings: the Curve tool created shapes with the desired colors and width only after I changed the Style settings using the Styles window. After that, changing the styles from the Curve tool's Tool options worked properly, and it now appears to stay in sync with the Style Window.

That might be another reason I hadn't noticed that before: I tend make style changes only in the Style window, not in Tool options.

I'm not sure yet if this was a random glitch. I'll play around with this a little more later this afternoon and post what I learn here.
User avatar
KuzKuz
Posts: 509
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Curve Tool

Post by KuzKuz »

Greenlaw wrote: Sun Feb 19, 2023 9:11 pm Quick update on the Style settings: the Curve tool created shapes with the desired colors and width only after I changed the Style settings using the Styles window. After that, changing the styles from the Curve tool's Tool options worked properly, and it now appears to stay in sync with the Style Window.

That might be another reason I hadn't noticed that before: I tend make style changes only in the Style window, not in Tool options.

I'm not sure yet if this was a random glitch. I'll play around with this a little more later this afternoon and post what I learn here.
Thank you for your time. Looks like I found what was causing the problem. Can you try this version of the script?
https://drive.google.com/file/d/1Jafrrl ... sp=sharing
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

Hey Eugene,

I tried the latest version and here's what I found:

1. Use Bezier Handles works now! Disabling this option now prevents Bezier mode from becoming activated, and the setting persists. Re-enabling it allows me to draw with Bezier Handles.

2. Threshold also now works correctly! increasing the value allows me to drag longer before activating Bezier mode. The value now persists and isn't reset when the mouse button is released.

Thank you so much for fixing this! MR_Curve is officially my current favorite tool! 😸

As for Style options, I was able to get the Stroke color to change from white to a different color but the Width setting was ignored. When I made the adjustments in the Style window, the color and width boxes in the Tool options started working properly. This is a minor issue though since I rarely make style changes in the Tool options bar. I'll keep playing around with these options and let you know if I observe anything else.

I noticed that MR_Curve doesn't allow me to delete points when using Delete or Backspace like Add Points does. This is very minor too, as this feature is probably more useful when points can be selected/deselected using the same tool, and even Add Point's doesn't do that. No biggie to switch tools when I need that.

Thanks again for sharing this fantastic tool!
User avatar
KuzKuz
Posts: 509
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Curve Tool

Post by KuzKuz »

Thank you very much for your help! I'll try to fix the styles problem soon. I think I can add the ability to select and delete points when the tool is not in draw mode.
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

Here's what I'm seeing with the Style options...

Image

After recording the above video I discovered that MR_Curve's Style options do work when the Style window is open before the tool is used. It seems the Style Window needs to be open for the tool to read the previously used settings from, and for the Style options to become activated.

Hope this is helpful.
Last edited by Greenlaw on Tue Feb 21, 2023 1:56 am, edited 1 time in total.
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

Update: I should have checked this earlier but the same goes for Fill. Changing it from the Tool options does not work until I first make the change in the Style window, or have the Style window open before selecting the tool.

Also, if I have MR_Curve selected, switch tools, then open the Style window, and then switch back to MR_Curve, the Fill and Stroke Style options in the Tools option bar will start working.
Last edited by Greenlaw on Tue Feb 21, 2023 1:58 am, edited 4 times in total.
User avatar
KuzKuz
Posts: 509
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Curve Tool

Post by KuzKuz »

Great! I can reproduce it now. It really helped.
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

One more thing:

MR_Curve doesn't work well with a Wacom Cintiq Pen. To be fair, Add Points isn't great with a pen either, and because of this I typically switch to a mouse when working in Moho.

With Add Points, it's always been kinda messy with a Wacom pen because of the double-click dragging action.

With MR_Curve, I thought a pen might work better since MR_Curve only needs a single-click but it behaves a little strangely with a pen too.

Even though I typically switch to a mouse when using Moho, I thought you should know.

Of course, MR_Curve is awesome with a mouse!
User avatar
KuzKuz
Posts: 509
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Curve Tool

Post by KuzKuz »

I studied the problem and I have several options for solving it.

1. Make the Auto-fill and the Auto-stroke options inactive until the Style panel is open.
2. Make Fill Color, Stroke Color and Stroke Width settings Independent from the Style panel.
3. Make Fill Color, Stroke Color and Stroke Width settings Independent from the Style panel until the style panel is open and then connect to the panel.

Which option would be best for you?
User avatar
synthsin75
Posts: 10027
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: MR Curve Tool

Post by synthsin75 »

Correct me if I'm wrong, but couldn't you store moho:CurrentEditStyle() in OnMouseDown?
UI functions probably don't get called regularly enough to always update.
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

KuzKuz wrote: Tue Feb 21, 2023 3:51 am I studied the problem and I have several options for solving it.

1. Make the Auto-fill and the Auto-stroke options inactive until the Style panel is open.
2. Make Fill Color, Stroke Color and Stroke Width settings Independent from the Style panel.
3. Make Fill Color, Stroke Color and Stroke Width settings Independent from the Style panel until the style panel is open and then connect to the panel.

Which option would be best for you?
I think #3? I can see myself using the MR_Curve's Style settings in the Tool Options initially and then switching to the Style window only when I need more advanced Style options.

It would be ideal if the options can be linked to the Style window all the time as Wes' post seems to suggest (and like how the Select Shape tool's Style options seems to be,) but only if doing so doesn't hurt performance of course.

If that's not possible, option #3 sounds like a very good alternative.
User avatar
KuzKuz
Posts: 509
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Curve Tool

Post by KuzKuz »

synthsin75 wrote: Tue Feb 21, 2023 5:35 am Correct me if I'm wrong, but couldn't you store moho:CurrentEditStyle() in OnMouseDown?
UI functions probably don't get called regularly enough to always update.
Thanks for helping me.
However, I am unable to access the Style panel until it is open. moho:CurrentEditStyle() returns nil even when used in OnMouseDown.
User avatar
KuzKuz
Posts: 509
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: MR Curve Tool

Post by KuzKuz »

Added a third solution to the problem with the Style panel.
Also added the ability to select points by holding Shift+Alt.
Unfortunately, I did not add the ability to add to selection and remove from selection, since almost all modifier key combinations are already used.
The Delete key can be used to delete selected points.
Please let me know if it works well now.

https://drive.google.com/file/d/1Jafrrl ... sp=sharing
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

Thanks Eugene! I'll test this release as soon as I can today. (Can't wait!) 😸
User avatar
Greenlaw
Posts: 9443
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: MR Curve Tool

Post by Greenlaw »

It's perfect!

The new Style options now behaves just as I would expect it to.

Shift+Alt+drag to select points is good, and Shift+Alt+click in empty area to drop all points is good enough for deselection. I think this addition will be incredibly useful as is. If the user really needs more than that they can switch to the Selection tool.

Thank you so much for your hard work Eugene. For anyone that draws with the Add-Points tool as much as I do, this latest version of MR Curve is an essential add-on for Moho!
Post Reply