diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-12 15:03:50 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-12 15:03:50 +0400 |
commit | b7b14ac186e9172cd243f7d2d2d43eec9695a3a3 (patch) | |
tree | ff75836ee813aea68a460efc28f813eabe21e783 /source/blender/makesrna/intern | |
parent | ae09d2f9d87f0e22c62e58954ba6aadc39a24db0 (diff) |
Changing image ID datablock fomr browser in Image node didn't change output sockets
Which lead to either multilayer sockets hanging around when switching image from
multilayer to singlelayer, or missing layers outputs when switching from single
to multilayer image.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 6022929badc..0d460edd380 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1042,6 +1042,16 @@ static bNodeSocket *rna_NodeTree_output_expose(bNodeTree *ntree, ReportList *rep return NULL; } +static void rna_Image_Node_update_id(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNode *node = (bNode *)ptr->data; + + node->update |= NODE_UPDATE_ID; + node_update(bmain, scene, ntree, node); + node->update &= ~NODE_UPDATE_ID; +} + static void rna_Mapping_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) { bNode *node = ptr->data; @@ -2444,7 +2454,7 @@ static void def_cmp_image(StructRNA *srna) RNA_def_property_struct_type(prop, "Image"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Image_Node_update_id"); prop = RNA_def_property(srna, "use_straight_alpha_output", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT); |