API for Instances

pcicconepciccone Posts: 661
edited December 1969 in Daz SDK Developer Discussion

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

  • ketthroveketthrove Posts: 63
    edited July 2012

    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
    
    Post edited by ketthrove on
  • pcicconepciccone Posts: 661
    edited December 1969

    Thank you very much.

Sign In or Register to comment.