Hi All,
Just wondering if anyone knows a good way of finding objects have no verts. I'm just trying to weed a few unnecessary objects out of a scene but I'm going to have to do it often so i'm trying to find a good way of selecting(then deleting) these objects through scripting.
Thanks
Pete
Finding objects with no verts
- xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 11:02
- Location: Montreal Canada
- Contact:
Re: Finding objects with no verts
Here's an old script I found on my hard drive.
Code: Select all
var oNoPoints = new ActiveXObject( "XSI.Collection" );
SelectObj( "#3dobject" );
SelectAllUsingFilter("object", siCheckComponentVisibility, null, null);
oEnum = new Enumerator( Application.Selection ) ;
for (;!oEnum.atEnd();oEnum.moveNext() )
{
var oSelItem = oEnum.item() ;
if ( classname( oSelItem ) == "X3DObject" &&
oSelItem.Type == "polymsh" &&
oSelItem.ActivePrimitive.Geometry.Points.Count == 0
)
{
oNoPoints.Add( oSelItem );
LogMessage( oSelItem.fullname + " has zero points" );
}
}
SelectObj( oNoPoints );
Re: Finding objects with no verts
Awesome, thanks man! I didn't receive a notification for this one so i only just got it. I'll clean up my dodgy hacky workaround now
Thanks!
Pete
Thanks!
Pete
Who is online
Users browsing this forum: No registered users and 36 guests