How to get the current viewport subd level?

Hi,

I'm trying to get the current viewport subd level.

I've tried this code but it always returns 0 no matter what.

var myMesh = Scene.getPrimarySelection().getObject().getCurrentShape().getFacetMesh();var currentSubDLevel = myMesh.getCurrentSubDivisionLevel();print("Current Subdivision Level: " + currentSubDLevel);

Does anyone know what I'm doing wrong?

Thanks

Comments

  • I'd suggest breaking those chains of functions down and error checking them, but couldn't you just get the property and check its value?

Sign In or Register to comment.