diff options
author | Matt Ebb <matt@mke3.net> | 2010-05-18 09:40:30 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-05-18 09:40:30 +0400 |
commit | cf4f5c44978246feb17247d512d52bf12b5a0cfe (patch) | |
tree | 27648fc0fea0ec8e60c8c8ba2faf74b4759c50d8 /source | |
parent | 10f5be4fbf3556b22f56faf96df09be2d39449e4 (diff) |
Fix : Preview render wasn't updating when switching pinned materials (and other types)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 7ba56d77801..24636de71e5 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -509,6 +509,28 @@ static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) return &RNA_ID; } +static void rna_SpaceProperties_pin_id_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + SpaceButs *sbuts= (SpaceButs*)(ptr->data); + ID *id = sbuts->pinid; + + switch (GS(id->name)) { + case ID_MA: + WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL); + break; + case ID_TE: + WM_main_add_notifier(NC_TEXTURE, NULL); + break; + case ID_WO: + WM_main_add_notifier(NC_WORLD, NULL); + break; + case ID_LA: + WM_main_add_notifier(NC_LAMP, NULL); + break; + } +} + + static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) { SpaceButs *sbuts= (SpaceButs*)(ptr->data); @@ -1203,7 +1225,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) /* note: custom set function is ONLY to avoid rna setting a user for this. */ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update"); prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT); |