[Bf-blender-cvs] [ce490e98467] asset-engine: Merge branch 'blender2.8' into asset-engine

Bastien Montagne noreply at git.blender.org
Sun Jul 1 16:50:17 CEST 2018


Commit: ce490e9846761554b00a97e664cb419afa603fab
Author: Bastien Montagne
Date:   Sun Jul 1 16:49:59 2018 +0200
Branches: asset-engine
https://developer.blender.org/rBce490e9846761554b00a97e664cb419afa603fab

Merge branch 'blender2.8' into asset-engine

Conflicts:
	source/blender/blenkernel/BKE_library.h
	source/blender/blenloader/intern/versioning_280.c
	source/blender/blenloader/intern/versioning_defaults.c
	source/blender/windowmanager/WM_api.h

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



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

diff --cc source/blender/blenkernel/BKE_library.h
index 69df1539a20,aaf53a2396b..3764b2da386
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@@ -210,21 -208,8 +210,23 @@@ void BKE_library_make_local
  void BKE_id_tag_set_atomic(struct ID *id, int tag);
  void BKE_id_tag_clear_atomic(struct ID *id, int tag);
  
+ bool BKE_id_is_in_gobal_main(struct ID *id);
+ 
 +void BKE_library_asset_repository_init(struct Library *lib, const struct AssetEngineType *aet, const char *repo_root);
 +void BKE_library_asset_repository_clear(struct Library *lib);
 +void BKE_library_asset_repository_free(struct Library *lib);
 +struct AssetRef *BKE_library_asset_repository_asset_add(struct Library *lib, const void *idv);
 +void BKE_library_asset_repository_asset_remove(struct Library *lib, const void *idv);
 +struct AssetRef *BKE_library_asset_repository_asset_find(struct Library *lib, const void *idv);
 +void BKE_library_asset_repository_subdata_add(struct AssetRef *aref, const void *idv);
 +void BKE_library_asset_repository_subdata_remove(struct AssetRef *aref, const void *idv);
 +
 +void BKE_libraries_asset_subdata_remove(struct Main *bmain, const void *idv);
 +void BKE_libraries_asset_repositories_clear(struct Main *bmain);
 +void BKE_libraries_asset_repositories_rebuild(struct Main *bmain);
 +struct AssetRef *BKE_libraries_asset_repository_uuid_find(struct Main *bmain, const struct AssetUUID *uuid);
 +struct Library *BKE_library_asset_virtual_ensure(struct Main *bmain, const struct AssetEngineType *aet);
 +
  /* use when "" is given to new_id() */
  #define ID_FALLBACK_NAME N_("Untitled")
  
diff --cc source/blender/blenkernel/intern/blender.c
index de8883fd3b9,23c2147ff7e..3d43701a6e1
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@@ -48,9 -46,9 +48,10 @@@
  #include "IMB_moviecache.h"
  
  #include "BKE_addon.h"
 +#include "BKE_asset_engine.h"
  #include "BKE_blender.h"  /* own include */
  #include "BKE_blender_version.h"  /* own include */
+ #include "BKE_blender_user_menu.h"
  #include "BKE_blendfile.h"
  #include "BKE_brush.h"
  #include "BKE_cachefile.h"
diff --cc source/blender/blenloader/intern/versioning_280.c
index 201ac63e4fb,3fa059989a3..3a88797f7ad
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -1599,31 -1477,87 +1477,113 @@@ void blo_do_versions_280(FileData *fd, 
  				}
  			}
  		}
 +
