Cleanup: use defines for buffer sizes

This commit is contained in:
Campbell Barton
2025-08-06 20:11:50 +00:00
parent d30cb946fa
commit 53c2ba29a6
3 changed files with 7 additions and 5 deletions

View File

@@ -31,7 +31,7 @@ typedef struct TexPaintSlot {
struct ImageUser *image_user;
/**
* Custom-data index for uv layer, #MAX_NAME.
* Custom-data index for uv layer, #MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX.
* May reference #NodeShaderUVMap::uv_name.
*/
char *uvname;

View File

@@ -333,7 +333,7 @@ static void rna_TexPaintSlot_uv_layer_set(PointerRNA *ptr, const char *value)
TexPaintSlot *data = (TexPaintSlot *)(ptr->data);
if (data->uvname != nullptr) {
BLI_strncpy_utf8(data->uvname, value, 64);
BLI_strncpy_utf8(data->uvname, value, MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX);
}
}
@@ -1247,7 +1247,8 @@ static void rna_def_tex_slot(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Icon", "Paint slot icon");
prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_maxlength(prop, 64); /* else it uses the pointer size! */
RNA_def_property_string_maxlength(
prop, MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX); /* Else it uses the pointer size! */
RNA_def_property_string_sdna(prop, nullptr, "uvname");
RNA_def_property_string_funcs(prop,
"rna_TexPaintSlot_uv_layer_get",

View File

@@ -7791,8 +7791,9 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* name */
RNA_def_string(func, "idname", "KeyingSet", 64, "IDName", "Internal identifier of Keying Set");
RNA_def_string(func, "name", "KeyingSet", 64, "Name", "User visible name of Keying Set");
RNA_def_string(
func, "idname", "KeyingSet", MAX_NAME, "IDName", "Internal identifier of Keying Set");
RNA_def_string(func, "name", "KeyingSet", MAX_NAME, "Name", "User visible name of Keying Set");
/* returns the new KeyingSet */
parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
RNA_def_function_return(func, parm);