delete half of model (polygon)?

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  09 September 2005
delete half of model (polygon)?

Would it be possible to write a script that deletes half of a model, the faces (everything on the -X side)?

It would be a big time saver for me. I use smooth proxy a lot with the mirror function. Sometimes when I want to do extrudes in the vertical middle of the model I have to UNsmooth proxy first / do my stuff / then smooth proxy again. But then I have to carefully select the left side of the model and delete. Which cost time if you need to do it 20 times a day.
It's not a big thing, but I think some modelers will find this useful. If some programmers can elaborate on this, that would be great! Thanks in advance.
  09 September 2005
global proc killHalf() {

string $sel[] = `ls -sl`;

select -r ($sel[0] + ".vtx[*]");

string $pnts[] = `ls -sl -fl`;

select -cl;

for($pnt in $pnts) {

float $pos[] = `xform -q -ws -t $pnt`;

if($pos[0] < 0) {

select -add $pnt;







  09 September 2005
HI thanks for your script, very cool!
But it's not always accurate, on a simple model it worked, but on a more detailed model it selection too much.

Check the screenshot:

But I'm gonna do some work myself too, checking out what xform can do for me in the manual.
  09 September 2005
just a fast guess: move the model a little bit so there are no vertices that could belong to both sides ...
  09 September 2005
Hey that's not a bad idea, when I first read it, I thought: "no way". But I moved the object .001 to the X+ and it worked.
I'm gonna to program the move of .001 in the script, and make it move back to 0 when done.

I hope this is a fail proof method.
  09 September 2005
I have changed the code to this:

PHP Code:
 global proc polyKillHalf() {
// put selection in array
string $objSelected[] = `ls -sl`;
// move object to the right
setAttr ($objSelected[0]+".translateX"0.001;
// select vertices of model
select -($objSelected[0] + ".vtx[*]");
// deselect right side of vertices
string $pnts[] = `ls -sl -fl`;
select -cl;
$pnt in $pnts) {
float $pos[] = `xform -q -ws -t $pnt`;
$pos[0] < 0) {
select -add $pnt;
// delete half
// move object to center again
setAttr ($objSelected[0]+".translateX"0;

Thanks for the help!
  09 September 2005
instead of programming a movement of the model, just change the if($pos[0] < ) statement

  09 September 2005
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 06:05 AM.

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