358
374
test_index_mface(mface, 3);
361
freedisplist(&ob->disp);
377
displistmesh_free(me->decimated);
383
free_editMesh(G.editMesh);
368
385
tex_space_mesh(me);
370
387
if (mesh_uses_displist(me)) {
371
388
makeDispList(ob);
390
BIF_undo_push("Apply decimation");
374
392
else error("Not a decimated Mesh");
396
/* *************** */
398
void do_common_editbuts(unsigned short event) // old name, is a mix of object and editing events....
400
EditMesh *em = G.editMesh;
410
int a, bit, index= -1;
415
if(G.obedit && G.obedit->actcol>0) {
416
if(G.obedit->type == OB_MESH) {
417
efa= em->faces.first;
419
if(efa->f & SELECT) {
420
if(index== -1) index= efa->mat_nr;
421
else if(index!=efa->mat_nr) {
422
error("Mixed colors");
429
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
432
if( isNurbsel(nu) ) {
433
if(index== -1) index= nu->mat_nr;
434
else if(index!=nu->mat_nr) {
435
error("Mixed colors");
443
G.obedit->actcol= index+1;
444
scrarea_queue_winredraw(curarea);
449
new_material_to_objectdata((G.scene->basact) ? (G.scene->basact->object) : 0);
450
scrarea_queue_winredraw(curarea);
451
BIF_undo_push("New material");
452
allqueue(REDRAWBUTSSHADING, 0);
453
allqueue(REDRAWVIEW3D_Z, 0);
454
allqueue(REDRAWOOPS, 0);
457
delete_material_index();
458
scrarea_queue_winredraw(curarea);
459
BIF_undo_push("Delete material index");
460
allqueue(REDRAWBUTSSHADING, 0);
461
allqueue(REDRAWVIEW3D_Z, 0);
462
allqueue(REDRAWOOPS, 0);
465
if(G.obedit && G.obedit->actcol>0) {
466
if(G.obedit->type == OB_MESH) {
467
efa= em->faces.first;
470
efa->mat_nr= G.obedit->actcol-1;
474
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
478
nu->mat_nr= G.obedit->actcol-1;
482
allqueue(REDRAWVIEW3D_Z, 0);
483
makeDispList(G.obedit);
484
BIF_undo_push("Assign material index");
490
if(G.obedit->type == OB_MESH) {
491
if (event==B_MATSEL) {
492
editmesh_select_by_material(G.obedit->actcol-1);
494
editmesh_deselect_by_material(G.obedit->actcol-1);
496
allqueue(REDRAWVIEW3D, 0);
498
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
501
if(nu->mat_nr==G.obedit->actcol-1) {
507
if(event==B_MATSEL) {
522
a= nu->pntsu*nu->pntsv;
526
if(event==B_MATSEL) bp->f1 |= 1;
535
BIF_undo_push("Select material index");
536
allqueue(REDRAWVIEW3D, 0);
542
if(G.obedit->type == OB_MESH) hide_mesh(0);
543
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) hideNurb(0);
548
if(G.obedit->type == OB_MESH) reveal_mesh();
549
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) revealNurb();
551
else if(G.f & G_FACESELECT) reveal_tface();
556
if(G.obedit->type == OB_MESH) selectswap_mesh();
557
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) selectswapNurb();
562
if(ob && G.obedit==0) {
563
if(ob->type==OB_MESH) tex_space_mesh(ob->data);
564
else if(ob->type==OB_MBALL) ;
565
else tex_space_curve(ob->data);
574
case B_DOCENTRECURSOR:
580
if(G.obedit->type == OB_MESH) {
581
efa= em->faces.first;
583
if(efa->f & SELECT) {
584
if(event==B_SETSMOOTH) efa->flag |= ME_SMOOTH;
585
else efa->flag &= ~ME_SMOOTH;
594
if(event==B_SETSMOOTH) nu->flag |= CU_SMOOTH;
595
else nu->flag &= ~CU_SMOOTH;
600
makeDispList(G.obedit);
601
allqueue(REDRAWVIEW3D, 0);
606
if(TESTBASELIB(base)) {
607
if(base->object->type==OB_MESH) {
608
me= base->object->data;
609
mesh_set_smooth_flag(me, (event==B_SETSMOOTH));
610
makeDispList(base->object);
612
else if ELEM(base->object->type, OB_SURF, OB_CURVE) {
613
cu= base->object->data;
616
if(event==B_SETSMOOTH) nu->flag |= ME_SMOOTH;
617
else nu->flag &= ~ME_SMOOTH;
620
makeDispList(base->object);
625
allqueue(REDRAWVIEW3D, 0);
627
if(event == B_SETSMOOTH) BIF_undo_push("Set Smooth");
628
else BIF_undo_push("Set Solid");
633
if(event>=B_OBLAY && event<=B_OBLAY+31) {
634
local= BASACT->lay & 0xFF000000;
635
BASACT->lay -= local;
636
if(BASACT->lay==0 || (G.qual & LR_SHIFTKEY)==0) {
639
scrarea_queue_winredraw(curarea);
641
BASACT->lay += local;
643
if( (OBACT->lay & G.vd->lay) && (BASACT->lay & G.vd->lay) );
644
else if( (OBACT->lay & G.vd->lay)==0 && (BASACT->lay & G.vd->lay)==0 );
645
else allqueue(REDRAWVIEW3D, 0);
647
OBACT->lay= BASACT->lay;
378
653
/* *************************** MESH ******************************** */
389
664
if( uiNewPanel(curarea, block, "Mesh", "Editing", 320, 0, 318, 204)==0) return;
391
666
uiBlockBeginAlign(block);
392
uiDefButS(block, TOG|BIT|5, REDRAWVIEW3D, "Auto Smooth",10,180,154,19, &me->flag, 0, 0, 0, 0, "Treats all faces with angles less than Degr: as 'smooth' during render");
393
uiDefButS(block, NUM, B_DIFF, "Degr:", 10,160,154,19, &me->smoothresh, 1, 80, 0, 0, "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
667
uiDefButS(block, TOG|BIT|5, REDRAWVIEW3D, "Auto Smooth",10,180,154,19, &me->flag, 0, 0, 0, 0, "Treats all set-smoothed faces with angles less than Degr: as 'smooth' during render");
668
uiDefButS(block, NUM, B_DIFF, "Degr:", 10,160,154,19, &me->smoothresh, 1, 80, 0, 0, "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
395
670
uiBlockBeginAlign(block);
396
671
uiBlockSetCol(block, TH_BUT_SETTING1);
397
uiDefButS(block, TOG|BIT|7, B_MAKEDISP, "SubSurf", 10,124,70,19, &me->flag, 0, 0, 0, 0, "Treats the active object as a Subdivision Surface");
398
uiDefButS(block, MENU, B_MAKEDISP, subsurfmenu, 80,124,84,19, &(me->subsurftype), 0, 0, 0, 0, "Selects type of Subsurf algorithm.");
672
uiDefButS(block, TOG|BIT|7, B_SUBSURFTYPE, "SubSurf", 10,134,70,19, &me->flag, 0, 0, 0, 0, "Treats the active object as a Subdivision Surface");
673
uiDefButS(block, MENU, B_SUBSURFTYPE, subsurfmenu, 80,134,84,19, &(me->subsurftype), 0, 0, 0, 0, "Selects type of Subsurf algorithm.");
399
674
uiBlockSetCol(block, TH_AUTO);
400
uiDefButS(block, NUM, B_MAKEDISP, "Subdiv:", 10,104,110,19, &me->subdiv, 0, 6, 0, 0, "Defines the level of subdivision to display in real time interactively");
401
uiDefButS(block, NUM, B_MAKEDISP, "", 120, 104, 44, 19, &me->subdivr, 0, 6, 0, 0, "Defines the level of subdivision to apply during rendering");
402
uiDefButS(block, TOG|BIT|8, B_MAKEDISP, "Optimal", 10,84,154,19, &me->flag, 0, 0, 0, 0, "Only draws optimal wireframe");
675
uiDefButS(block, NUM, B_SUBSURFTYPE, "Subdiv:", 10, 114,110,19, &me->subdiv, 0, 6, 0, 0, "Defines the level of subdivision to display in real time interactively");
676
uiDefButS(block, NUM, B_DIFF, "", 120,114, 44, 19, &me->subdivr, 0, 6, 0, 0, "Defines the level of subdivision to apply during rendering");
677
uiDefButS(block, TOG|BIT|8, B_SUBSURFTYPE, "Optimal", 10, 94,154,19, &me->flag, 0, 0, 0, 0, "Only draws optimal wireframe");
405
679
uiBlockBeginAlign(block);
406
if(me->msticky) val= 1.0; else val= 0.0;
407
uiDefBut(block, LABEL, 0, "Sticky", 10,50,70,20, 0, val, 0, 0, 0, "");
409
uiDefBut(block, BUT, B_MAKESTICKY, "Make", 80,50,84,19, 0, 0, 0, 0, 0, "Creates Sticky coordinates for the active object from the current camera view background picture");
681
if(me->medge) val= 1.0; else val= 0.0;
682
uiDefBut(block, LABEL, 0, "Edges", 10,70,70,20, 0, val, 0, 0, 0, "");
683
if(me->medge==NULL) {
684
uiDefBut(block, BUT, B_MAKEEDGES, "Make", 80,70,84,19, 0, 0, 0, 0, 0, "Adds edges data to active Mesh object, enables creases/seams and faster wireframe draw");
411
else uiDefBut(block, BUT, B_DELSTICKY, "Delete", 80,50,84,19, 0, 0, 0, 0, 0, "Deletes Sticky texture coordinates");
686
else uiDefBut(block, BUT, B_DELEDGES, "Delete", 80,70,84,19, 0, 0, 0, 0, 0, "Deletes edges data from active Mesh object");
413
688
if(me->mcol) val= 1.0; else val= 0.0;
414
uiDefBut(block, LABEL, 0, "VertCol", 10,30,70,20, 0, val, 0, 0, 0, "");
416
uiDefBut(block, BUT, B_MAKEVERTCOL, "Make", 80,30,84,19, 0, 0, 0, 0, 0, "Enables vertex colour painting on active object");
689
uiDefBut(block, LABEL, 0, "VertCol", 10,50,70,20, 0, val, 0, 0, 0, "");
691
uiDefBut(block, BUT, B_MAKEVERTCOL, "Make", 80,50,84,19, 0, 0, 0, 0, 0, "Enables vertex colour painting on active object");
418
else uiDefBut(block, BUT, B_DELVERTCOL, "Delete", 80,30,84,19, 0, 0, 0, 0, 0, "Deletes vertex colours on active object");
693
else uiDefBut(block, BUT, B_DELVERTCOL, "Delete", 80,50,84,19, 0, 0, 0, 0, 0, "Deletes vertex colours on active object");
420
695
if(me->tface) val= 1.0; else val= 0.0;
421
uiDefBut(block, LABEL, 0, "TexFace", 10,10,70,20, 0, val, 0, 0, 0, "");
423
uiDefBut(block, BUT, B_MAKE_TFACES, "Make", 80,10,84,19, 0, 0, 0, 0, 0, "Enables the active object's faces for UV coordinate mapping");
425
else uiDefBut(block, BUT, B_DEL_TFACES, "Delete", 80,10,84,19, 0, 0, 0, 0, 0, "Deletes UV coordinates for active object's faces");
696
uiDefBut(block, LABEL, 0, "TexFace", 10,30,70,20, 0, val, 0, 0, 0, "");
697
if(me->tface==NULL) {
698
uiDefBut(block, BUT, B_MAKE_TFACES, "Make", 80,30,84,19, 0, 0, 0, 0, 0, "Enables the active object's faces for UV coordinate mapping");
700
else uiDefBut(block, BUT, B_DEL_TFACES, "Delete", 80,30,84,19, 0, 0, 0, 0, 0, "Deletes UV coordinates for active object's faces");
702
if(me->msticky) val= 1.0; else val= 0.0;
703
uiDefBut(block, LABEL, 0, "Sticky", 10,10,70,20, 0, val, 0, 0, 0, "");
704
if(me->msticky==NULL) {
705
uiDefBut(block, BUT, B_MAKESTICKY, "Make", 80,10,84,19, 0, 0, 0, 0, 0, "Creates Sticky coordinates for the active object from the current camera view background picture");
707
else uiDefBut(block, BUT, B_DELSTICKY, "Delete", 80,10,84,19, 0, 0, 0, 0, 0, "Deletes Sticky texture coordinates");
426
709
uiBlockEndAlign(block);
430
712
if(G.obedit==NULL) {
431
713
int tottria= decimate_count_tria(ob);
434
// wacko, wait for new displist system (ton)
435
if( (dl=ob->disp.first) && dl->mesh);
436
else decim_faces= tottria;
716
if (!me->decimated) {
717
decim_faces= tottria;
438
720
uiBlockBeginAlign(block);
439
721
uiBlockSetCol(block, TH_BUT_SETTING1);
883
1189
if(ob->type==OB_CURVE) {
884
1190
uiDefBut(block, LABEL, 0, "Convert", 463,173,72, 18, 0, 0, 0, 0, 0, "");
885
1191
uiBlockBeginAlign(block);
886
uiDefBut(block, BUT,B_CONVERTPOLY,"Poly", 467,152,72, 18, 0, 0, 0, 0, 0, "");
887
uiDefBut(block, BUT,B_CONVERTBEZ,"Bezier", 467,132,72, 18, 0, 0, 0, 0, 0, "");
888
uiDefBut(block, BUT,B_CONVERTBSPL,"Bspline", 467,112,72, 18, 0, 0, 0, 0, 0, "");
889
uiDefBut(block, BUT,B_CONVERTCARD,"Cardinal", 467,92,72, 18, 0, 0, 0, 0, 0, "");
890
uiDefBut(block, BUT,B_CONVERTNURB,"Nurb", 467,72,72, 18, 0, 0, 0, 0, 0, "");
1192
uiDefBut(block, BUT,B_CONVERTPOLY,"Poly", 467,152,72, 18, 0, 0, 0, 0, 0, "Converts selected into regular Polygon vertices");
1193
uiDefBut(block, BUT,B_CONVERTBEZ,"Bezier", 467,132,72, 18, 0, 0, 0, 0, 0, "Converts selected to Bezier triples");
1194
uiDefBut(block, BUT,B_CONVERTNURB,"Nurb", 467,112,72, 18, 0, 0, 0, 0, 0, "Converts selected to Nurbs Points");
892
1196
uiBlockBeginAlign(block);
893
uiDefBut(block, BUT,B_UNIFU,"Uniform U", 565,152,102, 18, 0, 0, 0, 0, 0, "");
894
uiDefBut(block, BUT,B_UNIFV,"V", 670,152,50, 18, 0, 0, 0, 0, 0, "");
895
uiDefBut(block, BUT,B_ENDPU,"Endpoint U", 565,132,102, 18, 0, 0, 0, 0, 0, "");
896
uiDefBut(block, BUT,B_ENDPV,"V", 670,132,50, 18, 0, 0, 0, 0, 0, "");
897
uiDefBut(block, BUT,B_BEZU,"Bezier U", 565,112,102, 18, 0, 0, 0, 0, 0, "");
898
uiDefBut(block, BUT,B_BEZV,"V", 670,112,50, 18, 0, 0, 0, 0, 0, "");
1197
uiDefBut(block, BUT,B_UNIFU,"Uniform U", 565,152,102, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result doesn't go to end points in U");
1198
uiDefBut(block, BUT,B_UNIFV,"V", 670,152,50, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result doesn't go to end points in V");
1199
uiDefBut(block, BUT,B_ENDPU,"Endpoint U", 565,132,102, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result is forced to end points in U");
1200
uiDefBut(block, BUT,B_ENDPV,"V", 670,132,50, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result is forced to end points in V");
1201
uiDefBut(block, BUT,B_BEZU,"Bezier U", 565,112,102, 18, 0, 0, 0, 0, 0, "Nurbs only; make knots array mimic a Bezier in U");
1202
uiDefBut(block, BUT,B_BEZV,"V", 670,112,50, 18, 0, 0, 0, 0, 0, "Nurbs only; make knots array mimic a Bezier in V");
899
1203
uiBlockEndAlign(block);
901
uiDefBut(block, BUT,B_SETWEIGHT,"Set Weight", 465,11,95,49, 0, 0, 0, 0, 0, "");
1205
uiDefBut(block, BUT,B_SETWEIGHT,"Set Weight", 465,11,95,49, 0, 0, 0, 0, 0, "Nurbs only; set weight for select points");
903
1207
uiBlockBeginAlign(block);
904
uiDefButF(block, NUM,0,"Weight:", 565,36,102,22, &editbutweight, 0.01, 100.0, 10, 0, "");
1208
uiDefButF(block, NUM,0,"Weight:", 565,36,102,22, &editbutweight, 0.01, 100.0, 10, 0, "The weight you can assign");
905
1209
uiDefBut(block, BUT,B_SETW1,"1.0", 670,36,50,22, 0, 0, 0, 0, 0, "");
906
1210
uiDefBut(block, BUT,B_SETW2,"sqrt(2)/4",565,11,55,20, 0, 0, 0, 0, 0, "");
907
1211
uiDefBut(block, BUT,B_SETW3,"0.25", 620,11,45,20, 0, 0, 0, 0, 0, "");
975
1279
if(ob->type!=OB_SURF) {
977
1281
if(ob->type==OB_CURVE) {
978
1282
extern float prlen; // buttons_object.c, should be moved....
980
uiBlockBeginAlign(block);
981
uiDefButS(block, NUM, B_RECALCPATH, "PathLen:", 600,50,150,19, &cu->pathlen, 1.0, 9000.0, 0, 0, "");
982
uiDefButS(block, TOG|BIT|3, B_RECALCPATH, "CurvePath", 600,30,75,19 , &cu->flag, 0, 0, 0, 0, "");
983
uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "CurveFollow",675,30,75,19, &cu->flag, 0, 0, 0, 0, "");
984
1285
sprintf(str, "%.4f", prlen);
985
uiDefBut(block, BUT, B_PRINTLEN, "PrintLen", 600,10,75,19, 0, 0, 0, 0, 0, "");
986
uiDefBut(block, LABEL, 0, str, 675,10,75,19, 0, 1.0, 0, 0, 0, "");
1286
uiDefBut(block, BUT, B_PRINTLEN, "PrintLen", 600,135,75,19, 0, 0, 0, 0, 0, "");
1287
uiDefBut(block, LABEL, 0, str, 675,135,75,19, 0, 1.0, 0, 0, 0, "");
1289
uiBlockBeginAlign(block);
1290
uiDefButS(block, NUM, B_RECALCPATH, "PathLen:", 600,50,150,19, &cu->pathlen, 1.0, 9000.0, 0, 0, "If no speed Ipo was set, the amount of frames of the path");
1291
uiDefButS(block, TOG|BIT|3, B_RECALCPATH, "CurvePath", 600,30,75,19 , &cu->flag, 0, 0, 0, 0, "Enables curve to become translation path");
1292
uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "CurveFollow",675,30,75,19, &cu->flag, 0, 0, 0, 0, "Makes curve path children to rotate along path");
1293
uiDefButS(block, TOG|BIT|7, B_CURVECHECK, "CurveStretch", 600,10,150,19, &cu->flag, 0, 0, 0, 0, "Option for curve-deform: makes deformed child to stretch along entire path");
1294
uiDefButS(block, TOG|BIT|8, REDRAWVIEW3D, "PathDist Offs", 600,-10,150,19, &cu->flag, 0, 0, 0, 0, "Children will use TimeOffs value as path distance offset");
1296
uiBlockEndAlign(block);
989
1299
uiBlockBeginAlign(block);
990
uiDefButS(block, NUM, B_MAKEDISP, "DefResolU:", 760,160,120,19, &cu->resolu, 1.0, 128.0, 0, 0, "");
991
uiDefBut(block, BUT, B_SETRESOLU, "Set", 880,160,30,19, 0, 0, 0, 0, 0, "");
1300
uiDefButS(block, NUM, B_MAKEDISP, "DefResolU:", 760,160,120,19, &cu->resolu, 1.0, 1024.0, 0, 0, "Default resolution");
1301
uiDefBut(block, BUT, B_SETRESOLU, "Set", 880,160,30,19, 0, 0, 0, 0, 0, "Set resolution for interpolation");
993
1303
uiBlockBeginAlign(block);
994
uiDefButF(block, NUM, B_MAKEDISP, "Width:", 760,90,150,19, &cu->width, 0.0, 2.0, 1, 0, "");
995
uiDefButF(block, NUM, B_MAKEDISP, "Ext1:", 760,70,150,19, &cu->ext1, 0.0, 5.0, 10, 0, "");
996
uiDefButF(block, NUM, B_MAKEDISP, "Ext2:", 760,50,150,19, &cu->ext2, 0.0, 2.0, 1, 0, "");
997
uiDefButS(block, NUM, B_MAKEDISP, "BevResol:", 760,30,150,19, &cu->bevresol, 0.0, 10.0, 0, 0, "");
998
uiDefIDPoinBut(block, test_obcurpoin_but, B_MAKEDISP, "BevOb:", 760,10,150,19, &cu->bevobj, "");
1304
uiDefButF(block, NUM, B_MAKEDISP, "Width:", 760,90,150,19, &cu->width, 0.0, 2.0, 1, 0, "Make interpolated result thinner or fatter");
1305
uiDefButF(block, NUM, B_MAKEDISP, "Ext1:", 760,70,150,19, &cu->ext1, 0.0, 5.0, 10, 0, "Extrude depth");
1306
uiDefButF(block, NUM, B_MAKEDISP, "Ext2:", 760,50,150,19, &cu->ext2, 0.0, 2.0, 1, 0, "Extrude beveling depth");
1307
uiDefButS(block, NUM, B_MAKEDISP, "BevResol:", 760,30,150,19, &cu->bevresol, 0.0, 10.0, 0, 0, "Amount of bevels");
1308
uiDefIDPoinBut(block, test_obcurpoin_but, B_MAKEDISP, "BevOb:", 760,10,150,19, &cu->bevobj, "Curve object name that defines the bevel shape");
1309
uiDefIDPoinBut(block, test_obcurpoin_but, B_MAKEDISP, "TaperOb:", 760,-10,150,19, &cu->taperobj, "Curve object name that defines the taper (width)");
1000
1311
uiBlockBeginAlign(block);
1001
1312
uiBlockSetCol(block, TH_BUT_SETTING1);
1002
uiDefButS(block, TOG|BIT|2, B_MAKEDISP, "Back", 760,130,50,19, &cu->flag, 0, 0, 0, 0, "");
1003
uiDefButS(block, TOG|BIT|1, B_MAKEDISP, "Front",810,130,50,19, &cu->flag, 0, 0, 0, 0, "");
1004
uiDefButS(block, TOG|BIT|0, B_CU3D, "3D", 860,130,50,19, &cu->flag, 0, 0, 0, 0, "");
1313
uiDefButS(block, TOG|BIT|2, B_MAKEDISP, "Back", 760,130,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled back for curves");
1314
uiDefButS(block, TOG|BIT|1, B_MAKEDISP, "Front",810,130,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled front for curves");
1315
uiDefButS(block, TOG|BIT|0, B_CU3D, "3D", 860,130,50,19, &cu->flag, 0, 0, 0, 0, "Allow Curve Object to be 3d, it doesn't fill then");
1033
1347
uiDefButF(block, NUM,REDRAWVIEW3D, "DrawSize:", 470,90,160,20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "Specify the drawsize of the camera");
1035
uiDefButS(block, TOG, REDRAWVIEW3D, "Ortho", 470,49,61,40, &cam->type, 0, 0, 0, 0, "Render orthogonally");
1349
uiDefButS(block, TOG, REDRAWVIEW3D, "Ortho", 470,29,61,60, &cam->type, 0, 0, 0, 0, "Render orthogonally");
1036
1350
uiBlockBeginAlign(block);
1037
uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D, "ShowLimits", 533,69,97,20, &cam->flag, 0, 0, 0, 0, "Draw the field of view");
1038
uiDefButS(block, TOG|BIT|1,REDRAWVIEW3D, "Show Mist", 533,49,97,20, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area");
1351
uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D, "ShowLimits", 533,59,97,30, &cam->flag, 0, 0, 0, 0, "Draw the field of view");
1352
uiDefButS(block, TOG|BIT|1,REDRAWVIEW3D, "Show Mist", 533,29,97,30, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area");
1039
1353
uiBlockEndAlign(block);
1356
/* yafray: extra camera panel to set Depth-of-Field parameters */
1357
static void editing_panel_camera_yafraydof(Object *ob, Camera *cam)
1362
block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_yafraydof", UI_EMBOSS, UI_HELV, curarea->win);
1363
uiNewPanelTabbed("Camera", "Editing");
1364
if(uiNewPanel(curarea, block, "Yafray DoF", "Editing", 320, 0, 318, 204)==0) return;
1366
uiDefButF(block, NUM, REDRAWVIEW3D, "DoFDist:", 10, 147, 180, 20, &cam->YF_dofdist, 0.0, 5000.0, 50, 0, "Sets distance to point of focus (use camera 'ShowLimits' to make visible in 3Dview)");
1367
uiDefButF(block, NUM, B_DIFF, "Aperture:", 10, 125, 180, 20, &cam->YF_aperture, 0.0, 2.0, 1, 0, "Sets lens aperture, the larger, the more blur (use small values, 0 is no DoF)");
1369
uiDefButS(block, TOG|BIT|2, B_DIFF, "Random sampling", 10, 90, 180, 20, &cam->flag, 0, 0, 0, 0, "Use noisy random Lens sampling instead of QMC");
1371
uiDefBut(block, LABEL, 0, "Bokeh", 10, 60, 180, 19, 0, 0.0, 0.0, 0, 0, "");
1372
mst1 = "Bokeh Type%t|Disk1%x0|Disk2%x1|Triangle%x2|Square%x3|Pentagon%x4|Hexagon%x5|Ring%x6";
1373
uiDefButS(block, MENU, B_REDR, mst1, 10, 40, 89, 20, &cam->YF_bkhtype, 0.0, 0.0, 0, 0, "Sets Bokeh type");
1375
if ((cam->YF_bkhtype!=0) && (cam->YF_bkhtype!=6)) {
1376
mst2 = "Bokeh Bias%t|Uniform%x0|Center%x1|Edge%x2";
1377
uiDefButS(block, MENU, B_REDR, mst2, 100, 40, 90, 20, &cam->YF_bkhbias, 0.0, 0.0, 0, 0, "Sets Bokeh bias");
1378
if (cam->YF_bkhtype>1)
1379
uiDefButF(block, NUM, B_DIFF, "Rotation:", 10, 15, 180, 20, &cam->YF_bkhrot, 0.0, 360.0, 100, 0, "Shape rotation amount in degrees");
1384
/* **************************** CAMERA *************************** */
1386
void do_cambuts(unsigned short event)
1042
1402
/* *************************** MBALL ******************************** */
1044
1404
void do_mballbuts(unsigned short event)
1064
1424
uiBlockBeginAlign(block);
1065
uiDefButF(block, NUMSLI, B_RECALCMBALL, "Wiresize:", 470,178,250,19, &mb->wiresize, 0.05, 1.0, 0, 0, "");
1066
uiDefButF(block, NUMSLI, 0, "Rendersize:", 470,158,250,19, &mb->rendersize, 0.05, 1.0, 0, 0, "");
1067
uiDefButF(block, NUMSLI, B_RECALCMBALL, "Threshold:", 470,138,250,19, &mb->thresh, 0.0001, 5.0, 0, 0, "");
1425
uiDefButF(block, NUM, B_RECALCMBALL, "Wiresize:", 470,178,250,19, &mb->wiresize, 0.05, 1.0, 1, 0, "Polygonization resolution in 3d window");
1426
uiDefButF(block, NUM, 0, "Rendersize:", 470,158,250,19, &mb->rendersize, 0.05, 1.0, 1, 0, "Polygonization resolution in rendering");
1427
uiDefButF(block, NUM, B_RECALCMBALL, "Threshold:", 470,138,250,19, &mb->thresh, 0.0001, 5.0, 1, 0, "Defines influence of meta elements");
1069
1429
uiBlockBeginAlign(block);
1070
1430
uiBlockSetCol(block, TH_BUT_SETTING1);
1071
uiDefBut(block, LABEL, 0, "Update:", 471,108,120,19, 0, 0, 0, 0, 0, "");
1072
uiDefButS(block, ROW, B_DIFF, "Always", 471, 85, 120, 19, &mb->flag, 0.0, 0.0, 0, 0, "");
1073
uiDefButS(block, ROW, B_DIFF, "Half Res", 471, 65, 120, 19, &mb->flag, 0.0, 1.0, 0, 0, "");
1074
uiDefButS(block, ROW, B_DIFF, "Fast", 471, 45, 120, 19, &mb->flag, 0.0, 2.0, 0, 0, "");
1431
uiDefBut(block, LABEL, 0, "Update:", 471,108,120,19, 0, 0, 0, 0, 0, "");
1432
uiDefButS(block, ROW, B_DIFF, "Always", 471, 85, 120, 19, &mb->flag, 0.0, 0.0, 0, 0, "While editing, always updates");
1433
uiDefButS(block, ROW, B_DIFF, "Half Res", 471, 65, 120, 19, &mb->flag, 0.0, 1.0, 0, 0, "While editing, updates in half resolution");
1434
uiDefButS(block, ROW, B_DIFF, "Fast", 471, 45, 120, 19, &mb->flag, 0.0, 2.0, 0, 0, "While editing, updates without polygonization");
1435
uiDefButS(block, ROW, B_DIFF, "Never", 471, 25, 120, 19, &mb->flag, 0.0, 3.0, 0, 0, "While editing, doesn't update");
1086
1447
if(ob==G.obedit && lastelem) {
1087
1448
uiBlockBeginAlign(block);
1088
uiDefButF(block, NUMSLI, B_RECALCMBALL, "Stiffness:", 750,178,250,19, &lastelem->s, 0.0, 10.0, 0, 0, "");
1449
uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 750,178,250,19, &lastelem->s, 0.0, 10.0, 1, 0, "Stiffness for active meta");
1089
1450
if(lastelem->type!=MB_BALL)
1090
uiDefButF(block, NUMSLI, B_RECALCMBALL, "dx:", 750,158,250,19, &lastelem->expx, 0.0, 20.0, 0, 0, "");
1451
uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 750,158,250,19, &lastelem->expx, 0.0, 20.0, 1, 0, "X size for active meta");
1091
1452
if((lastelem->type!=MB_BALL)&&(lastelem->type!=MB_TUBE))
1092
uiDefButF(block, NUMSLI, B_RECALCMBALL, "dy:", 750,138,250,19, &lastelem->expy, 0.0, 20.0, 0, 0, "");
1453
uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 750,138,250,19, &lastelem->expy, 0.0, 20.0, 1, 0, "Y size for active meta");
1094
1455
if((lastelem->type==MB_CUBE)||(lastelem->type==MB_ELIPSOID))
1095
uiDefButF(block, NUMSLI, B_RECALCMBALL, "dz:", 750,118,250,19, &lastelem->expz, 0.0, 20.0, 0, 0, "");
1096
uiBlockEndAlign(block);
1098
uiDefButS(block, ROW, B_RECALCMBALL, "Ball", 753,83,60,19, &lastelem->type, 1.0, 0.0, 0, 0, "");
1099
uiBlockBeginAlign(block);
1100
uiDefButS(block, ROW, B_RECALCMBALL, "Tube", 753,62,60,19, &lastelem->type, 1.0, 4.0, 0, 0, "");
1101
uiDefButS(block, ROW, B_RECALCMBALL, "Plane", 814,62,60,19, &lastelem->type, 1.0, 5.0, 0, 0, "");
1102
uiDefButS(block, ROW, B_RECALCMBALL, "Elipsoid", 876,62,60,19, &lastelem->type, 1.0, 6.0, 0, 0, "");
1103
uiDefButS(block, ROW, B_RECALCMBALL, "Cube", 938,62,60,19, &lastelem->type, 1.0, 7.0, 0, 0, "");
1104
uiBlockEndAlign(block);
1106
uiDefButS(block, TOG|BIT|1, B_RECALCMBALL, "Negative",753,16,60,19, &lastelem->flag, 0, 0, 0, 0, "");
1456
uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 750,118,250,19, &lastelem->expz, 0.0, 20.0, 1, 0, "Z size for active meta");
1457
uiBlockEndAlign(block);
1459
uiDefButS(block, ROW, B_RECALCMBALL, "Ball", 753,83,60,19, &lastelem->type, 1.0, 0.0, 0, 0, "Draw active meta as Ball");
1460
uiBlockBeginAlign(block);
1461
uiDefButS(block, ROW, B_RECALCMBALL, "Tube", 753,62,60,19, &lastelem->type, 1.0, 4.0, 0, 0, "Draw active meta as Ball");
1462
uiDefButS(block, ROW, B_RECALCMBALL, "Plane", 814,62,60,19, &lastelem->type, 1.0, 5.0, 0, 0, "Draw active meta as Plane");
1463
uiDefButS(block, ROW, B_RECALCMBALL, "Elipsoid", 876,62,60,19, &lastelem->type, 1.0, 6.0, 0, 0, "Draw active meta as Ellipsoid");
1464
uiDefButS(block, ROW, B_RECALCMBALL, "Cube", 938,62,60,19, &lastelem->type, 1.0, 7.0, 0, 0, "Draw active meta as Cube");
1465
uiBlockEndAlign(block);
1467
uiBlockBeginAlign(block);
1468
uiDefButS(block, TOG|BIT|1, B_RECALCMBALL, "Negative",753,16,125,19, &lastelem->flag, 0, 0, 0, 0, "Make active meta creating holes");
1469
uiDefButS(block, TOG|BIT|3, B_RECALCMBALL, "Hide",878,16,125,19, &lastelem->flag, 0, 0, 0, 0, "Make active meta invisible");
1470
uiBlockEndAlign(block);
1150
1515
uiBlock *block;
1152
1517
block= uiNewBlock(&curarea->uiblocks, "editing_panel_lattice_type", UI_EMBOSS, UI_HELV, curarea->win);
1153
if(uiNewPanel(curarea, block, "Latice", "Editing", 320, 0, 318, 204)==0) return;
1518
if(uiNewPanel(curarea, block, "Lattice", "Editing", 320, 0, 318, 204)==0) return;
1156
1521
uiSetButLock(lt->key!=0, "Not with VertexKeys");
1157
1522
uiSetButLock(ob==G.obedit, "Unable to perform function in EditMode");
1159
1524
uiBlockBeginAlign(block);
1160
uiDefButS(block, NUM, B_RESIZELAT, "U:", 470, 178,100,19, <->pntsu, 1.0, 64.0, 0, 0, "Points in U direction");
1526
uiDefButS(block, NUM, B_RESIZELAT, "U:", 469, 178,100,19, <->pntsu, 1.0, 64.0, 0, 0, "Points in U direction");
1161
1527
uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 178, 40, 19, <->typeu, 1.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
1162
uiDefButC(block, ROW, B_LATTCHANGED, "Card", 612, 178, 40, 19, <->typeu, 1.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
1528
uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 178, 40, 19, <->typeu, 1.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
1163
1529
uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 178, 40, 19, <->typeu, 1.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
1165
uiBlockBeginAlign(block);
1166
uiDefButS(block, NUM, B_RESIZELAT, "V:", 470, 158,100,19, <->pntsv, 1.0, 64.0, 0, 0, "Points in V direction");
1167
uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 158, 40, 19, <->typev, 2.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
1168
uiDefButC(block, ROW, B_LATTCHANGED, "Card", 612, 158, 40, 19, <->typev, 2.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
1169
uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 158, 40, 19, <->typev, 2.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
1171
uiBlockBeginAlign(block);
1172
uiDefButS(block, NUM, B_RESIZELAT, "W:", 470, 138,100,19, <->pntsw, 1.0, 64.0, 0, 0, "Points in W direction");
1173
uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 138, 40, 19, <->typew, 3.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
1174
uiDefButC(block, ROW, B_LATTCHANGED, "Card", 612, 138, 40, 19, <->typew, 3.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
1175
uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 138, 40, 19, <->typew, 3.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
1531
uiDefButS(block, NUM, B_RESIZELAT, "V:", 469, 156,100,19, <->pntsv, 1.0, 64.0, 0, 0, "Points in V direction");
1532
uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 156, 40, 19, <->typev, 2.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
1533
uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 156, 40, 19, <->typev, 2.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
1534
uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 156, 40, 19, <->typev, 2.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
1536
uiDefButS(block, NUM, B_RESIZELAT, "W:", 469, 134,100,19, <->pntsw, 1.0, 64.0, 0, 0, "Points in W direction");
1537
uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 134, 40, 19, <->typew, 3.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation");
1538
uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 134, 40, 19, <->typew, 3.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation");
1539
uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 134, 40, 19, <->typew, 3.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation");
1176
1541
uiBlockEndAlign(block);
1178
uiDefBut(block, BUT, B_RESIZELAT, "Make Regular", 470,101,99,32, 0, 0, 0, 0, 0, "Make Lattice regular");
1543
uiDefBut(block, BUT, B_RESIZELAT, "Make Regular", 469,98,102,31, 0, 0, 0, 0, 0, "Make Lattice regular");
1180
1545
uiClearButLock();
1181
uiDefButS(block, TOG|BIT|1, B_LATTCHANGED, "Outside", 571,101,120,31, <->flag, 0, 0, 0, 0, "Only draw, and take into account, the outer vertices");
1546
uiDefButS(block, TOG|BIT|1, B_LATTCHANGED, "Outside", 571,98,122,31, <->flag, 0, 0, 0, 0, "Only draw, and take into account, the outer vertices");
1184
uiDefButS(block, NUM, B_DIFF, "Slurph:", 470,60,120,19, &(lt->key->slurph), -500.0, 500.0, 0, 0, "Set time value to denote 'slurph' (sequential delay) vertices with key framing");
1185
uiDefButS(block, TOG, B_RELKEY, "Relative Keys", 470,40,120,19, <->key->type, 0, 0, 0, 0, "Use relative keys (instead of absolute)");
1549
uiDefButS(block, NUM, B_DIFF, "Slurph:", 469,60,120,19, &(lt->key->slurph), -500.0, 500.0, 0, 0, "Set time value to denote 'slurph' (sequential delay) vertices with key framing");
1550
uiDefButS(block, TOG, B_RELKEY, "Relative Keys", 469,40,120,19, <->key->type, 0, 0, 0, 0, "Use relative keys (instead of absolute)");
1747
2159
block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools1", UI_EMBOSS, UI_HELV, curarea->win);
1748
2160
if(uiNewPanel(curarea, block, "Mesh Tools 1", "Editing", 960, 0, 318, 204)==0) return;
1750
uiDefBut(block, BUT,B_DOCENTRE, "Centre", 1091, 200, 166, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
1751
uiBlockBeginAlign(block);
1752
uiDefBut(block, BUT,B_HIDE, "Hide", 1091,155,77,24, 0, 0, 0, 0, 0, "Hides selected faces");
1753
uiDefBut(block, BUT,B_REVEAL, "Reveal", 1171,155,86,24, 0, 0, 0, 0, 0, "Reveals selected faces");
1754
uiBlockEndAlign(block);
1756
uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 1091,124,166,24, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces");
1758
uiBlockBeginAlign(block);
1759
uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 1090, 90, 164, 19, &editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals");
1760
uiDefButI(block, TOG|BIT|6, REDRAWVIEW3D, "Draw Normals", 1090,70,164,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
1761
uiDefButI(block, TOG|BIT|7, REDRAWVIEW3D, "Draw Faces", 1090,50,164,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
1762
uiDefButI(block, TOG|BIT|18, REDRAWVIEW3D, "Draw Edges", 1090,30,164,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
1763
uiDefButI(block, TOG|BIT|11, 0, "All edges", 1090,10,164,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
1764
uiBlockEndAlign(block);
2162
uiBlockBeginAlign(block);
2163
uiDefBut(block, BUT,B_DOCENTRE, "Centre", 955, 200, 160, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
2164
uiDefBut(block, BUT,B_HIDE, "Hide", 1115, 200, 160, 19, 0, 0, 0, 0, 0, "Hides selected faces");
2165
uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 955, 180, 160, 19, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces");
2166
uiDefBut(block, BUT,B_REVEAL, "Reveal", 1115, 180, 160, 19, 0, 0, 0, 0, 0, "Reveals selected faces");
2167
uiBlockEndAlign(block);
2169
uiBlockBeginAlign(block);
2170
uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 955, 131, 150, 19, &G.scene->editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals");
2171
uiDefButI(block, TOG|BIT|6, REDRAWVIEW3D, "Draw Normals", 955,110,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
2172
uiDefButI(block, TOG|BIT|7, REDRAWVIEW3D, "Draw Faces", 955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
2173
uiDefButI(block, TOG|BIT|18, REDRAWVIEW3D, "Draw Edges", 955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights");
2174
uiDefButI(block, TOG|BIT|19, REDRAWVIEW3D, "Draw Creases", 955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting");
2175
uiDefButI(block, TOG|BIT|20, REDRAWVIEW3D, "Draw Seams", 955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams");
2176
uiDefButI(block, TOG|BIT|11, 0, "All Edges", 955, 0,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization");
2177
uiBlockEndAlign(block);
2179
/* Measurement drawing options */
2180
uiBlockBeginAlign(block);
2181
uiDefButI(block, TOG|BIT|22, REDRAWVIEW3D, "Edge Length", 1125,131,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
2182
uiDefButI(block, TOG|BIT|24, REDRAWVIEW3D, "Edge Angles", 1125,110,150,19, &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
2183
uiDefButI(block, TOG|BIT|23, REDRAWVIEW3D, "Face Area", 1125,88,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
2184
uiBlockEndAlign(block);
2188
char *get_vertexgroup_menustr(Object *ob)
2191
int defCount, min, index;
2192
char (*qsort_ptr)[32] = NULL;
2195
defCount=BLI_countlist(&ob->defbase);
2197
if (!defCount) min=0;
2202
* This will hold the group names temporarily
2203
* so we can sort them
2205
qsort_ptr = MEM_callocN (defCount * sizeof (qsort_ptr[0]),
2207
for (index = 1, dg = ob->defbase.first; dg; index++, dg=dg->next) {
2208
snprintf (qsort_ptr[index - 1], sizeof (qsort_ptr[0]),
2209
"%s%%x%d|", dg->name, index);
2212
qsort (qsort_ptr, defCount, sizeof (qsort_ptr[0]),
2213
( int (*)(const void *, const void *) ) strcmp);
2216
s= menustr = MEM_callocN((32 * defCount)+30, "menustr"); // plus 30 for when defCount==0
2218
for (index = 0; index < defCount; index++) {
2219
int cnt= sprintf (s, "%s", qsort_ptr[index]);
2223
else strcpy(menustr, "No Vertex Groups in Object");
2226
MEM_freeN (qsort_ptr);
1769
2231
static void editing_panel_links(Object *ob)
2028
2459
allqueue(REDRAWBUTSEDIT, 0);
2463
editbutvweight = 0.0f;
2464
allqueue(REDRAWBUTSEDIT, 0);
2468
editbutvweight = 0.25f;
2469
allqueue(REDRAWBUTSEDIT, 0);
2472
editbutvweight = 0.5f;
2473
allqueue(REDRAWBUTSEDIT, 0);
2476
editbutvweight = 0.75f;
2477
allqueue(REDRAWBUTSEDIT, 0);
2480
editbutvweight = 1.0f;
2481
allqueue(REDRAWBUTSEDIT, 0);
2486
allqueue(REDRAWBUTSEDIT, 0);
2490
allqueue(REDRAWBUTSEDIT, 0);
2494
allqueue(REDRAWBUTSEDIT, 0);
2498
allqueue(REDRAWBUTSEDIT, 0);
2502
allqueue(REDRAWBUTSEDIT, 0);
2035
/* -------------------- MODE: vpaint faceselect ------------------- */
2510
/* -------------------- MODE: vpaint ------------------- */
2037
2512
static void editing_panel_mesh_paint(void)
2039
2514
extern VPaint Gvp; /* from vpaint */
2040
2515
uiBlock *block;
2042
2517
block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_paint", UI_EMBOSS, UI_HELV, curarea->win);
2043
2518
if(uiNewPanel(curarea, block, "Paint", "Editing", 640, 0, 318, 204)==0) return;
2045
uiBlockBeginAlign(block);
2046
uiDefButF(block, NUMSLI, 0, "R ", 979,160,194,19, &Gvp.r, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of red used for painting");
2047
uiDefButF(block, NUMSLI, 0, "G ", 979,140,194,19, &Gvp.g, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of green used for painting");
2048
uiDefButF(block, NUMSLI, 0, "B ", 979,120,194,19, &Gvp.b, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of blue used for painting");
2049
uiBlockEndAlign(block);
2051
uiDefButF(block, NUMSLI, 0, "Opacity ", 979,100,194,19, &Gvp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
2052
uiDefButF(block, NUMSLI, 0, "Size ", 979,80,194,19, &Gvp.size, 2.0, 64.0, 0, 0, "The size of the brush");
2054
uiDefButF(block, COL, B_VPCOLSLI, "", 1176,100,28,80, &(Gvp.r), 0, 0, 0, 0, "");
2055
uiBlockBeginAlign(block);
2056
uiDefButS(block, ROW, B_DIFF, "Mix", 1212,160,63,19, &Gvp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colours");
2057
uiDefButS(block, ROW, B_DIFF, "Add", 1212,140,63,19, &Gvp.mode, 1.0, 1.0, 0, 0, "Add the vertex colour");
2058
uiDefButS(block, ROW, B_DIFF, "Sub", 1212, 120,63,19, &Gvp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex colour");
2059
uiDefButS(block, ROW, B_DIFF, "Mul", 1212, 100,63,19, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex colour");
2060
uiDefButS(block, ROW, B_DIFF, "Filter", 1212, 80,63,19, &Gvp.mode, 1.0, 4.0, 0, 0, "Mix the colours with an alpha factor");
2062
uiBlockBeginAlign(block);
2063
uiDefButS(block, TOG|BIT|1, 0, "Area", 980,50,80,19, &Gvp.flag, 0, 0, 0, 0, "Set the area the brush covers");
2064
uiDefButS(block, TOG|BIT|2, 0, "Soft", 1061,50,112,19, &Gvp.flag, 0, 0, 0, 0, "Use a soft brush");
2065
uiDefButS(block, TOG|BIT|3, 0, "Normals", 1174,50,102,19, &Gvp.flag, 0, 0, 0, 0, "Use vertex normal for painting");
2067
uiBlockBeginAlign(block);
2068
uiDefBut(block, BUT, B_VPGAMMA, "Set", 980,30,80,19, 0, 0, 0, 0, 0, "Apply Mul and Gamma to vertex colours");
2069
uiDefButF(block, NUM, B_DIFF, "Mul:", 1061,30,112,19, &Gvp.mul, 0.1, 50.0, 10, 0, "Set the number to multiply vertex colours with");
2070
uiDefButF(block, NUM, B_DIFF, "Gamma:", 1174,30,102,19, &Gvp.gamma, 0.1, 5.0, 10, 0, "Change the clarity of the vertex colours");
2071
uiBlockEndAlign(block);
2073
uiDefBut(block, BUT, B_SET_VCOL, "Set VertCol", 980,5,80,20, 0, 0, 0, 0, 0, "Set Vertex colour of selection to current (Shift+K)");
2521
if(G.f & ( G_WEIGHTPAINT))
2525
if(ob==NULL) return;
2527
uiBlockBeginAlign(block);
2528
uiDefButF(block, NUMSLI, REDRAWVIEW3D, "Weight:",979,160,194,19, &editbutvweight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength");
2529
uiDefBut(block, BUT, B_WEIGHT0_0 , "0", 979,140,40,19, 0, 0, 0, 0, 0, "");
2530
uiDefBut(block, BUT, B_WEIGHT1_4 , "1/4", 1020,140,40,19, 0, 0, 0, 0, 0, "");
2531
uiDefBut(block, BUT, B_WEIGHT1_2 , "1/2", 1060,140,40,19, 0, 0, 0, 0, 0, "");
2532
uiDefBut(block, BUT, B_WEIGHT3_4 , "3/4", 1100,140,40,19, 0, 0, 0, 0, 0, "");
2533
uiDefBut(block, BUT, B_WEIGHT1_0 , "1", 1140,140,33,19, 0, 0, 0, 0, 0, "");
2535
uiDefButF(block, NUMSLI, 0, "Opacity ", 979,120,194,19, &Gvp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
2536
uiDefBut(block, BUT, B_OPA0_0 , "0", 979,100,40,19, 0, 0, 0, 0, 0, "");
2537
uiDefBut(block, BUT, B_OPA1_4 , "1/4", 1020,100,40,19, 0, 0, 0, 0, 0, "");
2538
uiDefBut(block, BUT, B_OPA1_2 , "1/2", 1060,100,40,19, 0, 0, 0, 0, 0, "");
2539
uiDefBut(block, BUT, B_OPA3_4 , "3/4", 1100,100,40,19, 0, 0, 0, 0, 0, "");
2540
uiDefBut(block, BUT, B_OPA1_0 , "1", 1140,100,33,19, 0, 0, 0, 0, 0, "");
2541
uiDefButF(block, NUMSLI, 0, "Size ", 979,80,194,19, &Gvp.size, 2.0, 64.0, 0, 0, "The size of the brush");
2542
uiBlockEndAlign(block);
2544
uiBlockBeginAlign(block);
2545
uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 979,40,194,19 , &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes");
2546
uiBlockEndAlign(block);
2550
uiBlockBeginAlign(block);
2551
uiDefButF(block, NUMSLI, 0, "R ", 979,160,194,19, &Gvp.r, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of red used for painting");
2552
uiDefButF(block, NUMSLI, 0, "G ", 979,140,194,19, &Gvp.g, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of green used for painting");
2553
uiDefButF(block, NUMSLI, 0, "B ", 979,120,194,19, &Gvp.b, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of blue used for painting");
2554
uiBlockEndAlign(block);
2555
uiDefButF(block, NUMSLI, 0, "Opacity ", 979,100,194,19, &Gvp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush");
2556
uiDefButF(block, NUMSLI, 0, "Size ", 979,80,194,19, &Gvp.size, 2.0, 64.0, 0, 0, "The size of the brush");
2558
uiDefButF(block, COL, B_REDR, "", 1176,99,28,80, &(Gvp.r), 0, 0, 0, B_VPCOLSLI, "");
2559
uiBlockBeginAlign(block);
2560
uiDefButS(block, ROW, B_DIFF, "Mix", 1212,160,63,19, &Gvp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colours");
2561
uiDefButS(block, ROW, B_DIFF, "Add", 1212,140,63,19, &Gvp.mode, 1.0, 1.0, 0, 0, "Add the vertex colour");
2562
uiDefButS(block, ROW, B_DIFF, "Sub", 1212, 120,63,19, &Gvp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex colour");
2563
uiDefButS(block, ROW, B_DIFF, "Mul", 1212, 100,63,19, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex colour");
2564
uiDefButS(block, ROW, B_DIFF, "Filter", 1212, 80,63,19, &Gvp.mode, 1.0, 4.0, 0, 0, "Mix the colours with an alpha factor");
2566
uiBlockBeginAlign(block);
2567
uiDefButS(block, TOG|BIT|1, 0, "Area", 979,50,81,19, &Gvp.flag, 0, 0, 0, 0, "Vertex paint evaluates the area of the face the brush covers (otherwise vertices only)");
2568
uiDefButS(block, TOG|BIT|2, 0, "Soft", 1061,50,112,19, &Gvp.flag, 0, 0, 0, 0, "Use a soft brush");
2569
uiDefButS(block, TOG|BIT|3, 0, "Normals", 1174,50,102,19, &Gvp.flag, 0, 0, 0, 0, "Vertex paint applies the vertex normal before painting");
2571
uiBlockBeginAlign(block);
2572
uiDefBut(block, BUT, B_VPGAMMA, "Set", 979,30,81,19, 0, 0, 0, 0, 0, "Apply Mul and Gamma to vertex colours");
2573
uiDefButF(block, NUM, B_DIFF, "Mul:", 1061,30,112,19, &Gvp.mul, 0.1, 50.0, 10, 0, "Set the number to multiply vertex colours with");
2574
uiDefButF(block, NUM, B_DIFF, "Gamma:", 1174,30,102,19, &Gvp.gamma, 0.1, 5.0, 10, 0, "Change the clarity of the vertex colours");
2575
uiBlockEndAlign(block);
2577
uiDefBut(block, BUT, B_SET_VCOL, "Set VertCol", 979,5,81,20, 0, 0, 0, 0, 0, "Set Vertex colour of selection to current (Shift+K)");
2078
2582
static void editing_panel_mesh_texface(void)
2584
extern VPaint Gvp; /* from vpaint */
2080
2585
uiBlock *block;
2081
2586
extern TFace *lasttface;
2155
2667
uiBlockBeginAlign(block);
2156
uiDefBut(block, BUT, B_UVAUTO_STD1,"Standard 1/1",100,row,200,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping");
2157
uiDefBut(block, BUT, B_UVAUTO_STD2,"1/2",100,row-butHB,66,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping 1/2");
2158
uiDefBut(block, BUT, B_UVAUTO_STD4,"1/4",166,row-butHB,67,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping 1/4");
2159
uiDefBut(block, BUT, B_UVAUTO_STD8,"1/8",234,row-butHB,66,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping 1/8");
2668
uiDefBut(block, BUT, B_UVAUTO_LSCM,"LSCM Unwrap",100,row,200,butH, 0, 0, 0, 0, 0, "Applies conformal UV mapping, preserving local angles");
2669
uiBlockEndAlign(block);
2672
uiBlockBeginAlign(block);
2673
uiDefBut(block, BUT, B_UVAUTO_STD1,"Standard",100,row,100,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping");
2674
uiDefBut(block, BUT, B_UVAUTO_STD2,"/2",200,row,33,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping 1/2");
2675
uiDefBut(block, BUT, B_UVAUTO_STD4,"/4",233,row,34,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping 1/4");
2676
uiDefBut(block, BUT, B_UVAUTO_STD8,"/8",267,row,33,butH, 0, 0, 0, 0, 0, "Applies standard UV mapping 1/8");
2677
uiBlockEndAlign(block);
2680
uiBlockBeginAlign(block);
2681
uiDefBut(block, BUT, B_UVAUTO_BOUNDS1,"Bounds",100,row,100,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/1");
2682
uiDefBut(block, BUT, B_UVAUTO_BOUNDS2,"/2",200,row,33,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/2");
2683
uiDefBut(block, BUT, B_UVAUTO_BOUNDS4,"/4",233,row,34,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/4");
2684
uiDefBut(block, BUT, B_UVAUTO_BOUNDS8,"/8",267,row,33,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/8");
2685
uiDefBut(block, BUT, B_UVAUTO_WINDOW,"From Window",100,row-butH,200,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping from window");
2160
2686
uiBlockEndAlign(block);
2161
2687
row-= 2*butHB+butS;
2163
2689
uiBlockBeginAlign(block);
2164
uiDefBut(block, BUT, B_UVAUTO_BOUNDS1,"Bounds 1/1",100,row,200,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/1");
2165
uiDefBut(block, BUT, B_UVAUTO_BOUNDS2,"1/2",100,row-butHB,66,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/2");
2166
uiDefBut(block, BUT, B_UVAUTO_BOUNDS4,"1/4",166,row-butHB,67,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/4");
2167
uiDefBut(block, BUT, B_UVAUTO_BOUNDS8,"1/8",234,row-butHB,66,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping with bounds 1/8");
2168
uiDefBut(block, BUT, B_UVAUTO_WINDOW,"From Window",100,row-2*butH,200,butH, 0, 0, 0, 0, 0, "Applies planar UV mapping from window");
2169
uiBlockEndAlign(block);
2172
uiBlockBeginAlign(block);
2173
uiDefButS(block,ROW,REDRAWVIEW3D,"No Edges",100,row,200,butH,&facesel_draw_edges, 2.0, 0, 0, 0, "Don't draw edges of deselected faces in 3D view");
2174
uiDefButS(block,ROW,REDRAWVIEW3D,"Draw Edges",100,row-butH,200,butH,&facesel_draw_edges, 2.0, 1.0, 0, 0, "Draw edges of deselected faces z-buffered in 3D view");
2175
uiDefButS(block,ROW,REDRAWVIEW3D,"All Edges",100,row-2*butH,200,butH,&facesel_draw_edges, 2.0, 2.0, 0, 0, "Draw all edges of deselected faces in 3D view");
2176
uiBlockEndAlign(block);
2690
uiDefButI(block, TOG|BIT|7, REDRAWVIEW3D, "Draw Faces", 100,row,200,butH, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
2691
uiDefButI(block,TOG|BIT|18,REDRAWVIEW3D,"Draw Edges",100,row-butHB,200,butH,&G.f, 2.0, 0, 0, 0, "Displays edges of visible faces");
2692
uiDefButI(block,TOG|BIT|21,REDRAWVIEW3D,"Draw Hidden Edges",100,row-2*butHB,200,butH,&G.f, 2.0, 1.0, 0, 0, "Displays edges of hidden faces");
2693
uiDefButI(block,TOG|BIT|20,REDRAWVIEW3D,"Draw Seams",100,row-3*butHB,200,butH,&G.f, 2.0, 2.0, 0, 0, "Displays UV unwrapping seams");
2694
uiBlockEndAlign(block);
2181
2699
uiBlockBeginAlign(block);
2182
2700
uiDefBut(block, BUT, B_UVAUTO_CUBE,"Cube",315,row,200,butH, 0, 0, 0, 0, 0, "Applies cube UV mapping");
2183
uiDefButF(block, NUM,B_UVAUTO_CUBESIZE ,"Size:",315,row-butHB,200,butH, &uv_calc_cubesize, 0.0001, 100.0, 10, 0, "Defines the cubemap size");
2701
uiDefButF(block, NUM,B_UVAUTO_CUBESIZE ,"Size:",315,row-butHB,200,butH, &uv_calc_cubesize, 0.0001, 100.0, 10, 3, "Defines the cubemap size");
2184
2702
uiBlockEndAlign(block);
2185
2703
row-= 2*butHB+butS;