CGeometryAccessor in XSI v5.0

· by Steve · Read in about 2 min · (259 Words)

I was looking into how I might optimise the XSI exporter some more, since it’s a little slow on large data sets. In the end, whilst I managed to get some small speedups, the vast majority of the work is genuinely needed, and is mostly because, like in most modelling tools, you have to jump through some hoops in order to translate the very flexible and highly normalised data structures used in a modelling tool, to the compressed, runtime efficient formats needed for realtime. I was somewhat disappointed though - after all, I know what data I need, it isn’t very unusual, and yet even the XSI SDK (which is nice compared to some) leads me on a merry trail to get that information.

Then I notice this in the “What’s new in v5.0” section of the SDK docs:

CGeometryAccessor The mesh geometry accessor provides an optimized access to the data and cluster property values of a geometry mesh object. CGeometryAccessor is suitable for data export application as it allows access to geometry data more quickly and efficiently than the regular geometry API classes.

Sounds just what I need. Unfortunately using this interface will mean the exporter will no longer work with XSI 4.2, so if I want to use it I’ll not only have to rewrite a fair amount of code, but also break it out into 2 separate version streams. Hmm.

Update Well, as it happened I found a shortcut that doesn’t require the use of this yet to get much faster exports, so I’m happy. 😀