Re: C++ question

Date : Tue, 5 Jul 2005 15:46:21 +1000
To : XSI(at)Softimage.COM
From : Aloys Baillet <aloys.baillet(at)gmail.com>
Subject : Re: C++ question
Hi Hans,

Indeed, that's one of the missing features of the C++ API...
You will have to use the CComAPIHandler to get the Member property.
Here is some code that should help you if it's the first time you're using it.
The tricky part is that the SceneItemCollection COM object is not translated in a CRefArray by the GetProperty, so you have to use the CComAPIHandler all the way long...

    CComAPIHandler oGroup( oGroupRef );
    CValue oGroupMembers( oGroup.GetProperty( L"Members") );
    CComAPIHandler oGroupSceneItems( oGroupMembers );
    long nbMembers = oGroupSceneItems.GetProperty(L"Count");
    Application().LogMessage(L"NB Members: " + CValue(nbMembers).GetAsText());
    for (long i=0; i<nbMembers; i++)
    {
        CValue oRef;
        CValueArray oArgs(1);
        oArgs[0] = CValue(i);
        oGroupSceneItems.Invoke(L"Item", oGroupSceneItems.PropertyGet , oRef, oArgs);
        X3DObject oObj(oRef);
        Application().LogMessage(L"Member : " + oObj.GetFullName());
    }

Hope this helps!

Aloys
On 7/5/05, Hans,Veenendaal,AMplus R&D,SOJ <Hans_van_Veenendaal(at)sega.co.jp> wrote:
Hi All,
 
How do one access the members in a group through the c++ interface?
 
The XSI::Group class doesn't seem to  have a GetMembers function...
 
Hans.
 



--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--
  • References:
    • C++ question
      • From: "Hans,Veenendaal,AMplus R&D,SOJ" <Hans_van_Veenendaal(at)sega.co.jp>

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.