Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_graph/graph_buttons.c
| Show First 20 Lines • Show All 728 Lines • ▼ Show 20 Lines | if (driver->type == DRIVER_TYPE_PYTHON) { | ||||
| bool bpy_data_expr_error = (strstr(driver->expression, "bpy.data.") != NULL); | bool bpy_data_expr_error = (strstr(driver->expression, "bpy.data.") != NULL); | ||||
| bool bpy_ctx_expr_error = (strstr(driver->expression, "bpy.context.") != NULL); | bool bpy_ctx_expr_error = (strstr(driver->expression, "bpy.context.") != NULL); | ||||
| /* expression */ | /* expression */ | ||||
| uiItemR(col, &driver_ptr, "expression", 0, IFACE_("Expr"), ICON_NONE); | uiItemR(col, &driver_ptr, "expression", 0, IFACE_("Expr"), ICON_NONE); | ||||
| /* errors? */ | /* errors? */ | ||||
| if ((G.f & G_SCRIPT_AUTOEXEC) == 0) { | if ((G.f & G_SCRIPT_AUTOEXEC) == 0) { | ||||
| uiItemL(col, IFACE_("ERROR: Python auto-execution disabled"), ICON_CANCEL); | uiItemL(col, IFACE_("ERROR: Python in restricted mode)"), ICON_CANCEL); | ||||
| } | } | ||||
| else if (driver->flag & DRIVER_FLAG_INVALID) { | else if (driver->flag & DRIVER_FLAG_INVALID) { | ||||
| uiItemL(col, IFACE_("ERROR: Invalid Python expression"), ICON_CANCEL); | uiItemL(col, IFACE_("ERROR: Invalid Python expression"), ICON_CANCEL); | ||||
| } | } | ||||
| /* Explicit bpy-references are evil. Warn about these to prevent errors */ | /* Explicit bpy-references are evil. Warn about these to prevent errors */ | ||||
| /* TODO: put these in a box? */ | /* TODO: put these in a box? */ | ||||
| if (bpy_data_expr_error || bpy_ctx_expr_error) { | if (bpy_data_expr_error || bpy_ctx_expr_error) { | ||||
| ▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines | |||||