Depsgraph: Don't use legacy function when building without legacy depsgraph

This commit is contained in:
Sergey Sharybin
2015-09-05 17:51:58 +05:00
parent 9683807459
commit 1478ac35c7
3 changed files with 9 additions and 0 deletions

View File

@@ -90,4 +90,8 @@ if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
if(WITH_LEGACY_DEPSGRAPH)
add_definitions(-DWITH_LEGACY_DEPSGRAPH)
endif()
blender_add_lib(bf_editor_space_view3d "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -68,4 +68,7 @@ if env['WITH_BF_INTERNATIONAL']:
if env['WITH_BF_FREESTYLE']:
defs.append('WITH_FREESTYLE')
if env['WITH_BF_LEGACY_DEPSGRAPH']:
defs.append('WITH_LEGACY_DEPSGRAPH')
env.BlenderLib ( 'bf_editors_space_view3d', sources, incs, defines = defs, libtype=['core'], priority=[40] )

View File

@@ -928,6 +928,7 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN
case ND_SHADING:
case ND_NODES:
{
#ifdef WITH_LEGACY_DEPSGRAPH
Object *ob = OBACT;
if ((v3d->drawtype == OB_MATERIAL) ||
(ob && (ob->mode == OB_MODE_TEXTURE_PAINT)) ||
@@ -935,6 +936,7 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN
(scene->gm.matmode == GAME_MAT_GLSL ||
BKE_scene_use_new_shading_nodes(scene))) ||
!DEG_depsgraph_use_legacy())
#endif
{
ED_region_tag_redraw(ar);
}