On 05/12/2016 at 02:41, xxxxxxxx wrote:
I'm still trying to think my way through this, but just for response's sake, here's my current state of thought. I'll deal with just the poly hits first, we'll come back to the non-drawn objects later.
By "original object", I mean the original object sitting in the AM. Here's an example screen cap of my AM setup:
My object plugin (third down) takes the child object (fourth down) and puts it under a hypernurbs, and returns the HN in GVO. When I test the hits in the viewport, I get this:
The yellow triangle and the yellow dot are where the hits occurred. The GePrints show there are three hits, one hit on polygon 19 of the polygon mesh in the viewport (yellow text "CORRECT"), and two hits on identical looking objects on polygon 4 (yellow text "HIT - NOT DRAWN") neither of which are drawn in the viewport. Technically, the index for all hits is correct.
So my first query, how do I get from the "correct" hit on poly 19, back to the original object source (which is a cube with 6 polygons)? I ask this because my hierarchy recursive function tests for caches, eg:
// psuedo code
ViewportSelect *v = ViewportSelect::Alloc();
int Hit = Test_Polygon(obj,ix,iy,v); // function to test polygon hit, returns index or -1
if(Hit >= 0)
GePrint("HIT found on obj " + obj->GetName() + ", poly " + LongToString(Hit));
if(obj->GetCache() != nullptr) // **THE "CORRECT" HIT COMES FROM THIS**
if(obj->GetDeformCache() != nullptr)
The correct hit comes from part of the recursive function when the getcache() statement is met. So how do I know if/when an object has been used in another generator etc and there could be caches all over the place etc that need to be taken into account? How do I get back to the original source?
Hope that explains it somewhat. Let me know if you need any more info/code/something else!