[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57258] trunk/blender/source/blender/ makesrna/intern/rna_nodetree.c: Fix for frame node property display: Extended frame node properties such as the "shrink" option were not shown in the node editor sidebar.

Lukas Toenne lukas.toenne at googlemail.com
Wed Jun 5 22:10:16 CEST 2013


Revision: 57258
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57258
Author:   lukastoenne
Date:     2013-06-05 20:10:15 +0000 (Wed, 05 Jun 2013)
Log Message:
-----------
Fix for frame node property display: Extended frame node properties such as the "shrink" option were not shown in the node editor sidebar. This was because the RNA type for the node was not using
NodeInternal as a base, which is a wrapper to expose the C callbacks as methods in bpy. Now these basic node types are also based on NodeInternal to ensure the full interface is available to py scripts.

In the process removed the unused NodeGroup register function, this doesn't work nicely anyway because it requires multiple inheritance which RNA doesn't support (so py node groups should be done
entirely in python in the future).

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	2013-06-05 19:33:19 UTC (rev 57257)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2013-06-05 20:10:15 UTC (rev 57258)
@@ -1364,22 +1364,6 @@
 	return nt->ext.srna;
 }
 
-static StructRNA *rna_NodeGroup_register(Main *bmain, ReportList *reports,
-                                         void *data, const char *identifier,
-                                         StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
-{
-	bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_NodeGroup, data, identifier, validate, call, free);
-	if (!nt)
-		return NULL;
-	
-	nodeRegisterType(nt);
-	
-	/* update while blender is running */
-	WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
-	
-	return nt->ext.srna;
-}
-
 static StructRNA *rna_ShaderNode_register(Main *bmain, ReportList *reports,
                                           void *data, const char *identifier,
                                           StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
@@ -2862,8 +2846,6 @@
 {
 	PropertyRNA *prop;
 	
-	RNA_def_struct_register_funcs(srna, "rna_NodeGroup_register", "rna_Node_unregister", NULL);
-	
 	prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "id");
 	RNA_def_property_struct_type(prop, "NodeTree");
@@ -7233,6 +7215,10 @@
 	FunctionRNA *func;
 	PropertyRNA *parm;
 	
+	/* XXX hack, want to avoid "NodeInternal" prefix, so use "Node" in NOD_static_types.h and replace here */
+	if (STREQ(base_name, "Node"))
+		base_name = "NodeInternal";
+	
 	srna = RNA_def_struct(brna, struct_name, base_name);
 	RNA_def_struct_ui_text(srna, ui_name, ui_desc);
 	RNA_def_struct_sdna(srna, "bNode");




More information about the Bf-blender-cvs mailing list