Digital Art Zone

 
     
API for Instances
Posted: 26 July 2012 02:33 PM   [ Ignore ]
Member
Avatar
Rank
Total Posts:  207
Joined  2005-05-06

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.

 Signature 

Paolo/Pret-a-3D
Reality for DAZ Studio
http://pinterest.com/preta3d/boards/
http://www.facebook.com/RealityPlugIn
http://twitter.com/preta3d
https://plus.google.com/106625816153304163119

Profile
 
 
Posted: 30 July 2012 10:24 AM   [ Ignore ]   [ # 1 ]
Member
Rank
Total Posts:  62
Joined  2004-12-26

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 
Profile
 
 
Posted: 30 July 2012 10:39 AM   [ Ignore ]   [ # 2 ]
Member
Avatar
Rank
Total Posts:  207
Joined  2005-05-06

Thank you very much.

 Signature 

Paolo/Pret-a-3D
Reality for DAZ Studio
http://pinterest.com/preta3d/boards/
http://www.facebook.com/RealityPlugIn
http://twitter.com/preta3d
https://plus.google.com/106625816153304163119

Profile