[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32495] trunk/blender/source/blender/ makesrna/intern/rna_nodetree.c: Fix for [#23314] Comp node renaming breaks animation
Janne Karhu
jhkarh at gmail.com
Fri Oct 15 12:25:43 CEST 2010
Revision: 32495
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32495
Author: jhk
Date: 2010-10-15 12:25:43 +0200 (Fri, 15 Oct 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2010-10-15 09:32:40 UTC (rev 32494)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2010-10-15 10:25:43 UTC (rev 32495)
@@ -180,7 +180,7 @@
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 @@
/* 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 @@
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);
More information about the Bf-blender-cvs
mailing list