[Bf-blender-cvs] [1983eea98ef] blender2.8: Cleanup: remove legacy 3D view data.

Brecht Van Lommel noreply at git.blender.org
Sat May 5 16:02:31 CEST 2018


Commit: 1983eea98ef73e6fe4c9bd187944d122dc1c7b07
Author: Brecht Van Lommel
Date:   Sat May 5 10:10:47 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB1983eea98ef73e6fe4c9bd187944d122dc1c7b07

Cleanup: remove legacy 3D view data.

===================================================================

M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 7b8f9db618d..a042e42775b 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6374,7 +6374,6 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
 				rv3d->render_engine = NULL;
 				rv3d->sms = NULL;
 				rv3d->smooth_timer = NULL;
-				rv3d->compositor = NULL;
 			}
 		}
 	}
@@ -6455,11 +6454,7 @@ static void direct_link_area(FileData *fd, ScrArea *area)
 				direct_link_gpencil(fd, v3d->gpd);
 			}
 			v3d->localvd = newdataadr(fd, v3d->localvd);
-			BLI_listbase_clear(&v3d->afterdraw_transp);
-			BLI_listbase_clear(&v3d->afterdraw_xray);
-			BLI_listbase_clear(&v3d->afterdraw_xraytransp);
 			v3d->properties_storage = NULL;
-			v3d->defmaterial = NULL;
 
 			/* render can be quite heavy, set to solid on load */
 			if (v3d->drawtype == OB_RENDER)
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index cd34f10d8a9..ee589e511c6 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1645,27 +1645,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 		for (Mesh *me = main->mesh.first; me; me = me->id.next) {
 			CustomData_set_layer_name(&me->vdata, CD_MDEFORMVERT, 0, "");
 		}
-
-		if (!DNA_struct_elem_find(fd->filesdna, "View3DDebug", "char", "background")) {
-			bScreen *screen;
-
-			for (screen = main->screen.first; screen; screen = screen->id.next) {
-				ScrArea *sa;
-				for (sa = screen->areabase.first; sa; sa = sa->next) {
-					SpaceLink *sl;
-
-					for (sl = sa->spacedata.first; sl; sl = sl->next) {
-						switch (sl->spacetype) {
-							case SPACE_VIEW3D:
-							{
-								View3D *v3d = (View3D *)sl;
-								v3d->debug.background = V3D_DEBUG_BACKGROUND_NONE;
-							}
-						}
-					}
-				}
-			}
-		}
 	}
 
 	if (!MAIN_VERSION_ATLEAST(main, 279, 3)) {
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index d68c0508e33..ee65cc01797 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -395,14 +395,6 @@ static void view3d_free(SpaceLink *sl)
 	
 	if (vd->properties_storage) MEM_freeN(vd->properties_storage);
 	
-	/* matcap material, its preview rect gets freed via icons */
-	if (vd->defmaterial) {
-		if (vd->defmaterial->gpumaterial.first)
-			GPU_material_free(&vd->defmaterial->gpumaterial);
-		BKE_previewimg_free(&vd->defmaterial->preview);
-		MEM_freeN(vd->defmaterial);
-	}
-
 	if (vd->fx_settings.ssao)
 		MEM_freeN(vd->fx_settings.ssao);
 	if (vd->fx_settings.dof)
@@ -434,8 +426,6 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 	
 	/* copy or clear inside new stuff */
 
-	v3dn->defmaterial = NULL;
-
 	v3dn->properties_storage = NULL;
 	if (v3dn->fx_settings.dof)
 		v3dn->fx_settings.dof = MEM_dupallocN(v3do->fx_settings.dof);
@@ -748,7 +738,6 @@ static void *view3d_main_region_duplicate(void *poin)
 		new->render_engine = NULL;
 		new->sms = NULL;
 		new->smooth_timer = NULL;
-		new->compositor = NULL;
 		
 		return new;
 	}
