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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-11 12:51:06 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-11 12:51:06 +0400
commit51bada696f77de9d7f673884cec9560218654fae (patch)
treed2434eac2fb74377592ee7c8c86d68b55733960c /source
parent782f0b63829a2c257a6e2942c49882f7fe04c33c (diff)
Longer names support for all ID and other object names
This commit extends limit of ID and objects to 64 (it means 63 meaning characters and 1 for zero-terminator). CustomData layers names are also extended. Changed DNA structures and all places where length constants were hardcoded. All names which are "generating" from ID block should be limited by MAX_ID_NAME-2, all non-id names now has got own define called MAX_NAME which should be used all over for non-id names to make further name migration stuff easier. All name fields in DNA now have comment with constant which corresponds to hardcoded numeric value which should make it easier to further update this limits or even switch to non-hardcoded values in DNA. Special thanks to Campbell who helped figuring out some issues and helped a lot in finding all cases where hardcoded valued were still used in code. Both of forwards and backwards compatibility is stored with blender versions newer than January 5, 2011. Older versions had issue with placing null-terminator to DNA strings on file load which will lead to some unpredictable behavior or even crashes.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_armature.h2
-rw-r--r--source/blender/blenkernel/BKE_deform.h2
-rw-r--r--source/blender/blenkernel/BKE_node.h6
-rw-r--r--source/blender/blenkernel/BKE_sequencer.h2
-rw-r--r--source/blender/blenkernel/intern/customdata.c2
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c4
-rw-r--r--source/blender/blenkernel/intern/library.c30
-rw-r--r--source/blender/blenkernel/intern/mball.c10
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c7
-rw-r--r--source/blender/blenkernel/intern/sequencer.c16
-rw-r--r--source/blender/blenkernel/intern/sound.c4
-rw-r--r--source/blender/blenkernel/intern/tracking.c4
-rw-r--r--source/blender/editors/armature/editarmature.c6
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c6
-rw-r--r--source/blender/editors/armature/poseobject.c2
-rw-r--r--source/blender/editors/include/ED_armature.h2
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_layout.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/mesh/mesh_data.c4
-rw-r--r--source/blender/editors/object/object_add.c4
-rw-r--r--source/blender/editors/object/object_constraint.c4
-rw-r--r--source/blender/editors/object/object_edit.c4
-rw-r--r--source/blender/editors/object/object_group.c4
-rw-r--r--source/blender/editors/object/object_hook.c4
-rw-r--r--source/blender/editors/object/object_modifier.c4
-rw-r--r--source/blender/editors/object/object_ops.c2
-rw-r--r--source/blender/editors/object/object_relations.c6
-rw-r--r--source/blender/editors/object/object_select.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/space_logic/logic_ops.c46
-rw-r--r--source/blender/editors/space_logic/logic_window.c96
-rw-r--r--source/blender/editors/space_node/drawnode.c4
-rw-r--r--source/blender/editors/space_node/node_edit.c12
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_ops.c4
-rw-r--r--source/blender/editors/transform/transform_orientations.c7
-rw-r--r--source/blender/gpu/GPU_extensions.h2
-rw-r--r--source/blender/makesdna/DNA_ID.h13
-rw-r--r--source/blender/makesdna/DNA_action_types.h6
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h30
-rw-r--r--source/blender/makesdna/DNA_armature_types.h4
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h47
-rw-r--r--source/blender/makesdna/DNA_controller_types.h2
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h4
-rw-r--r--source/blender/makesdna/DNA_defs.h3
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h2
-rw-r--r--source/blender/makesdna/DNA_effect_types.h2
-rw-r--r--source/blender/makesdna/DNA_key_types.h6
-rw-r--r--source/blender/makesdna/DNA_lattice_types.h2
-rw-r--r--source/blender/makesdna/DNA_material_types.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h68
-rw-r--r--source/blender/makesdna/DNA_node_types.h16
-rw-r--r--source/blender/makesdna/DNA_object_force.h6
-rw-r--r--source/blender/makesdna/DNA_object_types.h8
-rw-r--r--source/blender/makesdna/DNA_particle_types.h4
-rw-r--r--source/blender/makesdna/DNA_property_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h5
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h42
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h4
-rw-r--r--source/blender/makesdna/DNA_texture_types.h2
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h4
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h2
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c2
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c4
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c2
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c2
-rw-r--r--source/blender/modifiers/intern/MOD_cast.c2
-rw-r--r--source/blender/modifiers/intern/MOD_curve.c2
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c4
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c4
-rw-r--r--source/blender/modifiers/intern/MOD_lattice.c2
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c2
-rw-r--r--source/blender/modifiers/intern/MOD_util.c2
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c2
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.h2
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_output.c4
-rw-r--r--source/blender/python/generic/bpy_internal_import.c2
-rw-r--r--source/blender/python/generic/idprop_py_api.c4
-rw-r--r--source/blender/render/intern/include/render_types.h5
87 files changed, 345 insertions, 330 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 8836999bc9b..b301b7cf03b 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -82,7 +82,7 @@ void free_armature(struct bArmature *arm);
void make_local_armature(struct bArmature *arm);
struct bArmature *copy_armature(struct bArmature *arm);
-int bone_autoside_name (char name[32], int strip_number, short axis, float head, float tail);
+int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail);
struct Bone *get_named_bone (struct bArmature *arm, const char *name);
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index 9a27f292f36..11747899aa9 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -69,7 +69,7 @@ void defvert_normalize_lock(struct MDeformVert *dvert, const int def_nr_lock);
/* utility function, note that 32 chars is the maximum string length since its only
* used with defgroups currently */
-void flip_side_name(char name[32], const char from_name[32], int strip_number);
+void flip_side_name(char name[64], const char from_name[64], int strip_number);
#endif
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 8229978454f..67de699c7c4 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -76,7 +76,7 @@ struct Object;
*/
typedef struct bNodeSocketTemplate {
int type, limit;
- char name[32];
+ char name[64]; /* MAX_NAME */
float val1, val2, val3, val4; /* default alloc value for inputs */
float min, max;
PropertySubType subtype;
@@ -95,7 +95,7 @@ typedef void (*NodeSocketButtonFunction)(const struct bContext *C, struct uiBloc
*/
typedef struct bNodeSocketType {
int type;
- char ui_name[32];
+ char ui_name[64]; /* MAX_NAME */
char ui_description[128];
int ui_icon;
char ui_color[4];
@@ -125,7 +125,7 @@ typedef struct bNodeType {
short needs_free; /* set for allocated types that need to be freed */
int type;
- char name[32];
+ char name[64]; /* MAX_NAME */
float width, minwidth, maxwidth;
float height, minheight, maxheight;
short nclass, flag, compatibility;
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index 3a4ac279852..ed0730b7f09 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -306,7 +306,7 @@ typedef struct SeqLoadInfo {
int tot_error;
int len; /* only for image strips */
char path[512];
- char name[32];
+ char name[64];
} SeqLoadInfo;
/* SeqLoadInfo.flag */
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 35b2499bea5..f840774222a 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1519,7 +1519,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
data->layers[index].data = newlayerdata;
if(name || (name=typeInfo->defaultname)) {
- BLI_strncpy(data->layers[index].name, name, 32);
+ BLI_strncpy(data->layers[index].name, name, sizeof(data->layers[index].name));
CustomData_set_layer_unique_name(data, index);
}
else
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 567cc5ce07f..fb114aa54c6 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1323,7 +1323,7 @@ void dynamicPaint_setInitialColor(DynamicPaintSurface *surface)
MTFace *tface;
MFace *mface = dm->getFaceArray(dm);
int numOfFaces = dm->getNumFaces(dm);
- char uvname[40];
+ char uvname[MAX_CUSTOMDATA_LAYER_NAME];
if (!tex) return;
@@ -2079,7 +2079,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
int ty;
int w,h;
int numOfFaces;
- char uvname[32];
+ char uvname[MAX_CUSTOMDATA_LAYER_NAME];
int active_points = 0;
int error = 0;
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index cb1c7dbec5c..315f1e14e61 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1136,10 +1136,12 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
{
ID *idtest;
int nr= 0, nrtest, a, left_len;
- char left[32], leftest[32], in_use[32];
+ char in_use[64]; /* use as a boolean array, unrelated to name length */
+
+ char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8];
/* make sure input name is terminated properly */
- /* if( strlen(name) > 21 ) name[21]= 0; */
+ /* if( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
/* removed since this is only ever called from one place - campbell */
while (1) {
@@ -1151,20 +1153,20 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
if( idtest == NULL ) return 0;
/* we have a dup; need to make a new name */
- /* quick check so we can reuse one of first 32 ids if vacant */
+ /* quick check so we can reuse one of first 64 ids if vacant */
memset(in_use, 0, sizeof(in_use));
/* get name portion, number portion ("name.number") */
left_len= BLI_split_name_num(left, &nr, name, '.');
/* if new name will be too long, truncate it */
- if(nr > 999 && left_len > 16) {
- left[16]= 0;
- left_len= 16;
+ if(nr > 999 && left_len > (MAX_ID_NAME - 8)) {
+ left[MAX_ID_NAME - 8]= 0;
+ left_len= MAX_ID_NAME - 8;
}
- else if(left_len > 17) {
- left[17]= 0;
- left_len= 17;
+ else if(left_len > (MAX_ID_NAME - 7)) {
+ left[MAX_ID_NAME - 7]= 0;
+ left_len= MAX_ID_NAME - 7;
}
for(idtest= lb->first; idtest; idtest= idtest->next) {
@@ -1206,11 +1208,11 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
/* otherwise just continue and use a number suffix */
}
- if(nr > 999 && left_len > 16) {
+ if(nr > 999 && left_len > (MAX_ID_NAME - 8)) {
/* this would overflow name buffer */
- left[16] = 0;
- /* left_len = 16; */ /* for now this isnt used again */
- memcpy(name, left, sizeof(char) * 17);
+ left[MAX_ID_NAME - 8] = 0;
+ /* left_len = MAX_ID_NAME - 8; */ /* for now this isnt used again */
+ memcpy(name, left, sizeof(char) * (MAX_ID_NAME - 7));
continue;
}
/* this format specifier is from hell... */
@@ -1245,7 +1247,7 @@ int new_id(ListBase *lb, ID *id, const char *tname)
strncpy(name, tname, sizeof(name)-1);
- /* if result > 21, strncpy don't put the final '\0' to name.
+ /* if result > MAX_ID_NAME-3, strncpy don't put the final '\0' to name.
* easier to assign each time then to check if its needed */
name[sizeof(name)-1]= 0;
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 57fc7473860..fe2c10d7091 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -356,7 +356,7 @@ int is_basis_mball(Object *ob)
int is_mball_basis_for(Object *ob1, Object *ob2)
{
int basis1nr, basis2nr;
- char basis1name[32], basis2name[32];
+ char basis1name[MAX_ID_NAME], basis2name[MAX_ID_NAME];
BLI_split_name_num(basis1name, &basis1nr, ob1->id.name+2, '.');
BLI_split_name_num(basis2name, &basis2nr, ob2->id.name+2, '.');
@@ -378,7 +378,7 @@ void copy_mball_properties(Scene *scene, Object *active_object)
Object *ob;
MetaBall *active_mball = (MetaBall*)active_object->data;
int basisnr, obnr;
- char basisname[32], obname[32];
+ char basisname[MAX_ID_NAME], obname[MAX_ID_NAME];
BLI_split_name_num(basisname, &basisnr, active_object->id.name+2, '.');
@@ -423,7 +423,7 @@ Object *find_basis_mball(Scene *scene, Object *basis)
Object *ob,*bob= basis;
MetaElem *ml=NULL;
int basisnr, obnr;
- char basisname[32], obname[32];
+ char basisname[MAX_ID_NAME], obname[MAX_ID_NAME];
BLI_split_name_num(basisname, &basisnr, basis->id.name+2, '.');
totelem= 0;
@@ -1596,7 +1596,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
float size, totsize, obinv[4][4], obmat[4][4], vec[3];
//float max=0.0;
int a, obnr, zero_size=0;
- char obname[32];
+ char obname[MAX_ID_NAME];
copy_m4_m4(obmat, ob->obmat); /* to cope with duplicators from next_object */
invert_m4_m4(obinv, ob->obmat);
@@ -1619,7 +1619,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */
else ml= mb->elems.first;
}
else {
- char name[32];
+ char name[MAX_ID_NAME];
int nr;
BLI_split_name_num(name, &nr, bob->id.name+2, '.');
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 8f00cdac0db..d2b81a345a7 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -830,7 +830,7 @@ Object *add_object(struct Scene *scene, int type)
{
Object *ob;
Base *base;
- char name[32];
+ char name[MAX_ID_NAME];
BLI_strncpy(name, get_obdata_defname(type), sizeof(name));
ob = add_only_object(type, name);
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 731f82e1b80..b13e451b689 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -176,7 +176,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
MEM_freeN(info);
cp= BLI_dynlib_find_symbol(pis->handle, "seqname");
- if(cp) BLI_strncpy(cp, seqname, 21);
+ if(cp) BLI_strncpy(cp, seqname, SEQ_NAME_MAXSTR);
} else {
printf ("Plugin returned unrecognized version number\n");
return;
@@ -303,7 +303,10 @@ static struct ImBuf * do_plugin_effect(
cp = BLI_dynlib_find_symbol(
seq->plugin->handle, "seqname");
- if(cp) strncpy(cp, seq->name+2, 22);
+ /* XXX: it's crappy to limit copying buffer by it's lemgth,
+ * but assuming plugin stuff is using correct buffer size
+ * it should be fine */
+ if(cp) strncpy(cp, seq->name+2, sizeof(seq->name));
if (seq->plugin->current_private_data) {
*seq->plugin->current_private_data
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 6da9199ddc4..fe99c76575d 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -833,8 +833,8 @@ void clear_scene_in_allseqs(Main *bmain, Scene *scene)
typedef struct SeqUniqueInfo {
Sequence *seq;
- char name_src[32];
- char name_dest[32];
+ char name_src[SEQ_NAME_MAXSTR];
+ char name_dest[SEQ_NAME_MAXSTR];
int count;
int match;
} SeqUniqueInfo;
@@ -3388,13 +3388,13 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
/* XXX - hackish function needed for transforming strips! TODO - have some better solution */
void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
{
- char str[32];
+ char str[SEQ_NAME_MAXSTR+3];
FCurve *fcu;
if(scene->adt==NULL || ofs==0 || scene->adt->action==NULL)
return;
- sprintf(str, "[\"%s\"]", seq->name+2);
+ BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name+2);
for (fcu= scene->adt->action->curves.first; fcu; fcu= fcu->next) {
if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str)) {
@@ -3411,7 +3411,7 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst)
{
- char str_from[32];
+ char str_from[SEQ_NAME_MAXSTR+3];
FCurve *fcu;
FCurve *fcu_last;
FCurve *fcu_cpy;
@@ -3420,7 +3420,7 @@ void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst)
if(scene->adt==NULL || scene->adt->action==NULL)
return;
- sprintf(str_from, "[\"%s\"]", name_src);
+ BLI_snprintf(str_from, sizeof(str_from), "[\"%s\"]", name_src);
fcu_last= scene->adt->action->curves.last;
@@ -3441,13 +3441,13 @@ void seq_dupe_animdata(Scene *scene, const char *name_src, const char *name_dst)
/* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */
static void seq_free_animdata(Scene *scene, Sequence *seq)
{
- char str[32];
+ char str[SEQ_NAME_MAXSTR+3];
FCurve *fcu;
if(scene->adt==NULL || scene->adt->action==NULL)
return;
- sprintf(str, "[\"%s\"]", seq->name+2);
+ BLI_snprintf(str, sizeof(str), "[\"%s\"]", seq->name+2);
fcu= scene->adt->action->curves.first;
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 649984a7934..f5b677203f6 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -233,7 +233,7 @@ struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source)
{
bSound* sound = NULL;
- char name[25];
+ char name[MAX_ID_NAME+5];
strcpy(name, "buf_");
strcpy(name + 4, source->id.name);
@@ -257,7 +257,7 @@ struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, floa
{
bSound* sound = NULL;
- char name[25];
+ char name[MAX_ID_NAME+5];
strcpy(name, "lim_");
strcpy(name + 4, source->id.name);
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index e55f4dfbf78..1957f20c8bf 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -651,7 +651,7 @@ void BKE_tracking_clipboard_paste_tracks(MovieTracking *tracking, MovieTrackingO
/*********************** tracks map *************************/
typedef struct TracksMap {
- char object_name[32];
+ char object_name[MAX_NAME];
int is_camera;
int num_tracks;
@@ -1529,7 +1529,7 @@ typedef struct MovieReconstructContext {
struct libmv_Reconstruction *reconstruction;
#endif
- char object_name[32];
+ char object_name[MAX_NAME];
int is_camera;
float focal_length;
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index becc7e9b68f..4dcbc1b588b 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -3457,7 +3457,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C);
EditBone *bone;
float obmat[3][3], curs[3], viewmat[3][3], totmat[3][3], imat[3][3];
- char name[32];
+ char name[MAXBONENAME];
RNA_string_get(op->ptr, "name", name);
@@ -3507,7 +3507,7 @@ void ARMATURE_OT_bone_primitive_add(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "name", "Bone", 32, "Name", "Name of the newly created bone");
+ RNA_def_string(ot->srna, "name", "Bone", MAXBONENAME, "Name", "Name of the newly created bone");
}
@@ -5499,7 +5499,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
{
Object *ob= CTX_data_edit_object(C);
bArmature *arm;
- char newname[32];
+ char newname[MAXBONENAME];
short axis= RNA_enum_get(op->ptr, "type");
/* paranoia checks */
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index 451e672da7c..a928976d695 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -450,7 +450,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo
{
int i, j;
- for (i = 0, j = 0; template_name[i] != '\0' && i < 31 && j < 31; i++)
+ for (i = 0, j = 0; template_name[i] != '\0' && i < (MAXBONENAME-1) && j < (MAXBONENAME-1); i++)
{
if (template_name[i] == '&')
{
@@ -485,7 +485,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo
static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_ctrl, GHash *ptr_hash, char *side_string, char *num_string)
{
RigControl *ctrl;
- char name[32];
+ char name[MAXBONENAME];
ctrl = newRigControl(rg);
@@ -541,7 +541,7 @@ static RigArc *cloneArc(RigGraph *rg, RigGraph *src_rg, RigArc *src_arc, GHash *
if (src_edge->bone != NULL)
{
- char name[32];
+ char name[MAXBONENAME];
renameTemplateBone(name, src_edge->bone->name, rg->editbones, side_string, num_string);
edge->bone = duplicateEditBoneObjects(src_edge->bone, name, rg->editbones, src_rg->ob, rg->ob);
edge->bone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 832ee55997b..b14ce7e4690 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -1777,7 +1777,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
{
Object *ob= object_pose_armature_get(CTX_data_active_object(C));
bArmature *arm;
- char newname[32];
+ char newname[MAXBONENAME];
short axis= RNA_enum_get(op->ptr, "axis");
/* paranoia checks */
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index 2e9186b6c2f..d345f16b768 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -62,7 +62,7 @@ typedef struct EditBone
normal bones when leaving editmode. */
void *temp; /* Used to store temporary data */
- char name[32];
+ char name[64]; /* MAX_NAME */
float roll; /* Roll along axis. We'll ultimately use the axis/angle method
for determining the transformation matrix of the bone. The axis
is tail-head while roll provides the angle. Refer to Graphics
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 4948073f9c6..239dae7d236 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2920,7 +2920,7 @@ static void autocomplete_id(bContext *C, char *str, void *arg_v)
/* search if str matches the beginning of an ID struct */
if(str[0]) {
- AutoComplete *autocpl= autocomplete_begin(str, 22);
+ AutoComplete *autocpl= autocomplete_begin(str, MAX_ID_NAME-2);
ID *id;
for(id= listb->first; id; id= id->next)
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 84f0c61cd0c..5e42b06e1a7 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1208,7 +1208,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s
if(itemptr.type && RNA_struct_is_ID(itemptr.type)) {
ID *id= itemptr.data;
- char name_ui[32];
+ char name_ui[MAX_ID_NAME];
#if 0 /* this name is used for a string comparison and can't be modified, TODO */
name_uiprefix_id(name_ui, id);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 3ffc38791d6..573b6cd0b08 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -140,7 +140,7 @@ static void id_search_cb(const bContext *C, void *arg_template, const char *str,
continue;
if(BLI_strcasestr(id->name+2, str)) {
- char name_ui[32];
+ char name_ui[MAX_ID_NAME];
name_uiprefix_id(name_ui, id);
iconid= ui_id_icon_get((bContext*)C, id, 1);
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 7762203c371..9887ff9b540 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -359,7 +359,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
Mesh *me;
Object *obedit;
int exitmode= 0;
- char name[32];
+ char name[MAX_ID_NAME-2];
/* Check context */
if(base==NULL || base->object->type!=OB_MESH) {
@@ -429,7 +429,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign");
+ RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Image name to assign");
RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 1547c5daf54..0d4ad663b92 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1916,7 +1916,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
Object *ob;
int linked= RNA_boolean_get(op->ptr, "linked");
int dupflag= (linked)? 0: U.dupflag;
- char name[32];
+ char name[MAX_ID_NAME-2];
/* find object, create fake base */
RNA_string_get(op->ptr, "name", name);
@@ -1971,7 +1971,7 @@ void OBJECT_OT_add_named(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data");
- RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add");
+ RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add");
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 8266f3501c5..ac73f03c2d7 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -542,7 +542,7 @@ static int edit_constraint_poll(bContext *C)
static void edit_constraint_properties(wmOperatorType *ot)
{
- RNA_def_string(ot->srna, "constraint", "", 32, "Constraint", "Name of the constraint to edit");
+ RNA_def_string(ot->srna, "constraint", "", MAX_NAME, "Constraint", "Name of the constraint to edit");
RNA_def_enum(ot->srna, "owner", constraint_owner_items, 0, "Owner", "The owner of this constraint");
}
@@ -575,7 +575,7 @@ static int edit_constraint_invoke_properties(bContext *C, wmOperator *op)
static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int type)
{
- char constraint_name[32];
+ char constraint_name[MAX_NAME];
int owner = RNA_enum_get(op->ptr, "owner");
bConstraint *con;
ListBase *list=NULL;
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 7574059980c..e9bff9b644d 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1483,7 +1483,7 @@ static int game_property_new(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
bProperty *prop;
- char name[32];
+ char name[MAX_NAME];
int type= RNA_enum_get(op->ptr, "type");
prop= new_property(type);
@@ -1516,7 +1516,7 @@ void OBJECT_OT_game_property_new(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", gameproperty_type_items, 2, "Type", "Type of game property to add");
- RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the game property to add");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the game property to add");
}
static int game_property_remove(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 74cf174d7b4..1b8c0fd0840 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -192,7 +192,7 @@ static int group_create_exec(bContext *C, wmOperator *op)
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
Group *group= NULL;
- char name[32]; /* id name */
+ char name[MAX_ID_NAME-2]; /* id name */
RNA_string_get(op->ptr, "name", name);
@@ -223,7 +223,7 @@ void GROUP_OT_create(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "name", "Group", 32, "Name", "Name of the new group");
+ RNA_def_string(ot->srna, "name", "Group", MAX_ID_NAME-2, "Name", "Name of the new group");
}
/****************** properties window operators *********************/
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 7bb91c1fc4b..de991f28e4a 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -428,7 +428,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o
HookModifierData *hmd = NULL;
float cent[3];
int tot, ok, *indexar;
- char name[32];
+ char name[MAX_NAME];
ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent);
@@ -747,7 +747,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
Object *ob=NULL;
HookModifierData *hmd=NULL;
float cent[3];
- char name[32];
+ char name[MAX_NAME];
int *indexar, tot;
if (ptr.data) { /* if modifier context is available, use that */
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 9a592bc9324..b7736843561 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -728,7 +728,7 @@ static int edit_modifier_poll(bContext *C)
static void edit_modifier_properties(wmOperatorType *ot)
{
- RNA_def_string(ot->srna, "modifier", "", 32, "Modifier", "Name of the modifier to edit");
+ RNA_def_string(ot->srna, "modifier", "", MAX_NAME, "Modifier", "Name of the modifier to edit");
}
static int edit_modifier_invoke_properties(bContext *C, wmOperator *op)
@@ -750,7 +750,7 @@ static int edit_modifier_invoke_properties(bContext *C, wmOperator *op)
static ModifierData *edit_modifier_property_get(wmOperator *op, Object *ob, int type)
{
- char modifier_name[32];
+ char modifier_name[MAX_NAME];
ModifierData *md;
RNA_string_get(op->ptr, "modifier", modifier_name);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 137466bdf73..7e66d353121 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -245,7 +245,7 @@ void ED_operatormacros_object(void)
ot= WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
ot->description = "Add named object at cursor";
- RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add");
+ RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add");
WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d");
WM_operatortype_macro_define(ot, "OBJECT_OT_add_named");
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 1ba0157e8d3..fb577ad7035 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -335,7 +335,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
if (ob) {
Object *newob;
Base *newbase, *oldbase= BASACT;
- char name[32];
+ char name[MAX_ID_NAME+4];
/* Add new object for the proxy */
newob= add_object(scene, OB_EMPTY);
@@ -1890,7 +1890,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even
Main *bmain= CTX_data_main(C);
Base *base= ED_view3d_give_base_under_cursor(C, event->mval);
Material *ma;
- char name[32];
+ char name[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "name", name);
ma= (Material *)find_id("MA", name);
@@ -1923,5 +1923,5 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "Material", 24, "Name", "Material name to assign");
+ RNA_def_string(ot->srna, "name", "Material", MAX_ID_NAME-2, "Name", "Material name to assign");
}
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index b48b2e8718d..da69c2a0640 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -841,7 +841,7 @@ void OBJECT_OT_select_all(wmOperatorType *ot)
static int object_select_same_group_exec(bContext *C, wmOperator *op)
{
Group *group;
- char group_name[32];
+ char group_name[MAX_ID_NAME];
/* passthrough if no objects are visible */
if (CTX_DATA_COUNT(C, visible_bases) == 0) return OPERATOR_PASS_THROUGH;
@@ -882,7 +882,7 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select");
+ RNA_def_string(ot->srna, "group", "", MAX_ID_NAME, "Group", "Name of the group to select");
}
/**************************** Select Mirror ****************************/
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 649a993ea69..841b2696954 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -236,7 +236,7 @@ typedef struct StrokeCache {
float vertex_rotation;
- char saved_active_brush_name[24];
+ char saved_active_brush_name[MAX_ID_NAME];
int alt_smooth;
float plane_trim_squared;
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index ce6b7d2e910..b0f5e786eef 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -88,8 +88,8 @@ static int edit_actuator_poll(bContext *C)
static void edit_sensor_properties(wmOperatorType *ot)
{
- RNA_def_string(ot->srna, "sensor", "", 32, "Sensor", "Name of the sensor to edit");
- RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the object the sensor belongs to");
+ RNA_def_string(ot->srna, "sensor", "", MAX_NAME, "Sensor", "Name of the sensor to edit");
+ RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the object the sensor belongs to");
}
static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
@@ -113,14 +113,14 @@ static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
static Object *edit_object_property_get(bContext *C, wmOperator *op)
{
- char ob_name[32];
+ char ob_name[MAX_NAME];
Object *ob;
RNA_string_get(op->ptr, "object", ob_name);
/* if ob_name is valid try to find the object with this name
otherwise gets the active object */
- if (BLI_strnlen(ob_name, 32) > 0)
+ if (BLI_strnlen(ob_name, MAX_NAME) > 0)
ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
else
ob= ED_object_active_context(C);
@@ -130,7 +130,7 @@ static Object *edit_object_property_get(bContext *C, wmOperator *op)
static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object **ob)
{
- char sensor_name[32];
+ char sensor_name[MAX_NAME];
bSensor *sens;
RNA_string_get(op->ptr, "sensor", sensor_name);
@@ -144,8 +144,8 @@ static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object **o
static void edit_controller_properties(wmOperatorType *ot)
{
- RNA_def_string(ot->srna, "controller", "", 32, "Controller", "Name of the controller to edit");
- RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the object the controller belongs to");
+ RNA_def_string(ot->srna, "controller", "", MAX_NAME, "Controller", "Name of the controller to edit");
+ RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the object the controller belongs to");
}
static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
@@ -169,7 +169,7 @@ static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
static bController *edit_controller_property_get(bContext *C, wmOperator *op, Object **ob)
{
- char controller_name[32];
+ char controller_name[MAX_NAME];
bController *cont;
RNA_string_get(op->ptr, "controller", controller_name);
@@ -183,8 +183,8 @@ static bController *edit_controller_property_get(bContext *C, wmOperator *op, Ob
static void edit_actuator_properties(wmOperatorType *ot)
{
- RNA_def_string(ot->srna, "actuator", "", 32, "Actuator", "Name of the actuator to edit");
- RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the object the actuator belongs to");
+ RNA_def_string(ot->srna, "actuator", "", MAX_NAME, "Actuator", "Name of the actuator to edit");
+ RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the object the actuator belongs to");
}
static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
@@ -208,7 +208,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
static bActuator *edit_actuator_property_get(bContext *C, wmOperator *op, Object **ob)
{
- char actuator_name[32];
+ char actuator_name[MAX_NAME];
bActuator *act;
RNA_string_get(op->ptr, "actuator", actuator_name);
@@ -278,7 +278,7 @@ static int sensor_add_exec(bContext *C, wmOperator *op)
PointerRNA sens_ptr;
PropertyRNA *prop;
const char *sens_name;
- char name[32];
+ char name[MAX_NAME];
int type= RNA_enum_get(op->ptr, "type");
ob= edit_object_property_get(C, op);
@@ -293,7 +293,7 @@ static int sensor_add_exec(bContext *C, wmOperator *op)
prop = RNA_struct_find_property(&sens_ptr, "type");
RNA_string_get(op->ptr, "name", name);
- if(BLI_strnlen(name, 32) < 1){
+ if(BLI_strnlen(name, MAX_NAME) < 1){
RNA_property_enum_name(C, &sens_ptr, prop, RNA_property_enum_get(&sens_ptr, prop), &sens_name);
BLI_strncpy(sens->name, sens_name, sizeof(sens->name));
}
@@ -328,8 +328,8 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot)
/* properties */
ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
- RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add");
- RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Sensor to");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
+ RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
}
/* ************* Add/Remove Controller Operator ************* */
@@ -382,7 +382,7 @@ static int controller_add_exec(bContext *C, wmOperator *op)
PropertyRNA *prop;
const char *cont_name;
int bit;
- char name[32];
+ char name[MAX_NAME];
int type= RNA_enum_get(op->ptr, "type");
ob= edit_object_property_get(C, op);
@@ -397,7 +397,7 @@ static int controller_add_exec(bContext *C, wmOperator *op)
prop = RNA_struct_find_property(&cont_ptr, "type");
RNA_string_get(op->ptr, "name", name);
- if(BLI_strnlen(name, 32) < 1){
+ if(BLI_strnlen(name, MAX_NAME) < 1){
RNA_property_enum_name(C, &cont_ptr, prop, RNA_property_enum_get(&cont_ptr, prop), &cont_name);
BLI_strncpy(cont->name, cont_name, sizeof(cont->name));
}
@@ -442,8 +442,8 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot)
/* properties */
ot->prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
- RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add");
- RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Controller to");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
+ RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
}
/* ************* Add/Remove Actuator Operator ************* */
@@ -495,7 +495,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
PointerRNA act_ptr;
PropertyRNA *prop;
const char *act_name;
- char name[32];
+ char name[MAX_NAME];
int type= RNA_enum_get(op->ptr, "type");
ob= edit_object_property_get(C, op);
@@ -510,7 +510,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
prop = RNA_struct_find_property(&act_ptr, "type");
RNA_string_get(op->ptr, "name", name);
- if (BLI_strnlen(name, 32) < 1){
+ if (BLI_strnlen(name, MAX_NAME) < 1){
RNA_property_enum_name(C, &act_ptr, prop, RNA_property_enum_get(&act_ptr, prop), &act_name);
BLI_strncpy(act->name, act_name, sizeof(act->name));
}
@@ -545,8 +545,8 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
/* properties */
ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
- RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add");
- RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Actuator to");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
+ RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
}
/* ************* Move Logic Bricks Operator ************* */
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index e5255448ae9..f5feaad12ac 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1187,7 +1187,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
ts= sens->data;
- /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, 31, 0, 0, "Only look for Objects with this property"); */
+ /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); */
uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material");
///* uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
yco-= ysize;
@@ -1216,11 +1216,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
if (cs->mode & SENS_COLLISION_MATERIAL) {
uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.40 * (width-20)),
- (short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, 31, 0, 0,
+ (short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, MAX_NAME, 0, 0,
"Only look for Objects with this material");
} else {
uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.40 * (width-20)), (short)(yco-44),
- (short)(0.6*(width-20)), 19, &cs->name, 0, 31, 0, 0,
+ (short)(0.6*(width-20)), 19, &cs->name, 0, MAX_NAME, 0, 0,
"Only look for Objects with this property");
}
@@ -1240,7 +1240,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
ns= sens->data;
uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19,
- &ns->name, 0, 31, 0, 0, "Only look for Objects with this property");
+ &ns->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19,
&ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance");
uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19,
@@ -1261,7 +1261,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
uiDefBut(block, TEX, 1, "Prop:",
(short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19,
- &rs->name, 0, 31, 0, 0,
+ &rs->name, 0, MAX_NAME, 0, 0,
"Only look for Objects with this property");
str = "Type %t|+X axis %x0|+Y axis %x1|+Z axis %x2|-X axis %x3|-Y axis %x4|-Z axis %x5";
@@ -1316,14 +1316,14 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
/* line 4: toggle property for string logging mode */
uiDefBut(block, TEX, 1, "LogToggle: ",
xco+10, yco-((ks->type&1) ? 68:92), (width-20), 19,
- ks->toggleName, 0, 31, 0, 0,
+ ks->toggleName, 0, MAX_NAME, 0, 0,
"Property that indicates whether to log "
"keystrokes as a string");
/* line 5: target property for string logging mode */
uiDefBut(block, TEX, 1, "Target: ",
xco+10, yco-((ks->type&1) ? 92:116), (width-20), 19,
- ks->targetName, 0, 31, 0, 0,
+ ks->targetName, 0, MAX_NAME, 0, 0,
"Property that receives the keystrokes in case "
"a string is logged");
@@ -1349,21 +1349,21 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
if (ps->type != SENS_PROP_EXPRESSION)
{
uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19,
- ps->name, 0, 31, 0, 0, "Property name");
+ ps->name, 0, MAX_NAME, 0, 0, "Property name");
}
if(ps->type == SENS_PROP_INTERVAL)
{
uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19,
- ps->value, 0, 31, 0, 0, "check for min value");
+ ps->value, 0, MAX_NAME, 0, 0, "check for min value");
uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19,
- ps->maxvalue, 0, 31, 0, 0, "check for max value");
+ ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value");
}
else if(ps->type == SENS_PROP_CHANGED);
else
{
uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19,
- ps->value, 0, 31, 0, 0, "check for value");
+ ps->value, 0, MAX_NAME, 0, 0, "check for value");
}
yco-= ysize;
@@ -1384,12 +1384,12 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
uiBlockBeginAlign(block);
but = uiDefBut(block, TEX, 1, "Bone: ",
(xco+10), (yco-44), (width-20)/2, 19,
- arm->posechannel, 0, 31, 0, 0,
+ arm->posechannel, 0, MAX_NAME, 0, 0,
"Bone on which you want to check a constraint");
uiButSetFunc(but, check_armature_sensor, but, arm);
but = uiDefBut(block, TEX, 1, "Cons: ",
(xco+10)+(width-20)/2, (yco-44), (width-20)/2, 19,
- arm->constraint, 0, 31, 0, 0,
+ arm->constraint, 0, MAX_NAME, 0, 0,
"Name of the constraint you want to control");
uiButSetFunc(but, check_armature_sensor, but, arm);
uiBlockEndAlign(block);
@@ -1420,7 +1420,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
as= sens->data;
uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19,
- as->name, 0, 31, 0, 0, "Actuator name, actuator active state modifications will be detected");
+ as->name, 0, MAX_NAME, 0, 0, "Actuator name, actuator active state modifications will be detected");
yco-= ysize;
break;
}
@@ -1513,13 +1513,13 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
if (raySens->mode & SENS_COLLISION_MATERIAL)
{
uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
- &raySens->matname, 0, 31, 0, 0,
+ &raySens->matname, 0, MAX_NAME, 0, 0,
"Only look for Objects with this material");
}
else
{
uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
- &raySens->propname, 0, 31, 0, 0,
+ &raySens->propname, 0, MAX_NAME, 0, 0,
"Only look for Objects with this property");
}
@@ -1557,7 +1557,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short
/* line 2: Subject filter */
uiDefBut(block, TEX, 1, "Subject: ",
(xco+10), (yco-44), (width-20), 19,
- mes->subject, 0, 31, 0, 0,
+ mes->subject, 0, MAX_NAME, 0, 0,
"Optional subject filter: only accept messages with this subject"
", or empty for all");
@@ -1683,7 +1683,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
ec= cont->data;
/* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */
uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19,
- ec->str, 0, 127, 0, 0,
+ ec->str, 0, sizeof(ec->str), 0, 0,
"Expression");
yco-= ysize;
@@ -1704,7 +1704,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
if(pc->mode==0)
uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script");
else {
- uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
+ uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting");
}
uiBlockEndAlign(block);
@@ -2032,7 +2032,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
if(aa->type == ACT_ACTION_FROM_PROP)
{
- uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position");
+ uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position");
}
else
{
@@ -2043,7 +2043,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending");
uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack");
- uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign the action's current frame number to this property");
+ uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property");
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
@@ -2094,7 +2094,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
if(ia->type==ACT_IPO_FROM_PROP) {
uiDefBut(block, TEX, 0,
"Prop: ", xco+10, yco-44, width-80, 19,
- ia->name, 0.0, 31.0, 0, 0,
+ ia->name, 0.0, MAX_NAME, 0, 0,
"Use this property to define the Ipo position");
}
else {
@@ -2113,7 +2113,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
"Update IPO on all children Objects as well");
uiDefBut(block, TEX, 0,
"FrameProp: ", xco+10, yco-64, width-20, 19,
- ia->frameProp, 0.0, 31.0, 0, 0,
+ ia->frameProp, 0.0, MAX_NAME, 0, 0,
"Assign the action's current frame number to this property");
yco-= ysize;
@@ -2131,7 +2131,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
str= "Type%t|Assign%x0|Add %x1|Copy %x2|Toggle (bool/int/float/timer)%x3";
uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type");
- uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, 31, 0, 0, "Property name");
+ uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name");
if(pa->type==ACT_PROP_TOGGLE) {
@@ -2140,10 +2140,10 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
}
else if(pa->type==ACT_PROP_COPY) {
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object");
- uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, 31, 0, 0, "Copy this property");
+ uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, MAX_NAME, 0, 0, "Copy this property");
}
else {
- uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, 31, 0, 0, "change with this value, use \"\" around strings");
+ uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings");
}
yco-= ysize;
@@ -2175,7 +2175,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|"
"Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19,
- ((ID *)sa->sound)->name+2, 0.0, 21.0, 0, 0, "");
+ ((ID *)sa->sound)->name+2, 0.0, MAX_ID_NAME-2, 0, 0, "");
uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19,
&sa->type, 0.0, 0.0, 0, 0, "");
uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume,
@@ -2397,13 +2397,13 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
if (coa->flag & ACT_CONST_MATERIAL)
{
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
+ coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detects only Objects with this material");
}
else
{
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
+ coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detect only Objects with this property");
}
uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19,
@@ -2456,13 +2456,13 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
if (coa->flag & ACT_CONST_MATERIAL)
{
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
+ coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detects only Objects with this material");
}
else
{
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
- coa->matprop, 0, 31, 0, 0,
+ coa->matprop, 0, MAX_NAME, 0, 0,
"Ray detect only Objects with this property");
}
uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19,
@@ -2554,8 +2554,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
ysize = 48;
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
-// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation");
+ uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
+// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
}
/* else if (gma->type == ACT_GAME_START)
{
@@ -2563,8 +2563,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
- uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file");
- uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation");
+ uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file");
+ uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
}
*/ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG))
{
@@ -2592,11 +2592,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, "");
if(ga->type==ACT_GROUP_SET) {
- uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, 31.0, 0, 0, "This name defines groupkey to be set");
+ uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, MAX_NAME, 0, 0, "This name defines groupkey to be set");
uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame");
}
else if(ga->type==ACT_GROUP_FROM_PROP) {
- uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define the Group position");
+ uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Group position");
}
else {
uiDefButI(block, NUM, 0, "State", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame");
@@ -2698,7 +2698,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
/* 3. property */
uiDefBut(block, TEX, 1, "Property:", (xco+10), yco-44, (width-20), 19,
- &randAct->propname, 0, 31, 0, 0,
+ &randAct->propname, 0, MAX_NAME, 0, 0,
"Assign the random value to this property");
/*4. and 5. arguments for the distribution*/
@@ -2789,13 +2789,13 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
/* line 1: To */
uiDefBut(block, TEX, 1, "To: ",
(xco+10), (yco-(myline++*24)), (width-20), 19,
- &ma->toPropName, 0, 31, 0, 0,
+ &ma->toPropName, 0, MAX_NAME, 0, 0,
"Optional send message to objects with this name only, or empty to broadcast");
/* line 2: Message Subject */
uiDefBut(block, TEX, 1, "Subject: ",
(xco+10), (yco-(myline++*24)), (width-20), 19,
- &ma->subject, 0, 31, 0, 0,
+ &ma->subject, 0, MAX_NAME, 0, 0,
"Optional message subject. This is what can be filtered on");
/* line 3: Text/Property */
@@ -2809,14 +2809,14 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
/* line 3: Message Body */
uiDefBut(block, TEX, 1, "Body: ",
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
- &ma->body, 0, 31, 0, 0,
+ &ma->body, 0, MAX_NAME, 0, 0,
"Optional message body Text");
} else
{
/* line 3: Property body (set by property) */
uiDefBut(block, TEX, 1, "Propname: ",
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
- &ma->body, 0, 31, 0, 0,
+ &ma->body, 0, MAX_NAME, 0, 0,
"The message body will be set by the Property Value");
}
@@ -2923,12 +2923,12 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
uiBlockBeginAlign(block);
but = uiDefBut(block, TEX, 1, "Bone: ",
(xco+5), (yco-44), (width-10)/2, 19,
- armAct->posechannel, 0, 31, 0, 0,
+ armAct->posechannel, 0, MAX_NAME, 0, 0,
"Bone on which the constraint is defined");
uiButSetFunc(but, check_armature_actuator, but, armAct);
but = uiDefBut(block, TEX, 1, "Cons: ",
(xco+5)+(width-10)/2, (yco-44), (width-10)/2, 19,
- armAct->constraint, 0, 31, 0, 0,
+ armAct->constraint, 0, MAX_NAME, 0, 0,
"Name of the constraint you want to control");
uiButSetFunc(but, check_armature_actuator, but, armAct);
uiBlockEndAlign(block);
@@ -4938,7 +4938,7 @@ void logic_buttons(bContext *C, ARegion *ar)
if(cont->flag & CONT_SHOW) {
cont->otype= cont->type;
uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, 31, 0, 0, "Controller name");
+ but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name");
uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0);
ycoo= yco;
@@ -5030,7 +5030,7 @@ void logic_buttons(bContext *C, ARegion *ar)
if(sens->flag & SENS_SHOW)
{
uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, 31, 0, 0, "Sensor name");
+ but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name");
uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
sens->otype= sens->type;
@@ -5042,7 +5042,7 @@ void logic_buttons(bContext *C, ARegion *ar)
glRecti(xco+22, yco, xco+width-22,yco+19);
but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, "");
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
- but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, 31, 0, 0, "");
+ but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, "");
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
uiBlockBeginAlign(block);
@@ -5108,7 +5108,7 @@ void logic_buttons(bContext *C, ARegion *ar)
if(act->flag & ACT_SHOW) {
act->otype= act->type;
uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, UI_UNIT_Y, &act->type, 0, 0, 0, 0, "Actuator type");
- but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, 31, 0, 0, "Actuator name");
+ but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name");
uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
ycoo= yco;
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 6c0cc15559c..285bac9c519 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -631,7 +631,7 @@ static void draw_group_socket_name(SpaceNode *snode, bNode *gnode, bNodeSocket *
if (sock->flag & SOCK_DYNAMIC) {
bt = uiDefBut(gnode->block, TEX, 0, "",
sock->locx+xoffset, sock->locy+1+yoffset, 72, NODE_DY,
- sock->name, 0, 31, 0, 0, "");
+ sock->name, 0, sizeof(sock->name), 0, 0, "");
if (in_out==SOCK_IN)
uiButSetFunc(bt, update_group_input_cb, snode, ngroup);
else
@@ -640,7 +640,7 @@ static void draw_group_socket_name(SpaceNode *snode, bNode *gnode, bNodeSocket *
else {
uiDefBut(gnode->block, LABEL, 0, sock->name,
sock->locx+xoffset, sock->locy+1+yoffset, 72, NODE_DY,
- NULL, 0, 31, 0, 0, "");
+ NULL, 0, sizeof(sock->name), 0, 0, "");
}
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 1fe754466f4..3523e6bd9ab 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -751,7 +751,7 @@ static int edit_node_poll(bContext *C)
static void edit_node_properties(wmOperatorType *ot)
{
/* XXX could node be a context pointer? */
- RNA_def_string(ot->srna, "node", "", 32, "Node", "");
+ RNA_def_string(ot->srna, "node", "", MAX_NAME, "Node", "");
RNA_def_int(ot->srna, "socket", 0, 0, MAX_SOCKET, "Socket", "", 0, MAX_SOCKET);
RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Side", "");
}
@@ -779,7 +779,7 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r
{
bNode *node;
bNodeSocket *sock=NULL;
- char nodename[32];
+ char nodename[MAX_NAME];
int sockindex;
int in_out;
@@ -889,7 +889,7 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op)
{
SpaceNode *snode = CTX_wm_space_node(C);
int in_out= -1;
- char name[32]= "";
+ char name[MAX_NAME]= "";
int type= SOCK_FLOAT;
bNodeTree *ngroup= snode->edittree;
/* bNodeSocket *sock; */ /* UNUSED */
@@ -932,7 +932,7 @@ void NODE_OT_group_socket_add(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Type", "Input or Output");
- RNA_def_string(ot->srna, "name", "", 32, "Name", "Group socket name");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Group socket name");
RNA_def_enum(ot->srna, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of the group socket");
}
@@ -3451,7 +3451,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
}
else if(RNA_property_is_set(op->ptr, "name"))
{
- char name[32];
+ char name[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "name", name);
ima= (Image *)find_id("IM", name);
@@ -3517,7 +3517,7 @@ void NODE_OT_add_file(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path
- RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign");
+ RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Datablock name to assign");
}
/********************** New node tree operator *********************/
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index fa970f7f9d8..6e591a714e4 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2960,7 +2960,7 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
View3D *v3d= CTX_wm_view3d(C);
Image *ima= NULL;
BGpic *bgpic;
- char name[32];
+ char name[MAX_ID_NAME-2];
/* check input variables */
if(RNA_property_is_set(op->ptr, "filepath")) {
@@ -3007,7 +3007,7 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
ot->flag = 0;
/* properties */
- RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign");
+ RNA_def_string(ot->srna, "name", "Image", MAX_ID_NAME-2, "Name", "Image name to assign");
RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 2233aeda92e..aab7dda0e86 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -281,7 +281,7 @@ typedef struct TransInfo {
char *undostr; /* if set, uses this string for undo */
float spacemtx[3][3]; /* orientation matrix of the current space */
- char spacename[32]; /* name of the current space */
+ char spacename[64]; /* name of the current space, MAX_NAME */
struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 90f95bea696..81a2b7158ee 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -268,7 +268,7 @@ static void TRANSFORM_OT_delete_orientation(struct wmOperatorType *ot)
static int create_orientation_exec(bContext *C, wmOperator *op)
{
- char name[36];
+ char name[MAX_NAME];
int use = RNA_boolean_get(op->ptr, "use");
int overwrite = RNA_boolean_get(op->ptr, "overwrite");
@@ -301,7 +301,7 @@ static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot)
ot->poll = ED_operator_areaactive;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "name", "", 35, "Name", "Text to insert at the cursor position");
+ RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Text to insert at the cursor position");
RNA_def_boolean(ot->srna, "use", 0, "Use after creation", "Select orientation after its creation");
RNA_def_boolean(ot->srna, "overwrite", 0, "Overwrite previous", "Overwrite previously created orientation with same name");
}
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 3cb35c48f39..0e77c23f64f 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -145,7 +145,7 @@ TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(reports)
/* use object name if no name is given */
if (name[0] == 0)
{
- strncpy(name, ob->id.name+2, 35);
+ strncpy(name, ob->id.name+2, MAX_ID_NAME-2);
}
return addMatrixSpace(C, mat, name, overwrite);
@@ -289,7 +289,7 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[],
{
ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix");
BLI_addtail(transform_spaces, ts);
- strncpy(ts->name, name, 35);
+ strncpy(ts->name, name, sizeof(ts->name));
}
/* copy matrix into transform space */
@@ -422,10 +422,11 @@ const char * BIF_menustringTransformOrientation(const bContext *C, const char *t
TransformOrientation *ts;
int i = V3D_MANIP_CUSTOM;
char *str_menu, *p;
+ const int elem_size = MAX_NAME + 4;
title = IFACE_(title);
- str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix"));
+ str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + elem_size * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix"));
p = str_menu;
p += sprintf(str_menu, "%s", title);
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 1dbe9ed7371..03e169a9512 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -179,7 +179,7 @@ typedef struct GPUVertexAttribs {
int glindex;
int gltexco;
int attribid;
- char name[32];
+ char name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
} layer[GPU_MAX_ATTRIB];
int totlayer;
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index f0e126db813..f311d94703f 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -53,7 +53,7 @@ typedef struct IDProperty {
struct IDProperty *next, *prev;
char type, subtype;
short flag;
- char name[32];
+ char name[64]; /* MAX_IDPROP_NAME */
int saved; /*saved is used to indicate if this struct has been saved yet.
seemed like a good idea as a pad var was needed anyway :)*/
IDPropertyData data; /* note, alignment for 64 bits */
@@ -65,7 +65,7 @@ typedef struct IDProperty {
saved.*/
} IDProperty;
-#define MAX_IDPROP_NAME 32
+#define MAX_IDPROP_NAME 64
#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
/*->type*/
@@ -96,7 +96,8 @@ typedef struct IDProperty {
* provides a common handle to place all data in double-linked lists.
* */
-#define MAX_ID_NAME 24
+/* 2 characters for ID code and 64 for actual name */
+#define MAX_ID_NAME 66
/* There's a nasty circular dependency here.... void* to the rescue! I
* really wonder why this is needed. */
@@ -104,14 +105,14 @@ typedef struct ID {
void *next, *prev;
struct ID *newid;
struct Library *lib;
- char name[24];
- short us;
+ char name[66];
+ short pad, us;
/**
* LIB_... flags report on status of the datablock this ID belongs
* to.
*/
short flag;
- int icon_id;
+ int icon_id, pad2;
IDProperty *properties;
} ID;
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 9cee4e188ff..7df4ebd3c55 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -184,7 +184,7 @@ typedef struct bPoseChannel {
IDProperty *prop; /* User-Defined Properties on this PoseChannel */
ListBase constraints;/* Constraints that act on this PoseChannel */
- char name[32]; /* Channels need longer names than normal blender objects */
+ char name[72]; /* Channels need longer names than normal blender objects */
short flag; /* dynamic, for detecting transform changes */
short ikflag; /* settings for IK bones */
@@ -345,7 +345,7 @@ typedef struct bPose {
void *ikparam; /* IK solver parameters, structure depends on iksolver */
bAnimVizSettings avs; /* settings for visualization of bone animation */
- char proxy_act_bone[32]; /* proxy active bone name*/
+ char proxy_act_bone[64]; /* proxy active bone name, MAXBONENAME */
} bPose;
@@ -669,7 +669,7 @@ typedef struct bActionChannel {
ListBase constraintChannels; /* Constraint Channels (when Action Channel represents an Object or Bone) */
int flag; /* settings accessed via bitmapping */
- char name[32]; /* channel name */
+ char name[64]; /* channel name, MAX_NAME */
int temp; /* temporary setting - may be used to indicate group that channel belongs to during syncing */
} bActionChannel;
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index 076910ade1f..3be46538c22 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -50,8 +50,8 @@ typedef struct bActionActuator {
struct bAction *act; /* Pointer to action */
short type, flag; /* Playback type */ // not in use
float sta, end; /* Start & End frames */
- char name[32]; /* For property-driven playback */
- char frameProp[32]; /* Set this property to the actions current frame */
+ char name[64]; /* For property-driven playback, MAX_NAME */
+ char frameProp[64]; /* Set this property to the actions current frame, MAX_NAME */
short blendin; /* Number of frames of blending */
short priority; /* Execution priority */
short layer; /* Animation layer */
@@ -90,7 +90,7 @@ typedef struct bEditObjectActuator {
short type, flag;
struct Object *ob;
struct Mesh *me;
- char name[32];
+ char name[64]; /* MAX_NAME */
float linVelocity[3]; /* initial lin. velocity on creation */
float angVelocity[3]; /* initial ang. velocity on creation */
float mass;
@@ -107,7 +107,7 @@ typedef struct bSceneActuator {
typedef struct bPropertyActuator {
int pad, type;
- char name[32], value[32];
+ char name[64], value[64]; /* MAX_NAME */
struct Object *ob;
} bPropertyActuator;
@@ -125,8 +125,8 @@ typedef struct bObjectActuator {
typedef struct bIpoActuator {
short flag, type;
float sta, end;
- char name[32];
- char frameProp[32]; /* Set this property to the actions current frame */
+ char name[64]; /* MAX_NAME */
+ char frameProp[64]; /* Set this property to the actions current frame, MAX_NAME */
short pad1, pad2, pad3, pad4;
@@ -147,13 +147,13 @@ typedef struct bConstraintActuator {
int pad;
float minloc[3], maxloc[3];
float minrot[3], maxrot[3];
- char matprop[32];
+ char matprop[64]; /* MAX_NAME */
} bConstraintActuator;
typedef struct bGroupActuator {
short flag, type;
int sta, end;
- char name[32]; /* property or groupkey */
+ char name[64]; /* property or groupkey, MAX_NAME */
short pad[3], cur, butsta, butend;/* not referenced, can remove? */
/* struct Group *group; not used, remove */
@@ -168,16 +168,16 @@ typedef struct bRandomActuator {
int int_arg_2;
float float_arg_1;
float float_arg_2;
- char propname[32];
+ char propname[64]; /* MAX_NAME */
} bRandomActuator;
typedef struct bMessageActuator {
- char toPropName[32]; /* Send to all objects with this propertyname. Empty to broadcast. */
+ char toPropName[64]; /* Send to all objects with this propertyname. Empty to broadcast. MAX_NAME. */
struct Object *toObject;/* (Possible future use) pointer to a single destination object. */
- char subject[32]; /* Message Subject to send. */
+ char subject[64]; /* Message Subject to send. MAX_NAME. */
short bodyType, pad1; /* bodyType is either 'User defined text' or PropName */
int pad2;
- char body[32]; /* Either User Defined Text or our PropName to send value of */
+ char body[64]; /* Either User Defined Text or our PropName to send value of, MAX_NAME */
} bMessageActuator;
typedef struct bGameActuator {
@@ -220,8 +220,8 @@ typedef struct bStateActuator {
} bStateActuator;
typedef struct bArmatureActuator {
- char posechannel[32];
- char constraint[32];
+ char posechannel[64]; /* MAX_NAME */
+ char constraint[64]; /* MAX_NAME */
int type; /* 0=run, 1=enable, 2=disable, 3=set target, 4=set weight */
float weight;
struct Object *target;
@@ -250,7 +250,7 @@ typedef struct bActuator {
*/
short flag;
short otype, go;
- char name[32];
+ char name[64]; /* MAX_NAME */
/**
* data must point to an object actuator type struct.
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 45c30315575..33f965663de 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -49,7 +49,7 @@ typedef struct Bone {
IDProperty *prop; /* User-Defined Properties on this Bone */
struct Bone *parent; /* Parent (ik parent if appropriate flag is set */
ListBase childbase; /* Children */
- char name[32]; /* Name of the bone - must be unique within the armature */
+ char name[64]; /* Name of the bone - must be unique within the armature, MAXBONENAME */
float roll; /* roll is input for editmode, length calculated */
float head[3];
@@ -200,6 +200,6 @@ typedef enum eBone_Flag {
BONE_NO_LOCAL_LOCATION = (1<<22) /* bone location is in armature space */
} eBone_Flag;
-#define MAXBONENAME 32
+#define MAXBONENAME 64
#endif
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index c829d5be294..fdc493ddfd3 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -61,11 +61,12 @@ typedef struct bConstraint {
char ownspace; /* Space that owner should be evaluated in */
char tarspace; /* Space that target should be evaluated in (only used if 1 target) */
- char name[30]; /* Constraint name */
+ char name[64]; /* Constraint name, MAX_NAME */
+
+ short pad;
float enforce; /* Amount of influence exherted by constraint (0.0-1.0) */
float headtail; /* Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/
- int pad;
struct Ipo *ipo DNA_DEPRECATED; /* local influence ipo or driver */ /* old animation system, deprecated for 2.5 */
@@ -85,7 +86,7 @@ typedef struct bConstraintTarget {
struct bConstraintTarget *next, *prev;
struct Object *tar; /* object to use as target */
- char subtarget[32]; /* subtarget - pchan or vgroup name */
+ char subtarget[64]; /* subtarget - pchan or vgroup name, MAX_ID_NAME-2 */
float matrix[4][4]; /* matrix used during constraint solving - should be cleared before each use */
@@ -121,7 +122,7 @@ typedef struct bPythonConstraint {
ListBase targets; /* a list of targets that this constraint has (bConstraintTarget-s) */
struct Object *tar; /* target from previous implementation (version-patch sets this to NULL on file-load) */
- char subtarget[32]; /* subtarger from previous implentation (version-patch sets this to "" on file-load) */
+ char subtarget[64]; /* subtarger from previous implentation (version-patch sets this to "" on file-load), MAX_ID_NAME-2 */
} bPythonConstraint;
@@ -137,9 +138,9 @@ typedef struct bKinematicConstraint {
short flag; /* All & CopyPose: some options Like CONSTRAINT_IK_TIP */
short rootbone; /* All: index to rootbone, if zero go all the way to mother bone */
short max_rootbone; /* CopyPose: for auto-ik, maximum length of chain */
- char subtarget[32]; /* All: String to specify sub-object target */
+ char subtarget[64]; /* All: String to specify sub-object target, MAX_ID_NAME-2 */
struct Object *poletar; /* All: Pole vector target */
- char polesubtarget[32]; /* All: Pole vector sub-object target */
+ char polesubtarget[64]; /* All: Pole vector sub-object target, MAX_ID_NAME-2 */
float poleangle; /* All: Pole vector rest angle */
float weight; /* All: Weight of constraint in IK tree */
float orientweight; /* CopyPose: Amount of rotation a target applies on chain */
@@ -187,7 +188,7 @@ typedef struct bTrackToConstraint {
int reserved2;
int flags;
int pad;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bTrackToConstraint;
/* Copy Rotation Constraint */
@@ -195,7 +196,7 @@ typedef struct bRotateLikeConstraint {
struct Object *tar;
int flag;
int reserved1;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bRotateLikeConstraint;
/* Copy Location Constraint */
@@ -203,7 +204,7 @@ typedef struct bLocateLikeConstraint {
struct Object *tar;
int flag;
int reserved1;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bLocateLikeConstraint;
/* Copy Scale Constraint */
@@ -211,7 +212,7 @@ typedef struct bSizeLikeConstraint {
struct Object *tar;
int flag;
int reserved1;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bSizeLikeConstraint;
/* Maintain Volume Constraint */
@@ -223,7 +224,7 @@ typedef struct bSameVolumeConstraint {
/* Copy Transform Constraint */
typedef struct bTransLikeConstraint {
struct Object *tar;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bTransLikeConstraint;
/* Floor Constraint */
@@ -234,7 +235,7 @@ typedef struct bMinMaxConstraint {
int flag;
short sticky, stuck, pad1, pad2; /* for backward compatibility */
float cache[3];
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bMinMaxConstraint;
/* Action Constraint */
@@ -248,7 +249,7 @@ typedef struct bActionConstraint {
float max;
int pad;
struct bAction *act;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bActionConstraint;
/* Locked Axis Tracking constraint */
@@ -256,7 +257,7 @@ typedef struct bLockTrackConstraint {
struct Object *tar;
int trackflag;
int lockflag;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bLockTrackConstraint;
/* Damped Tracking constraint */
@@ -264,7 +265,7 @@ typedef struct bDampTrackConstraint {
struct Object *tar;
int trackflag;
int pad;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bDampTrackConstraint;
/* Follow Path constraints */
@@ -287,7 +288,7 @@ typedef struct bStretchToConstraint {
int plane;
float orglength;
float bulge;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
} bStretchToConstraint;
/* Rigid Body constraint */
@@ -323,13 +324,13 @@ typedef struct bChildOfConstraint {
int flag; /* settings */
int pad;
float invmat[4][4]; /* parent-inverse matrix to use */
- char subtarget[32]; /* string to specify a subobject target */
+ char subtarget[64]; /* string to specify a subobject target, MAX_ID_NAME-2 */
} bChildOfConstraint;
/* Generic Transform->Transform Constraint */
typedef struct bTransformConstraint {
struct Object *tar; /* target (i.e. 'driver' object/bone) */
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
short from, to; /* can be loc(0) , rot(1), or size(2) */
char map[3]; /* defines which target-axis deform is copied by each owner-axis */
@@ -348,7 +349,7 @@ typedef struct bPivotConstraint {
* Either target object + offset, or just offset is used
*/
struct Object *tar; /* target object (optional) */
- char subtarget[32]; /* subtarget name (optional) */
+ char subtarget[64]; /* subtarget name (optional), MAX_ID_NAME-2 */
float offset[3]; /* offset from the target to use, regardless of whether it exists */
/* Rotation-driven activation:
@@ -391,7 +392,7 @@ typedef struct bSizeLimitConstraint {
/* Limit Distance Constraint */
typedef struct bDistLimitConstraint {
struct Object *tar;
- char subtarget[32];
+ char subtarget[64]; /* MAX_ID_NAME-2 */
float dist; /* distance (radius of clamping sphere) from target */
float soft; /* distance from clamping-sphere to start applying 'fade' */
@@ -413,9 +414,9 @@ typedef struct bShrinkwrapConstraint {
/* Follow Track constraints */
typedef struct bFollowTrackConstraint {
struct MovieClip *clip;
- char track[24];
+ char track[64]; /* MAX_NAME */
int flag, pad;
- char object[24];
+ char object[64]; /* MAX_NAME */
struct Object *camera;
struct Object *depth_ob;
} bFollowTrackConstraint;
@@ -430,7 +431,7 @@ typedef struct bCameraSolverConstraint {
typedef struct bObjectSolverConstraint {
struct MovieClip *clip;
int flag, pad;
- char object[24];
+ char object[64]; /* MAX_NAME */
float invmat[4][4]; /* parent-inverse matrix to use */
struct Object *camera;
} bObjectSolverConstraint;
diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h
index c8f4325d717..51ab29db7ae 100644
--- a/source/blender/makesdna/DNA_controller_types.h
+++ b/source/blender/makesdna/DNA_controller_types.h
@@ -54,7 +54,7 @@ typedef struct bController {
short type, flag, inputs, totlinks;
short otype, totslinks, pad2, pad3;
- char name[32];
+ char name[64];
void *data;
struct bActuator **links;
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index 8259eea42ce..00a0cf8881f 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -48,10 +48,12 @@ typedef struct CustomDataLayer {
int active_clone; /* number of the layer to render*/
int active_mask; /* number of the layer to render*/
char pad[4];
- char name[32]; /* layer name */
+ char name[64]; /* layer name, MAX_CUSTOMDATA_LAYER_AAME */
void *data; /* layer data */
} CustomDataLayer;
+#define MAX_CUSTOMDATA_LAYER_NAME 64
+
typedef struct CustomDataExternal {
char filename[240]; /* FILE_MAX */
} CustomDataExternal;
diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index 575938da653..46d7fc2b009 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -47,4 +47,7 @@
#define USE_BMESH_FORWARD_COMPAT
+/* non-id name variables should use this length */
+#define MAX_NAME 64
+
#endif /* DNA_DEFS_H */
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index d58e11d9640..5ea82709239 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -124,7 +124,7 @@ typedef struct DynamicPaintSurface {
int pad_;
- char uvlayer_name[32];
+ char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
char image_output_path[240];
char output_name[40];
char output_name2[40]; /* some surfaces have 2 outputs */
diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h
index b7437b5e973..ddff22aae37 100644
--- a/source/blender/makesdna/DNA_effect_types.h
+++ b/source/blender/makesdna/DNA_effect_types.h
@@ -118,7 +118,7 @@ typedef struct PartEff {
short staticstep, omat, timetex, speedtex, flag2, flag2neg;
short disp, vertgroup_v;
- char vgroupname[32], vgroupname_v[32];
+ char vgroupname[64], vgroupname_v[64]; /* MAX_VGROUP_NAME */
float imat[4][4]; /* inverse matrix of parent Object */
Particle *keys;
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index 12fb9b92602..b64389a365c 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -48,8 +48,8 @@ typedef struct KeyBlock {
void *data;
float *weights;
- char name[32];
- char vgroup[32];
+ char name[64]; /* MAX_NAME */
+ char vgroup[64]; /* MAX_VGROUP_NAME */
float slidermin;
float slidermax;
@@ -61,7 +61,7 @@ typedef struct Key {
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
KeyBlock *refkey;
- char elemstr[32];
+ char elemstr[64]; /* MAX_NAME */
int elemsize;
float curval DNA_DEPRECATED;
diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h
index 2a67afb5708..0a73ed5b24f 100644
--- a/source/blender/makesdna/DNA_lattice_types.h
+++ b/source/blender/makesdna/DNA_lattice_types.h
@@ -66,7 +66,7 @@ typedef struct Lattice {
struct Key *key;
struct MDeformVert *dvert;
- char vgroup[32]; /* multiply the influence */
+ char vgroup[64]; /* multiply the influence, MAX_VGROUP_NAME */
/* used while deforming, always free and NULL after use */
float *latticedata;
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 55e9328a72a..eacc1b222e4 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -121,7 +121,7 @@ typedef struct Material {
float hasize, flaresize, subsize, flareboost;
float strand_sta, strand_end, strand_ease, strand_surfnor;
float strand_min, strand_widthfade;
- char strand_uvname[32];
+ char strand_uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
float sbias; /* shadow bias to prevent terminator prob */
float lbias; /* factor to multiply lampbias with (0.0 = no mult) */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 77fa03aeedc..e310f148110 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -96,7 +96,7 @@ typedef struct ModifierData {
int type, mode;
int stackindex, pad;
- char name[32];
+ char name[64]; /* MAX_NAME */
/* XXX for timing info set by caller... solve later? (ton) */
struct Scene *scene;
@@ -117,7 +117,7 @@ typedef struct MappingInfoModifierData {
struct Tex *texture;
struct Object *map_object;
- char uvlayer_name[32];
+ char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
int uvlayer_tmp;
int texmapping;
} MappingInfoModifierData;
@@ -134,14 +134,14 @@ typedef struct LatticeModifierData {
ModifierData modifier;
struct Object *object;
- char name[32]; /* optional vertexgroup name */
+ char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
} LatticeModifierData;
typedef struct CurveModifierData {
ModifierData modifier;
struct Object *object;
- char name[32]; /* optional vertexgroup name */
+ char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
short defaxis; /* axis along which curve deforms */
char pad[6];
} CurveModifierData;
@@ -166,7 +166,7 @@ typedef struct MaskModifierData {
ModifierData modifier;
struct Object *ob_arm; /* armature to use to in place of hardcoded vgroup */
- char vgroup[32]; /* name of vertex group to use to mask */
+ char vgroup[64]; /* name of vertex group to use to mask, MAX_VGROUP_NAME */
int mode; /* using armature or hardcoded vgroup */
int flag; /* flags for various things */
@@ -278,7 +278,7 @@ typedef struct BevelModifierData {
short lim_flags; /* flags to tell the tool how to limit the bevel */
short e_flags; /* flags to direct how edge weights are applied to verts */
float bevel_angle; /* if the BME_BEVEL_ANGLE is set, this will be how "sharp" an edge must be before it gets beveled */
- char defgrp_name[32]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group */
+ char defgrp_name[64]; /* if the BME_BEVEL_VWEIGHT option is set, this will be the name of the vert group, MAX_VGROUP_NAME */
} BevelModifierData;
typedef struct BMeshModifierData {
@@ -310,14 +310,14 @@ typedef struct DisplaceModifierData {
/* keep in sync with MappingInfoModifierData */
struct Tex *texture;
struct Object *map_object;
- char uvlayer_name[32];
+ char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
int uvlayer_tmp;
int texmapping;
/* end MappingInfoModifierData */
float strength;
int direction;
- char defgrp_name[32];
+ char defgrp_name[64]; /* MAX_VGROUP_NAME */
float midlevel;
int pad;
} DisplaceModifierData;
@@ -349,7 +349,7 @@ typedef struct UVProjectModifierData {
int num_projectors;
float aspectx, aspecty;
float scalex, scaley;
- char uvlayer_name[32];
+ char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
int uvlayer_tmp, pad;
} UVProjectModifierData;
@@ -373,7 +373,7 @@ typedef struct DecimateModifierData {
typedef struct SmoothModifierData {
ModifierData modifier;
float fac;
- char defgrp_name[32];
+ char defgrp_name[64]; /* MAX_VGROUP_NAME */
short flag, repeat;
} SmoothModifierData;
@@ -397,7 +397,7 @@ typedef struct CastModifierData {
float fac;
float radius;
float size;
- char defgrp_name[32];
+ char defgrp_name[64]; /* MAX_VGROUP_NAME */
short flag, type;
} CastModifierData;
@@ -416,13 +416,13 @@ typedef struct WaveModifierData {
/* keep in sync with MappingInfoModifierData */
struct Tex *texture;
struct Object *map_object;
- char uvlayer_name[32];
+ char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
int uvlayer_tmp;
int texmapping;
/* end MappingInfoModifierData */
struct Object *objectcenter;
- char defgrp_name[32];
+ char defgrp_name[64]; /* MAX_VGROUP_NAME */
short flag, pad;
@@ -440,14 +440,14 @@ typedef struct ArmatureModifierData {
int pad2;
struct Object *object;
float *prevCos; /* stored input of previous modifier, for vertexgroup blending */
- char defgrp_name[32];
+ char defgrp_name[64]; /* MAX_VGROUP_NAME */
} ArmatureModifierData;
typedef struct HookModifierData {
ModifierData modifier;
struct Object *object;
- char subtarget[32]; /* optional name of bone target */
+ char subtarget[64]; /* optional name of bone target, MAX_ID_NAME-2 */
float parentinv[4][4]; /* matrix making current transform unmodified */
float cent[3]; /* visualization of hook */
@@ -456,7 +456,7 @@ typedef struct HookModifierData {
int *indexar; /* if NULL, it's using vertexgroup */
int totindex;
float force;
- char name[32]; /* optional vertexgroup name */
+ char name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
} HookModifierData;
typedef struct SoftbodyModifierData {
@@ -537,7 +537,7 @@ typedef struct MeshDeformModifierData {
ModifierData modifier;
struct Object *object; /* mesh object */
- char defgrp_name[32]; /* optional vertexgroup name */
+ char defgrp_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
short gridsize, flag, mode, pad;
@@ -613,7 +613,7 @@ typedef struct ExplodeModifierData {
int *facepa;
short flag, vgroup;
float protect;
- char uvname[32];
+ char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
} ExplodeModifierData;
typedef struct MultiresModifierData {
@@ -640,7 +640,7 @@ typedef struct ShrinkwrapModifierData {
struct Object *target; /* shrink target */
struct Object *auxTarget; /* additional shrink target */
- char vgroup_name[32]; /* optional vertexgroup name */
+ char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
float keepDist; /* distance offset to keep from mesh/projection point */
short shrinkType; /* shrink type projection */
short shrinkOpts; /* shrink options */
@@ -680,7 +680,7 @@ typedef struct SimpleDeformModifierData {
ModifierData modifier;
struct Object *origin; /* object to control the origin of modifier space coordinates */
- char vgroup_name[32]; /* optional vertexgroup name */
+ char vgroup_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
float factor; /* factors to control simple deforms */
float limit[2]; /* lower and upper limit */
@@ -712,7 +712,7 @@ typedef struct ShapeKeyModifierData {
typedef struct SolidifyModifierData {
ModifierData modifier;
- char defgrp_name[32]; /* name of vertex group to use */
+ char defgrp_name[64]; /* name of vertex group to use, MAX_VGROUP_NAME */
float offset; /* new surface offset level*/
float offset_fac; /* midpoint of the offset */
float offset_fac_vg; /* factor for the minimum weight to use when vgroups are used, avoids 0.0 weights giving duplicate geometry */
@@ -774,7 +774,7 @@ typedef struct OceanModifierData {
int bakeend;
char cachepath[240]; // FILE_MAX
- char foamlayername[32];
+ char foamlayername[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
char cached;
char geometry_mode;
@@ -814,7 +814,7 @@ typedef struct WarpModifierData {
/* keep in sync with MappingInfoModifierData */
struct Tex *texture;
struct Object *map_object;
- char uvlayer_name[32];
+ char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
int uvlayer_tmp;
int texmapping;
/* end MappingInfoModifierData */
@@ -822,7 +822,7 @@ typedef struct WarpModifierData {
struct Object *object_from;
struct Object *object_to;
struct CurveMapping *curfalloff;
- char defgrp_name[32]; /* optional vertexgroup name */
+ char defgrp_name[64]; /* optional vertexgroup name, MAX_VGROUP_NAME */
float strength;
float falloff_radius;
char flag; /* not used yet */
@@ -850,7 +850,7 @@ typedef struct WeightVGEditModifierData {
/* Note: I tried to keep everything logically ordered - provided the
* alignment constraints... */
- char defgrp_name[32]; /* Name of vertex group to edit. */
+ char defgrp_name[64]; /* Name of vertex group to edit. MAX_VGROUP_NAME. */
short edit_flags; /* Using MOD_WVG_EDIT_* flags. */
short falloff_type; /* Using MOD_WVG_MAPPING_* defines. */
@@ -865,7 +865,7 @@ typedef struct WeightVGEditModifierData {
/* Masking options. */
float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */
/* Name of mask vertex group from which to get weight factors. */
- char mask_defgrp_name[32];
+ char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */
/* Texture masking. */
int mask_tex_use_channel; /* Which channel to use as weightf. */
@@ -873,7 +873,7 @@ typedef struct WeightVGEditModifierData {
struct Object *mask_tex_map_obj; /* Name of the map object. */
/* How to map the texture (using MOD_DISP_MAP_* constants). */
int mask_tex_mapping;
- char mask_tex_uvlayer_name[32]; /* Name of the UV map. */
+ char mask_tex_uvlayer_name[64]; /* Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME */
/* Padding... */
int pad_i1;
@@ -899,8 +899,8 @@ typedef struct WeightVGMixModifierData {
/* XXX Note: I tried to keep everything logically ordered – provided the
* alignment constraints... */
- char defgrp_name_a[32]; /* Name of vertex group to modify/weight. */
- char defgrp_name_b[32]; /* Name of other vertex group to mix in. */
+ char defgrp_name_a[64]; /* Name of vertex group to modify/weight. MAX_VGROUP_NAME. */
+ char defgrp_name_b[64]; /* Name of other vertex group to mix in. MAX_VGROUP_NAME. */
float default_weight_a; /* Default weight value for first vgroup. */
float default_weight_b; /* Default weight value to mix in. */
char mix_mode; /* How second vgroups weights affect first ones */
@@ -911,14 +911,14 @@ typedef struct WeightVGMixModifierData {
/* Masking options. */
float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */
/* Name of mask vertex group from which to get weight factors. */
- char mask_defgrp_name[32];
+ char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */
/* Texture masking. */
int mask_tex_use_channel; /* Which channel to use as weightf. */
struct Tex *mask_texture; /* The texture. */
struct Object *mask_tex_map_obj; /* Name of the map object. */
int mask_tex_mapping; /* How to map the texture! */
- char mask_tex_uvlayer_name[32]; /* Name of the UV map. */
+ char mask_tex_uvlayer_name[64]; /* Name of the UV map. MAX_CUSTOMDATA_LAYER_NAME. */
/* Padding... */
int pad_i1;
@@ -946,7 +946,7 @@ typedef struct WeightVGProximityModifierData {
/* Note: I tried to keep everything logically ordered - provided the
* alignment constraints... */
- char defgrp_name[32]; /* Name of vertex group to modify/weight. */
+ char defgrp_name[64]; /* Name of vertex group to modify/weight. MAX_VGROUP_NAME. */
/* Proximity modes. */
int proximity_mode;
@@ -958,14 +958,14 @@ typedef struct WeightVGProximityModifierData {
/* Masking options. */
float mask_constant; /* The global "influence", if no vgroup nor tex is used as mask. */
/* Name of mask vertex group from which to get weight factors. */
- char mask_defgrp_name[32];
+ char mask_defgrp_name[64]; /* MAX_VGROUP_NAME */
/* Texture masking. */
int mask_tex_use_channel; /* Which channel to use as weightf. */
struct Tex *mask_texture; /* The texture. */
struct Object *mask_tex_map_obj; /* Name of the map object. */
int mask_tex_mapping; /* How to map the texture! */
- char mask_tex_uvlayer_name[32]; /* Name of the UV Map. */
+ char mask_tex_uvlayer_name[64]; /* Name of the UV Map. MAX_CUSTOMDATA_LAYER_NAME. */
float min_dist, max_dist; /* Distances mapping to 0.0/1.0 weights. */
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 01ffbb44c13..fe4f6905f42 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -49,7 +49,7 @@ struct bGPdata;
struct uiBlock;
struct Image;
-#define NODE_MAXSTR 32
+#define NODE_MAXSTR 64
typedef struct bNodeStack {
float vec[4];
@@ -71,7 +71,7 @@ typedef struct bNodeStack {
typedef struct bNodeSocket {
struct bNodeSocket *next, *prev, *new_sock;
- char name[32];
+ char name[64]; /* MAX_NAME */
void *storage; /* custom storage */
@@ -142,7 +142,7 @@ typedef struct bNodePreview {
typedef struct bNode {
struct bNode *next, *prev, *new_node;
- char name[32];
+ char name[64]; /* MAX_NAME */
short type, flag;
short done, level; /* both for dependency and sorting */
short lasty, menunr; /* lasty: check preview render status, menunr: browse ID blocks */
@@ -160,7 +160,7 @@ typedef struct bNode {
int update; /* update flags */
- char label[32]; /* custom user-defined label */
+ char label[64]; /* custom user-defined label, MAX_NAME */
short custom1, custom2; /* to be abused for buttons */
float custom3, custom4;
@@ -369,12 +369,12 @@ typedef struct NodeTwoFloats {
} NodeTwoFloats;
typedef struct NodeGeometry {
- char uvname[32];
- char colname[32];
+ char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
+ char colname[64];
} NodeGeometry;
typedef struct NodeVertexCol {
- char name[32];
+ char name[64];
} NodeVertexCol;
/* qdn: Defocus blur node */
@@ -497,7 +497,7 @@ typedef struct NodeShaderAttribute {
/* TEX_output */
typedef struct TexNodeOutput {
- char name[32];
+ char name[64];
} TexNodeOutput;
/* comp channel matte */
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index cb72e396356..28c28bbf329 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -274,7 +274,7 @@ typedef struct SoftBody {
/* general options */
float nodemass; /* softbody mass of *vertex* */
- char namedVG_Mass[32]; /* along with it introduce mass painting
+ char namedVG_Mass[64]; /* MAX_VGROUP_NAME */ /* along with it introduce mass painting
starting to fix old bug .. nastyness that VG are indexes
rather find them by name tag to find it -> jow20090613 */
float grav; /* softbody amount of gravitaion to apply */
@@ -289,7 +289,7 @@ typedef struct SoftBody {
float maxgoal;
float defgoal; /* default goal for vertices without vgroup */
short vertgroup; /* index starting at 1 */
- char namedVG_Softgoal[32]; /* starting to fix old bug .. nastyness that VG are indexes
+ char namedVG_Softgoal[64]; /* MAX_VGROUP_NAME */ /* starting to fix old bug .. nastyness that VG are indexes
rather find them by name tag to find it -> jow20090613 */
short fuzzyness; /* */
@@ -297,7 +297,7 @@ typedef struct SoftBody {
/* springs */
float inspring; /* softbody inner springs */
float infrict; /* softbody inner springs friction */
- char namedVG_Spring_K[32]; /* along with it introduce Spring_K painting
+ char namedVG_Spring_K[64]; /* MAX_VGROUP_NAME */ /* along with it introduce Spring_K painting
starting to fix old bug .. nastyness that VG are indexes
rather find them by name tag to find it -> jow20090613 */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 7f1239195ec..b8580b47269 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -61,11 +61,11 @@ struct bGPdata;
/* Vertex Groups - Name Info */
typedef struct bDeformGroup {
struct bDeformGroup *next, *prev;
- char name[32];
+ char name[64]; /* MAX_VGROUP_NAME */
/* need this flag for locking weights */
char flag, pad[7];
} bDeformGroup;
-#define MAX_VGROUP_NAME 32
+#define MAX_VGROUP_NAME 64
/* bDeformGroup->flag */
#define DG_LOCK_WEIGHT 1
@@ -107,7 +107,7 @@ typedef struct Object {
short type, partype;
int par1, par2, par3; /* can be vertexnrs */
- char parsubstr[32]; /* String describing subobject info */
+ char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME-2 */
struct Object *parent, *track;
/* if ob->proxy (or proxy_group), this object is proxy for object ob->proxy */
/* proxy_from is set in target back to the proxy. */
@@ -273,7 +273,7 @@ typedef struct ObHook {
float cent[3]; /* visualization of hook */
float falloff; /* if not zero, falloff is distance where influence zero */
- char name[32];
+ char name[64]; /* MAX_NAME */
int *indexar;
int totindex, curindex; /* curindex is cache for fast lookup */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 07efd17df7f..4c3279c6527 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -261,7 +261,7 @@ typedef struct ParticleSystem
struct ListBase targets; /* used for keyed and boid physics */
- char name[32]; /* particle system name */
+ char name[64]; /* particle system name, MAX_NAME */
float imat[4][4]; /* used for duplicators */
float cfra, tree_frame, bvhtree_frame;
@@ -269,7 +269,7 @@ typedef struct ParticleSystem
int flag, totpart, totunexist, totchild, totcached, totchildcache;
short recalc, target_psys, totkeyed, bakespace;
- char bb_uvname[3][32]; /* billboard uv name */
+ char bb_uvname[3][64]; /* billboard uv name, MAX_CUSTOMDATA_LAYER_NAME */
/* if you change these remember to update array lengths to PSYS_TOT_VG! */
short vgroup[12], vg_neg, rt3; /* vertex groups, 0==disable, 1==starting index */
diff --git a/source/blender/makesdna/DNA_property_types.h b/source/blender/makesdna/DNA_property_types.h
index e74ae41a421..a36e362632b 100644
--- a/source/blender/makesdna/DNA_property_types.h
+++ b/source/blender/makesdna/DNA_property_types.h
@@ -43,7 +43,7 @@
typedef struct bProperty {
struct bProperty *next, *prev;
- char name[32];
+ char name[64]; /* MAX_NAME */
short type, flag;
int data; /* data should be 4 bytes to store int,float stuff */
void *poin; /* references data unless its a string which is malloc'd */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 7d611acc551..d3eb4f12b2a 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -171,7 +171,7 @@ typedef struct AudioData {
typedef struct SceneRenderLayer {
struct SceneRenderLayer *next, *prev;
- char name[32];
+ char name[64]; /* MAX_NAME */
struct Material *mat_override;
struct Group *light_override;
@@ -804,8 +804,9 @@ typedef struct VPaint {
typedef struct TransformOrientation {
struct TransformOrientation *next, *prev;
- char name[36];
+ char name[64]; /* MAX_NAME */
float mat[3][3];
+ int pad;
} TransformOrientation;
/* *************************************************************** */
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index e7444b06898..80f19b30079 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -40,7 +40,7 @@ struct Material;
/* ****************** SENSORS ********************* */
typedef struct bNearSensor {
- char name[32];
+ char name[64]; /* MAX_NAME */
float dist, resetdist;
int lastval, pad;
} bNearSensor;
@@ -59,7 +59,7 @@ typedef struct bMouseSensor {
} bMouseSensor;
typedef struct bTouchSensor {
- char name[32];
+ char name[64]; /* MAX_NAME */
struct Material *ma;
float dist, pad;
} bTouchSensor;
@@ -70,25 +70,25 @@ typedef struct bKeyboardSensor {
/**
* Name of the target property
*/
- char targetName[32];
+ char targetName[64]; /* MAX_NAME */
/**
* Name of the toggle property
*/
- char toggleName[32];
+ char toggleName[64]; /* MAX_NAME */
} bKeyboardSensor;
typedef struct bPropertySensor {
int type;
int pad;
- char name[32];
- char value[32];
- char maxvalue[32];
+ char name[64]; /* MAX_NAME */
+ char value[64];
+ char maxvalue[64];
} bPropertySensor;
typedef struct bActuatorSensor {
int type;
int pad;
- char name[32];
+ char name[64]; /* MAX_NAME */
} bActuatorSensor;
typedef struct bDelaySensor {
@@ -99,8 +99,8 @@ typedef struct bDelaySensor {
} bDelaySensor;
typedef struct bCollisionSensor {
- char name[32]; /* property name */
- char materialName[32]; /* material */
+ char name[64]; /* property name. MAX_NAME */
+ char materialName[64]; /* material */
// struct Material *ma; // XXX remove materialName
short damptimer, damp;
short mode; /* flag to choose material or property */
@@ -108,23 +108,23 @@ typedef struct bCollisionSensor {
} bCollisionSensor;
typedef struct bRadarSensor {
- char name[32];
+ char name[64]; /* MAX_NAME */
float angle;
float range;
short flag, axis;
} bRadarSensor;
typedef struct bRandomSensor {
- char name[32];
+ char name[64]; /* MAX_NAME */
int seed;
int delay;
} bRandomSensor;
typedef struct bRaySensor {
- char name[32];
+ char name[64]; /* MAX_NAME */
float range;
- char propname[32];
- char matname[32];
+ char propname[64];
+ char matname[64];
//struct Material *ma; // XXX remove materialName
short mode;
short pad1;
@@ -132,8 +132,8 @@ typedef struct bRaySensor {
} bRaySensor;
typedef struct bArmatureSensor {
- char posechannel[32];
- char constraint[32];
+ char posechannel[64]; /* MAX_NAME */
+ char constraint[64]; /* MAX_NAME */
int type;
float value;
} bArmatureSensor;
@@ -147,12 +147,12 @@ typedef struct bMessageSensor {
/**
* Can be used to filter on subjects like this
*/
- char subject[32];
+ char subject[64];
/**
* (Possible future use) body to filter on
*/
- char body[32];
+ char body[64];
} bMessageSensor;
typedef struct bSensor {
@@ -160,7 +160,7 @@ typedef struct bSensor {
/* pulse and freq are the bool toggle and frame count for pulse mode */
short type, otype, flag, pulse;
short freq, totlinks, pad1, pad2;
- char name[32];
+ char name[64]; /* MAX_NAME */
void *data;
struct bController **links;
@@ -175,7 +175,7 @@ typedef struct bSensor {
} bSensor;
typedef struct bJoystickSensor {
- char name[32];
+ char name[64]; /* MAX_NAME */
char type;
char joyindex;
short flag;
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index aab20dbeee1..fa501de8d6d 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -127,7 +127,7 @@ typedef struct Sequence {
struct Sequence *next, *prev;
void *tmp; /* tmp var for copying, and tagging for linked selection */
void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */
- char name[24]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
+ char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
int flag, type; /*flags bitmap (see below) and the type of sequence*/
int len; /* the length of the contense of this strip - before handles are applied */
@@ -255,7 +255,7 @@ typedef struct SpeedControlVars {
#define SEQ_SPEED_COMPRESS_IPO_Y 4
/* ***************** SEQUENCE ****************** */
-#define SEQ_NAME_MAXSTR 24
+#define SEQ_NAME_MAXSTR 64
/* seq->flag */
#define SEQ_LEFTSEL (1<<1)
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 82ffa82cf60..e711124d39c 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -60,7 +60,7 @@ typedef struct MTex {
short texco, mapto, maptoneg, blendtype;
struct Object *object;
struct Tex *tex;
- char uvname[32];
+ char uvname[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
char projx, projy, projz, mapping;
float ofs[3], size[3], rot;
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index 131c540ac47..a8b3a7183cf 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -75,7 +75,7 @@ typedef struct MovieTrackingMarker {
typedef struct MovieTrackingTrack {
struct MovieTrackingTrack *next, *prev;
- char name[24];
+ char name[64]; /* MAX_NAME */
/* ** setings ** */
float pat_min[2], pat_max[2]; /* positions of left-bottom and right-top corners of pattern (in unified 0..1 space) */
@@ -178,7 +178,7 @@ typedef struct MovieTrackingReconstruction {
typedef struct MovieTrackingObject {
struct MovieTrackingObject *next, *prev;
- char name[24]; /* Name of tracking object */
+ char name[64]; /* Name of tracking object, MAX_NAME */
int flag;
float scale; /* scale of object solution in amera space */
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index ae026b0bcc9..58c3f091d6d 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -173,7 +173,7 @@ typedef struct View3D {
struct View3D *localvd; /* allocated backup of its self while in localview */
- char ob_centre_bone[32]; /* optional string for armature bone to define center */
+ char ob_centre_bone[64]; /* optional string for armature bone to define center, MAXBONENAME */
unsigned int lay;
int layact;
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 57989424d4a..156d2ebbb20 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -168,7 +168,7 @@ typedef struct wmWindow {
struct bScreen *screen; /* active screen */
struct bScreen *newscreen; /* temporary when switching */
- char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */
+ char screenname[64]; /* MAX_ID_NAME for matching window with active screen after file read */
short posx, posy, sizex, sizey; /* window coords */
short windowstate; /* borderless, full */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 3a7d453fa79..3f3ac6ce906 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1969,7 +1969,7 @@ static void rna_def_modifier_explode(BlenderRNA *brna)
prop= RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvname");
- RNA_def_property_string_maxlength(prop, 32);
+ RNA_def_property_string_maxlength(prop, MAX_CUSTOMDATA_LAYER_NAME);
RNA_def_property_ui_text(prop, "Particle UV", "UV map to change with particle age");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 05b33877f10..2b5925179d8 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3234,7 +3234,7 @@ static void rna_def_group_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int
func= RNA_def_function(srna, "new", (in_out==SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new"));
RNA_def_function_ui_description(func, "Add a socket to the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_string(func, "name", "Socket", 32, "Name", "Name of the socket");
+ RNA_def_string(func, "name", "Socket", MAX_NAME, "Name", "Name of the socket");
RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket");
/* return value */
parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 16748d4c8ac..01f3889d684 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -807,7 +807,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique name of track");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingTrack_name_set");
- RNA_def_property_string_maxlength(prop, MAX_ID_NAME);
+ RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
RNA_def_struct_name_property(srna, prop);
@@ -1179,7 +1179,7 @@ static void rna_def_trackingObject(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique name of object");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingObject_name_set");
- RNA_def_property_string_maxlength(prop, MAX_ID_NAME);
+ RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);
RNA_def_struct_name_property(srna, prop);
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index d2d875150e8..8c8523f8d2c 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -69,7 +69,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tamd->object = amd->object;
tamd->deformflag = amd->deformflag;
tamd->multi = amd->multi;
- BLI_strncpy(tamd->defgrp_name, amd->defgrp_name, 32);
+ BLI_strncpy(tamd->defgrp_name, amd->defgrp_name, sizeof(tamd->defgrp_name));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md))
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index c746b10755e..160167808fc 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -71,7 +71,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tbmd->lim_flags = bmd->lim_flags;
tbmd->e_flags = bmd->e_flags;
tbmd->bevel_angle = bmd->bevel_angle;
- BLI_strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32);
+ BLI_strncpy(tbmd->defgrp_name, bmd->defgrp_name, sizeof(tbmd->defgrp_name));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c
index 16d57a2400f..78bebc0b5e2 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -76,7 +76,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tcmd->flag = cmd->flag;
tcmd->type = cmd->type;
tcmd->object = cmd->object;
- BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, 32);
+ BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, sizeof(tcmd->defgrp_name));
}
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c
index 261d0c6c0d3..9a7dd3fc898 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -64,7 +64,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tcmd->defaxis = cmd->defaxis;
tcmd->object = cmd->object;
- BLI_strncpy(tcmd->name, cmd->name, 32);
+ BLI_strncpy(tcmd->name, cmd->name, sizeof(tcmd->name));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index da90879ed6d..1ac11da25db 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -74,11 +74,11 @@ static void copyData(ModifierData *md, ModifierData *target)
tdmd->texture = dmd->texture;
tdmd->strength = dmd->strength;
tdmd->direction = dmd->direction;
- BLI_strncpy(tdmd->defgrp_name, dmd->defgrp_name, 32);
+ BLI_strncpy(tdmd->defgrp_name, dmd->defgrp_name, sizeof(tdmd->defgrp_name));
tdmd->midlevel = dmd->midlevel;
tdmd->texmapping = dmd->texmapping;
tdmd->map_object = dmd->map_object;
- BLI_strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32);
+ BLI_strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, sizeof(tdmd->uvlayer_name));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index f5e4ebfd449..9d5bc46810b 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -71,8 +71,8 @@ static void copyData(ModifierData *md, ModifierData *target)
thmd->totindex = hmd->totindex;
thmd->indexar = MEM_dupallocN(hmd->indexar);
memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv));
- BLI_strncpy(thmd->name, hmd->name, 32);
- BLI_strncpy(thmd->subtarget, hmd->subtarget, 32);
+ BLI_strncpy(thmd->name, hmd->name, sizeof(thmd->name));
+ BLI_strncpy(thmd->subtarget, hmd->subtarget, sizeof(thmd->subtarget));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c
index 4d5c63986a5..ac0a3a0c052 100644
--- a/source/blender/modifiers/intern/MOD_lattice.c
+++ b/source/blender/modifiers/intern/MOD_lattice.c
@@ -56,7 +56,7 @@ static void copyData(ModifierData *md, ModifierData *target)
LatticeModifierData *tlmd = (LatticeModifierData*) target;
tlmd->object = lmd->object;
- BLI_strncpy(tlmd->name, lmd->name, 32);
+ BLI_strncpy(tlmd->name, lmd->name, sizeof(tlmd->name));
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index 1bd5b2e78dd..e43304bc4b9 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -67,7 +67,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tsmd->fac = smd->fac;
tsmd->repeat = smd->repeat;
tsmd->flag = smd->flag;
- BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, 32);
+ BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, sizeof(tsmd->defgrp_name));
}
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index 5be7eb6af3d..aa8f578942c 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -99,7 +99,7 @@ void get_texture_coords(MappingInfoModifierData *dmd, Object *ob,
char *done = MEM_callocN(sizeof(*done) * numVerts,
"get_texture_coords done");
int numFaces = dm->getNumFaces(dm);
- char uvname[32];
+ char uvname[MAX_CUSTOMDATA_LAYER_NAME];
MTFace *tf;
CustomData_validate_layer_name(&dm->faceData, CD_MTFACE, dmd->uvlayer_name, uvname);
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index c89fdb3a0ee..77ce879bbf6 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -155,7 +155,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
Projector projectors[MOD_UVPROJECT_MAXPROJECTORS];
int num_projectors = 0;
float aspect;
- char uvname[32];
+ char uvname[MAX_CUSTOMDATA_LAYER_NAME];
float aspx= umd->aspectx ? umd->aspectx : 1.0f;
float aspy= umd->aspecty ? umd->aspecty : 1.0f;
float scax= umd->scalex ? umd->scalex : 1.0f;
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index e83aa9e3fb9..f4377e82408 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -97,7 +97,7 @@ static void copyData(ModifierData *md, ModifierData *target)
twmd->texture = wmd->texture;
twmd->map_object = wmd->map_object;
twmd->texmapping = wmd->texmapping;
- BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, 32);
+ BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
}
static int dependsOnTime(ModifierData *UNUSED(md))
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index 5631b7e716a..9794635e428 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -112,7 +112,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
* XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear.
*/
void weightvg_do_mask(int num, const int *indices, float *org_w, const float *new_w,
- Object *ob, DerivedMesh *dm, float fact, const char defgrp_name[32],
+ Object *ob, DerivedMesh *dm, float fact, const char defgrp_name[MAX_VGROUP_NAME],
Tex *texture, int tex_use_channel, int tex_mapping,
Object *tex_map_object, const char *tex_uvlayer_name)
{
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h
index 2f364a2017f..5ae1e991073 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.h
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.h
@@ -73,7 +73,7 @@ void weightvg_do_map(int num, float *new_w, short mode, struct CurveMapping *cma
* XXX The standard “factor” value is assumed in [0.0, 1.0] range. Else, weird results might appear.
*/
void weightvg_do_mask(int num, const int *indices, float *org_w, const float *new_w, Object *ob,
- DerivedMesh *dm, float fact, const char defgrp_name[32], Tex *texture,
+ DerivedMesh *dm, float fact, const char defgrp_name[MAX_VGROUP_NAME], Tex *texture,
int tex_use_channel, int tex_mapping, Object *tex_map_object,
const char *tex_uvlayer_name);
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index d6a1c50162b..400b6a1fa5f 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -604,7 +604,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
if(ntree->progress && totnode)
ntree->progress(ntree->prh, (1.0f - curnode/(float)totnode));
if(ntree->stats_draw) {
- char str[64];
+ char str[128];
sprintf(str, "Compositing %d %s", curnode, node->name);
ntree->stats_draw(ntree->sdh, str);
}
diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c
index 0ed6d232b81..829cd06dfc0 100644
--- a/source/blender/nodes/texture/nodes/node_texture_output.c
+++ b/source/blender/nodes/texture/nodes/node_texture_output.c
@@ -103,8 +103,8 @@ static void unique_name(bNode *node)
} else {
suffix = 0;
new_len = len + 4;
- if(new_len > 31)
- new_len = 31;
+ if(new_len > (sizeof(tno->name) - 1))
+ new_len = (sizeof(tno->name) - 1);
}
new_name = MEM_mallocN(new_len + 1, "new_name");
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index db3519a3056..ecf65275483 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -101,7 +101,7 @@ void bpy_text_filename_get(char *fn, size_t fn_len, Text *text)
PyObject *bpy_text_import(Text *text)
{
char *buf = NULL;
- char modulename[24];
+ char modulename[MAX_ID_NAME+2];
int len;
if (!text->compiled) {
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index c058ee1d4f0..516c0afa883 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -249,7 +249,7 @@ static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUS
name = _PyUnicode_AsStringAndSize(value, &name_size);
if (name_size > MAX_IDPROP_NAME) {
- PyErr_SetString(PyExc_TypeError, "string length cannot exceed 31 characters!");
+ PyErr_SetString(PyExc_TypeError, "string length cannot exceed 63 characters!");
return -1;
}
@@ -359,7 +359,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
Py_ssize_t name_size;
name = _PyUnicode_AsStringAndSize(name_obj, &name_size);
if (name_size > MAX_IDPROP_NAME) {
- return "the length of IDProperty names is limited to 31 characters";
+ return "the length of IDProperty names is limited to 63 characters";
}
}
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 43d03ec60a4..f414be60b0a 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -36,6 +36,7 @@
/* ------------------------------------------------------------------------- */
#include "DNA_color_types.h"
+#include "DNA_customdata_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
#include "DNA_object_types.h"
@@ -306,8 +307,8 @@ typedef struct ObjectRen {
struct HaloRen **bloha;
struct StrandBuffer *strandbuf;
- char (*mtface)[32];
- char (*mcol)[32];
+ char (*mtface)[MAX_CUSTOMDATA_LAYER_NAME];
+ char (*mcol)[MAX_CUSTOMDATA_LAYER_NAME];
int actmtface, actmcol, bakemtface;
float obmat[4][4]; /* only used in convertblender.c, for instancing */