Removed old viewport draw in favour or VP2 GeometryOverride with Parallel Eval and Viewport Caching compatibility #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Types of Changes
Proposed Changes
This is something that has been on my mind since we adopted TwistSpline at work, but never had time to properly sit there and reading some docs on how to solve it, until last week.
The issue first came up when the animators on a project using the plugin were dealing with flipping geometry and needed a visual aid, but the spline debug axis weren't working interactively. I later discovered the issue was being triggered when Parallel Evaluation came into play, as I started noticing it on the rigging side when we started adding controller tags to rig controls by default (that also triggers parallel eval, other than animation keys).
This pull request aims at fixing that behaviour by replacing the legacy viewport draw code with the new
GeometryOverride
methods. I am by no means a c++ expert and it took me some time to understand what was doing what in there, but I think I sort of got it now and the comments from thefootPrintNode_geometryOverride
example from Autodesk (which I adapted for this plugin and left in there) helped getting this working.Due to the amount of new code introduced I have split these new changes into two new modules:
drawOverride.h
anddrawOverride.cpp
. So all the code for the viewport logic has been implemented there, with the exception of some requirements that needed to go into the TwistSplineNode class.I uploaded a couple of videos on Youtube to show the difference between the current behaviour and the new one. I should also mention that I ran the Profiler with and without Viewport Caching and the results seem as intended, with Viewport Caching cutting down at least half of the time of computation (on my machine, it went from 800-900 us to 300-400 us when caching was on).
Most importantly, the drawing is now interactive when manipulating a rig with Parallel Eval and Viewport Caching, and also during playback.
Current viewport implementation: https://youtu.be/uez-osG62bg
New viewport implementation from this pull request: https://youtu.be/-tBCMP8yGtU