Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-06-21 06:54:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-06-21 07:10:14 +0300
commitb7669ac1c672a92f31735ae9f92b369f9ba30eb1 (patch)
tree1747e45bcc61cd4c2fc02dd3f006f49b4a18ca2b /source/blender/editors/space_node/node_manipulators.c
parent5b51dcacbc81df6283518317c274bf897010e967 (diff)
Manipulators: move settings to ID properties
This makes manipulator access closer to operators, and allows Python access. This adds RNA for manipulators, but not Python registration yet. - Split draw style into 2x settings: `draw_style` (enum) & `draw_options` (enum-flag) - Rename wmManipulator.properties -> properties_edit, Use wmManipulator.properties for ID-properties. Note that this area of the API will need further work since manipulators now have 2 kinds of properties & API's to access them.
Diffstat (limited to 'source/blender/editors/space_node/node_manipulators.c')
-rw-r--r--source/blender/editors/space_node/node_manipulators.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_node/node_manipulators.c b/source/blender/editors/space_node/node_manipulators.c
index f1369fae94e..e3f699cabdf 100644
--- a/source/blender/editors/space_node/node_manipulators.c
+++ b/source/blender/editors/space_node/node_manipulators.c
@@ -63,11 +63,10 @@ static void WIDGETGROUP_node_transform_setup(const bContext *UNUSED(C), wmManipu
{
wmManipulatorWrapper *wwrapper = MEM_mallocN(sizeof(wmManipulatorWrapper), __func__);
- wwrapper->manipulator = WM_manipulator_new("MANIPULATOR_WT_cage_2d", mgroup, "backdrop_cage");
+ wwrapper->manipulator = WM_manipulator_new("MANIPULATOR_WT_cage_2d", mgroup, "backdrop_cage", NULL);
- ED_manipulator_cage2d_transform_set_style(
- wwrapper->manipulator,
- ED_MANIPULATOR_RECT_TRANSFORM_STYLE_TRANSLATE | ED_MANIPULATOR_RECT_TRANSFORM_STYLE_SCALE_UNIFORM);
+ RNA_enum_set(wwrapper->manipulator->ptr, "transform",
+ ED_MANIPULATOR_RECT_TRANSFORM_FLAG_TRANSLATE | ED_MANIPULATOR_RECT_TRANSFORM_FLAG_SCALE_UNIFORM);
mgroup->customdata = wwrapper;
}
@@ -84,10 +83,12 @@ static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmManipulatorG
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if (ibuf) {
- const float w = (ibuf->x > 0) ? ibuf->x : 64.0f;
- const float h = (ibuf->y > 0) ? ibuf->y : 64.0f;
+ const float dims[2] = {
+ (ibuf->x > 0) ? ibuf->x : 64.0f,
+ (ibuf->y > 0) ? ibuf->y : 64.0f,
+ };
- ED_manipulator_cage2d_transform_set_dims(cage, w, h);
+ RNA_float_set_array(cage->ptr, "dimensions", dims);
WM_manipulator_set_matrix_location(cage, origin);
WM_manipulator_set_flag(cage, WM_MANIPULATOR_HIDDEN, false);