From fe0520e2c841569712e14446f4afbb4036daae3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Mon, 5 Dec 2016 23:33:21 +0100 Subject: [PATCH] UI: add a message to indicate when using a modifier that wasn't compiled. This adds a short message to the smoke, remesh and boolean modifiers' UI when trying to use them when their compilation was turned off. This was already implemented for the fluid and ocean simulation modifiers. This also makes the 'quick fluid' and 'quick smoke' operator abort and report when trying to use them when unavailable. --- .../scripts/startup/bl_operators/object_quick_effects.py | 8 ++++++++ release/scripts/startup/bl_ui/properties_data_modifier.py | 8 ++++++++ release/scripts/startup/bl_ui/properties_physics_smoke.py | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 414855c7e35..cdab380bb9c 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -317,6 +317,10 @@ class QuickSmoke(Operator): ) def execute(self, context): + if not bpy.app.build_options.mod_smoke: + self.report({'ERROR'}, "Build without Smoke modifier support") + return {'CANCELLED'} + fake_context = context.copy() mesh_objects = [obj for obj in context.selected_objects if obj.type == 'MESH'] @@ -562,6 +566,10 @@ class QuickFluid(Operator): ) def execute(self, context): + if not bpy.app.build_options.mod_fluid: + self.report({'ERROR'}, "Build without Fluid modifier support") + return {'CANCELLED'} + fake_context = context.copy() mesh_objects = [obj for obj in context.selected_objects if (obj.type == 'MESH' and 0.0 not in obj.dimensions)] diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 540c29f31e4..d66fb08bcd6 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -146,6 +146,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.row().prop(md, "offset_type", expand=True) def BOOLEAN(self, layout, ob, md): + if not bpy.app.build_options.mod_boolean: + layout.label("Built without Boolean modifier") + return + split = layout.split() col = split.column() @@ -1077,6 +1081,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "narrowness", slider=True) def REMESH(self, layout, ob, md): + if not bpy.app.build_options.mod_remesh: + layout.label("Built without Remesh modifier") + return + layout.prop(md, "mode") row = layout.row() diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 0374d032141..ee9135b9dbf 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -45,6 +45,10 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): def draw(self, context): layout = self.layout + if not bpy.app.build_options.mod_smoke: + layout.label("Built without Smoke modifier") + return + md = context.smoke ob = context.object