Code cleanup:
authorThomas Dinges <blender@dingto.org>
Sat, 23 Mar 2013 06:55:59 +0000 (06:55 +0000)
committerThomas Dinges <blender@dingto.org>
Sat, 23 Mar 2013 06:55:59 +0000 (06:55 +0000)
* Use bpy.app.build_options for UI checks rather than custom ones.

release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_physics_fluid.py
release/scripts/startup/bl_ui/space_info.py
source/blender/makesrna/intern/rna_modifier.c

index b38e2a7e98cd14a69c7a59bc53f40df7afd2e169..71178e6afac3f0347a1905e5d6e43d7f9b6d0c9f 100644 (file)
@@ -509,7 +509,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
             row.label()
 
     def OCEAN(self, layout, ob, md):
-        if not md.is_build_enabled:
+        if not bpy.app.build_options.mod_oceansim:
             layout.label("Built without OceanSim modifier")
             return
 
index 696e895fa67e3707a472e5fb702ca639cbbfa120..b3cd5dc5464196c3b6248392372ca8af6e6cb679 100644 (file)
@@ -51,7 +51,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
         fluid = md.settings
 
         col = layout.column()
-        if fluid is None:
+        if not bpy.app.build_options.mod_fluid:
             col.label("Built without fluids")
             return
 
index 51c975c3e70bd68d34c9cb935f15019e6062e7fc..d782bb1b3b9a714be3b53e85c96d4688fc291a1d 100644 (file)
@@ -157,7 +157,7 @@ class INFO_MT_file_import(Menu):
     bl_label = "Import"
 
     def draw(self, context):
-        if hasattr(bpy.types, "WM_OT_collada_import"):
+        if bpy.app.build_options.collada:
             self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
 
 
@@ -166,7 +166,7 @@ class INFO_MT_file_export(Menu):
     bl_label = "Export"
 
     def draw(self, context):
-        if hasattr(bpy.types, "WM_OT_collada_export"):
+        if bpy.app.build_options.collada:
             self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
 
 
index fa436e30200e037ac445a9394a53ede0941d0abc..185968ded79e5cf943cee33a25bc183b8f9ca57f 100644 (file)
@@ -670,15 +670,6 @@ static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
                md->projectors[a] = NULL;
 }
 
-static int rna_OceanModifier_is_build_enabled_get(PointerRNA *UNUSED(ptr))
-{
-#ifdef WITH_OCEANSIM
-       return 1;
-#else /* WITH_OCEANSIM */
-       return 0;
-#endif /* WITH_OCEANSIM */
-}
-
 static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        OceanModifierData *omd = (OceanModifierData *)ptr->data;
@@ -3287,12 +3278,6 @@ static void rna_def_modifier_ocean(BlenderRNA *brna)
        RNA_def_struct_sdna(srna, "OceanModifierData");
        RNA_def_struct_ui_icon(srna, ICON_MOD_OCEAN);
        
-       /* General check if blender was built with OceanSim modifier support */
-       prop = RNA_def_property(srna, "is_build_enabled", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_funcs(prop, "rna_OceanModifier_is_build_enabled_get", NULL);
-       RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Build Enabled", "True if the OceanSim modifier is enabled in this build");
-       
        prop = RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "geometry_mode");
        RNA_def_property_enum_items(prop, geometry_items);