Pass depsgraph via Context to selection code
This commit is contained in:
parent
dc1f491a50
commit
b27775138b
|
@ -28,6 +28,7 @@
|
|||
|
||||
struct ARegion;
|
||||
struct CollectionEngineSettings;
|
||||
struct Depsgraph;
|
||||
struct DRWPass;
|
||||
struct Material;
|
||||
struct Scene;
|
||||
|
@ -62,7 +63,8 @@ void DRW_engine_viewport_data_size_get(
|
|||
|
||||
void DRW_draw_view(const struct bContext *C);
|
||||
void DRW_draw_select_loop(
|
||||
struct ViewContext *vc, struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d, struct ARegion *ar,
|
||||
struct ViewContext *vc, struct Depsgraph *graph,
|
||||
struct Scene *scene, struct SceneLayer *sl, struct View3D *v3d, struct ARegion *ar,
|
||||
bool use_obedit_skip, bool use_nearest, const struct rcti *rect);
|
||||
|
||||
void DRW_object_engine_data_free(struct Object *ob);
|
||||
|
|
|
@ -2045,7 +2045,8 @@ void DRW_draw_view(const bContext *C)
|
|||
* object mode select-loop, see: ED_view3d_draw_select_loop (legacy drawing).
|
||||
*/
|
||||
void DRW_draw_select_loop(
|
||||
struct ViewContext *vc, Scene *scene, struct SceneLayer *sl, View3D *v3d, ARegion *ar,
|
||||
struct ViewContext *vc, Depsgraph *graph,
|
||||
Scene *scene, struct SceneLayer *sl, View3D *v3d, ARegion *ar,
|
||||
bool UNUSED(use_obedit_skip), bool UNUSED(use_nearest), const rcti *rect)
|
||||
{
|
||||
#ifndef USE_GPU_SELECT
|
||||
|
@ -2115,7 +2116,6 @@ void DRW_draw_select_loop(
|
|||
DRW_engines_cache_populate(vc->obedit);
|
||||
}
|
||||
else {
|
||||
Depsgraph *graph = scene->depsgraph; // CTX_data_depsgraph(C);
|
||||
DEG_OBJECT_ITER(graph, ob)
|
||||
{
|
||||
if ((ob->base_flag & BASE_SELECTABLED) != 0) {
|
||||
|
|
|
@ -699,6 +699,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
|
|||
}
|
||||
}
|
||||
else {
|
||||
cdd->vc.depsgraph = CTX_data_depsgraph(C);
|
||||
cdd->vc.scene = CTX_data_scene(C);
|
||||
cdd->vc.scene_layer = CTX_data_scene_layer(C);
|
||||
cdd->vc.obedit = CTX_data_edit_object(C);
|
||||
|
|
|
@ -40,6 +40,7 @@ struct BPoint;
|
|||
struct BaseLegacy;
|
||||
struct BezTriple;
|
||||
struct BoundBox;
|
||||
struct Depsgraph;
|
||||
struct EditBone;
|
||||
struct ImBuf;
|
||||
struct MVert;
|
||||
|
@ -70,6 +71,7 @@ enum eGPUFXFlags;
|
|||
|
||||
/* for derivedmesh drawing callbacks, for view3d_select, .... */
|
||||
typedef struct ViewContext {
|
||||
struct Depsgraph *depsgraph;
|
||||
struct Scene *scene;
|
||||
struct SceneLayer *scene_layer;
|
||||
struct Object *obact;
|
||||
|
|
|
@ -109,6 +109,7 @@ void view3d_set_viewcontext(bContext *C, ViewContext *vc)
|
|||
{
|
||||
memset(vc, 0, sizeof(ViewContext));
|
||||
vc->ar = CTX_wm_region(C);
|
||||
vc->depsgraph = CTX_data_depsgraph(C);
|
||||
vc->scene = CTX_data_scene(C);
|
||||
vc->scene_layer = CTX_data_scene_layer(C);
|
||||
vc->v3d = CTX_wm_view3d(C);
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
#include "BKE_scene.h"
|
||||
#include "BKE_screen.h"
|
||||
|
||||
#include "DEG_depsgraph.h"
|
||||
|
||||
#include "BIF_glutil.h"
|
||||
|
||||
#include "GPU_select.h"
|
||||
|
@ -1113,6 +1115,7 @@ int view3d_opengl_select(
|
|||
ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const rcti *input,
|
||||
eV3DSelectMode select_mode)
|
||||
{
|
||||
Depsgraph *graph = vc->depsgraph;
|
||||
Scene *scene = vc->scene;
|
||||
SceneLayer *sl = vc->scene_layer;
|
||||
View3D *v3d = vc->v3d;
|
||||
|
@ -1187,10 +1190,10 @@ int view3d_opengl_select(
|
|||
ED_view3d_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest);
|
||||
}
|
||||
else {
|
||||
DRW_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest, &rect);
|
||||
DRW_draw_select_loop(vc, graph, scene, sl, v3d, ar, use_obedit_skip, use_nearest, &rect);
|
||||
}
|
||||
#else
|
||||
DRW_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest, &rect);
|
||||
DRW_draw_select_loop(vc, graph, scene, sl, v3d, ar, use_obedit_skip, use_nearest, &rect);
|
||||
#endif /* WITH_OPENGL_LEGACY */
|
||||
|
||||
hits = GPU_select_end();
|
||||
|
@ -1203,7 +1206,7 @@ int view3d_opengl_select(
|
|||
ED_view3d_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest);
|
||||
}
|
||||
else {
|
||||
DRW_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest, &rect);
|
||||
DRW_draw_select_loop(vc, graph, scene, sl, v3d, ar, use_obedit_skip, use_nearest, &rect);
|
||||
}
|
||||
|
||||
GPU_select_end();
|
||||
|
|
Loading…
Reference in New Issue