-
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
MAYA-111889 point snapping to similar instances #1521
MAYA-111889 point snapping to similar instances #1521
Conversation
14a9e5f
to
75bf83d
Compare
/* static */ | ||
InstanceIdMap& MayaUsdCustomData::Get(const MHWRender::MRenderItem& renderItem) | ||
{ | ||
return sMayaUsdCustomData._itemData[renderItem.InternalObjectId()]; |
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.
This data structure always grows. Is there a point in time where the data can be cleaned-up?
@@ -1333,13 +1337,34 @@ void HdVP2Mesh::_InitRepr(const TfToken& reprToken, HdDirtyBits* dirtyBits) | |||
case HdMeshGeomStyleHull: | |||
// Creating the smoothHull hull render items requires geom subsets from the topology, | |||
// and we can't access that here. | |||
#ifdef HAS_DEFAULT_MATERIAL_SUPPORT_API | |||
#ifdef MAYA_NEW_POINT_SNAPPING_SUPPORT | |||
if (reprToken == HdVP2ReprTokens->defaultMaterial) { |
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.
This part is still HAS_DEFAULT_MATERIAL_SUPPORT_API.
if (reprToken == HdVP2ReprTokens->defaultMaterial) { | ||
// But default material mode does not use geom subsets, so we create the render item | ||
renderItem = _CreateSmoothHullRenderItem(renderItemName); | ||
renderItem->setDefaultMaterialHandling( | ||
MRenderItem::DrawOnlyWhenDefaultMaterialActive); | ||
renderItem->setShader(_delegate->Get3dDefaultMaterialShader()); | ||
|
||
if (!GetInstancerId().IsEmpty()) { |
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.
MAYA_NEW_POINT_SNAPPING_SUPPORT would begin here?
MString shadedSelectedInstancesRenderItemName = renderItemName; | ||
shadedSelectedInstancesRenderItemName | ||
+= std::string(1, VP2_RENDER_DELEGATE_SEPARATOR).c_str(); | ||
shadedSelectedInstancesRenderItemName += "shadedSelectedInstances"; |
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.
Need one definition for the "shadedSelectedInstances" string which appears 3 times. Maybe a token? Or maybe this code should be in a helper function?
…tances and one for unselected instances. This allows a different values for kSelectPointsForGravity, so that the selected instances can snap to unselected instances.
4675aea
to
8d724d5
Compare
The changes for MAYA-111889 also require the work done in #1502. That work is included in this PR for now. #1502 should be merged first, and then this pull request can be re-based on top of the new dev.
This change also requires more Maya API changes, so it can't be merged until that API is available.