-
Notifications
You must be signed in to change notification settings - Fork 125
SceneShapeProxy #1311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
SceneShapeProxy #1311
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We noticed huge FPS drops in scenes with a huge amount of `SceneShapes`. Profiling showed that a lot of time is spend by `SubSceneOverride` requesting draw updates from the shapes in the scene. This also happens for shapes that are set as hidden, what we consider a bug/flaw in Maya's VP2 drawing API. To alleviate this issue, we derive the proxy from `SceneShape` and inherit all of it's behaviour with the exception, that we don't register it as drawable. This allows us to replace `SceneShape`s with its proxy implementation, where only the data reading capabilities are needed, e.g. layouts or rigs.
Changing all `staticmethod`s to `classmethod`s and replacing all method calls from within the class to use either `self` or `cls` instead of the class name. This allows for easier inheritance and less code duplication in subclasses
With overriding the `__new__` method of the `FnSceneShape` class we change the object type during construction and before initialization. This gives us the ability to use `FnSceneShape` regardless if it's dealing with a `SceneShape` or it's proxy version.
We add the `shapeType` argument to the methods that can create a `SceneShape` node to specify if we want to create an `ieSceneShape` or its proxy version. If we don't pass in the argument `FnSceneShape` will create shapes of the type it was initially created with.
Moving the node creation in the `setUp` method, which is called before every test method, gives subclasses the ability to run the same test cases with a different node. This is e.g. useful for `ieSceneShapeProxy` as we need to make sure that it behaves the same way as it's non proxy version
ivanimanishi
approved these changes
Nov 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a proxy type of
ieSceneShape. In maya scenes with lots ofieSceneShapeswe noticed huge frame rate drops. These are related to maya's ViewPort2 and theSubSceneOverrideasking everyieSceneShapeif it needs to be updated.This call turned out to be very costly and is also executed for scene shapes that are set to invisible. Multiple attempts of rewriting scene shape to use other API classes failed or have proven themselves as unstable. We therefore implement a proxy version of
ieSceneShapethat provides the same functionality as the base class in regards of reading scene caches and output paths, attributes and tags but is not registered with the viewport as drawable. This allows us to replace hiddenieSceneShapes withieSceneShapeProxyand gain back performance.ieSceneShapeProxyas a subclass ofieSceneShapethat is not registered as drawableieSceneShapeto findieSceneShapeandieSceneShapeProxytypes during hierarchy traversalFnSceneShape'sstaticmethods toclassmethods for easier subclassingFnSceneShapeto operate on scene shapes and proxies interchangeable while keeping the APIieSceneShapetests to allow subclassing and run the same tests with a different node typeRelated Issues
Checklist