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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/modifier.c8
-rw-r--r--source/blender/editors/object/object_vgroup.c2
-rw-r--r--source/blender/makesdna/DNA_ID.h6
-rw-r--r--source/blender/makesrna/intern/rna_ID.c6
4 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 0ecc8166d72..e483ae0e6a8 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -178,13 +178,7 @@ ModifierData *modifiers_findByType(Object *ob, ModifierType type)
ModifierData *modifiers_findByName(Object *ob, const char *name)
{
- ModifierData *md = ob->modifiers.first;
-
- for (; md; md=md->next)
- if (strcmp(md->name, name)==0)
- break;
-
- return md;
+ return BLI_findstring(&(ob->modifiers), name, offsetof(ModifierData, name));
}
void modifiers_clearErrors(Object *ob)
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index f7847972df1..246bc3875f1 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -93,7 +93,7 @@ bDeformGroup *ED_vgroup_add_name(Object *ob, char *name)
defgroup = MEM_callocN(sizeof(bDeformGroup), "add deformGroup");
- BLI_strncpy(defgroup->name, name, 32);
+ BLI_strncpy(defgroup->name, name, sizeof(defgroup->name));
BLI_addtail(&ob->defbase, defgroup);
defgroup_unique_name(defgroup, ob);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index e9b1b655ad8..1eddbb26168 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -116,10 +116,10 @@ typedef struct Library {
ID id;
ID *idblock;
struct FileData *filedata;
- char name[240]; /* revealed in the UI, can store relative path */
- char filename[240]; /* expanded name, not relative, used while reading */
+ char name[240]; /* path name used for reading, can be relative and edited in the outliner */
+ char filename[240]; /* temp. absolute filepath, only used while reading */
int tot, pad; /* tot, idblock and filedata are only fo read and write */
- struct Library *parent; /* for outliner, showing dependency */
+ struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */
} Library;
#define PREVIEW_MIPMAPS 2
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 3263d816ad0..50ab36bd4a4 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -401,8 +401,12 @@ static void rna_def_library(BlenderRNA *brna)
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "Path to the library .blend file");
+ /* TODO - lib->filename isnt updated, however the outliner also skips this, probably only needed on read. */
+
+ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "ID");
+ RNA_def_property_ui_text(prop, "Parent", "");
}
void RNA_def_ID(BlenderRNA *brna)
{