[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27269] trunk/blender/source/blender/ makesrna/intern/rna_space.c: Patch #21459: Expose viewmat (in Region3DView) via the py API
Joshua Leung
aligorith at gmail.com
Fri Mar 5 04:16:22 CET 2010
Revision: 27269
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27269
Author: aligorith
Date: 2010-03-05 04:16:16 +0100 (Fri, 05 Mar 2010)
Log Message:
-----------
Patch #21459: Expose viewmat (in Region3DView) via the py API
Patch by Martin Burbaum (pontiac), with some changes from me
Added access to the View (from patch) and Perspective (additional change) matrices for 3D Regions in RNA.
Also, made these non editable for now (my change), since although users might need to get these matrices to make it easier to determine any projections that may be needed for funky operator drawing-hacks to be done, there is almost certainly no need for changing those matrices...
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_space.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c 2010-03-05 02:43:40 UTC (rev 27268)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c 2010-03-05 03:16:16 UTC (rev 27269)
@@ -805,6 +805,7 @@
{
StructRNA *srna;
PropertyRNA *prop;
+ int matrix_dimsize[]= {4, 4};
static EnumPropertyItem viewport_shading_items[] = {
{OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
@@ -1044,6 +1045,18 @@
RNA_def_property_boolean_sdna(prop, NULL, "viewlock", RV3D_BOXCLIP);
RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Region3DView_quadview_update");
+
+ prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "persmat");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
+ RNA_def_property_multi_array(prop, 2, matrix_dimsize);
+ RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
+
+ prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
+ RNA_def_property_float_sdna(prop, NULL, "viewmat");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
+ RNA_def_property_multi_array(prop, 2, matrix_dimsize);
+ RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");
}
static void rna_def_space_buttons(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list