"Fix" for #35336. Added a warning in the doc string for nodetree.nodes.new() to point users at the recent API change from node.type enum identifiers to the generic node.bl_idname strings. Not really nice, but could prevent a few bug reports and make scripters' lifes easier.

This commit is contained in:
Lukas Toenne
2013-05-14 11:18:45 +00:00
parent bbea18f8c1
commit e4921a9664

View File

@@ -6888,7 +6888,10 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_NodeTree_node_new");
RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_string(func, "type", "", MAX_NAME, "Type", "Type of node to add");
/* XXX warning note should eventually be removed,
* added this here to avoid frequent confusion with API changes from "type" to "bl_idname"
*/
parm = RNA_def_string(func, "type", "", MAX_NAME, "Type", "Type of node to add (Warning: should be same as node.bl_idname, not node.type!)");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
parm = RNA_def_pointer(func, "node", "Node", "", "New node");