Separate polygon groups into separate objects

297 views
Skip to first unread message

Joe Laffey

unread,
Jun 30, 2008, 10:24:46 PM6/30/08
to Softimage XSI Mailing List
Anyone know of a way to take a single object that has several (200)
distinct polygon groups (connected polygons) and make them each into a
separate object for rigid bodies?

I know I wrtoe a script to do this in LightWave a while back, but cannot
locate it.

I am using 5.11.

Thanks,

--
Joe Laffey | Visual Effects for Film and Video
LAFFEY Computer Imaging | -------------------------------------
St. Louis, MO | Show Reel http://LAFFEY.tv/?e10937
USA | -------------------------------------
. | -*- Digital Fusion Plugins -*-
--------------------------------------------------------------------------
---
Unsubscribe? Mail Majo...@Softimage.COM with the following text in body:
unsubscribe xsi

Wayne Williams

unread,
Jun 30, 2008, 10:39:04 PM6/30/08
to X...@softimage.com
Are you meaning polygon clusters? If so I'm taking a wild guess you'd
script up something to select the components from each poly cluster and
extract polgyons>delete....or is this not what you are wanting to do?

Julian Johnson

unread,
Jul 1, 2008, 2:13:17 AM7/1/08
to X...@softimage.com
Joe Laffey wrote:

Joe, I'm sure I've seen a better script around to do this but this
Python snippet will work on a selected object, convert the polygon
islands to individual objects and parent them under a null at the scene
root...is this what you want?

Julian

split.py

Thiago Costa

unread,
Jul 1, 2008, 2:59:52 AM7/1/08
to X...@softimage.com
maybe this? http://www.xsi-blog.com/archives/260

2008/6/30 Julian Johnson <jul...@exch.demon.co.uk>:
Joe Laffey wrote:

Joe, I'm sure I've seen a better script around to do this but this Python snippet will work on a selected object, convert the polygon islands to individual objects and parent them under a null at the scene root...is this what you want?

Julian

def GetIslands(obj):
       islands = []
       ofilter = Application.Filters("Polygon_Island")
       polys = obj.ActivePrimitive.Geometry.Polygons
       polyidx = [0]*polys.Count
       curpoly = XSIFactory.CreateObject("XSI.Collection")

       for x in range(len(polys)):
               if polyidx[x]:
                         continue
               curpoly.Add(polys[x])
               curisland = ofilter.Subset(curpoly)
               LogMessage(curisland)
               curisland = Application.Dictionary.GetObject(curisland).SubComponent.ComponentCollection
               curpoly.RemoveAll()
               for y in range(len(curisland)):
                       polyidx[curisland(y).Index] = 1
               LogMessage(polyidx)
               islands.append(curisland)

       Application.DeselectAll()
       return islands

obj = Application.Selection(0)
islands = GetIslands(obj)
oNull = Application.ActiveSceneRoot.AddNull('Objects_Parent')
for x in islands:
       Application.SelectObj(x)
       oIsland = Application.ExtractFromComponents("ExtractPolygonsOp", "", "polymsh_extracted", "", "siPersistentOperation", "siKeepGenOpInputs", "")
       oNull.AddChild(oIsland[0][0])


Ponthieux, Joey

unread,
Jul 1, 2008, 11:03:50 AM7/1/08
to X...@softimage.com
Joe this is qualified for 5 and up. It should do what you want.

http://community.softimage.com/downloads.php?do=file&id=21

Joey Ponthieux
NCI Information Systems Inc.
NASA Langley Research Center
____________________________________________________________
Opinions stated here-in are strictly those of the author and
do not represent the opinions of NASA or any other party.

Joe Laffey

unread,
Jul 1, 2008, 11:10:57 AM7/1/08
to X...@softimage.com
On Tue, 1 Jul 2008, Ponthieux, Joey wrote:

> Joe this is qualified for 5 and up. It should do what you want.
>
> http://community.softimage.com/downloads.php?do=file&id=21

Thanks, and thanks to Julian Johnson for his script as well. I was able to
find a solution last night. In NetView there is one script that tags
separate poly islands with different clusters, and then there is another
script that separates clusters into distinct objects. These two new tools
are even better, though (one step).

Thanks again,

--
Joe Laffey | Visual Effects for Film and Video
LAFFEY Computer Imaging | -------------------------------------

St. Louis, MO | Show Reel http://LAFFEY.tv/?e10939

John Payne

unread,
Jul 2, 2008, 10:34:46 AM7/2/08
to X...@softimage.com
Hi Joe,

Did you try the shatter script, (XSI shatter v4), from:

http://www.motionblur.it/

-----Original Message-----
From: owne...@Softimage.COM [mailto:owne...@Softimage.COM] On Behalf Of
Joe Laffey
Sent: Monday, June 30, 2008 10:25 PM
To: Softimage XSI Mailing List
Subject: Separate polygon groups into separate objects

Joe Laffey

unread,
Jul 2, 2008, 10:43:12 AM7/2/08
to X...@softimage.com
On Wed, 2 Jul 2008, John Payne wrote:

> Hi Joe,
>
> Did you try the shatter script, (XSI shatter v4), from:
>
> http://www.motionblur.it/


Thanks, yes. It was decent, but in the end I had to make a custom cutter
object and boolean it in order to get the pieces into the shapes I wanted.
Then I needed to make each piece a separte object... But XSI began to
choke on so many dynamic objects (600), and many of the booleaned objects
caused "Could not generate convex hull" errors.

I took it into LightWave instead (because LW lets you have a single object
with multiple polygon islands and the dynamics engine treats it individual
pieces instantly), and the dynamics ran very fast. I was able to get the
results I wanted there.

Thanks,

--
Joe Laffey | Visual Effects for Film and Video
LAFFEY Computer Imaging | -------------------------------------

St. Louis, MO | Show Reel http://LAFFEY.tv/?e10946

Reply all
Reply to author
Forward
0 new messages