Cycles microdisplacement: move subdivision options to subsurf modifier

Subdivision options can now be found in the subsurf modifier. The modifier must
be the last in the stack or the options will be unavailable. Catmull-Clark
subdivision is still unavailable and will fallback to linear subdivision instead

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2109
This commit is contained in:
2016-07-16 19:56:45 -04:00
parent c96ae81160
commit 66e2e2484c
7 changed files with 92 additions and 37 deletions

View File

@@ -48,7 +48,29 @@ static inline BL::Mesh object_to_mesh(BL::BlendData& data,
bool calc_undeformed,
bool subdivision)
{
bool subsurf_mod_show_render;
bool subsurf_mod_show_viewport;
if(subdivision) {
BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];
subsurf_mod_show_render = subsurf_mod.show_render();
subsurf_mod_show_viewport = subsurf_mod.show_render();
subsurf_mod.show_render(false);
subsurf_mod.show_viewport(false);
}
BL::Mesh me = data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, false, calc_undeformed);
if(subdivision) {
BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];
subsurf_mod.show_render(subsurf_mod_show_render);
subsurf_mod.show_viewport(subsurf_mod_show_viewport);
}
if((bool)me) {
if(me.use_auto_smooth()) {
me.calc_normals_split();