mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 03:11:47 +00:00
Fix model initialization without a wx application (#15866)
Guard the smooth-normals preference read when CLI thumbnail generation initializes geometry without a wx application. Use the existing flat-normal path in that case and preserve GUI preferences.
This commit is contained in:
@@ -456,8 +456,9 @@ void GLModel::init_from(const indexed_triangle_set& its)
|
|||||||
data.reserve_vertices(3 * its.indices.size());
|
data.reserve_vertices(3 * its.indices.size());
|
||||||
data.reserve_indices(3 * its.indices.size());
|
data.reserve_indices(3 * its.indices.size());
|
||||||
|
|
||||||
// Read user preference: smooth normals enabled
|
// CLI thumbnail generation can initialize models without a wx application.
|
||||||
const bool smooth_normals_enabled = wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_PHONG_SMOOTH_NORMALS);
|
const bool smooth_normals_enabled = wxApp::GetInstance() != nullptr && wxGetApp().app_config != nullptr &&
|
||||||
|
wxGetApp().app_config->get_bool(SETTING_OPENGL_PHONG_SMOOTH_NORMALS);
|
||||||
|
|
||||||
if (smooth_normals_enabled) {
|
if (smooth_normals_enabled) {
|
||||||
// Use per-corner smooth normals (via IGL)
|
// Use per-corner smooth normals (via IGL)
|
||||||
|
|||||||
Reference in New Issue
Block a user