How to access thinkin particles data channels correctly?
-
Hi All,
There is thinking particles system and it has few named channels such as here:Float [chan 5] DataChannelType 19 DataChannelName mass(Real) Float [chan 6] DataChannelType 19 DataChannelName oldP(Real) Float [chan 8] DataChannelType 19 DataChannelName pscale(Real) Float [chan 10] DataChannelType 19 DataChannelName spriteuv(Real) Vector [chan 1] DataChannelType 23 DataChannelName Cd(Vector)
I get channel info using tps->DataChannelType(chan) and etc.
19 is DTYPE_REAL, 23 is DTYPE_VECTOR
But when I try to read the channel value per particle then it returns false and doesn't read the values. For example this request returns false:TP_MasterSystem* tps; Vector fval(0.0); tps->GetData(pid, channel, &fval, DTYPE_VECTOR); // nothing is written in fval. I also tried to use GeData, but it didn't help
Other particle data such as tps->Transform(...), tps->Color(...), tps->Age(...) is returning relevant results.
Please, can someone show me a valid example of correct TP data channel access?
Cheers
-
Solved, it works this way:
Vector v(0.0); tps->GetData(pid, channel, &v, ID_GV_VALUE_TYPE_VECTOR);
-