diff options
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 14 |
3 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 89ddb59aab5..d686a5951eb 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -42,8 +42,8 @@ extern "C" { BlenderRNA *RNA_create(void); void RNA_define_free(BlenderRNA *brna); void RNA_free(BlenderRNA *brna); -void RNA_define_verify_sdna(int verify); -void RNA_define_animate_sdna(int animate); +void RNA_define_verify_sdna(bool verify); +void RNA_define_animate_sdna(bool animate); void RNA_init(void); void RNA_exit(void); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index b7cdc7a75b3..b153728050c 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -574,13 +574,13 @@ void RNA_define_free(BlenderRNA *UNUSED(brna)) DefRNA.error = 0; } -void RNA_define_verify_sdna(int verify) +void RNA_define_verify_sdna(bool verify) { DefRNA.verify = verify; } #ifndef RNA_RUNTIME -void RNA_define_animate_sdna(int animate) +void RNA_define_animate_sdna(bool animate) { DefRNA.animate = animate; } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 3589610214b..dffdc988ca6 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -908,6 +908,15 @@ static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr) WM_main_add_notifier(NC_MATERIAL | ND_SHADING_LINKS, NULL); } +static char *rna_MaterialSlot_path(PointerRNA *ptr) +{ + Object *ob = (Object *)ptr->id.data; + int index = (Material **)ptr->data - ob->mat; + + /* from armature... */ + return BLI_sprintfN("material_slots[%d]", index); +} + /* why does this have to be so complicated?, can't all this crap be * moved to in BGE conversion function? - Campbell * * @@ -1553,6 +1562,8 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", "Material slot name"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_struct_name_property(srna, prop); + + RNA_def_struct_path_func(srna, "rna_MaterialSlot_path"); } static void rna_def_object_game_settings(BlenderRNA *brna) @@ -2766,11 +2777,14 @@ static void rna_def_object_base(BlenderRNA *brna) void RNA_def_object(BlenderRNA *brna) { rna_def_object(brna); + + RNA_define_animate_sdna(false); rna_def_object_game_settings(brna); rna_def_object_base(brna); rna_def_vertex_group(brna); rna_def_material_slot(brna); rna_def_dupli_object(brna); + RNA_define_animate_sdna(true); } #endif |