ClausKleber Posted April 8, 2014 Share Posted April 8, 2014 Hi, could someone give me a simple code example or a link how to read the particle attributes of a DOP Network? (especially how can i get the collision data of the particles and an object?) I tried it with deriving my class from SIM_Data, but e.g. the SIM_ElectricalProperties example doesnt help me further. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
ClausKleber Posted April 11, 2014 Author Share Posted April 11, 2014 Can someone give me an advice? Quote Link to comment Share on other sites More sharing options...
ClausKleber Posted April 15, 2014 Author Share Posted April 15, 2014 (edited) I've found a way to get access of the particle collision data. Maybe someone tries something similar to do so i post my code here. I have derived my class from DOP_Node. void DOP_ReadParticles::processObjectsSubclass(fpreal time, int, const SIM_ObjectArray &objects, DOP_Engine &engine) { for (int i = 0; i < objects.entries(); i++) { SIM_Object* obj = objects.findObjectById(i); SIM_GeometryCopy* geometry = (SIM_GeometryCopy*)obj.getNamedSubData(SIM_GEOMETRY_DATANAME); if (geometry) { GU_DetailHandle gdh = geometry->getGeometry().getWriteableCopy(); const GU_Detail* gdp = gdh.peekDetail(); GA_ROAttributeRef hituv = gdp->findPointAttribute("hituv"); GA_ROHandleV2 h_hituv(hituv.getAttribute()); if (h_hituv.isValid()) { UT_Vector2F uv; for (G A_Iterator it(gdp->getPointRange()); !it.atEnd(); it.advance()) { UT_Vector2F uv(h_hituv.get(it.getOffset())); // read the UV-hitposition printf("%i hitUV: (%f, %f)\n", it.getIndex(), uv.x(), uv.y()); } } } } } Edited April 15, 2014 by ClausKleber Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.