THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/12/2009 at 06:23, xxxxxxxx wrote:
First switch the COFFEE effector to "Full Control" mode.
Then get the global position by multiplying the clone's local postion with the generator's (cloner, fracture object etc) global matrix.
Here is a simple example (doing nothing except printing the global position)
main(doc,op)
{
var md = GeGetMoData(op);
if (!md) return false;
var cnt = md->GetCount();
var marr = md->GetArray(MODATA_MATRIX);
var fall = md->GetFalloffs();
var obj = md->GetGenerator();
if (!obj) return false;
var mg = obj->GetMg();
var i = 0;
for (i = cnt - 1; i >= 0; --i)
{
var pos = marr[i]->GetV0();
pos = mg->GetMulP(pos); //pos is the global position
println(pos);
}
md->SetArray(MODATA_MATRIX, marr, true);
return true;
}
cheers,
Matthias