diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2012-01-17 20:31:13 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2012-01-17 20:31:13 +0400 |
commit | a8081c1d2bb9115833493b011bb93d6c08112b2d (patch) | |
tree | 4383d080b80786257b291068e48a06bdb0ef5bd6 /source/blender/editors/space_image | |
parent | fcc54520d1f029b86cb8c6f43c239ef81090a99a (diff) |
Uv Tools branch GSOC 2011
=========================
Documentation: http://wiki.blender.org/index.php/User:Psy-Fi/UV_Tools
Major features include:
*16 bit image support in viewport
*Subsurf aware unwrapping
*Smart Stitch(snap/rotate islands, preview, middlepoint/endpoint stitching)
*Seams from islands tool (marks seams and sharp, depending on settings)
*Uv Sculpting(Grab/Pinch/Rotate)
All tools are complete apart from stitching that is considered stable but with an extra edge mode under development(will be in soc-2011-onion-uv-tools).
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 28 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 6 |
2 files changed, 31 insertions, 3 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index e7a139fe465..2a8a5b3452f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -178,6 +178,30 @@ int space_image_main_area_poll(bContext *C) return 0; } +/* For IMAGE_OT_curves_point_set to avoid sampling when in uv smooth mode */ +int space_image_main_area_not_uv_brush_poll(bContext *C) +{ + SpaceImage *sima= CTX_wm_space_image(C); + + ToolSettings *toolsettings = CTX_data_scene(C)->toolsettings; + if(sima && !toolsettings->uvsculpt) + return 1; + + return 0; +} + +static int space_image_image_sample_poll(bContext *C) +{ + SpaceImage *sima= CTX_wm_space_image(C); + Object *obedit= CTX_data_edit_object(C); + ToolSettings *toolsettings = CTX_data_scene(C)->toolsettings; + + if(obedit){ + if(ED_space_image_show_uvedit(sima, obedit) && (toolsettings->use_uv_sculpt)) + return 0; + } + return space_image_main_area_poll(C); +} /********************** view pan operator *********************/ typedef struct ViewPanData { @@ -1949,7 +1973,7 @@ void IMAGE_OT_sample(wmOperatorType *ot) ot->invoke= image_sample_invoke; ot->modal= image_sample_modal; ot->cancel= image_sample_cancel; - ot->poll= space_image_main_area_poll; + ot->poll= space_image_image_sample_poll; /* flags */ ot->flag= OPTYPE_BLOCKING; @@ -2086,7 +2110,7 @@ void IMAGE_OT_curves_point_set(wmOperatorType *ot) ot->invoke= image_sample_invoke; ot->modal= image_sample_modal; ot->cancel= image_sample_cancel; - ot->poll= space_image_main_area_poll; + ot->poll= space_image_main_area_not_uv_brush_poll; /* properties */ RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves"); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 66a38389555..fd7895052f1 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -773,6 +773,9 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar) keymap= WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); + keymap= WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); + /* own keymaps */ keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); @@ -785,6 +788,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ SpaceImage *sima= CTX_wm_space_image(C); + Object *obact= CTX_data_active_object(C); Object *obedit= CTX_data_edit_object(C); Scene *scene= CTX_data_scene(C); View2D *v2d= &ar->v2d; @@ -810,7 +814,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) /* and uvs in 0.0-1.0 space */ UI_view2d_view_ortho(v2d); - draw_uvedit_main(sima, ar, scene, obedit); + draw_uvedit_main(sima, ar, scene, obedit, obact); ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); |