[Bf-blender-cvs] [59e10bae3ce] blender2.8: Manipulator: add read-only matrix_world

Campbell Barton noreply at git.blender.org
Sun Aug 20 15:09:49 CEST 2017


Commit: 59e10bae3cee6fae17bae8a568291ae9b852087f
Author: Campbell Barton
Date:   Sun Aug 20 22:44:22 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB59e10bae3cee6fae17bae8a568291ae9b852087f

Manipulator: add read-only matrix_world

===================================================================

M	source/blender/makesrna/intern/rna_wm_manipulator.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_wm_manipulator.c b/source/blender/makesrna/intern/rna_wm_manipulator.c
index 5e19298764e..7c3562dad77 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator.c
@@ -363,6 +363,12 @@ RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_space, matrix_space, 16);
 RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_basis, matrix_basis, 16);
 RNA_MANIPULATOR_GENERIC_FLOAT_ARRAY_RW_DEF(matrix_offset, matrix_offset, 16);
 
+static void rna_Manipulator_matrix_world_get(PointerRNA *ptr, float value[16])
+{
+	wmManipulator *mpr = ptr->data;
+	WM_manipulator_calc_matrix_final(mpr, (float (*)[4])value);
+}
+
 RNA_MANIPULATOR_GENERIC_FLOAT_RW_DEF(scale_basis, scale_basis);
 RNA_MANIPULATOR_GENERIC_FLOAT_RW_DEF(line_width, line_width);
 
@@ -1019,6 +1025,12 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop)
 	RNA_def_property_float_funcs(prop, "rna_Manipulator_matrix_offset_get", "rna_Manipulator_matrix_offset_set", NULL);
 	RNA_def_property_update(prop, NC_SCREEN | NA_EDITED, NULL);
 
+	prop = RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX);
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+	RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
+	RNA_def_property_ui_text(prop, "Final World Matrix", "");
+	RNA_def_property_float_funcs(prop, "rna_Manipulator_matrix_world_get", NULL, NULL);
+
 	prop = RNA_def_property(srna, "scale_basis", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_ui_text(prop, "Scale Basis", "");
 	RNA_def_property_float_funcs(prop, "rna_Manipulator_scale_basis_get", "rna_Manipulator_scale_basis_set", NULL);



More information about the Bf-blender-cvs mailing list