-
Notifications
You must be signed in to change notification settings - Fork 202
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
[al] Performance improvements when processing prim meta data #245
[al] Performance improvements when processing prim meta data #245
Conversation
+ Added a new LockManager to maintain the locked/unlocked status of prims in the Scene + Added ability for TransformIterator to stop when encountering a prim + Refactored the selectabilityDB to simplify the way the internal data is modified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the somewhat superficial review. Aside from what I believe is a duplicate parentTransform() implementation, I trust the rest performs as required... And there appears to be sufficient testing to prove it, thanks a lot for that.
bool containsPath(const SdfPath& path) const | ||
{ | ||
auto foundPathEntry = std::lower_bound(m_unselectablePaths.begin(), m_unselectablePaths.end(), path); | ||
if(foundPathEntry != m_unselectablePaths.end() && path == *foundPathEntry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: could just return the result of the boolean expression and avoid the conditional altogether.
return (foundPathEntry != m_unselectablePaths.end() && path == *foundPathEntry);
Fine as it is, of course.
@@ -77,6 +77,16 @@ typedef void (*proxy_function_prototype)(void* userData, AL::usdmaya::nodes::Pro | |||
|
|||
const char* ProxyShape::s_selectionMaskName = "al_ProxyShape"; | |||
|
|||
//---------------------------------------------------------------------------------------------------------------------- | |||
MDagPath ProxyShape::parentTransform() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sure you really need this? You're inheriting from MayaUsdProxyShapeBase, which has the exact same implementation of parentTransform():
https://github.com/Autodesk/maya-usd/blob/dev/lib/nodes/proxyShapeBase.cpp#L921
{ | ||
bool ignoreLockPrims = MGlobal::optionVarIntValue("AL_usdmaya_ignoreLockPrims"); | ||
//The lock Prim functionality is a UI thing - no need to have it on in batch mode | ||
//However, this also causes the tests to fail which is bad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do the tests fail? What's the interaction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we run the tests on our build server, MGlobal::mayaState() == MGlobal::kInteractive
will return false, which would end up disabling the meta-data processing entirely. Not overly useful when you've written tests to test said functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix compilation error in strict mode + resolve conflicts with latest dev branch.
@@ -128,14 +128,15 @@ class TransformIterator | |||
|
|||
std::vector<StackRef> m_primStack; | |||
UsdStageRefPtr m_stage; | |||
size_t m_currentItem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/git/usd/maya-usd/plugin/al/lib/AL_USDMaya/AL/usdmaya/fileio/TransformIterator.h:131:10: error: private field 'm_currentItem' is not used [-Werror,-Wunused-private-field]
size_t m_currentItem;
As well, for variables like this (and m_stopOnInstance) below, use in-class member initializers instead (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-default)
@robthebloke please resolve conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 5d0612f has change made to lib/usd/translators/CMakeLists.txt which doesn't come from the dev
branch. Not sure why it was added, but it makes this PR not compile:
[ 77%] Linking CXX shared library libmayaUsd_Translators.dylib
ld: library not found for -lOpenMayaFX
Please remove this change from lib/usd/translators/CMakeLists.txt since this dependency is not needed.
It is not required to build the plug in, but it is required to load the plug in successfully. |
It’s not something we observed, nor we have any issues logged for it. Additionally, most of Pixar tests rely on this plugin, so I really don’t see how we could have missed it.
Given that this change doesn’t belong to PR you have open, let’s not sneak changes in hidden behind “merge from dev”.
|
@robthebloke Let's get this PR in by removing the unrelated change which causes compilation problems. Then please open a new PR with only this new change and description of the problem it fixes. |
Previously we a mishmash of code buried within the ProxyShape that would handle 3 separate meta data tags we could apply to a prim within a scene. These are:
al_usdmaya_excludeFromProxyShape
If this boolean value is true, the prim would be added to an excluded geometry list that we then pass to UsdImaging to disable the rendering of these prims within Hydra.
al_usdmaya_lock
This meta data tag affects the transform chains created when importing maya nodes via either the translator framework, or the translate prim command. It controls whether the transform attributes (scale, rotate, etc) are locked after creation. There are 3 possible values for this meta data:
al_usdmaya_selectability
This meta data tag controls whether it's possible to select a prim (and it's children) within the Maya viewport. We use this at AL to say, prevent animators from accidentally selecting the environments whilst animating. This can have two values:
Problems this PR addreses
The motivating factor for the PR was that we found the previous code used to handle the meta data did not scale to very large set sizes. This PR primarily addresses those performance problems, has fixed a few bugs and inconsistencies along the way, and additional tests have been added. In general, these are the main aims:
Code changes