[Bf-blender-cvs] [894c9f3] object_nodes: Added RNA function for debugging dupli bvm nodes.
Lukas Tönne
noreply at git.blender.org
Wed Dec 23 18:11:50 CET 2015
Commit: 894c9f3f85b6509f7e9116f2b5be687d44fd48a7
Author: Lukas Tönne
Date: Wed Dec 23 17:35:54 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB894c9f3f85b6509f7e9116f2b5be687d44fd48a7
Added RNA function for debugging dupli bvm nodes.
===================================================================
M source/blender/makesrna/intern/rna_object_api.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 258ad1f..f9b20e9 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -471,7 +471,7 @@ void rna_Object_dm_info(struct Object *ob, int type, char *result)
}
#endif /* NDEBUG */
-static void rna_Object_debug_nodes_graphviz(struct Object *ob, const char *filename)
+static void rna_Object_debug_geometry_nodes_graphviz(struct Object *ob, const char *filename)
{
FILE *f = fopen(filename, "w");
if (f == NULL)
@@ -499,6 +499,34 @@ static void rna_Object_debug_nodes_graphviz(struct Object *ob, const char *filen
fclose(f);
}
+static void rna_Object_debug_instancing_nodes_graphviz(struct Object *ob, const char *filename)
+{
+ FILE *f = fopen(filename, "w");
+ if (f == NULL)
+ return;
+
+ if (ob->nodetree) {
+ bNodeTree *duplitree = NULL;
+ bNode *node;
+
+ for (node = ob->nodetree->nodes.first; node; node = node->next) {
+ if (STREQ(node->idname, "InstancingNode")) {
+ duplitree = (bNodeTree *)node->id;
+ break;
+ }
+ }
+
+ if (duplitree) {
+ struct BVMFunction *fn;
+
+ fn = BVM_gen_dupli_function(duplitree, f);
+ BVM_function_free(fn);
+ }
+ }
+
+ fclose(f);
+}
+
static int rna_Object_update_from_editmode(Object *ob)
{
if (ob->mode & OB_MODE_EDIT) {
@@ -727,7 +755,12 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_output(func, parm);
#endif /* NDEBUG */
- func = RNA_def_function(srna, "debug_nodes_graphviz", "rna_Object_debug_nodes_graphviz");
+ func = RNA_def_function(srna, "debug_geometry_nodes_graphviz", "rna_Object_debug_geometry_nodes_graphviz");
+ parm = RNA_def_string_file_path(func, "filename", NULL, FILE_MAX, "File Name",
+ "File in which to store graphviz debug output");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
+ func = RNA_def_function(srna, "debug_instancing_nodes_graphviz", "rna_Object_debug_instancing_nodes_graphviz");
parm = RNA_def_string_file_path(func, "filename", NULL, FILE_MAX, "File Name",
"File in which to store graphviz debug output");
RNA_def_property_flag(parm, PROP_REQUIRED);
More information about the Bf-blender-cvs
mailing list