فهرست منبع

Merge branch 'main' of https://github.com/armory3d/armortools

luboslenco 1 ماه پیش
والد
کامیت
a3b3a7d591
2فایلهای تغییر یافته به همراه14 افزوده شده و 6 حذف شده
  1. 10 6
      base/sources/ts/project.ts
  2. 4 0
      base/sources/ts/tab_textures.ts

+ 10 - 6
base/sources/ts/project.ts

@@ -310,6 +310,16 @@ function project_new(reset_layers: bool = true) {
 
 	if (in_use) draw_begin(current);
 
+	project_set_default_envmap();
+
+	///if is_paint
+	context_init_tool();
+	///end
+
+	render_path_raytrace_ready = false;
+}
+
+function project_set_default_envmap() {
 	context_raw.saved_envmap = null;
 	context_raw.envmap_loaded = false;
 	scene_world._.envmap = context_raw.empty_envmap;
@@ -319,12 +329,6 @@ function project_new(reset_layers: bool = true) {
 	scene_world._.radiance_mipmaps = context_raw.default_radiance_mipmaps;
 	scene_world._.irradiance = context_raw.default_irradiance;
 	scene_world.strength = 4.0;
-
-	///if is_paint
-	context_init_tool();
-	///end
-
-	render_path_raytrace_ready = false;
 }
 
 function project_import_material() {

+ 4 - 0
base/sources/ts/tab_textures.ts

@@ -265,6 +265,10 @@ function tab_textures_delete_texture(asset: asset_t) {
 		ui_toolbar_handle.redraws = 1;
 	}
 
+	if (data_get_image(asset.file) == scene_world._.envmap) {
+		project_set_default_envmap();
+	}
+
 	data_delete_image(asset.file);
 	map_delete(project_asset_map, asset.id);
 	array_splice(project_assets, i, 1);