Congratulations! You are a March Madness BONUS BUYER!

Enjoy 10% OFF* ALL PURCHASES STOREWIDE or enjoy 30% OFF items with a SKU number lower than 16000 & 30% OFF items from Runtime DNA.

Buy any "Newly Mad" or "Still Mad" and get an EXTRA 60% OFF**:

Star 2.0 Stellar BundleCallie 6 Pro BundleToon Generations 2 Essentials for Genesis 3Karen 7 Pro BundleCaptain Charisma for Genesis 3 Male

Offer valid for intended recipient only
* 10% discount DOES apply to Gift Cards and Memberships. **Items must be in cart simultaneously for discount to apply.
[ collapse ]

API for Instances

pcicconepciccone Posts: 632
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: 632
    edited December 1969

    Thank you very much.

Sign In or Register to comment.