Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_util.h
| Show All 39 Lines | |||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| void python_thread_state_save(void **python_thread_state); | void python_thread_state_save(void **python_thread_state); | ||||
| void python_thread_state_restore(void **python_thread_state); | void python_thread_state_restore(void **python_thread_state); | ||||
| static inline BL::Mesh object_to_mesh(BL::BlendData &data, | static inline BL::Mesh object_to_mesh(BL::BlendData &data, | ||||
| BL::Object &object, | BL::Object &object, | ||||
| BL::Depsgraph &depsgraph, | BL::Depsgraph & /*depsgraph*/, | ||||
| bool calc_undeformed, | bool /*calc_undeformed*/, | ||||
| Mesh::SubdivisionType subdivision_type) | Mesh::SubdivisionType subdivision_type) | ||||
| { | { | ||||
| /* TODO: make this work with copy-on-write, modifiers are already evaluated. */ | /* TODO: make this work with copy-on-write, modifiers are already evaluated. */ | ||||
| #if 0 | #if 0 | ||||
| bool subsurf_mod_show_render = false; | bool subsurf_mod_show_render = false; | ||||
| bool subsurf_mod_show_viewport = false; | bool subsurf_mod_show_viewport = false; | ||||
| if (subdivision_type != Mesh::SUBDIVISION_NONE) { | if (subdivision_type != Mesh::SUBDIVISION_NONE) { | ||||
| Show All 12 Lines | if (object.type() == BL::Object::type_MESH) { | ||||
| /* TODO: calc_undeformed is not used. */ | /* TODO: calc_undeformed is not used. */ | ||||
| mesh = BL::Mesh(object.data()); | mesh = BL::Mesh(object.data()); | ||||
| /* Make a copy to split faces if we use autosmooth, otherwise not needed. | /* Make a copy to split faces if we use autosmooth, otherwise not needed. | ||||
| * Also in edit mode do we need to make a copy, to ensure data layers like | * Also in edit mode do we need to make a copy, to ensure data layers like | ||||
| * UV are not empty. */ | * UV are not empty. */ | ||||
| if (mesh.is_editmode() || | if (mesh.is_editmode() || | ||||
| (mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE)) { | (mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE)) { | ||||
| mesh = data.meshes.new_from_object(depsgraph, object, false, false); | mesh = data.meshes.new_from_object(object); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| mesh = data.meshes.new_from_object(depsgraph, object, true, calc_undeformed); | mesh = data.meshes.new_from_object(object); | ||||
| } | } | ||||
| #if 0 | #if 0 | ||||
| if (subdivision_type != Mesh::SUBDIVISION_NONE) { | if (subdivision_type != Mesh::SUBDIVISION_NONE) { | ||||
| BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1]; | BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1]; | ||||
| subsurf_mod.show_render(subsurf_mod_show_render); | subsurf_mod.show_render(subsurf_mod_show_render); | ||||
| subsurf_mod.show_viewport(subsurf_mod_show_viewport); | subsurf_mod.show_viewport(subsurf_mod_show_viewport); | ||||
| ▲ Show 20 Lines • Show All 729 Lines • Show Last 20 Lines | |||||