THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/11/2002 at 09:10, xxxxxxxx wrote:
Quote: Originally posted by darf on 13 November 2002
>
> * * *
>
> Tried this. There is a valid pointer received but I am not sure where to go to retrieve the actual data that would contain the TP_MasterSystem. GetData retrieves a BaseContainer with a couple of items ( LONGs ) that are not of importance in this case ( I don't believe they are anyway ). I also tried GetCustomData but that did not seem to turn up a valid pointer.
>
> Any ideas?
Uhm, what you get *is* the master system. However, it seems to assume that the global TPOS variable has been initialized. So you'll have to help it with a CheckLib:
PluginSceneHook* hook = doc->FindSceneHook(ID_THINKINGPARTICLES);
if (!hook || hook->GetType() != ID_THINKINGPARTICLES) return FALSE;
if (!CheckLib(
ID_THINKINGPARTICLES,
LIBOFFSET(C4DLibrary_TPOS, MSYS),
reinterpret_cast<C4DLibrary**>(&TPOS))) return FALSE;
TP_MasterSystem* tpms = static_cast<TP_MasterSystem*>(hook);
for (LONG pid = 0; pid < tpms->NumParticles(); ++pid)
{
GePrint(" pid: " + LongToString(pid) + " age: " +
RealToString(tpms->Age(pid).Get()));
}
> Did I mention your help has been invaluable!? Thank you!
You're welcome!