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:
authorCampbell Barton <ideasman42@gmail.com>2010-04-18 18:47:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-18 18:47:45 +0400
commit4fde9823fdfe323de4c8d3b76aa75d98ef9362a6 (patch)
tree047f14eeb0a0c71f41a0a70cf0c53bb9e6e8b687 /source
parent153081accdc6c8d5779b1d13e1d25555682b9e44 (diff)
possible fix for [#22057] Autoname L/R in bones names center bones as .R
Bone would get a '.' added even when there was no extension. (center limit would still be useful) - name flipping function used sizeof() incorrectly. - ED_lorem should be extern.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_armature.h2
-rw-r--r--source/blender/blenkernel/intern/armature.c10
-rw-r--r--source/blender/blenkernel/intern/deform.c8
-rw-r--r--source/blender/editors/armature/editarmature.c4
-rw-r--r--source/blender/editors/armature/poseobject.c4
-rw-r--r--source/blender/editors/curve/curve_intern.h2
-rw-r--r--source/blender/python/intern/bpy.c5
7 files changed, 22 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 7e3d7f2a2ce..2c661a74573 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -81,7 +81,7 @@ void make_local_armature(struct bArmature *arm);
struct bArmature *copy_armature(struct bArmature *arm);
void bone_flip_name (char *name, int strip_number);
-void bone_autoside_name (char *name, int strip_number, short axis, float head, float tail);
+int bone_autoside_name (char *name, 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/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index aec6ab6a139..04d5acb11cc 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -361,7 +361,7 @@ void bone_flip_name (char *name, int strip_number)
* axis: the axis to name on
* head/tail: the head/tail co-ordinate of the bone on the specified axis
*/
-void bone_autoside_name (char *name, int strip_number, short axis, float head, float tail)
+int bone_autoside_name (char *name, int strip_number, short axis, float head, float tail)
{
unsigned int len;
char basename[32]={""};
@@ -462,9 +462,15 @@ void bone_autoside_name (char *name, int strip_number, short axis, float head, f
if ((32 - len) < strlen(extension) + 1) { /* add 1 for the '.' */
strncpy(name, basename, len-strlen(extension));
}
+
+ sprintf(name, "%s.%s", basename, extension);
+
+ return 1;
}
- sprintf(name, "%s.%s", basename, extension);
+ else {
+ return 0;
+ }
}
/* ************* B-Bone support ******************* */
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index d9ba6cd6a9d..fecafc701a6 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -364,10 +364,10 @@ void defgroup_unique_name (bDeformGroup *dg, Object *ob)
void flip_side_name (char *name, const char *from_name, int strip_number)
{
int len;
- char prefix[sizeof((bDeformGroup *)NULL)->name]={""}; /* The part before the facing */
- char suffix[sizeof((bDeformGroup *)NULL)->name]={""}; /* The part after the facing */
- char replace[sizeof((bDeformGroup *)NULL)->name]={""}; /* The replacement string */
- char number[sizeof((bDeformGroup *)NULL)->name]={""}; /* The number extension string */
+ char prefix[sizeof(((bDeformGroup *)NULL)->name)]= {""}; /* The part before the facing */
+ char suffix[sizeof(((bDeformGroup *)NULL)->name)]= {""}; /* The part after the facing */
+ char replace[sizeof(((bDeformGroup *)NULL)->name)]= {""}; /* The replacement string */
+ char number[sizeof(((bDeformGroup *)NULL)->name)]= {""}; /* The number extension string */
char *index=NULL;
len= strlen(from_name);
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 2db86d70734..58819546ec1 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -5601,8 +5601,8 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, EditBone *, ebone, selected_editable_bones)
{
BLI_strncpy(newname, ebone->name, sizeof(newname));
- bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]);
- ED_armature_bone_rename(arm, ebone->name, newname);
+ if(bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
+ ED_armature_bone_rename(arm, ebone->name, newname);
}
CTX_DATA_END;
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index a3d2c454d23..795a27c5642 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -1410,8 +1410,8 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
BLI_strncpy(newname, pchan->name, sizeof(newname));
- bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]);
- ED_armature_bone_rename(arm, pchan->name, newname);
+ if(bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
+ ED_armature_bone_rename(arm, pchan->name, newname);
}
CTX_DATA_END;
diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h
index b423a53ce35..d3b377e2a67 100644
--- a/source/blender/editors/curve/curve_intern.h
+++ b/source/blender/editors/curve/curve_intern.h
@@ -33,7 +33,7 @@
struct wmOperatorType;
/* lorem.c */
-char *ED_lorem;
+extern char *ED_lorem;
/* editfont.c */
enum { DEL_ALL, DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_SELECTION, DEL_NEXT_SEL, DEL_PREV_SEL };
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 9bd67f678f8..d59a4ca262d 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -96,12 +96,15 @@ void BPy_init_modules( void )
/* Needs to be first since this dir is needed for future modules */
char *modpath= BLI_gethome_folder("scripts/modules", BLI_GETHOME_ALL);
if(modpath) {
+ // printf("bpy: found module path '%s'.\n", modpath);
PyObject *sys_path= PySys_GetObject("path"); /* borrow */
PyObject *py_modpath= PyUnicode_FromString(modpath);
PyList_Insert(sys_path, 0, py_modpath); /* add first */
Py_DECREF(py_modpath);
}
-
+ else {
+ printf("bpy: couldnt find 'scripts/modules', blender probably wont start.\n");
+ }
/* stand alone utility modules not related to blender directly */
Geometry_Init();
Mathutils_Init();