42
39
#include <config.h>
42
#include "DNA_brush_types.h"
45
43
#include "DNA_ID.h"
46
44
#include "DNA_image_types.h"
47
#include "DNA_mesh_types.h"
48
#include "DNA_object_types.h"
49
#include "DNA_packedFile_types.h"
50
45
#include "DNA_scene_types.h"
51
46
#include "DNA_screen_types.h"
52
47
#include "DNA_space_types.h"
48
#include "DNA_texture_types.h"
53
49
#include "DNA_userdef_types.h"
50
#include "DNA_customdata_types.h" /* for UV layer menu */
52
#include "BLI_arithb.h"
53
#include "BLI_blenlib.h"
55
55
#include "BDR_drawmesh.h"
56
56
#include "BDR_unwrapper.h"
58
#include "BKE_brush.h"
59
#include "BKE_colortools.h"
57
60
#include "BKE_global.h"
58
61
#include "BKE_image.h"
59
#include "BKE_library.h"
60
62
#include "BKE_main.h"
61
#include "BKE_packedFile.h"
62
63
#include "BKE_utildefines.h"
63
#include "BKE_depsgraph.h"
64
#include "BLI_editVert.h" /* for UV layer menu */
65
#include "BKE_customdata.h" /* ditto */
65
#include "BLI_blenlib.h"
67
#include "BIF_butspace.h"
66
68
#include "BIF_drawimage.h"
67
69
#include "BIF_editsima.h"
70
#include "BIF_imasel.h"
68
71
#include "BIF_interface.h"
69
#include "BIF_previewrender.h"
70
72
#include "BIF_resources.h"
71
73
#include "BIF_screen.h"
72
74
#include "BIF_space.h"
73
#include "BIF_toets.h"
75
#include "BIF_transform.h"
74
76
#include "BIF_toolbox.h"
75
#include "BIF_transform.h"
76
#include "BIF_writeimage.h"
77
#include "BIF_editmesh.h"
79
#include "BSE_drawview.h"
78
80
#include "BSE_filesel.h"
79
81
#include "BSE_headerbuttons.h"
82
#include "BSE_trans_types.h"
81
85
#include "BPY_extern.h"
82
86
#include "BPY_menus.h"
84
#include "IMB_imbuf.h"
85
88
#include "IMB_imbuf_types.h"
86
#include "BSE_trans_types.h"
90
#include "RE_pipeline.h"
88
92
#include "blendef.h"
89
94
#include "mydevice.h"
91
static void load_space_image(char *str) /* called from fileselect */
96
error("Can't perfom this in editmode");
105
free_image_buffers(ima); /* force read again */
107
image_changed(G.sima, 0);
110
BIF_undo_push("Load image UV");
111
allqueue(REDRAWIMAGE, 0);
114
static void image_replace(Image *old, Image *new)
120
new->tpageflag= old->tpageflag;
121
new->twsta= old->twsta;
122
new->twend= old->twend;
123
new->xrep= old->xrep;
124
new->yrep= old->yrep;
126
me= G.main->mesh.first;
133
if(tface->tpage==old) {
144
if(new->id.us==0) new->id.us= 1;
146
else error("Nothing replaced");
149
static void replace_space_image(char *str) /* called from fileselect */
154
error("Can't perfom this in editmode");
161
if(G.sima->image && G.sima->image != ima) {
162
image_replace(G.sima->image, ima);
167
free_image_buffers(ima); /* force read again */
169
/* replace also assigns: */
170
image_changed(G.sima, 0);
173
BIF_undo_push("Replace image UV");
174
allqueue(REDRAWIMAGE, 0);
177
static void save_paint(char *name)
179
Image *ima = G.sima->image;
181
char str[FILE_MAXDIR+FILE_MAXFILE];
183
if (ima && ima->ibuf) {
184
BLI_strncpy(str, name, sizeof(str));
186
BLI_convertstringcode(str, G.sce, G.scene->r.cfra);
188
if(G.scene->r.scemode & R_EXTENSION)
189
BKE_add_image_extension(str, G.scene->r.imtype);
193
/* enforce user setting for RGB or RGBA, but skip BW */
194
if(G.scene->r.planes==32)
195
ima->ibuf->depth= 32;
196
else if(G.scene->r.planes==24)
197
ima->ibuf->depth= 24;
200
if (BKE_write_ibuf(ima->ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality)) {
201
BLI_strncpy(ima->name, name, sizeof(ima->name));
202
ima->ibuf->userflags &= ~IB_BITMAPDIRTY;
203
allqueue(REDRAWHEADERS, 0);
204
allqueue(REDRAWBUTSSHADING, 0);
206
error("Couldn't write image: %s", str);
209
/* name image as how we saved it */
211
while (len > 0 && str[len - 1] != '/' && str[len - 1] != '\\') len--;
212
rename_id(&ima->id, str+len);
219
96
void do_image_buttons(unsigned short event)
98
ToolSettings *settings= G.scene->toolsettings;
226
102
if(curarea->win==0) return;
105
if(event<=50) do_global_buttons2(event);
106
else do_global_buttons(event);
112
allqueue (REDRAWIMAGE, 0);
229
114
case B_SIMAGEHOME:
233
118
case B_SIMABROWSE:
234
119
if(G.sima->imanr== -2) {
235
activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
236
&G.sima->imanr, do_image_buttons);
120
if(G.qual & LR_CTRLKEY) {
121
activate_databrowse_imasel((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
122
&G.sima->imanr, do_image_buttons);
124
activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE,
125
&G.sima->imanr, do_image_buttons);
239
129
if(G.sima->imanr < 0) break;
242
132
id= (ID *)G.sima->image;
244
idtest= G.main->image.first;
246
if(nr==G.sima->imanr) {
250
idtest= idtest->next;
252
if(idtest==0) { /* no new */
134
idtest= BLI_findlink(&G.main->image, G.sima->imanr-1);
135
if(idtest==NULL) { /* no new */
257
140
G.sima->image= (Image *)idtest;
258
141
if(idtest->us==0) idtest->us= 1;
142
BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE);
259
143
allqueue(REDRAWIMAGE, 0);
261
145
/* also when image is the same: assign! 0==no tileflag: */
262
image_changed(G.sima, 0);
146
image_changed(G.sima, (Image *)idtest);
263
147
BIF_undo_push("Assign image UV");
268
if(G.sima->image) strcpy(name, G.sima->image->name);
269
else strcpy(name, U.textudir);
271
if(G.qual==LR_CTRLKEY)
272
activate_imageselect(FILE_SPECIAL, "SELECT IMAGE", name, load_space_image);
274
activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name, load_space_image);
277
case B_SIMAGEREPLACE:
279
if(G.sima->image) strcpy(name, G.sima->image->name);
280
else strcpy(name, U.textudir);
282
if(G.qual==LR_CTRLKEY)
283
activate_imageselect(FILE_SPECIAL, "REPLACE IMAGE", name, replace_space_image);
285
activate_fileselect(FILE_SPECIAL, "REPLACE IMAGE", name, replace_space_image);
290
if(G.f & G_FACESELECT) {
291
make_repbind(G.sima->image);
292
image_changed(G.sima, 1);
294
allqueue(REDRAWVIEW3D, 0);
295
allqueue(REDRAWIMAGE, 0);
299
image_changed(G.sima, 2); /* 2: only tileflag */
300
allqueue(REDRAWVIEW3D, 0);
301
allqueue(REDRAWIMAGE, 0);
307
if(ima->flag & IMA_TWINANIM) {
308
nr= ima->xrep*ima->yrep;
309
if(ima->twsta>=nr) ima->twsta= 1;
310
if(ima->twend>=nr) ima->twend= nr-1;
311
if(ima->twsta>ima->twend) ima->twsta= 1;
312
allqueue(REDRAWIMAGE, 0);
151
image_set_tile(G.sima, 1); /* 1: only tileflag */
152
allqueue(REDRAWVIEW3D, 0);
153
allqueue(REDRAWIMAGE, 0);
155
case B_SIMA3DVIEWDRAW:
156
allqueue(REDRAWVIEW3D, 0);
158
case B_SIMA_REDR_IMA_3D:
159
allqueue(REDRAWVIEW3D, 0);
160
allqueue(REDRAWIMAGE, 0);
317
162
case B_SIMAGEPAINTTOOL:
318
// check for packed file here
163
if(G.sima->flag & SI_DRAWTOOL)
164
/* add new brush if none exists */
165
brush_check_exists(&G.scene->toolsettings->imapaint.brush);
166
allqueue(REDRAWBUTSSHADING, 0);
319
167
allqueue(REDRAWIMAGE, 0);
320
168
allqueue(REDRAWVIEW3D, 0);
322
171
case B_SIMAPACKIMA:
325
if (ima->packedfile) {
326
if (G.fileflags & G_AUTOPACK) {
327
if (okee("Disable AutoPack ?")) {
328
G.fileflags &= ~G_AUTOPACK;
332
if ((G.fileflags & G_AUTOPACK) == 0) {
333
unpackImage(ima, PF_ASK);
336
if (ima->ibuf && (ima->ibuf->userflags & IB_BITMAPDIRTY)) {
337
error("Can't pack painted image. Save image first.");
339
ima->packedfile = newPackedFile(ima->name);
342
allqueue(REDRAWBUTSSHADING, 0);
343
allqueue(REDRAWHEADERS, 0);
349
strcpy(name, ima->name);
352
save_image_filesel_str(str);
354
/* so it shows extension in file window */
355
if(G.scene->r.scemode & R_EXTENSION)
356
BKE_add_image_extension(name, G.scene->r.imtype);
358
activate_fileselect(FILE_SPECIAL, str, name, save_paint);
176
BKE_image_memorypack(G.sima->image);
177
allqueue(REDRAWIMAGE, 0);
362
180
case B_SIMA_USE_ALPHA:
363
181
G.sima->flag &= ~(SI_SHOW_ALPHA|SI_SHOW_ZBUF);
364
182
scrarea_queue_winredraw(curarea);
374
192
scrarea_queue_winredraw(curarea);
375
193
scrarea_queue_headredraw(curarea);
204
char str[FILE_MAXDIR+FILE_MAXFILE];
206
/* name in ima has been changed by button! */
207
BLI_strncpy(str, G.sima->image->name, sizeof(str));
208
ima= BKE_add_image_file(str);
210
BKE_image_signal(ima, &G.sima->iuser, IMA_SIGNAL_RELOAD);
211
image_changed(G.sima, ima);
213
BIF_undo_push("Load image");
214
allqueue(REDRAWIMAGE, 0);
218
if(G.sima && G.sima->image) {
219
BKE_image_multilayer_index(G.sima->image->rr, &G.sima->iuser);
220
allqueue(REDRAWIMAGE, 0);
224
image_editvertex_buts(NULL);
227
image_editcursor_buts(NULL);
237
if(ima->flag & IMA_TWINANIM) {
238
nr= ima->xrep*ima->yrep;
239
if(ima->twsta>=nr) ima->twsta= 1;
240
if(ima->twend>=nr) ima->twend= nr-1;
241
if(ima->twsta>ima->twend) ima->twsta= 1;
242
allqueue(REDRAWIMAGE, 0);
247
case B_SIMACLONEBROWSE:
248
if (settings->imapaint.brush)
249
if (brush_clone_image_set_nr(settings->imapaint.brush, G.sima->menunr))
250
allqueue(REDRAWIMAGE, 0);
253
case B_SIMACLONEDELETE:
254
if (settings->imapaint.brush)
255
if (brush_clone_image_delete(settings->imapaint.brush))
256
allqueue(REDRAWIMAGE, 0);
259
case B_SIMABRUSHCHANGE:
260
allqueue(REDRAWIMAGE, 0);
261
allqueue(REDRAWBUTSEDIT, 0);
265
curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima));
266
allqueue(REDRAWIMAGE, 0);
270
curvemapping_set_black_white(G.sima->cumap, NULL, NULL);
271
curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima));
272
allqueue(REDRAWIMAGE, 0);
275
case B_SIMABRUSHBROWSE:
276
if(G.sima->menunr==-2) {
277
activate_databrowse((ID*)settings->imapaint.brush, ID_BR, 0, B_SIMABRUSHBROWSE, &G.sima->menunr, do_global_buttons);
280
else if(G.sima->menunr < 0) break;
282
if(brush_set_nr(&settings->imapaint.brush, G.sima->menunr)) {
283
BIF_undo_push("Browse Brush");
284
allqueue(REDRAWBUTSEDIT, 0);
285
allqueue(REDRAWIMAGE, 0);
288
case B_SIMABRUSHDELETE:
289
if(brush_delete(&settings->imapaint.brush)) {
290
BIF_undo_push("Unlink Brush");
291
allqueue(REDRAWIMAGE, 0);
292
allqueue(REDRAWBUTSEDIT, 0);
296
brush_toggled_fake_user(settings->imapaint.brush);
297
allqueue(REDRAWIMAGE, 0);
298
allqueue(REDRAWBUTSEDIT, 0);
300
case B_SIMABRUSHLOCAL:
301
if(settings->imapaint.brush && settings->imapaint.brush->id.lib) {
302
if(okee("Make local")) {
303
make_local_brush(settings->imapaint.brush);
304
allqueue(REDRAWIMAGE, 0);
305
allqueue(REDRAWBUTSEDIT, 0);
309
case B_SIMABTEXBROWSE:
310
if(settings->imapaint.brush) {
311
Brush *brush= settings->imapaint.brush;
313
if(G.sima->menunr==-2) {
314
MTex *mtex= brush->mtex[brush->texact];
315
ID *id= (ID*)((mtex)? mtex->tex: NULL);
316
if(G.qual & LR_CTRLKEY) {
317
activate_databrowse_imasel(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons);
319
activate_databrowse(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons);
323
else if(G.sima->menunr < 0) break;
325
if(brush_texture_set_nr(brush, G.sima->menunr)) {
326
BIF_undo_push("Browse Brush Texture");
327
allqueue(REDRAWBUTSSHADING, 0);
328
allqueue(REDRAWBUTSEDIT, 0);
329
allqueue(REDRAWIMAGE, 0);
333
case B_SIMABTEXDELETE:
334
if(settings->imapaint.brush) {
335
if (brush_texture_delete(settings->imapaint.brush)) {
336
BIF_undo_push("Unlink Brush Texture");
337
allqueue(REDRAWBUTSSHADING, 0);
338
allqueue(REDRAWBUTSEDIT, 0);
339
allqueue(REDRAWIMAGE, 0);
347
imagespace_composite_flipbook(curarea);
352
static void do_image_buttons_set_uvlayer_callback(void *act, void *data)
354
CustomData_set_layer_active(&G.editMesh->fdata, CD_MTFACE, *((int *)act));
356
BIF_undo_push("Set Active UV Texture");
357
allqueue(REDRAWVIEW3D, 0);
358
allqueue(REDRAWBUTSEDIT, 0);
359
allqueue(REDRAWIMAGE, 0);
380
362
static void do_image_view_viewnavmenu(void *arg, int event)
498
473
block= uiNewBlock(&curarea->uiblocks, "image_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
499
474
uiBlockSetButmFunc(block, do_image_viewmenu, NULL);
501
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
502
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
476
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
477
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Image Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
478
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Real-time Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
479
if (G.sima->image && (G.sima->flag & SI_DRAWTOOL)) {
480
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
503
482
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Curves Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
504
483
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Composite Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
506
if(G.sima->flag & SI_COORDFLOATS) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Display Normalized Coordinates|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
507
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Display Normalized Coordinates|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
508
if(G.f & G_DRAWFACES) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Draw Faces", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
509
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Draw Faces|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
510
if(G.sima->flag & SI_DRAWSHADOW) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Draw Shadow Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
511
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Draw Shadow Mesh|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
485
if(G.sima->flag & SI_LOCAL_UV) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
486
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
487
if(!(G.sima->flag & SI_LOCAL_UV)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
488
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
513
490
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
514
492
uiDefIconTextBlockBut(block, image_view_viewnavmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, "");
516
494
if(G.sima->lock) {
600
561
block= uiNewBlock(&curarea->uiblocks, "image_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
601
562
uiBlockSetButmFunc(block, do_image_selectmenu, NULL);
603
if(G.sima->flag & SI_SELACTFACE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
604
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
606
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
608
if(G.sima->flag & SI_LOCALSTICKY) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
609
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
611
if(G.sima->flag & SI_STICKYUVS) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
612
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
614
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
565
if ((G.sima->flag & SI_SYNC_UVSEL)==0 || (G.sima->flag & SI_SYNC_UVSEL && (G.scene->selectmode != SCE_SELECT_FACE))) {
566
if(G.sima->flag & SI_SELACTFACE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
567
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
569
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
616
572
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
617
573
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Pinned|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
678
636
static void do_image_imagemenu(void *arg, int event)
638
/* events >=20 are registered bpython scripts */
639
if (event >= 20) BPY_menu_do_python(PYMENU_IMAGE, event - 20);
686
if(G.sima->image) strcpy(name, G.sima->image->name);
687
else strcpy(name, U.textudir);
688
if(G.qual==LR_CTRLKEY)
689
activate_imageselect(FILE_SPECIAL, "Open Image", name, load_space_image);
691
activate_fileselect(FILE_SPECIAL, "Open Image", name, load_space_image);
693
case 1: /* Replace */
694
if(G.sima->image) strcpy(name, G.sima->image->name);
695
else strcpy(name, U.textudir);
697
if(G.qual==LR_CTRLKEY)
698
activate_imageselect(FILE_SPECIAL, "Replace Image", name, replace_space_image);
700
activate_fileselect(FILE_SPECIAL, "Replace Image", name, replace_space_image);
702
case 2: /* Pack Image */
705
if (ima->packedfile) {
706
error("Image is already packed.");
708
if (ima->ibuf && (ima->ibuf->userflags & IB_BITMAPDIRTY)) {
709
error("Can't pack painted image. Save the painted image first.");
711
ima->packedfile = newPackedFile(ima->name);
715
BIF_undo_push("Pack image");
716
allqueue(REDRAWBUTSSHADING, 0);
717
allqueue(REDRAWHEADERS, 0);
719
case 3: /* Unpack Image */
722
if (ima->packedfile) {
723
if (G.fileflags & G_AUTOPACK) {
724
if (okee("Disable AutoPack?")) {
725
G.fileflags &= ~G_AUTOPACK;
729
if ((G.fileflags & G_AUTOPACK) == 0) {
730
unpackImage(ima, PF_ASK);
733
error("There are no packed images to unpack");
736
BIF_undo_push("Unpack image");
737
allqueue(REDRAWBUTSSHADING, 0);
738
allqueue(REDRAWHEADERS, 0);
644
open_image_sima((G.qual==LR_CTRLKEY));
647
replace_image_sima((G.qual==LR_CTRLKEY));
740
652
case 4: /* Texture Painting */
653
brush_check_exists(&G.scene->toolsettings->imapaint.brush);
741
654
if(G.sima->flag & SI_DRAWTOOL) G.sima->flag &= ~SI_DRAWTOOL;
742
655
else G.sima->flag |= SI_DRAWTOOL;
744
case 5: /* Save Painted Image */
747
strcpy(name, ima->name);
750
save_image_filesel_str(str);
752
/* so it shows an extension in filewindow */
753
if(G.scene->r.scemode & R_EXTENSION)
754
BKE_add_image_extension(name, G.scene->r.imtype);
756
activate_fileselect(FILE_SPECIAL, str, name, save_paint);
760
case 6: /* Reload Image */
763
if (ima->packedfile) {
765
pf = newPackedFile(ima->name);
767
freePackedFile(ima->packedfile);
768
ima->packedfile = pf;
771
error("Image not available. Keeping packed image.");
774
free_image_preview(ima);
776
free_image_buffers(ima); /* force read again */
778
image_changed(G.sima, 0);
656
allqueue(REDRAWBUTSSHADING, 0);
659
save_as_image_sima();
671
save_image_sequence_sima();
674
BKE_image_memorypack(G.sima->image);
780
675
allqueue(REDRAWIMAGE, 0);
781
allqueue(REDRAWVIEW3D, 0);
782
BIF_preview_changed(ID_TE);
784
case 7: /* New Image */
786
static int width= 256, height= 256;
787
static short uvtestgrid=0;
790
strcpy(name, "Image");
792
add_numbut(0, TEX, "Name:", 0, 255, name, NULL);
793
add_numbut(1, NUM|INT, "Width:", 1, 5000, &width, NULL);
794
add_numbut(2, NUM|INT, "Height:", 1, 5000, &height, NULL);
795
add_numbut(3, TOG|SHO, "UV Test Grid", 0, 0, &uvtestgrid, NULL);
796
if (!do_clever_numbuts("New Image", 4, REDRAW))
799
G.sima->image= new_image(width, height, name, uvtestgrid);
800
image_changed(G.sima, 0);
802
allqueue(REDRAWIMAGE, 0);
803
allqueue(REDRAWVIEW3D, 0);
810
680
static uiBlock *image_imagemenu(void *arg_unused)
682
ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
813
684
short yco= 0, menuwidth=150;
815
688
block= uiNewBlock(&curarea->uiblocks, "image_imagemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
816
689
uiBlockSetButmFunc(block, do_image_imagemenu, NULL);
818
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
819
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
691
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New...|Alt N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
692
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
821
694
if (G.sima->image) {
695
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
696
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
697
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
699
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
822
700
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
823
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
824
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
701
if(G.sima->image->source==IMA_SRC_SEQUENCE)
702
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Changed Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
826
703
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
828
705
if (G.sima->image->packedfile) {
829
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
706
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
831
708
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Image", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
711
/* only for dirty && specific image types */
712
if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
713
if( ELEM(G.sima->image->source, IMA_SRC_FILE, IMA_SRC_GENERATED))
714
if(G.sima->image->type!=IMA_TYPE_MULTILAYER)
715
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Image as PNG", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
834
717
uiDefBut(block, SEPR, 0, "", 0, yco-=7, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
836
719
if(G.sima->flag & SI_DRAWTOOL) {
1015
917
uiBlockSetButmFunc(block, do_image_uvs_weldalignmenu, NULL);
1017
919
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Weld|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
1018
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align X|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
1019
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Y|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
1021
uiBlockSetDirection(block, UI_RIGHT);
1022
uiTextBoundsBlock(block, 60);
920
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Auto|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
921
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align X|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
922
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Y|W, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
924
uiBlockSetDirection(block, UI_RIGHT);
925
uiTextBoundsBlock(block, 60);
929
static void do_image_uvs_scriptsmenu(void *arg, int event)
931
BPY_menu_do_python(PYMENU_UV, event);
933
allqueue(REDRAWIMAGE, 0);
936
static uiBlock *image_uvs_scriptsmenu (void *args_unused)
941
short yco = 20, menuwidth = 120;
943
block= uiNewBlock(&curarea->uiblocks, "image_uvs_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
944
uiBlockSetButmFunc(block, do_image_uvs_scriptsmenu, NULL);
946
/* note that we acount for the N previous entries with i+20: */
947
for (pym = BPyMenuTable[PYMENU_UV]; pym; pym = pym->next, i++) {
949
uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19,
950
NULL, 0.0, 0.0, 1, i,
951
pym->tooltip?pym->tooltip:pym->filename);
954
uiBlockSetDirection(block, UI_RIGHT);
955
uiTextBoundsBlock(block, 60);
1026
960
static void do_image_uvsmenu(void *arg, int event)
1028
/* events >=20 are registered bpython scripts */
1029
if (event >= 20) BPY_menu_do_python(PYMENU_UV, event - 20);
964
// case 0: /* UV Transform Properties Panel... */
965
// add_blockhandler(curarea, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_UNSTOW);
1033
967
case 1: /* UVs Constrained Rectangular */
1034
968
if(G.sima->flag & SI_BE_SQUARE) G.sima->flag &= ~SI_BE_SQUARE;
1035
969
else G.sima->flag |= SI_BE_SQUARE;
1104
1042
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1044
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Islands|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
1045
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Average Islands Scale|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
1106
1046
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Minimize Stretch|Ctrl V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
1107
1047
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Limit Stitch...|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
1108
1048
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Stitch|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
1050
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1109
1052
uiDefIconTextBlockBut(block, image_uvs_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
1111
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1113
1053
uiDefIconTextBlockBut(block, image_uvs_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
1114
1054
uiDefIconTextBlockBut(block, image_uvs_weldalignmenu, NULL, ICON_RIGHTARROW_THIN, "Weld/Align", 0, yco-=20, 120, 19, "");
1194
1140
uiDefPulldownBut(block, image_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
1197
xmax= GetButStringLength("Select");
1198
uiDefPulldownBut(block, image_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
1202
xmax= GetButStringLength("Image");
1203
uiDefPulldownBut(block, image_imagemenu, NULL, "Image", xco, -2, xmax-3, 24, "");
1206
xmax= GetButStringLength("UVs");
1207
uiDefPulldownBut(block, image_uvsmenu, NULL, "UVs", xco, -2, xmax-3, 24, "");
1143
if((EM_texFaceCheck()) && !(ima && (G.sima->flag & SI_DRAWTOOL))) {
1144
xmax= GetButStringLength("Select");
1145
uiDefPulldownBut(block, image_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
1149
if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
1153
xmax= GetButStringLength(menuname);
1154
uiDefPulldownBut(block, image_imagemenu, NULL, menuname, xco, -2, xmax-3, 24, "");
1156
if((EM_texFaceCheck()) && !(ima && (G.sima->flag & SI_DRAWTOOL))) {
1157
xmax= GetButStringLength("UVs");
1158
uiDefPulldownBut(block, image_uvsmenu, NULL, "UVs", xco, -2, xmax-3, 24, "");
1211
1163
/* other buttons: */
1212
1164
uiBlockSetEmboss(block, UI_EMBOSS);
1214
xco= std_libbuttons(block, xco, 0, 0, NULL, B_SIMABROWSE, ID_IM, 0, (ID *)G.sima->image, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
1169
xco= 8 + std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
1171
if( ima && !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) {
1216
if (G.sima->image) {
1219
if (G.sima->image->packedfile) {
1173
if (ima->packedfile) {
1220
1174
headerbuttons_packdummy = 1;
1222
uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
1176
if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
1177
uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
1179
uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
1184
/* UV EditMode buttons, not painting or rencering or compositing */
1185
if ( EM_texFaceCheck() && (G.sima->flag & SI_DRAWTOOL)==0 && !is_render) {
1189
uiDefIconTextButS(block, ICONTEXTROW, B_NOP, ICON_ROTATE,
1190
"Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1",
1191
xco,0,XIC+10,YIC, &(G.v2d->around), 0, 3.0, 0, 0,
1192
"Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period)");
1196
uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_EDIT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync UV and Mesh Selection");
1198
if (G.sima->flag & SI_SYNC_UVSEL) {
1199
uiBlockBeginAlign(block);
1201
/* B_SEL_VERT & B_SEL_FACE are not defined here which is a bit bad, BUT it works even if image editor is fullscreen */
1202
uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)");
1205
/*uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Edge select mode (Ctrl Tab 2)");
1207
uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)");
1209
uiBlockEndAlign(block);
1212
uiBlockBeginAlign(block);
1213
uiDefIconButBitI(block, TOGN, SI_SELACTFACE, B_REDR, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.sima->flag, 1.0, 0.0, 0, 0, "UV Vertex select mode");
1215
uiDefIconButBitI(block, TOG, SI_SELACTFACE, B_REDR, ICON_FACESEL, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "UV Face select mode");
1217
uiBlockEndAlign(block);
1219
/* would use these if const's could go in strings
1220
* SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */
1221
ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC,
1222
"Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2",
1223
xco,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0,
1224
"Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)");
1229
/* Snap copied right out of view3d header */
1230
uiBlockBeginAlign(block);
1232
if (G.scene->snap_flag & SCE_SNAP) {
1233
uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)");
1235
uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode");
1238
uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)");
1242
uiBlockEndAlign(block);
1247
layercount = CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE);
1248
if (layercount>1 && layercount < 12) { /* could allow any number but limit of 11 means no malloc needed */
1250
char str_menu[384], *str_pt; /*384 allows for 11 layers */
1253
act = CustomData_get_active_layer(&G.editMesh->fdata, CD_MTFACE);
1255
/*str_pt = (char *)MEM_mallocN(layercount*40 , "uvmenu"); str[0]='\0';*/
1258
mesh_layers_menu_concat(&G.editMesh->fdata, CD_MTFACE, str_pt);
1259
ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,85,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing");
1260
uiButSetFunc(ubut, do_image_buttons_set_uvlayer_callback, &act, NULL);
1268
RenderResult *rr= BKE_image_get_renderresult(ima);
1273
uiBlockBeginAlign(block);
1274
uiblock_layer_pass_buttons(block, rr, &G.sima->iuser, B_REDR, xco, 0, 160);
1275
uiBlockEndAlign(block);
1225
1278
uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button");
1228
1282
uiBlockBeginAlign(block);
1229
uiDefIconButBitI(block, TOG, SI_USE_ALPHA, B_SIMA_USE_ALPHA, ICON_TRANSP_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws image with alpha");
1231
uiDefIconButBitI(block, TOG, SI_SHOW_ALPHA, B_SIMA_SHOW_ALPHA, ICON_DOT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws only alpha");
1233
if(G.sima->image->ibuf) {
1234
if(G.sima->image->ibuf->zbuf || G.sima->image->ibuf->zbuf_float) {
1235
uiDefIconButBitI(block, TOG, SI_SHOW_ZBUF, B_SIMA_SHOW_ZBUF, ICON_SOLID, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws zbuffer values");
1283
if(ibuf==NULL || ibuf->channels==4) {
1284
uiDefIconButBitI(block, TOG, SI_USE_ALPHA, B_SIMA_USE_ALPHA, ICON_TRANSP_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws image with alpha");
1286
uiDefIconButBitI(block, TOG, SI_SHOW_ALPHA, B_SIMA_SHOW_ALPHA, ICON_DOT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws only alpha");
1290
if(ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)) {
1291
uiDefIconButBitI(block, TOG, SI_SHOW_ZBUF, B_SIMA_SHOW_ZBUF, ICON_SOLID, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws zbuffer values (mapped from camera clip start to end)");
1238
else G.sima->flag &= ~SI_SHOW_ZBUF; /* no confusing display for non-zbuf images */
1297
uiBlockBeginAlign(block);
1298
if(ima->type==IMA_TYPE_COMPOSITE) {
1299
uiDefIconBut(block, BUT, B_SIMA_RECORD, ICON_REC, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Record Composite");
1302
if((ima->type==IMA_TYPE_COMPOSITE) || ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
1303
uiDefIconBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Play");
1240
1306
uiBlockEndAlign(block);
1244
1310
/* draw LOCK */
1245
1311
uiDefIconButS(block, ICONTOG, 0, ICON_UNLOCKED, xco,0,XIC,YIC, &(G.sima->lock), 0, 0, 0, 0, "Updates other affected window spaces automatically to reflect changes in real time");