This patch fix T81050 by clamping the frame area with clipped area. According to my testing in local machine. My fixing can focus the frame area to the clipped area when clipped.
Details
- Reviewers
- None
- Group Reviewers
User Interface - Maniphest Tasks
- T81050: Take Clipping Region into account for Frame All
Diff Detail
- Repository
- rB Blender
Event Timeline
| source/blender/editors/space_view3d/view3d_edit.c | ||
|---|---|---|
| 2969 | maybe use RV3D_CLIPPING_ENABLED? (clipping does not happen in all shading modes) | |
| source/blender/editors/space_view3d/view3d_edit.c | ||
|---|---|---|
| 2972 | obmat is used for object matrices. As here it isn't we should rename it to unit_mat to be clear that it hasn't to do with any object. | |
| 2973 | obmat is uninitialized and can refer to random values. the bb_min and bb_max are then multiplied by some random values. Have you tested it with objects that aren't on the origin? | |
| source/blender/editors/space_view3d/view3d_edit.c | ||
|---|---|---|
| 2969 | This entire block could be moved into a separate function. That way it can be given a descriptive name as well. | |
This method of clamping the clipping isn't sufficient, failing whenever the clipping isn't axis aligned. e.g. see attached file:
Even if an approximation is used, should work examples like the one given.
In principle - intersecting the two bounding boxes, then get the minimum & maximum of the resulting intersection will work.
Since we only need the min/max it's simplest to compute an array of planes (from the min-max bounding-box and the 3d view's clipping). Then calculate points inside all of the planes, logic from: M_Geometry_points_in_planes can be used for this.
@Juicy HUANG (juicyenc) why did you abandon this patch? Do you have ideas for a completely new patch? Or do you need more help to finish this one?
I abandoned my patch because I have no idea how to do it at present. Everyone is welcome to help with this task.