getting user defined ice attributes c++

83 views
Skip to first unread message

Stephan Woermann

unread,
Sep 22, 2012, 6:14:06 AM9/22/12
to soft...@listproc.autodesk.com
Have a problem to get user defined ICE attributes.
I can check if an attribute is available. But the count of data is different.

ICEAttribute attr = cloud.GetActivePrimitive().GetGeometry().GetICEAttributeFromName( L"TestAttribute" );
Application().LogMessage( CString( attr.GetElementCount() ) );

This gives me a right value.


CICEAttributeDataArrayBool cTest;
attr.GetDataArray( cTest );
Application().LogMessage( CString( cTest.GetCount() ) );

Gives me 0 back.

With known attributes like Size or PointPosition, i get with both of them the right value...



Alok Gandhi

unread,
Sep 22, 2012, 10:26:22 AM9/22/12
to soft...@listproc.autodesk.com
The custom attributes have a lazy update implementation and are evaluated on as needed basis. If you force the attribute by showing it, or using it somehow in the tree, it might give you right count.
--

Chris Chia

unread,
Sep 22, 2012, 12:13:11 PM9/22/12
to <softimage@listproc.autodesk.com>
Forcing it to display will prevent the optimisation from affecting the data...

Chris

On 22 Sep, 2012, at 10:26 PM, "Alok Gandhi" <alok.ga...@gmail.com<mailto:alok.ga...@gmail.com>> wrote:

The custom attributes have a lazy update implementation and are evaluated on as needed basis. If you force the attribute by showing it, or using it somehow in the tree, it might give you right count.

On Sat, Sep 22, 2012 at 6:14 AM, Stephan Woermann <swoer...@googlemail.com<mailto:swoer...@googlemail.com>> wrote:
Have a problem to get user defined ICE attributes.
I can check if an attribute is available. But the count of data is different.

ICEAttribute attr = cloud.GetActivePrimitive().GetGeometry().GetICEAttributeFromName( L"TestAttribute" );
Application().LogMessage( CString( attr.GetElementCount() ) );

This gives me a right value.


CICEAttributeDataArrayBool cTest;
attr.GetDataArray( cTest );
Application().LogMessage( CString( cTest.GetCount() ) );

Gives me 0 back.

With known attributes like Size or PointPosition, i get with both of them the right value...






--
[cid:]
winmail.dat

Alok

unread,
Sep 22, 2012, 12:33:11 PM9/22/12
to soft...@listproc.autodesk.com
Here is a good read on the subject:
http://www.andynicholas.com/?p=360

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2221 / Virus Database: 2441/5285 - Release Date: 09/22/12

Stephan Woermann

unread,
Sep 22, 2012, 6:48:52 PM9/22/12
to soft...@listproc.autodesk.com
Many thanks, now it works.
I need only a bool to en/disable an option in a plugin.
Have made a little compound where true set the value to true and false set the value to false.
If the value is false, the value is shown, but because false is the default value for a boolean, you don´t see it.
You must only set the option 'Skip Default Values During Display' to true.

Stephan
custom.gif
Reply all
Reply to author
Forward
0 new messages