@@ -1419,8 +1408,6 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i
 
 		/* Values in local-view aren't used, see: T52663 */
 		if (is_local == false) {
-			/* Skip 'v3d->defmaterial', it's not library data.  */
-
 			if ((ID *)v3d->ob_centre == old_id) {
 				v3d->ob_centre = (Object *)new_id;
 				/* Otherwise, bonename may remain valid... We could be smart and check this, too? */
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index ea3795c9ec3..ecb5f10be12 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -44,7 +44,6 @@ struct bGPdata;
 struct SmoothView3DStore;
 struct wmTimer;
 struct Material;
-struct GPUFX;
 struct GPUViewport;
 
 /* This is needed to not let VC choke on near and far... old
@@ -67,12 +66,6 @@ struct GPUViewport;
 /* The near/far thing is a Win EXCEPTION. Thus, leave near/far in the
  * code, and patch for windows. */
 
-typedef struct View3DDebug {
-	float znear, zfar;
-	char background;
-	char pad[7];
-} View3DDebug;
-
 typedef struct RegionView3D {
 	
 	float winmat[4][4];			/* GL_PROJECTION matrix */
@@ -136,8 +129,6 @@ typedef struct RegionView3D {
 	/* active rotation from NDOF or elsewhere */
 	float rot_angle;
 	float rot_axis[3];
-
-	struct GPUFX *compositor;
 } RegionView3D;
 
 /* 3D ViewPort Struct */
@@ -195,11 +186,6 @@ typedef struct View3D {
 	
 	short flag3;
 
-	/* afterdraw, for xray & transparent */
-	struct ListBase afterdraw_transp;
-	struct ListBase afterdraw_xray;
-	struct ListBase afterdraw_xraytransp;
-
 	/* drawflags, denoting state */
 	char zbuf, transp, xray;
 
@@ -212,8 +198,6 @@ typedef struct View3D {
 	struct GPUFXSettings fx_settings;
 
 	void *properties_storage;		/* Nkey panel stores stuff here (runtime only!) */
-	/* Allocated per view, not library data (used by matcap). */
-	struct Material *defmaterial;
 
 	/* XXX deprecated? */
 	struct bGPdata *gpd  DNA_DEPRECATED;		/* Grease-Pencil Data (annotation layers) */
@@ -239,8 +223,6 @@ typedef struct View3D {
 	int overlays;
 
 	int pad5;
-
-	View3DDebug debug;
 } View3D;
 
 
@@ -346,13 +328,6 @@ enum {
 	V3D_OVERLAY_HIDE_CURSOR      = (1 << 1),
 };
 
-/* View3d->debug.background */
-enum {
-	V3D_DEBUG_BACKGROUND_NONE     = (1 << 0),
-	V3D_DEBUG_BACKGROUND_GRADIENT = (1 << 1),
-	V3D_DEBUG_BACKGROUND_WORLD    = (1 << 2),
-};
-
 /* View3D->around */
 enum {
 	/* center of the bounding box */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2c063d5991a..222de73492a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -499,23 +499,6 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *UNUSED(scene), Poi
 	ED_view3d_shade_update(bmain, v3d, sa);
 }
 
-static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
-{
-	View3D *v3d = (View3D *)(ptr->data);
-
-	if (v3d->defmaterial) {
-		Material *ma = v3d->defmaterial;
-
-		if (ma->preview)
-			BKE_previewimg_free(&ma->preview);
-
-		if (ma->gpumaterial.first)
-			GPU_material_free(&ma->gpumaterial);
-
-		WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
-	}
-}
-
 static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	View3D *v3d = (View3D *)(ptr->data);
@@ -2652,7 +2635,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
 	RNA_def_property_enum_sdna(prop, NULL, "matcap_icon");
 	RNA_def_property_enum_items(prop, view3d_matcap_items);
 	RNA_def_property_ui_text(prop, "Matcap", "Image to use for Material Capture, active objects only");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_matcap_update");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
 	prop = RNA_def_property(srna, "fx_settings", PROP_POINTER, PROP_NONE);
 	RNA_def_property_ui_text(prop, "FX Options", "Options used for real time compositing");



More information about the Bf-blender-cvs mailing list