Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
760 stars 202 forks source link

[MAYA-109518] Point Snapping is too slow #1106

Closed noWookies closed 2 years ago

noWookies commented 3 years ago

Describe the bug Point Snapping is too slow for efficient artist workflows

Steps to reproduce Steps to reproduce the behavior:

  1. Open kitchen_set_instanced.usd from Pixar
  2. Select the instanceable parent transforms of the two chairs (ChairB_*)
  3. Press W to switch to the move tool
  4. Hold V to enable point snapping and drag and hold the center of the translate manipulator
  5. Notice a multi second (up to about 10 sec) lag

Expected behavior Interactive translation/snapping refresh at 24fps +

Attachments

Specs (if applicable):

kxl-adsk commented 3 years ago

Hi Jens. Using your repro steps, I can't see a 10-sec lag. Everything runs smoothly with the fps cap at 60 fps. See below

PointSnapping_KitchenSet

noWookies commented 3 years ago

Great, and not so great ;)

So how do we find the offending difference in my test setup?

Did you try my repro steps as well as yours? (Select both chairs, hold down the snapping hot key).

Did your test on Centos7? Could it be the GPU driver or similar?

kxl-adsk commented 3 years ago

This test was on macOS. All other steps should be the same. I will ask @santosg87 to test on Linux. After that, you will need to find a way to reproduce it on a vanilla setup.

santosg87 commented 3 years ago

hi @noWookies, I can reproduce the problem on Linux. the delay I am seeing is not as bad as it is for you, but it is noticeable. It seems the delay happens once per new selection. After the first moving operation, it behaves properly.

snapDelay

noWookies commented 3 years ago

Great thank you. It might be proportional to the number of objects selected and the size of the scene? I've seen 30sec+ delays in our medium sized production sets.

kxl-adsk commented 3 years ago

@noWookies The 10s delay you reported was with KitchenSet?

noWookies commented 3 years ago

Yes.

santosd commented 3 years ago

Hi @noWookies, I tested this out on my end using your steps and I am not seeing the 10 second delays using the kitchen set. If I select somewhere around 1000 objects I see a slight delay of a couple of seconds but I am not seeing the 10 seconds. Maybe we are missing something in our repro steps, wondering if you could provide a video or maybe a different asset in which we can reproduce the issue. Thank you.

https://user-images.githubusercontent.com/29235905/105911008-b1d4b480-5ff7-11eb-97c0-21940e3bd228.mp4

noWookies commented 3 years ago

Thanks @santosd , I had a closer look and I have to apologize as my repro was incomplete. When I was testing, I also had a couple of other stages in the maya scene (which were hidden) and I can only repro the serious (10sec+) lag if they exist. Unfortunately I can not currently share these as they are proprietary. Is the smaller lag that you are reproducing (on linux only) enough for now to constitute an actionable bug ?

PS: Currently I don't have a way to upload from our content network hence the lag of screen captures.

kxl-adsk commented 3 years ago

Bottlenecks can be different when you profile something that takes ms vs sec, this is why it is important we reproduce and profile the actual problem you are hitting. If you don't mind, I would prefer to wait for the asset before we engage on this ticket.

noWookies commented 3 years ago

Hmm, the issue is even visible in the gif from @santosg87 ... it's just much more noticeable when there are more (instanced?) assets in the scene.

kxl-adsk commented 3 years ago

We want to understand the issue you are hitting because like you said, 10s (or more) is too slow for snapping to be usable.

Having worked with performance optimizations for a long time, I know there is no doubt when you profile something that takes seconds. Everyone will be able to reproduce it and there is no doubt that fix will work. What made me concern about this particular example is that 2/3 videos are not showing the issue you described. Chances are that the developer profiling the scene will not find the same bottlenecks and this is simply what I tried to eliminate.

If I'm reading between lines correctly, it may be tricky to give us the asset. In such a case, we will look over the heavy assets we collected and try to find one that shows your problem.

santosg87 commented 3 years ago

we have an internal ticket for this while we are investigating it. just updating the title so we can refer to that internally as well.

huidong-chen commented 3 years ago

Hi @noWookies ,

The performance bottleneck is inside Maya (instead of mayaUsdPlugin) and I am still investigating how to fix it. Meanwhile, could you enable camera-based selection (in marquee selection section of the select tool setting) to use hardware point snapping code path and let me know how it performs on your side? Hopefully it can alleviate the pain you are facing before we find a way to fix it.

Here is the data I gathered on my Win10 workstation and a heavy asset we collected:

Tables 1st frame delay consecutive frame rate
Moving object without point snapping 0s 17.3fps
Moving object with HW point snapping 12s 14.5fps
Moving object with SW point snapping 29s 1.5fps
noWookies commented 3 years ago

Thanks @HdC-adsk , we're not currently using maya-usd/UFE in production yet, but we'll watch this issue as a part of our "traffic light" system so we know when we can start adoption.

huidong-chen commented 3 years ago

Hi @noWookies Thanks. To clarify, the performance bottleneck is inside Maya VP2 but not UFE, meaning with a heavy Maya asset we can also hit the problem, so it is probably not fair to UFE if we use this issue as the traffic light. But I understand we should solve this issue as possible as we can to remove any adoption blockers.

huidong-chen commented 3 years ago

Update: we are already implementing a serial of optimizations to improve the point snapping performance, re both first frame delay and consecutive frame rate. Thanks for patience.

santosg87 commented 2 years ago

this should be fixed on the latest versions of the plugin. Marking it as closed for now. :)