Re: OM scripting

Date : Thu, 13 Apr 2006 18:35:05 -0400
To : XSI(at)Softimage.COM
From : Joey Ponthieux <j.g.ponthieux(at)LaRC.NASA.GOV>
Subject : Re: OM scripting
Stephen,
	Thanks, this worked perfecly for my oFilter.Subset input, however I am
now more confused than ever. I have two pieces of code that are supposed
to select all the edges of a particular facet, one works, one doesnt,
they are:


//1.DOES NOT WORK
SelectObj("cube", null, true);
var oColl = XSIFactory.CreateActiveXObject("XSI.Collection")
oColl.AddItems(Selection(0).ActivePrimitive.Geometry.Facets);
SelectGeometryComponents(oColl(0).Edges);

//2.WORKS
SelectObj("cube", null, true);
var oSelList = Selection(0).ActivePrimitive.Geometry.Facets;
SelectGeometryComponents(oSelList(1).Edges);



If Selection(0).ActivePrimitive.Geometry.Facets is a facet collection,
how does it differ from an XSI Collection? In this case it would seem
that the XSI Collection is being passed to SelectGeometryComponents in
example 1 and a Facet Collection is being sent to
SelectGeometryComponents in example 2. Why would the XSI Collection work
in the case of filter.subset but not here?  


-- 

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.



Stephen Blair wrote:
> 
> Hi Joey
> 
> Instead of messing about with the selection, just get all the edges into
> a collection and then filter the collection.
> 
> Here's an example, but with polygons and the Quad filter:
> 
> var oCone = ActiveSceneRoot.AddGeometry("Cone","MeshSurface");
> var oPolygons = oCone.ActivePrimitive.Geometry.Polygons;
> 
> var oColl = XSIFactory.CreateActiveXObject("XSI.Collection");
> oColl.AddItems(oPolygons);
> LogMessage( oColl.Count );
> 
> var oFilter = Application.Filters("Quad");
> var oQuads = oFilter.Subset( oColl );
> LogMessage( oQuads.Count );
> 
> Also
> 
> Application.Selection is a Selection object
> Selection(0).ActivePrimitive.Geometry.Segments is a SegmentCollection
> 
> that's why you get the error
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi

  • References:

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.