LumaPictures / maya-to-hydra

This repo is no longer updated. Please see https://github.com/Autodesk/maya-usd
Other
10 stars 3 forks source link

Passing subdivision settings to Hydra #45

Closed sirpalee closed 5 years ago

sirpalee commented 5 years ago

We need to pass Maya's subdivision settings to Hydra. I'm not yet sure how to tackle this problem, one of the possible solutions is to set-up the HdDisplayStyle for each mesh, which has a refine level parameter.

sirpalee commented 5 years ago

I managed to get the subdivision running, but strangely it wasn't doing anything. I increased the refineLevel on the HdDisplayStyle struct, which significantly increased memory usage and computational time (so it must be doing something), but I didn't see any difference in the geometry. I was trying to change the subdivision style to catmark (same as in all the other adapters from UsdImaging), but that did not affect the result either.

I'm still digging around what flag or switch did I miss.

sirpalee commented 5 years ago

The ReprSelector was not set to refined on the Render Collection. Once that's configured properly, subdivided surfaces show up perfectly in the viewport.

I added new exposed interfaces to the shape adapter, that lets every adapter configure its subdivision level and subdiv tags.

sirpalee commented 5 years ago

Note, Maya 2018 crashes, if the smooth mesh preview is set to Opensubdiv - Catmull Clark, and based on the symbols the crash is taking place in the version Maya is using. For now, we are going to disable smooth mesh preview for Maya 2018.