[SOLVED] Help using DzTSharedPointer

cridgitcridgit Posts: 1,524

I'm trying to generate a list of assets in a product using the SDK. I can do it no problems using DAZ Script, but am getting stuck using the SDK because there is no (= zip, zero, nada) documentation on DzTSharedPointer. I can't figure out how to dereference this class or cast to/from a regular pointer.

DzTopLevelAssetContainer *pContainer = dzApp->getAssetMgr()->getProducts();
DzAbstractAssetContainerList subcontainers;
pContainer->getChildContainers(subcontainers); // ignore result
foreach (DzAbstractAssetContainerPtr pChild, subcontainers)
	DzAssetList assets;
	pChild->getAssets(assets); // ignore result
	foreach(DzAssetPtr pAsset, assets)
		QMessageBox::warning(0, "Info", pAsset->getAssetName(), QMessageBox::Ok);

The code above crashes with an error at line 431 in QList.h ...

while(from != to) --to, delete reinterpret_cast<T*>(to->v);

Both DzAbstractAssetContainerList and DzAssetList are not documented. From the header files they are of type QList<...> with subclasses of DzTSharedPointer (which is also not documented). I don't want to use a list with an undocumented pointer wrapper class, I want to use a simple good old C pointer. Any suggestions how I can get an array of pointers or at least cast the DzAssetPtr to a DzAsset*



Post edited by cridgit on


Sign In or Register to comment.