Fix: Overlay-Next: Disable background images on selection
They can't be selected, and default_fb is invalid in selection mode, which causes null dereferences. Pull Request: https://projects.blender.org/blender/blender/pulls/130627
This commit is contained in:
committed by
Clément Foucault
parent
c533a7b008
commit
0df7cf4be8
@@ -359,6 +359,7 @@ class Cameras {
|
||||
}
|
||||
|
||||
bool enabled_ = false;
|
||||
bool images_enabled_ = false;
|
||||
|
||||
public:
|
||||
Cameras(const SelectionType selection_type) : call_buffers_{selection_type} {};
|
||||
@@ -382,6 +383,12 @@ class Cameras {
|
||||
call_buffers_.tracking_path.clear();
|
||||
Empties::begin_sync(call_buffers_.empties);
|
||||
|
||||
images_enabled_ = res.selection_type == SelectionType::DISABLED;
|
||||
|
||||
if (!images_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
float4x4 depth_bias_winmat = winmat_polygon_offset(
|
||||
view.winmat(), state.view_dist_get(view.winmat()), -1.0f);
|
||||
|
||||
@@ -616,7 +623,7 @@ class Cameras {
|
||||
|
||||
void pre_draw(Manager &manager, View &view)
|
||||
{
|
||||
if (!enabled_) {
|
||||
if (!images_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -638,7 +645,7 @@ class Cameras {
|
||||
|
||||
void draw_scene_background_images(GPUFrameBuffer *framebuffer, Manager &manager, View &view)
|
||||
{
|
||||
if (!enabled_) {
|
||||
if (!images_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -649,7 +656,7 @@ class Cameras {
|
||||
|
||||
void draw_background_images(Framebuffer &framebuffer, Manager &manager, View &view)
|
||||
{
|
||||
if (!enabled_) {
|
||||
if (!images_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -659,7 +666,7 @@ class Cameras {
|
||||
|
||||
void draw_in_front(Framebuffer &framebuffer, Manager &manager, View &view)
|
||||
{
|
||||
if (!enabled_) {
|
||||
if (!images_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -676,6 +683,10 @@ class Cameras {
|
||||
Resources &res,
|
||||
const SelectionType selection_type)
|
||||
{
|
||||
if (!images_enabled_) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object *ob = ob_ref.object;
|
||||
const Camera *cam = static_cast<Camera *>(ob->data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user