Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/modules/rna_prop_ui.py8
-rw-r--r--release/scripts/startup/bl_operators/wm.py18
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py1
-rw-r--r--release/scripts/startup/bl_ui/space_image.py3
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py10
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py6
7 files changed, 44 insertions, 4 deletions
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index 662c1d908fc..98722ea322b 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -309,13 +309,15 @@ def draw(layout, context, context_member, property_type, use_edit=True):
# Do not allow editing of overridden properties (we cannot use a poll function of the operators here
# since they's have no access to the specific property...).
row.enabled = not(is_lib_override and key in rna_item.id_data.override_library.reference)
- if not is_rna:
+ if is_rna:
+ row.label(text="API Defined")
+ elif is_lib_override:
+ row.label(text="Library Override")
+ else:
props = row.operator("wm.properties_edit", text="Edit")
assign_props(props, val_draw, key)
props = row.operator("wm.properties_remove", text="", icon='REMOVE')
assign_props(props, val_draw, key)
- else:
- row.label(text="API Defined")
del flow
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 570b4663f1d..83039a5c333 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1276,6 +1276,11 @@ class WM_OT_properties_edit(Operator):
# First remove
item = eval("context.%s" % data_path)
+
+ if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference):
+ self.report({'ERROR'}, "Cannot edit properties from override data")
+ return {'CANCELLED'}
+
prop_type_old = type(item[prop_old])
rna_idprop_ui_prop_clear(item, prop_old)
@@ -1375,6 +1380,10 @@ class WM_OT_properties_edit(Operator):
item = eval("context.%s" % data_path)
+ if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference):
+ self.report({'ERROR'}, "Cannot edit properties from override data")
+ return {'CANCELLED'}
+
# retrieve overridable static
exec_str = "item.is_property_overridable_library('[\"%s\"]')" % (self.property)
self.is_overridable_library = bool(eval(exec_str))
@@ -1498,6 +1507,10 @@ class WM_OT_properties_add(Operator):
data_path = self.data_path
item = eval("context.%s" % data_path)
+ if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference):
+ self.report({'ERROR'}, "Cannot add properties to override data")
+ return {'CANCELLED'}
+
def unique_name(names):
prop = "prop"
prop_new = prop
@@ -1550,6 +1563,11 @@ class WM_OT_properties_remove(Operator):
)
data_path = self.data_path
item = eval("context.%s" % data_path)
+
+ if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference):
+ self.report({'ERROR'}, "Cannot remove properties from override data")
+ return {'CANCELLED'}
+
prop = self.property
rna_idprop_ui_prop_update(item, prop)
del item[prop]
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 7ff2688f2a7..64bc694d5ca 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -468,7 +468,7 @@ class DATA_PT_sculpt_vertex_colors(MeshButtonsPanel, Panel):
@classmethod
def poll(cls, context):
- return context.preferences.experimental.use_sculpt_vertex_colors
+ return super().poll(context) and context.preferences.experimental.use_sculpt_vertex_colors
def draw(self, context):
layout = self.layout
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 6dde1e715bb..c7df2bbb7eb 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -313,6 +313,7 @@ class TextureMaskPanel(BrushPanel):
class StrokePanel(BrushPanel):
bl_label = "Stroke"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 13
def draw(self, context):
layout = self.layout
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 75c1bb5e3f9..3aedc04af88 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -1137,6 +1137,7 @@ class IMAGE_PT_paint_settings_advanced(Panel, ImagePaintPanel):
bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
bl_label = "Advanced"
+ bl_ui_units_x = 12
def draw(self, context):
layout = self.layout
@@ -1193,6 +1194,7 @@ class IMAGE_PT_tools_brush_display(Panel, BrushButtonsPanel, DisplayPanel):
bl_category = "Tool"
bl_label = "Brush Tip"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 15
class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
@@ -1219,6 +1221,7 @@ class IMAGE_PT_tools_mask_texture(Panel, BrushButtonsPanel, TextureMaskPanel):
bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
bl_label = "Texture Mask"
+ bl_ui_units_x = 12
class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel, StrokePanel):
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 03f85578b6e..9548de20752 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2118,6 +2118,10 @@ class ExperimentalPanel:
url_prefix = "https://developer.blender.org/"
+ @classmethod
+ def poll(cls, context):
+ return bpy.app.version_cycle == 'alpha'
+
def _draw_items(self, context, items):
prefs = context.preferences
experimental = prefs.experimental
@@ -2178,6 +2182,12 @@ class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
class USERPREF_PT_experimental_debugging(ExperimentalPanel, Panel):
bl_label = "Debugging"
+ @classmethod
+ def poll(cls, context):
+ # Unlike the other experimental panels, the debugging one is always visible
+ # even in beta or release.
+ return True
+
def draw(self, context):
self._draw_items(
context, (
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 6e31808d27d..e6d27d531be 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -392,6 +392,7 @@ class VIEW3D_PT_tools_brush_settings_advanced(Panel, View3DPaintBrushPanel):
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
bl_label = "Advanced"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 14
def draw(self, context):
layout = self.layout
@@ -598,6 +599,7 @@ class VIEW3D_PT_tools_brush_display(Panel, View3DPaintBrushPanel, DisplayPanel):
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
bl_label = "Cursor"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 12
# TODO, move to space_view3d.py
@@ -828,6 +830,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
bl_label = "Options"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 12
@classmethod
def poll(cls, context):
@@ -1375,6 +1378,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_advanced(View3DPanel, Panel):
bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings'
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 11
@classmethod
def poll(cls, context):
@@ -1434,6 +1438,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_stroke(Panel, View3DPanel):
bl_label = "Stroke"
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
+ bl_ui_units_x = 12
@classmethod
def poll(cls, context):
@@ -2110,6 +2115,7 @@ class VIEW3D_PT_tools_grease_pencil_paint_appearance(GreasePencilDisplayPanel, P
bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings'
bl_label = "Cursor"
bl_category = "Tool"
+ bl_ui_units_x = 15
class VIEW3D_PT_tools_grease_pencil_sculpt_appearance(GreasePencilDisplayPanel, Panel, View3DPanel):