Minor fix.

This commit is contained in:
Dion Moult
2023-02-04 11:59:35 +11:00
parent c4b77c2a07
commit 6bab10d2ac
@@ -16,15 +16,14 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>. # along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
from bpy.types import Panel, UIList
import bpy import bpy
import blenderbim.bim.helper import blenderbim.bim.helper
import blenderbim.tool as tool import blenderbim.tool as tool
from bpy.types import Panel, UIList
from blenderbim.bim.module.profile.data import ProfileData from blenderbim.bim.module.profile.data import ProfileData
from blenderbim.bim.module.profile.prop import generate_thumbnail_for_active_profile from blenderbim.bim.module.profile.prop import generate_thumbnail_for_active_profile
# Profile Manager Class
class BIM_PT_profiles(Panel): class BIM_PT_profiles(Panel):
bl_label = "IFC Profiles" bl_label = "IFC Profiles"
bl_idname = "BIM_PT_profiles" bl_idname = "BIM_PT_profiles"
@@ -43,11 +42,10 @@ class BIM_PT_profiles(Panel):
ProfileData.load() ProfileData.load()
self.props = context.scene.BIMProfileProperties self.props = context.scene.BIMProfileProperties
if self.props.is_editing: if self.props.is_editing and self.props.profiles and self.props.active_profile_index < len(self.props.profiles):
preview_collection = ProfileData.preview_collection preview_collection = ProfileData.preview_collection
box = self.layout.box() box = self.layout.box()
profile_id = self.props.profiles[self.props.active_profile_index].ifc_definition_id profile_id = self.props.profiles[self.props.active_profile_index].ifc_definition_id
profile_id_str = str(profile_id) profile_id_str = str(profile_id)
if profile_id_str in preview_collection: if profile_id_str in preview_collection:
preview_image = preview_collection[profile_id_str] preview_image = preview_collection[profile_id_str]