Script idea for magnet mod: relax

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

Post Reply
User avatar
funksmaname
Posts: 3113
Joined: Tue May 29, 2007 11:31 am
Location: Nelson, New Zealand

Script idea for magnet mod: relax

Post by funksmaname » Fri Aug 19, 2016 5:08 am

Hey, just messing with mesh warp and thought it would be cool if there was a way to 'relax' magnet edits towards points position at a different frame (initially, frame 0 position, but maybe could be set by one of the timline markers or something?)

Similar to when you use the liquify tool in photoshop, you can 'relax' your edits so they aren't so extreme - strength could be pen pressure controlled too?

Just a passing thought, could be great for working with meshes... don't know how difficult it would be...?
User avatar
chucky
Posts: 3937
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: Script idea for magnet mod: relax

Post by chucky » Tue Aug 23, 2016 2:21 pm

Many uv editors for 3d use tools like relax to ease out overlaps and bunching. It would be a perfect magnet type addition to the moho toolset.
Sequential offender.
my latest animations
Breinmeester
Posts: 294
Joined: Thu May 13, 2010 2:01 pm

Re: Script idea for magnet mod: relax

Post by Breinmeester » Wed Aug 24, 2016 3:28 pm

I've modifications to the magnet tool on my to-do list. I don't fully grasp the idea yet. Can you explain a little further?
User avatar
funksmaname
Posts: 3113
Joined: Tue May 29, 2007 11:31 am
Location: Nelson, New Zealand

Re: Script idea for magnet mod: relax

Post by funksmaname » Thu Aug 25, 2016 2:26 am

w00t!

Well, say you smoosh some points about with the magnet tool, the only ways to unsmoosh them is either to continue using the magnet tool and pulling things back (often creating more of a smoosh than before), or copying their previous position from a key. What you might want to do is just 'relax' your smooshing - so by 'rubbing' an area with the magnet tool and a mod key the points slowly ease back to the position they had at the previous keyframe, you could then 'ease' different parts of your smoosh to get the effect you want with more control as you can target a small or big area to relax the movement...

hope this made more sense - please let me know if still confused and I'll try to simplify my explanation further (or record a video explanation)
User avatar
synthsin75
Posts: 7241
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Script idea for magnet mod: relax

Post by synthsin75 » Thu Aug 25, 2016 2:36 am

Personally, I think what we need is a value to control the magnet influence drop-off. We could then get sharper or more relaxed drop-off. Maybe that would help not get bunched points in the first place?
User avatar
chucky
Posts: 3937
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: Script idea for magnet mod: relax

Post by chucky » Thu Aug 25, 2016 3:02 am

Sure Wes, agreed but it's still nice to get out of problems when they occur. I thought I'd actually requested the relax feature months ago, or at least suggested somewhere in Lenny's or Mantis.
Aah here it was
viewtopic.php?f=18&t=29378&p=166216&hilit=mesh#p166216
Sequential offender.
my latest animations
dkwroot
Posts: 661
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Script idea for magnet mod: relax

Post by dkwroot » Fri Feb 10, 2017 4:33 pm

This sounds like it would be really useful for warp cages. I have a rough idea about how to do this.

I think you would have to find the vector positions of every point on the previous keyframe. You would then subtract the current vector position of a point by it's previous vector position to get the position change (Vec_change).

When the user brushes over a point, the pen pressure should gradually add to a value 'D'. The value D will be clamped to a range of 0 to 1.

When the user lifts the pen, the program would calculate each vector position like this:
VecPos = VecPos - Vec_change * D

where VecPos = Current Position of a Vector, Vec_Change = the difference between the vectors current position and the previous keyframe position, D = pen strength

EDIT:
I created a relax points tool. It's not the magnet tool improvement you wanted, but it gets the job done. viewtopic.php?f=12&t=30542
Post Reply