Re: Trying to IsA a PolyMesh

Date : Mon, 18 Jul 2005 14:55:23 +0100 (BST)
To : XSI(at)Softimage.COM
From : "Andrew Nicholas" <andy(at)andynicholas.com>
Subject : Re: Trying to IsA a PolyMesh
Hi Alan,

You might want to check what class of object you're starting with by using
the GetClassIDName() method. Sometimes you won't always have what you
think you should have. I've been caught out a few times by this.

The code below obtains the PolygonMesh object from a polymesh input
connection of a SCOP:


   XSI::InputPort polyMeshPort(op.GetPort(L"polymshIn",L"Group_0",0));
   XSI::Primitive primitive(polyMeshPort.GetValue());

   //Get geometry object from primitive
   XSI::Geometry geometry(primitive.GetGeometry());

   //Check that the geometry is actually a polygon mesh
   if(!geometry.IsA(XSI::siPolygonMeshID)) return XSI::CStatus::Fail;

   //Create the polygon mesh object
   XSI::PolygonMesh polyMesh(geometry);

Hope this helps.

Cheers

Andy





> When I run .IsA on a poly mesh it tells me it's an X3DObject - so I
> try getting the activeprimitive of it and it tells me it's a
> primitive.
>
> Any idea why I'm getting non-specific types? This is in C++
>
> 		CRef item = app.GetSelection().GetItem(0) ;
> 		if (item.IsA(siPolygonMeshID) ) {
> 			//nope it says it's not...
>
> Thanks,
>
> Alan.
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>

---
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.