API for Instances

Hello.
I was hoping that the new instances were transparent at the API level but apparently it's not so. I added a torus and created two node instances from it and Reality does not see those. Can anybody outline what is the suggested API workflow when dealing with instances?

Thanks in advance.

Comments

Instances are encapsulated by the DzAbstractShapeInstance class. DzShape has a list of them. The basic work flow for export for Reality would probably be:

Get cache
Get Shape
If shape has instances:
Copy World Space Mesh
Transform mesh by inverse world space transform for the node the cache was on
Write transformed mesh as an 'object'
Instance the source node with its world space transform
For each instance,
push the world space transform provide by instance (DzAbstractShapeInstance::getWSTransform())
instance object
else
do as currently