CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 02-16-2013, 06:41 PM   #1
cgbeige's Avatar
Dave Girard
Opinions are mine. You can't have them.
Oakland, USA
Join Date: Jul 2005
Posts: 7,020
problem with script due to poly count change

I'm trying to do a simple script that selects an nGon and then extrudes the faces and merges the extruded verts. The first part is fine but what happens when I try and select the next face is that, since the previous extrusion has created more faces, the face I want to select is no longer named pCylinder15.f[20], for example. Is there some way around this some sort of absolute selection that doesn't use the name like this?
Old 02-16-2013, 07:58 PM   #2
Dee Mae
Salis, GB
Join Date: Jun 2008
Posts: 369
Hmm that is a bit annoying that the face names get 're-issued'.
Not sure how else Maya would do what it needs to do there, but still annoying.

Only time I've seen someone have to deal with similar I think they assigned a temp_unique shader to the faces and use the 'Select objects with Material' to get the faces.
Sounds like the long way round to me.

Would also be interested in alternative methods
Old 02-16-2013, 11:03 PM   #3
Nyro's Avatar
A. D.
Vertex Slinger
Munich, Germany
Join Date: Dec 2006
Posts: 1,436
You could try adding vertices (or any other component) to a set before performing the extrusion. Sets contain only a reference to their members, i.e. when a member changes it's name or value the reference is kept intact. So after extruding you query the set members and delete the set.
Old 02-17-2013, 12:08 AM   #4
cgbeige's Avatar
Dave Girard
Opinions are mine. You can't have them.
Oakland, USA
Join Date: Jul 2005
Posts: 7,020
ah - of course, sets. That works great now.
polyExtrudeFacet; string $compStorey[] = `filterExpand -sm 34 -expand true`; string $createSetResulty[] = {}; for ($n=0 ; $n<size($compStorey) ; $n++) { select -r $compStorey[$n]; $createSetResulty[$n] = `sets -name ("setTemp" + $n)`; } for ($n=0 ; $n<size($compStorey) ; $n++) { select -r $createSetResulty[$n]; ConvertSelectionToFaces; MergeVerts; }

Last edited by cgbeige : 02-17-2013 at 12:22 AM.
Old 02-17-2013, 12:08 AM   #5
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
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
Society of Digital Artists

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

All times are GMT. The time now is 08:44 AM.

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