diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-02-13 04:13:16 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-02-13 04:13:16 +0300 |
commit | 135a944c66c57f11fd77b4f7231686353112e7ac (patch) | |
tree | 3928c457f44f544113e84b3356ab101e3820072e /source/blender/editors/space_image/image_ops.c | |
parent | 1b3948f9aad25fec1923f5ccd36ea525d8e34fb6 (diff) | |
parent | 33b1cbf06d2c822c68676390b1775eb5d78de6e6 (diff) |
Merged changes in the trunk up to revision 26856.
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 2011649fda6..4a2dd52384c 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. @@ -1791,6 +1791,51 @@ void IMAGE_OT_record_composite(wmOperatorType *ot) ot->poll= space_image_poll; } +/********************* cycle render slot operator *********************/ + +static int cycle_render_slot_poll(bContext *C) +{ + Image *ima= CTX_data_edit_image(C); + + return (ima && ima->type == IMA_TYPE_R_RESULT); +} + +static int cycle_render_slot_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + int a, slot, cur= RE_GetViewSlot(); + + for(a=1; a<RE_SLOT_MAX; a++) { + slot= (cur+a)%RE_SLOT_MAX; + + if(RE_GetRender(scene->id.name, slot)) { + RE_SetViewSlot(slot); + break; + } + } + + if(a == RE_SLOT_MAX) + RE_SetViewSlot((cur == 1)? 0: 1); + + WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL); + + return OPERATOR_FINISHED; +} + +void IMAGE_OT_cycle_render_slot(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Cycle Render Slot"; + ot->idname= "IMAGE_OT_cycle_render_slot"; + + /* api callbacks */ + ot->exec= cycle_render_slot_exec; + ot->poll= cycle_render_slot_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /******************** TODO ********************/ /* XXX notifier? */ @@ -1843,3 +1888,4 @@ void BIF_image_update_frame(void) } #endif + |