Magnet Tool for maya.


#1

Hello everyone! I gues it’s time to share with you one of my favorite scripts - magnet tool. This is much like LightWaves drag net, or wing’s3d tweak mode, the only difference that it moves the vertexies in a most perpendicular to the current view plane. A handy tool while tweaking geometry, creating blend shapes, etc.

It works on polygons and only on maya version 6( or higher :slight_smile: ), since it uses some of it’s new features.
Note that the script uses it’s own undo( assigned at ctrl + left mouse click), and it turns off maya’s native undo, but leaving the queue.

Here is the archive, there you’ll find a script itself, an icon, and a detailed description txt file which contents the installation directions.
There still could be some bugs, since I haven’t seriously beta tested it, so if you find one - report right away:)

And of course crits and suggestions wellcome:)

EDIT: It’s annoying to use ctrl+click undo instead of maya’s ctrl + z (z) combination for the undo.
You can create a new hotkey with this code and assign it to z (ctrl+z) replacing maya’s default undo. This code forces the Magnet to use it’s own undo when it’s active, when it’s not - it will perform maya’s standart undo.

$CurTool = `currentCtx `;
    if($CurTool == "HKMagnetTool")
    {
    $Obj = `ls -hl`;
    if(`size $Obj` > 0)
    {
     string $Shape[];
    		  $Shape = `listRelatives -s -ni $Obj[0]`;
    		 string $DNode[];
    		  $DNode = `listConnections -s 1 -d 0 ($Shape[0]+".inMesh")`;
    		 if( `nodeType $DNode[0]` == "softMod")
    		  delete $DNode;
    }
    }
    else 
    undo;
 Hope you find it nifty:)

EDIT: Keep the time and range sliders active! And you will not have any crash problems. Thank you:)


#2

Also Here you can find a little( 3.5 mb) video demonstration of the tool, encoded with Tech Smith codec, which can be downloaded here.
And here’s a little screnie of what’s inside:)

edit: fixed the broken link for the video demo, now it’s working:)


#3

thx a lot…:bounce:


#4

seems to work great man … but how do i get that options windows you have in your screenshot to display


#5

Hi Mr Hawk -
This does look like a really cool tool for Maya but I seem to keep getting a “Fatal Error”. It always happens just as I start adjusting the magnet’s radius. Maya tries to save the scene in a Temp directory.
I’m using Maya 6.0.1, Win2000 SP4, P42.4G, 2GRam, and a Quadro FX1100 with the latest drivers.
Can you maybe tell me why this is happing???

Thanks!


#6

I think that error is similar to the Koshigaya Interactive Loop error. It causes it when your mesh has no history. I just got that error after I deleted the history and tried to get into the tool again. Aside from that, it’s a very cool script!


#7

absolutely amazing dude :beer:
the best softselection ever :slight_smile:


#8

Thank you all for the replies :slight_smile:

to d0c:
To open the option window you can double click the shelf icon which is created by the tool.
Or you can just use “HKMOptionBox;” command to call it.

roger:
This looks like a serious bug of maya, since the whole tool is scripted, and nothing exept of mel commands is used, so it looks like some combination of mel commands causes maya to fall. I’m not getting such error, so I unfortunately can’t debug it properly with this error.

Iconoclast:
So you say if the history isn’t deleted the fatal error is gone?


#9

I believe so, but I’m not entirely positive. All I know is that Koshigaya has/had the same problem with his interactive loop split script. You might want to ask him about it.


#10

Mr.Hawk -
I wonder why I am having these fatal errors while you are not??
I did try not deleting history on the poly object and I still got a fatal error :scream:
Is anyone else getting a fatal error when using this tool??


#11

Eyyyyy . . . . Mr.HawK. i will give your script a test run. finally something similiar to byron soft transformation tool! cos that soft mod in maya six just doesn;t work intuitively. BIG THX.

ill give it a shot and see if i find bugs and such.

regards,

rw


#12

hey Hawk. there is a big fatal error when i just try to use the tools. you might want to debug it again.

regards


#13

This is really, really strange… I’ll need to change something, that’s for sure. Ok I need some beta testers to get rid of this error, If someone is interested, don’t be shy:)

And since I don’t know what’s causing this error I’d ask those lucky ones that have no error to post their configurations. My gues is that on pentium machines it falls but on athlon ones not.


#14

I think your magnet tool has great potential…and I’m getting the fatal errors so I will be more than happy to be a beta tester!


#15

The magnet tool is great! Love it. Thanx a lot.

I have a few suggestion

  • Gradient Color Falloff for the radius. Makes it easier to see the center of action. Like Soft Selection in 3dsmax. Scroll down to see a videoclip showing SoftSel color display.TSCC codec http://www.martincoven.com/Main_Tools.html

  • A mirror option for X Y Z. Similar to the reflection in SculptPolygonTool. Useful for modelling Blendshapes.

  • Dont know its its possible in Maya. If possible then add highlight temporary selection. That is useful for tweaking in areas with lots of polygons. Basically it highlights components without affecting them until holding down leftmouse and dragging. Similar to wings3D.

Is the history supposed to disappear after each tweak? It does not. Its not of a big deal but i see that there is “Kill history on Tool Completion” but i dont find it doing much. Other than that it works well. Celeron 2.4Ghz here

Cheers


#16

Awesome, just awesome! I tested it and it works like a charm. I am in love with you.


#17

hey hawk, when will you update the script ? it will be great if it will work for intel chip also. it will be great if i could tested it again.

regards


#18

wow… this script looks really good in the AVI file. for me, it crashes even when i’m using it on a cylinder. i dont think i want to try it on my models.

i hate fatal errors.


#19

Hey Hawk,

thanks for that cool tool. you did a good job writing it !!
But here is my problem :
-using it on my home xp machine, it crashes after the first use with a fatal error.
-same on my linux rh 7.2 machine at work.
interesting :
it works very stable in my collegues rh 9 machine ( thats where I tested it today) all of the machines are pentiums ... the red hat 9 is the only one that work. dont ask me what`s the difference =)

Also, in all cases I had to // the last part (global proc HKMagnetTool() as maya gives me
sourceing errors otherwise.
anyway, hope to use it soon on all machine.
thanks,
Flo


#20

hey Flo, is that RH9 has visual C++ installed in it. or anything with c++ ?
im encountring some plugins wotn work until i install C++ compiler on the machine.

this is just my guess. if you coulds check that, its will be a great resource for Mr.Hawk.

regards