[Bf-blender-cvs] [acc6373939d] master: Fix custom-property UI allowing long names that raised errors

Campbell Barton noreply at git.blender.org
Wed Dec 9 07:21:14 CET 2020


Commit: acc6373939d4825d9be0d8fa81e9a1a4e3dd0d27
Author: Campbell Barton
Date:   Wed Dec 9 17:17:27 2020 +1100
Branches: master
https://developer.blender.org/rBacc6373939d4825d9be0d8fa81e9a1a4e3dd0d27

Fix custom-property UI allowing long names that raised errors

Rename `rna_property` to `rna_custom_property`
to differentiate it from a more general property.

===================================================================

M	release/scripts/startup/bl_operators/wm.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 3d8ed7ef0b5..bd1c99fdeb3 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1147,10 +1147,11 @@ rna_default = StringProperty(
     maxlen=1024,
 )
 
-rna_property = StringProperty(
+rna_custom_property = StringProperty(
     name="Property Name",
     description="Property name edit",
-    maxlen=1024,
+    # Match `MAX_IDPROP_NAME - 1` in Blender's source.
+    maxlen=63,
 )
 
 rna_min = FloatProperty(
@@ -1196,7 +1197,7 @@ class WM_OT_properties_edit(Operator):
     bl_options = {'REGISTER', 'INTERNAL'}
 
     data_path: rna_path
-    property: rna_property
+    property: rna_custom_property
     value: rna_value
     default: rna_default
     min: rna_min
@@ -1552,7 +1553,7 @@ class WM_OT_properties_remove(Operator):
     bl_options = {'UNDO', 'INTERNAL'}
 
     data_path: rna_path
-    property: rna_property
+    property: rna_custom_property
 
     def execute(self, context):
         from rna_prop_ui import (



More information about the Bf-blender-cvs mailing list