From 213a57ccafdf2f4fcc472801c60332d40cfe6464 Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Mon, 25 Jul 2016 21:45:20 -0500 Subject: Stop baking process if there is no geometry in the BakedLightInstance. moved missing baked light warning to BakedLightInstance configuration warning --- scene/3d/baked_light_instance.cpp | 10 ++++++++++ scene/3d/baked_light_instance.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'scene') diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index fafa62866f..ca3a309568 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -60,6 +60,8 @@ void BakedLightInstance::set_baked_light(const Ref& p_baked_light) { // VS::get_singleton()->instance_geometry_set_baked_light(E->get()->get_instance(),baked_light.is_valid()?get_instance():RID()); // } } + + update_configuration_warning(); } Ref BakedLightInstance::get_baked_light() const{ @@ -77,6 +79,14 @@ DVector BakedLightInstance::get_faces(uint32_t p_usage_flags) const { } +String BakedLightInstance::get_configuration_warning() const { + if (get_baked_light().is_null()) { + return TTR("BakedLightInstance does not contain a BakedLight resource."); + } + return String(); +} + + void BakedLightInstance::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_baked_light","baked_light"),&BakedLightInstance::set_baked_light); diff --git a/scene/3d/baked_light_instance.h b/scene/3d/baked_light_instance.h index 92c2d50986..002e55df1d 100644 --- a/scene/3d/baked_light_instance.h +++ b/scene/3d/baked_light_instance.h @@ -55,6 +55,8 @@ public: virtual AABB get_aabb() const; virtual DVector get_faces(uint32_t p_usage_flags) const; + String get_configuration_warning() const; + BakedLightInstance(); }; -- cgit v1.2.3