Skip to content
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

Merged
merged 16 commits into from
Jul 14, 2021

Conversation

williamkrick
Copy link
Contributor

@williamkrick williamkrick commented Jun 24, 2021

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.

@williamkrick williamkrick added do-not-merge-yet Development is not finished, PR not ready for merge vp2renderdelegate Related to VP2RenderDelegate labels Jun 24, 2021
@williamkrick williamkrick force-pushed the krickw/MAYA-111889/point_snapping_to_similar_instances branch from 14a9e5f to 75bf83d Compare July 8, 2021 18:04
@williamkrick williamkrick removed the do-not-merge-yet Development is not finished, PR not ready for merge label Jul 8, 2021
/* static */
InstanceIdMap& MayaUsdCustomData::Get(const MHWRender::MRenderItem& renderItem)
{
return sMayaUsdCustomData._itemData[renderItem.InternalObjectId()];
Copy link
Collaborator

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) {
Copy link
Collaborator

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()) {
Copy link
Collaborator

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";
Copy link
Collaborator

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.
@williamkrick williamkrick force-pushed the krickw/MAYA-111889/point_snapping_to_similar_instances branch from 4675aea to 8d724d5 Compare July 13, 2021 22:20
@williamkrick williamkrick added the ready-for-merge Development process is finished, PR is ready for merge label Jul 14, 2021
@kxl-adsk kxl-adsk merged commit 0cb5ec9 into dev Jul 14, 2021
@kxl-adsk kxl-adsk deleted the krickw/MAYA-111889/point_snapping_to_similar_instances branch July 14, 2021 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants