THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/07/2012 at 11:45, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
GetAllTextures() now requires pointing to an array. So now the code examples posted in the archives no longer works for me.
I can't get any textures to return from it using the old code:
AutoAlloc<AtomArray> myArray; //Create a new empty atom type array
if(myArray)
{
doc->GetActiveObjects(*myArray,FALSE); //Get any active objects and store them in the array (use GETACTIVEOBJECTFLAGS_0 for R13)
LONG cnt = myArray->GetCount(); //Returns the size of the array based on how many objects are selected
for(LONG i = 0L; i != cnt; ++i)
{
String name = static_cast<BaseObject*>(myArray->GetIndex(i))->GetName(); //Get the name of each selected object
GePrint(name);
}
}
////// Great..Everything is working properly so far ///////
////// Now lets check to see what textures are assigned to the selected objects ////////
BaseContainer bc = doc->GetAllTextures(myArray); //Create a container pointing to the array of selected objects
BrowseContainer browse(&bc); //Create an instance of the BrowseContainer class
LONG cid;
GeData *data;
while(browse.GetNext(&cid, &data))
{
GePrint("found a texture"); //<---I get nothing in the console...Even with this!?
Filename fn = data->GetFilename();
GePrint("Texture: " + fn.GetString());
}
Could someone please post a working example of GetAllTextures() that works with R12 and/or R13?
-ScottA