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:
authorJanne Karhu <jhkarh@gmail.com>2010-10-15 14:25:43 +0400
committerJanne Karhu <jhkarh@gmail.com>2010-10-15 14:25:43 +0400
commit44afd8ae5af40dfbff51503894e9c5754ce5657a (patch)
tree2ae3ae782f1fe0a3f13466c2c2a3a8f320f06654 /source/blender/makesrna/intern/rna_nodetree.c
parenta431b40de28c0bf79686fd14ea13bc72af01cf94 (diff)
Fix for [#23314] Comp node renaming breaks animation
* Old name was already overwritten before the update function, so changed the update function to a "set" function.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index ef56ad6a0c2..52a19c6376f 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -180,7 +180,7 @@ static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr)
node_update(bmain, scene, ntree, node);
}
-static void rna_Node_update_name(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Node_name_set(PointerRNA *ptr, const char *value)
{
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data;
@@ -188,14 +188,14 @@ static void rna_Node_update_name(Main *bmain, Scene *scene, PointerRNA *ptr)
/* make a copy of the old name first */
BLI_strncpy(oldname, node->name, sizeof(node->name));
+ /* set new name */
+ BLI_strncpy(node->name, value, sizeof(node->name));
nodeUniqueName(ntree, node);
node->flag |= NODE_CUSTOM_NAME;
/* fix all the animation data which may link to this */
BKE_all_animdata_fix_paths_rename("nodes", oldname, node->name);
-
- node_update(bmain, scene, ntree, node);
}
/* this should be done at display time! if no custom names are set */
@@ -2263,7 +2263,8 @@ static void rna_def_node(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Node name");
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update_name");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Node_name_set");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "inputs", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "inputs", NULL);