+ 		if (!DNA_struct_elem_find(fd->filesdna, "SpaceAction", "char", "mode_prev")) {
+ 			for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+ 				for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ 					for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ 						if (sl->spacetype == SPACE_ACTION) {
+ 							SpaceAction *saction = (SpaceAction *)sl;
+ 							/* "Dopesheet" should be default here, unless it looks like the Action Editor was active instead */
+ 							if ((saction->mode_prev == 0) && (saction->action == NULL)) {
+ 								saction->mode_prev = SACTCONT_DOPESHEET;
+ 							}
+ 						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 
+ 		for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+ 			for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ 				for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ 					if (sl->spacetype == SPACE_VIEW3D) {
+ 						View3D *v3d = (View3D *)sl;
+ 						if (v3d->drawtype == OB_TEXTURE) {
+ 							v3d->drawtype = OB_SOLID;
+ 							v3d->shading.light = V3D_LIGHTING_STUDIO;
+ 							v3d->shading.color_type = V3D_SHADING_TEXTURE_COLOR;
+ 						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 
+ 	}
+ 
+ 	{
+ 		if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "texture_paint_mode_opacity")) {
+ 			for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+ 				for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ 					for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ 						if (sl->spacetype == SPACE_VIEW3D) {
+ 							View3D *v3d = (View3D *)sl;
+ 							float alpha = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 0.8f;
+ 							v3d->overlay.texture_paint_mode_opacity = alpha;
+ 							v3d->overlay.vertex_paint_mode_opacity = alpha;
+ 							v3d->overlay.weight_paint_mode_opacity = alpha;
+ 						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 
+ 		for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+ 			if (scene->toolsettings->manipulator_flag == 0) {
+ 				scene->toolsettings->manipulator_flag = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
+ 			}
+ 		}
+ 
+ 		if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyWorld", "RigidBodyWorld_Shared", "*shared")) {
+ 			for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+ 				RigidBodyWorld *rbw = scene->rigidbody_world;
+ 
+ 				if (rbw == NULL) {
+ 					continue;
+ 				}
+ 
+ 				if (rbw->shared == NULL) {
+ 					rbw->shared = MEM_callocN(sizeof(*rbw->shared), "RigidBodyWorld_Shared");
+ 				}
+ 
+ 				/* Move shared pointers from deprecated location to current location */
+ 				rbw->shared->pointcache = rbw->pointcache;
+ 				rbw->shared->ptcaches = rbw->ptcaches;
+ 
+ 				rbw->pointcache = NULL;
+ 				BLI_listbase_clear(&rbw->ptcaches);
+ 
+ 				if (rbw->shared->pointcache == NULL) {
+ 					rbw->shared->pointcache = BKE_ptcache_add(&(rbw->shared->ptcaches));
+ 				}
+ 
+ 			}
+ 		}
+ 
 +		if (1 || !DNA_struct_find(fd->filesdna, "AssetUUID")) {  /* struct_find will have to wait, not working for now... */
 +			/* Move non-op filebrowsers to 'library browsing' type/mode. */
 +			for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
 +				for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
 +					for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
 +						if (sl->spacetype == SPACE_FILE) {
 +							SpaceFile *sfile = (SpaceFile *)sl;
 +							if (sfile->params != NULL) {
 +								sfile->params->type = FILE_LOADLIB;
 +								sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB;
 +								/* For now, always init filterid to 'all true' */
 +								sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA |
 +								                           FILTER_ID_CU | FILTER_ID_GD | FILTER_ID_GR | FILTER_ID_IM |
 +								                           FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
 +								                           FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK |
 +								                           FILTER_ID_NT | FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL |
 +								                           FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
 +								                           FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO |
 +								                           FILTER_ID_CF;
 +							}
 +						}
 +					}
 +				}
 +			}
 +		}
  	}
  }
diff --cc source/blender/blenloader/intern/versioning_defaults.c
index 610e3a1dc99,860d1432370..60e30e350b7
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@@ -96,10 -95,12 +96,17 @@@ void BLO_update_defaults_userpref_blend
  	U.flag &= ~USER_SCRIPT_AUTOEXEC_DISABLE;
  #endif
  
 +	/* Enable Amber asset engine by default. */
 +	bAddon *bext = MEM_callocN(sizeof(bAddon), "bAddon");
 +	BLI_strncpy(bext->module, "amber", sizeof(bext->module));
 +	BLI_addtail(&U.addons, bext);
++
+ 	/* Ignore the theme saved in the blend file,
+ 	 * instead use the theme from 'userdef_default_theme.c' */
+ 	{
+ 		bTheme *theme = U.themes.first;
+ 		memcpy(theme, &U_theme_default, sizeof(bTheme));
+ 	}
  }
  
  /**
diff --cc source/blender/editors/space_file/file_draw.c
index 4c92e568019,4d4845c41b9..fa028100eaa
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@@ -418,11 -415,12 +419,11 @@@ static void file_draw_preview
  	UI_but_func_tooltip_set(but, file_draw_tooltip_func, BLI_strdup(path));
  
  	/* dragregion */
 -	if (drag) {
 -		/* path is no more static, cannot give it directly to but... */
 -		UI_but_drag_set_image(but, BLI_strdup(path), icon, imb, scale, true);
 +	if (drag_data != NULL) {
 +		UI_but_drag_set_library(but, icon, imb, scale, drag_data, true);
  	}
  
- 	glDisable(GL_BLEND);
+ 	GPU_blend(false);
  }
  
  static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname)
diff --cc source/blender/editors/space_outliner/outliner_draw.c
index a75824d8340,19e5217cdd2..3c9e7c87874
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@@ -1456,34 -1680,20 +1680,37 @@@ static void outliner_draw_tree_element
  
  		if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_LINKED(tselem->id)) {
  			if (tselem->id->tag & LIB_TAG_MISSING) {
- 				UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN,
- 				                   alpha_fac);
+ 				UI_icon_draw_alpha(
+ 				        (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN,
+ 				        alpha_fac);
  			}
  			else if (tselem->id->tag & LIB_TAG_INDIRECT) {
- 				UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT,
- 				                   alpha_fac);
+ 				UI_icon_draw_alpha(
+ 				        (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT,
+ 				        alpha_fac);
  			}
  			else {
- 				UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
- 				                   alpha_fac);
+ 				UI_icon_draw_alpha(
+ 				        (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
+ 				        alpha_fac);
  			}
 +			if (tselem->id->uuid) {
 +				offsx += UI_UNIT_X;
 +				UI_icon_draw_alpha((float)startx + offsx - 0.5f * ufac, (float)*starty + 1.5f * ufac, ICON_SOLO_ON,
 +				                   alpha_fac);
 +				if (tselem->id->uuid->tag & UUID_TAG_ENGINE_MISSING) {
 +					

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list