Differential D10300 Diff 33525 source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
| Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (G.debug & G_DEBUG_FREESTYLE) { | if (G.debug & G_DEBUG_FREESTYLE) { | ||||
| cout << "\n=== Importing triangular meshes into Blender ===" << endl; | cout << "\n=== Importing triangular meshes into Blender ===" << endl; | ||||
| } | } | ||||
| // creation of the scene root node | // creation of the scene root node | ||||
| _Scene = new NodeGroup; | _Scene = new NodeGroup; | ||||
| _viewplane_left = _re->viewplane.xmin; | |||||
| _viewplane_right = _re->viewplane.xmax; | |||||
| _viewplane_bottom = _re->viewplane.ymin; | |||||
| _viewplane_top = _re->viewplane.ymax; | |||||
| if (_re->clip_start < 0.0f) { | if (_re->clip_start < 0.0f) { | ||||
| // Adjust clipping start/end and set up a Z offset when the viewport preview | // Adjust clipping start/end and set up a Z offset when the viewport preview | ||||
| // is used with the orthographic view. In this case, _re->clip_start is negative, | // is used with the orthographic view. In this case, _re->clip_start is negative, | ||||
| // while Freestyle assumes that imported mesh data are in the camera coordinate | // while Freestyle assumes that imported mesh data are in the camera coordinate | ||||
| // system with the view point located at origin [bug T36009]. | // system with the view point located at origin [bug T36009]. | ||||
| _z_near = -0.001f; | _z_near = -0.001f; | ||||
| _z_offset = _re->clip_start + _z_near; | _z_offset = _re->clip_start + _z_near; | ||||
| _z_far = -_re->clip_end + _z_offset; | _z_far = -_re->clip_end + _z_offset; | ||||
| } | } | ||||
| else { | else { | ||||
| _z_near = -_re->clip_start; | _z_near = -_re->clip_start; | ||||
| _z_far = -_re->clip_end; | _z_far = -_re->clip_end; | ||||
| _z_offset = 0.0f; | _z_offset = 0.0f; | ||||
| } | } | ||||
| #if 0 | |||||
| if (G.debug & G_DEBUG_FREESTYLE) { | |||||
| cout << "Frustum: l " << _viewplane_left << " r " << _viewplane_right << " b " | |||||
| << _viewplane_bottom << " t " << _viewplane_top << " n " << _z_near << " f " << _z_far | |||||
| << endl; | |||||
| } | |||||
| #endif | |||||
| int id = 0; | int id = 0; | ||||
| const eEvaluationMode eval_mode = DEG_get_mode(_depsgraph); | const eEvaluationMode eval_mode = DEG_get_mode(_depsgraph); | ||||
| DEG_OBJECT_ITER_BEGIN (_depsgraph, | DEG_OBJECT_ITER_BEGIN (_depsgraph, | ||||
| ob, | ob, | ||||
| DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | | DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | | ||||
| DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | DEG_ITER_OBJECT_FLAG_VISIBLE | | DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | DEG_ITER_OBJECT_FLAG_VISIBLE | | ||||
| DEG_ITER_OBJECT_FLAG_DUPLI) { | DEG_ITER_OBJECT_FLAG_DUPLI) { | ||||
| ▲ Show 20 Lines • Show All 715 Lines • Show Last 20 Lines | |||||