- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I have a custom locator that draws a subset of faces to make a deformable control using two inputs (a mesh, and a intArray of faces IDs). Like this https://vimeo.com/311008901
Ultimately I'm using this method to draw it:
drawManager.mesh(MHWRender::MUIDrawManager::kTriangles, draw_trianglePoints, NULL,NULL, &triangleIds);
Because I have to convert from facesIDs to triangle and vertex ids, I have stuff set up so that I cache the vertex ids I need to requery the positions of on each redraw, and I also put those positions into a non-repeating array and the "triangleIds" attribute contains the indices within that short list of positions that define each triangle I draw.
So "draw_trianglePoints" updates every time the mesh deforms, but "triangleIds" only updates if the topology changes or I change the value of the faceIds inputs. However during the "prepareForDraw" step I can't think of a way to avoid always re-querying "triangleIds" in case the value has changed, since I only have access to the DAG node being drawn. Does anyone have experience with optimizing custom locators for stuff like this?
Solved! Go to Solution.