diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-20 15:44:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-20 15:44:22 +0300 |
commit | 59e10bae3cee6fae17bae8a568291ae9b852087f (patch) | |
tree | a58c67e624b84315575ff68ae9774cb53e02cd91 /source/blender/makesrna/intern/rna_wm_manipulator.c | |
parent | 2530ae6c744ee30f0df28bfd46da0427881a01a3 (diff) |
Manipulator: add read-only matrix_world
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_manipulator.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_manipulator.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); |