Re: [scripting] Findobjects

Date : Wed, 26 Sep 2007 16:17:39 +0100
To : XSI(at)Softimage.COM
From : Julian Johnson <julian(at)exch.demon.co.uk>
Subject : Re: [scripting] Findobjects
Alexander Hemery wrote:
What I'm trying to do is .. while in a for loop going through each object in a scene, delete all material clusters but leave the texture coordinates intact.
I would use DeleteObj oObj & "*.cls.Polygon*", but there are some material clusters that are renamed randomly.
Any help appreciated!

Hi Alex,

Could you do this:

oDelete = XSIFactory.CreateObject('XSI.Collection')

oFoundClusters = Application.FindObjects("","{600E50F1-52FC-11D2-A924-00A024190119}")
for x in oFoundClusters:
for y in x.LocalProperties:
if y.Type == 'material':
oDelete.Add(x)
Application.DeleteObj(oDelete)


Just check to see if there's a material node in the Local Properties of the cluster?

Julian
========================================

This e-mail (and any attachments) is confidential and may contain personal views which are not the views of Men-from-Mars unless specifically stated.

If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi



Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.