polygon pickwalk script for download

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Display Modes
  03 March 2005
polygon pickwalk script for download

Hi All,
I just wrote a script for pickwalking on polys.. its based on screen space of the current camera, so you can just go up, down, left, right relative to your view...
it also has the option to add the resulting pickwalk to the current selection. (basically grow selection in a particular direction)

here is the link on highend jhPolyPickwalk v1.0

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
  03 March 2005
HE john very cool!!..I'e been trying to write something like that but didn't succeed, was going the way of transforamtion matrix and fail lamentably.(a programer around me at that time suggest it would be the only way, but my math were not up for the challenge).I suppose i can now check inside your brain..hehe ..

Anyway I'll use yours thanks for that very usefull stuff.



cheers
 
  03 March 2005
Thanks, John - very much appreciated.... will try later and report back

A.
__________________

 
  03 March 2005
Originally Posted by thematt: ...was going the way of transforamtion matrix and fail lamentably.(a programer around me at that time suggest it would be the only way, but my math were not up for the challenge).


wow sounds technical... the closest I came to something like that in this script would be checking if ($a > $b)



BTW that link above seems to just go to the search page...
this one should go to the script.

.j
__________________
Make something idiot proof and they'll just build a better idiot

Last edited by john_homer : 03 March 2005 at 12:08 AM.
 
  03 March 2005
Really cool, I like it a lot. Definitely gonna bind this to some hotkeys.

Some crits if you don't mind:

It is a bit counterintuitive as to what it selects (i.e. if I have a vertex at the left rim of a sphere in the viewport it can start pickwalking upwards if I set it to "right" - perfectly logical but not what one would intuitively expect) but this is all in the nature of how it works (which is a really cool idea btw).

It's also a bit slow when the selection starts growing - this might be caused by the creation of all the groups or it might also be caused by the xform command (which is ridiculously slow but alas afaik there's no faster alternative - I think pointPosition is just as slow). Here's a few optimization tips:

1 You could take the original selection and use polySelectConstraint -pp 3; to get the border vertices, and only use those in the main for loop instead of all the selected vertices - if you pickwalk a vertex that's not a on the selection border, you're allways gonna reselect a vertex that was already selected to begin with, aren't you?

2 This is a bit trickier but I think it's gonna make a big speed difference: the script creates (n+1) transforms for every vertex, where n is the number of edges connected to that vertex, so if your selection consists of 10 quad vertices, 50 new transforms will be created am I right? You could skip the group creation entirely using a pointMatrixMult node. If you connect the camera's worldInverseMatrix to the pointMatrixMult's inMatrix attribute and set the pointMatrixMult's inPoint attribute to the world space position of any vertex, the pointMatrixMult's output attribute will store that vertex' position in the cameras local space - same result as getting the translate attributes from your reference groups, but probably a lot faster. And you only need to create one pointMatrixMult node at the start of the script and then you can delete it at the end.

And lastly a request: this script would totally kick ass if you could pickwalk any poly component type - vertex, edge, face, UV. It shouldn't be too hard if you convert e.g. faces to vertices first, run the pickwalk loop, and then convert back to face using polylistComponentConversion -fromVertex -toFace -internal.

Thanks for a great script, mate.
 
  03 March 2005
Quote: creation entirely using a pointMatrixMult node. If you connect the camera's worldInverseMatrix to the pointMatrixMult's inMatrix attribute and set the pointMatrixMult's inPoint attribute to the world space position of any vertex, the pointMatrixMult's output attribute will store that vertex' position in the cameras local space


see what i'm talking about John ?..I guess my math are still not up for that..damn why did i do art school??
Sounds greta anyway Anders.

cheers
 
  03 March 2005
Well, it's based on a very simple, but extremely useful rule:

To convert a point from local space to world space, multiply its local coordinates by the world transform matrix. worldPoint3 = localPoint3 * worldMatrix4

To convert a point from world space to local space, multiply its world coordinates by the inverse of the world transform matrix. localPoint3 = worldPoint3 * inverse(worldMatrix4)

In Maya, all dag nodes (and thus all nodes which derive from dag nodes, e.g. transform nodes) have both the world matrix and inverse world matrix stored as read only attributes, so you don't actually have to know how to multiply points by matrices mathematically (not to mention multiplying matrices by matrices and especially inverting matrices where it gets really involved) - maya can do that for you

Btw my math education isn't that rigorous either, I usually read up on things when I need them. But yes, vector and matrix math can get a bit involved.
 
  03 March 2005
It just occurred to me that you can use a vectorProduct node instead of a pointMatrixMult node. I don't know why Alias have made two nodes for doing the exact same thing, and I don't know which one is better, but the vectorProduct node has a nice and descriptive icon...
 
  03 March 2005
thanks for the head on..I read stuff about it all the time, but it seems that it can never stick in my brain..said the same for mel a year ago and finally got a grip on it..well hopefully it won't take much than that...(not too sure).


thanks anyway
 
  03 March 2005
hey Anders, stop showing me up!!!
cheeky bugger

just kidding buddy, all good suggestions.. and I will look into all of them.
hopefully I get some time, that was probably a pretty premature release of the script, as I'm pretty busy and just wrote it in my breaks over the course of a week and didn't really test it.
I did notice it was dog slow with a large selection ;^)

damn you, after having the idea i couldn't rest untill it was done (hence the working on it in my breaks), now I wont be able to rest untill it is up to the "Anders standard".

the script only creates 1 transform for each vert, and the verts connected to it...
probably doesnt need one for the start vert...


hey did you get my email the other week? I think it bounced! you change addresses? send me a mail if you still have mine would ya?

.j
__________________
Make something idiot proof and they'll just build a better idiot

Last edited by john_homer : 03 March 2005 at 11:17 PM.
 
  03 March 2005
Sorry bout that mate .

The mail most likely bounced. Check your mail and PM.
 
  03 March 2005
hey guys does this script work with maya 6 or 6.5? I get a syntax error in 6.01, maybe I'm doing something wrong, I just dragged it onto my shelf.

Cheers

MunCH
__________________
____________________________

An erection doesn't count as "Personal Growth"
 
  03 March 2005
Originally Posted by MunCHeR: hey guys does this script work with maya 6 or 6.5?

yes, will work in all versions

Originally Posted by MunCHeR: maybe I'm doing something wrong, I just dragged it onto my shelf.

yes, thats what you are doing wrong. not many scripts will work like that...
read the top of the file.

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
  03 March 2005
Thanks john, it helps reading all the info, was running late for work when I tried it (slack excuse), would this be possible to put in a marking menu? and also it only works on vertices right?

Good job John, thanks for sharing

MunCH
__________________
____________________________

An erection doesn't count as "Personal Growth"
 
  03 March 2005
Originally Posted by MunCHeR: would this be possible to put in a marking menu?

sure, just make a marking menu in the usual way, and put the relative commands in.
Originally Posted by MunCHeR: and also it only works on vertices right?

I'll put in support for faces and edges next chance I get, should only take a few minutes...

I'm looking at the speed too.. finding interesting things about maya.. that shouldn't happen.. the slowness is actually due (in part) to the undo que, which I'm looking at going "around"..

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:42 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.