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>2012-07-25 14:39:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-25 14:39:54 +0400
commitc3a8894f57fc7560e54a344a4a16ed5b3886a688 (patch)
treed6e97a61a1a7994dfdf24215a8284453006e8d53 /source/blender/editors/space_image/image_edit.c
parent93f359604ce38166a188382b62ac1ba160790bc6 (diff)
wip mask/image commit, mostly internal function & added some TODO's
Diffstat (limited to 'source/blender/editors/space_image/image_edit.c')
-rw-r--r--source/blender/editors/space_image/image_edit.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 725c76d8bb6..1c488fe4ac7 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -28,13 +28,15 @@
* \ingroup spimage
*/
+#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
-#include "BKE_image.h"
+#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_tessmesh.h"
@@ -79,6 +81,20 @@ void ED_space_image_set(SpaceImage *sima, Scene *scene, Object *obedit, Image *i
WM_main_add_notifier(NC_SPACE | ND_SPACE_IMAGE, NULL);
}
+Mask *ED_space_image_get_mask(SpaceImage *sima)
+{
+ return sima->mask_info.mask;
+}
+
+void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
+{
+ sima->mask_info.mask = mask;
+
+ if (C) {
+ WM_event_add_notifier(C, NC_MASK | NA_SELECTED, mask);
+ }
+}
+
ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **lock_r)
{
ImBuf *ibuf;
@@ -279,6 +295,40 @@ int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit)
return 0;
}
+/* matches clip function */
+int ED_space_image_check_show_maskedit(SpaceImage *sima)
+{
+ /* MASKTODO - whem we have a mask edit option */
+ (void)sima;
+ return TRUE;
+}
+
+int ED_space_image_maskedit_poll(bContext *C)
+{
+ SpaceImage *sima = CTX_wm_space_image(C);
+
+ if (sima && sima->image) {
+ return ED_space_image_check_show_maskedit(sima);
+ }
+
+ return FALSE;
+}
+
+int ED_space_image_maskedit_mask_poll(bContext *C)
+{
+ if (ED_space_image_maskedit_poll(C)) {
+ Image *ima = CTX_data_edit_image(C);
+
+ if (ima) {
+ SpaceImage *sima = CTX_wm_space_image(C);
+
+ return sima->mask_info.mask != NULL;
+ }
+ }
+
+ return FALSE;
+}
+
/******************** TODO ********************/
/* XXX notifier? */