RE: Display Callback Performance

Date : Sat, 4 Mar 2006 18:39:31 +0900
To : <XSI(at)Softimage.COM>
From : "Hans,Veenendaal,AMplus R&D,SOJ" <Hans_van_Veenendaal(at)sega.co.jp>
Subject : RE: Display Callback Performance
Thanks for the help,

Forgive me if I'm wrong, but FindObjects is not an object model function, and using ExecuteCommand will report a line in the Message Window. I don't want to have hundreds of info messages passing by when moving a window.

A Display Callback is programmed in C++ so how do I call FindObjects without using ExecuteCommand and displaying messages?

Also in my test when using ExecuteCommand it is slower then FindChildren. This is probably caused by the messages I get every frame.

5.3Hz vs 7.8Hz with 37 nulls and nothing visible.

Confused...

Using indices instead of parameter names is a little faster, but not by much. I'm not reading that many parameters (~10)

Do you think it might be faster to traverse the scene by myself? This would prevent the creation of a CRefArray every time I re-display... or would it. 

Hans.


>-----Original Message-----
>From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] 
>On Behalf Of Stephen Blair
>Sent: Saturday, March 04, 2006 00:58
>To: XSI(at)Softimage.COM
>Subject: RE: Display Callback Performance
>
>{5FC0CCAE-3DC8-11D0-9449-00AA006D3165} will find all 3d 
>objects eg nulls, lights, camera root.
>
>Do this to get the null primitives, then you can get the nulls 
>via the Parent property.
>var oNullPrimitives = FindObjects( null, 
>"{7DD91AA2-89D8-11D0-A75C-00AA00BB6238}" ); 
>
>-----Original Message-----
>From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] 
>On Behalf Of Guy Rabiller
>Sent: March 3, 2006 10:52 AM
>To: XSI(at)Softimage.COM
>Subject: Re: Display Callback Performance
>
>Hi Hans,
>
>regarding the MyProperty.GetParameterValue() part, you should 
>try to use array indices on parameters ref array.
>
>CParameterRefArray oParams( MyProperty.GetParameters() );
>
>Then get the values directly:
>
>CValue oVal1( Parameter(oParams[0]).GetValue() );
>
>Of course you should seek for the right parameter index, but 
>on known Properties, it should be persistent.
>( That said, you'll need to re-check this after a new XSI 
>version is released ).
>
>You should see significant speed boost.
>( I got ~30% speed increase on our fluids simulation plugins 
>with this ).
>
>Also, avoid Find at all cost. Better use a 
>GetProperties().GetItem( L"MyProp" ) then check if the CRef is 
>of ClassID siPropertyID ( or siCustomPropertyID ).
>
>For finding objects you might try the CLSID path rather than 
>the FindChildren one, albeit I didnt run extensive tests on this one.
>( using the FindObjects Command with the CLSID of the Null 
>Class - for instance - wich is 
>{5FC0CCAE-3DC8-11D0-9449-00AA006D3165} ).
>
>Let me know.
>
>--
>guy rabiller | 3d technical director (at) LaMaison
>
>
>Hans,Veenendaal,AMplus R&D,SOJ a écrit :
>> Hello All,
>>  
>> I've created a Display Callback that adds visualization for a Custom 
>> Property connected to nulls.
>>  
>> When I create several of those nulls the performance really drops, 
>> while I'm not drawing anything heavy.
>>  
>> Statistics:    37 Nulls (Hidden)
>> No Display Callback:      60.0 Hz.   [Nothing is Drawn except for 
>> standard view]
>> With Display Callback:     7.8 Hz.  [Nothing is Drawn except for 
>> standard view]
>>  
>> Statistics:    37 Nulls (Visible)
>> No Display Callback:      60.0 Hz.   [All Nulls Visible]
>> With Display Callback:     4.8 Hz.  [All Nulls Visible and as little 
>> as possible attributes drawn]
>> With Display Callback:     4.8 Hz.  [All Nulls Visible and all 
>> possible attributes drawn]
>>  
>> I suspect that I take the performance hit on getting stuff 
>out of XSI...
>>  
>> Maybe somebody can tell me whether there are faster methods than the 
>> ones I'm using:
>>  
>> Get Scene Root with :
>> Model SceneRoot = app.GetActiveSceneRoot();
>>  
>> Find the nulls with:
>> nulls = SceneRoot.FindChildren(NULL, L"null", empty);    // This is 
>> probably painful.
>>  
>> Get the properties of the nulls with:
>> CRefArray props = obj.GetProperties();
>>  
>> Find Visibility Property
>> CRef o;
>> if(props.Find(L"visibility", o) == CStatus::OK)
>>  
>> Find Parameter with
>> CValue val = Visibility.GetParameterValue(L"viewvis");
>>  
>> Find my Property
>> if(props.Find(L"MyProperty", o) == CStatus::OK)
>>  
>> Find Parameter with
>> CValue val1 = MyProperty.GetParameterValue(L"param1"); // This also 
>> seems less than optimal.
>> CValue val2 = MyProperty.GetParameterValue(L"param2");
>> CValue val3 = MyProperty.GetParameterValue(L"param3");
>> CValue val4 = MyProperty.GetParameterValue(L"param4");
>> CValue val5 = MyProperty.GetParameterValue(L"param5");
>> CValue val6 = MyProperty.GetParameterValue(L"param6");
>>  
>> Get null global Position with:
>> Kinematics Kine = obj.GetKinematics();                       
> // This 
>> also seems a bit elaborate.
>> KinematicState Global = Kine.GetGlobal(); 
>MATH::CTransformation Trans 
>> = Global.GetTransform(); double x,y,z; 
>> Trans.GetTranslationValues(x,y,z);
>> Any help is welcome. Thanks.
>>  
>> Hans.
>>  
>>  
>> ---------------------------------------
>> Hans van Veenendaal,
>> Sega AM plus
>>  
>
>
>
>
>---
>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
>

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