Page MenuHome

Multires: Remove Simple subdivision type
Needs ReviewPublic

Authored by Pablo Dobarro (pablodp606) on Jul 31 2020, 2:37 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This removes the subdivision type option from the Multires modifier UI
and converts all displacement stored using simple subdivision type to
Catmull-Clark.

Diff Detail

Repository
rB Blender
Branch
remove-subdivision-type (branched from master)
Build Status
Buildable 9348
Build 9348: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Jul 31 2020, 2:37 AM
Pablo Dobarro (pablodp606) planned changes to this revision.

@Sergey Sharybin (sergey) The multiresModifier_convert_to_catmull_clark seems to work fine, but it crashes when it is used from the versioning code. Is this the right approach for doing this kind of versioning?

The versioning code is to happen after IDs are linked (do_versions_after_link afair it's called).

Another thing is that simple in DNA is to become tagged with DNA_DEPRECATED, which will make it impossible to be used from areas other than versioning related.

  • Fix versioning, add DNA_DEPRECATED

It seems to be working now, I was able to open a file from 2.83 created using the simple subdivision type correctly.

@Pablo Dobarro (pablodp606), Quick question for now: what is the compiler you're using? :)

gcc 9.3.0 (If it is about the deprecated warnings, I still didn't refactor and remove that code, I was just checking that it works)

@Pablo Dobarro (pablodp606), @Dalai Felinto (dfelinto), is there a specific reason why this change got put on a shelf and focus got moved to implementing new features?
Surely, adding new exciting tools is fun and makes users happy, but having strong and clear design of what is already in Blender is not any less exciting.

There is still quite some work to be done here to make things correct. Mainly: don't access "deprecated" members outside of versioning code.
On implementation side it should be relatively easy to do by "sublcassing" subdiv converter created for mesh, "override" scheme and sharpness accessors, and create Subdiv from this converter. All would need to happen in some versioning file, because it would need access to MultiresModifierData::simple, and that should be the only file accessing this field.

So, the idea is to create an alternative function to multires_reshape_create_subdiv and instead of using BKE_multires_subdiv_settings_init initialize settings->is_simple to true outside that function, and then use the rest of the code in multires_reshape like in this patch, right? If that works, can all the other references to mmd->simple can be just be set to false?

The versioning code should not depend on the settings->is_simple. The reason for this is because the simple mode from the subsurf modifier is to be replaced with a much simpler (and faster for what it does) modifier ased on bmesh. If you add new code relying on the setting which is planned to be removed you'll just introduce more work for the future.

It should be possible to provide "custom" Subdiv to the reshape pipeline. And then this Subdiv will be created with edge sharpness set to infinity by "subclassing" the converter.