loading an obj silently - source code

mCasualmCasual Posts: 4,604
edited December 1969 in Daz SDK Developer Discussion

loading an obj silently - source code

for my lattice deformer i'll use "null" nodes, but for a moment i was thinking of using cubes
and i didnt want to go through the trouble and potential problems associated to building a node

here's code to load an obj that worked

i was planning to create the obj file at runtime, save it to the temp folder, and load it this way

but there's a progress-dialog that flashes on-screen when loading so that's a drawback


//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
DzNode *loadThingie( char * nodeName, char *fileName )
{
 DzNode* thingie = new DzNode();
 thingie->setName( nodeName );
 DzObject *object = new DzObject();
 object->setName( nodeName );
 thingie->setObject( object );
 DzImportMgr* importManager = dzApp->getImportMgr();
 DzFacetShape* shape = new DzFacetShape();
 DzFileIOSettings *ioSettings = new DzFileIOSettings();
 ioSettings->setIntValue( "RunSilent", 1 );
 ioSettings->setFloatValue( "Scale", 1 );
 importManager->readGeometry( fileName, (DzShape**) &shape;, -1, ioSettings );
 object->addShape( shape );
 dzScene->addNode( thingie );
 return( thingie );
}
Sign In or Register to comment.