1100
735
/* didn't find any */
1102
static void check_armature_bone_constraint(Object *ob, char *posechannel, char *constraint)
1104
/* check that bone exist in the active object */
1105
if (ob->type == OB_ARMATURE && ob->pose) {
1106
bPoseChannel *pchan;
1107
bPose *pose = ob->pose;
1108
for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
1109
if (!strcmp(pchan->name, posechannel)) {
1110
/* found it, now look for constraint channel */
1112
for (con=pchan->constraints.first; con; con=con->next) {
1113
if (!strcmp(con->name, constraint)) {
1114
/* found it, all ok */
1118
/* didn't find constraint, make empty */
1124
/* didn't find any */
1129
static void check_armature_sensor(bContext *C, void *arg1_but, void *arg2_sens)
1131
bArmatureSensor *sens = arg2_sens;
1132
uiBut *but = arg1_but;
1133
Object *ob= CTX_data_active_object(C);
1135
/* check that bone exist in the active object */
1136
but->retval = B_REDR;
1137
check_armature_bone_constraint(ob, sens->posechannel, sens->constraint);
1140
static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short xco, short yco, short width)
1142
bNearSensor *ns = NULL;
1143
bTouchSensor *ts = NULL;
1144
bKeyboardSensor *ks = NULL;
1145
bPropertySensor *ps = NULL;
1146
bArmatureSensor *arm = NULL;
1147
bMouseSensor *ms = NULL;
1148
bCollisionSensor *cs = NULL;
1149
bRadarSensor *rs = NULL;
1150
bRandomSensor *randomSensor = NULL;
1151
bRaySensor *raySens = NULL;
1152
bMessageSensor *mes = NULL;
1153
bJoystickSensor *joy = NULL;
1154
bActuatorSensor *as = NULL;
1155
bDelaySensor *ds = NULL;
1160
/* yco is at the top of the rect, draw downwards */
1162
set_col_sensor(sens->type, 0);
1170
glRects(xco, yco-ysize, xco+width, yco);
1171
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1173
draw_default_sensor_header(sens, block, xco, yco, width);
1183
glRects(xco, yco-ysize, xco+width, yco);
1184
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1186
draw_default_sensor_header(sens, block, xco, yco, width);
1190
// uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
1191
uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material");
1192
// uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity");
1196
case SENS_COLLISION:
1200
glRects(xco, yco-ysize, xco+width, yco);
1201
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1203
draw_default_sensor_header(sens, block, xco, yco, width);
1206
/* The collision sensor will become a generic collision (i.e. it */
1207
/* absorb the old touch sensor). */
1209
uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse",(short)(xco + 10),(short)(yco - 44),
1210
(short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0,
1211
"Changes to the set of colliding objects generated pulses");
1213
uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10 + (0.20 * (width-20))),(short)(yco - 44),
1214
(short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0,
1215
"Toggle collision on material or property");
1217
if (cs->mode & SENS_COLLISION_MATERIAL) {
1218
uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.40 * (width-20)),
1219
(short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, MAX_NAME, 0, 0,
1220
"Only look for Objects with this material");
1223
uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.40 * (width-20)), (short)(yco-44),
1224
(short)(0.6*(width-20)), 19, &cs->name, 0, MAX_NAME, 0, 0,
1225
"Only look for Objects with this property");
1228
/* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90,yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */
1237
glRects(xco, yco-ysize, xco+width, yco);
1238
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1240
draw_default_sensor_header(sens, block, xco, yco, width);
1243
uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19,
1244
&ns->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property");
1245
uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19,
1246
&ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance");
1247
uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19,
1248
&ns->resetdist, 0.0, 1000.0, 1000, 0, "Reset distance");
1256
glRects(xco, yco-ysize, xco+width, yco);
1257
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1259
draw_default_sensor_header(sens, block, xco, yco, width);
1263
uiDefBut(block, TEX, 1, "Prop:",
1264
(short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19,
1265
&rs->name, 0, MAX_NAME, 0, 0,
1266
"Only look for Objects with this property");
1268
str = "Type %t|+X axis %x0|+Y axis %x1|+Z axis %x2|-X axis %x3|-Y axis %x4|-Z axis %x5";
1269
uiDefButS(block, MENU, B_REDR, str,
1270
(short)(10+xco+0.7 * (width-20)), (short)(yco-44), (short)(0.3 * (width-22)), 19,
1271
&rs->axis, 2.0, 31, 0, 0,
1272
"Specify along which axis the radar cone is cast");
1274
uiDefButF(block, NUM, 1, "Ang:",
1275
(short)(10+xco), (short)(yco-68), (short)((width-20)/2), 19,
1276
&rs->angle, 0.0, 179.9, 10, 0,
1277
"Opening angle of the radar cone");
1278
uiDefButF(block, NUM, 1, "Dist:",
1279
(short)(xco+10 + (width-20)/2), (short)(yco-68), (short)((width-20)/2), 19,
1280
&rs->range, 0.01, 10000.0, 100, 0,
1281
"Depth of the radar cone");
1289
/* 5 lines: 120 height */
1290
ysize= (ks->type&1) ? 96:120;
1292
glRects(xco, yco-ysize, xco+width, yco);
1293
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1296
draw_default_sensor_header(sens, block, xco, yco, width);
1298
/* part of line 1 */
1299
uiDefBut(block, LABEL, 0, "Key", xco, yco-44, 40, 19, NULL, 0, 0, 0, 0, "");
1300
uiDefButBitS(block, TOG, 1, B_REDR, "All keys", xco+40+(width/2), yco-44, (width/2)-50, 19,
1301
&ks->type, 0, 0, 0, 0, "");
1304
if ((ks->type&1)==0) { /* is All Keys option off? */
1305
/* line 2: hotkey and allkeys toggle */
1306
but = uiDefKeyevtButS(block, 0, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code");
1307
uiButSetFunc(but, test_keyboard_event, ks, NULL);
1309
/* line 3: two key modifyers (qual1, qual2) */
1310
uiDefBut(block, LABEL, 0, "Hold", xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, "");
1311
but = uiDefKeyevtButS(block, 0, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code");
1312
uiButSetFunc(but, test_keyboard_event, ks, NULL);
1313
but = uiDefKeyevtButS(block, 0, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code");
1314
uiButSetFunc(but, test_keyboard_event, ks, NULL);
1317
/* line 4: toggle property for string logging mode */
1318
uiDefBut(block, TEX, 1, "LogToggle: ",
1319
xco+10, yco-((ks->type&1) ? 68:92), (width-20), 19,
1320
ks->toggleName, 0, MAX_NAME, 0, 0,
1321
"Property that indicates whether to log "
1322
"keystrokes as a string");
1324
/* line 5: target property for string logging mode */
1325
uiDefBut(block, TEX, 1, "Target: ",
1326
xco+10, yco-((ks->type&1) ? 92:116), (width-20), 19,
1327
ks->targetName, 0, MAX_NAME, 0, 0,
1328
"Property that receives the keystrokes in case "
1329
"a string is logged");
1338
glRects(xco, yco-ysize, xco+width, yco);
1339
uiEmboss((float)xco, (float)yco-ysize,
1340
(float)xco+width, (float)yco, 1);
1342
draw_default_sensor_header(sens, block, xco, yco, width);
1345
str= "Type %t|Equal %x0|Not Equal %x1|Interval %x2|Changed %x3";
1346
/* str= "Type %t|Equal %x0|Not Equal %x1"; */
1347
uiDefButI(block, MENU, B_REDR, str, xco+30,yco-44,width-60, 19,
1348
&ps->type, 0, 31, 0, 0, "Type");
1350
if (ps->type != SENS_PROP_EXPRESSION)
1352
uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19,
1353
ps->name, 0, MAX_NAME, 0, 0, "Property name");
1356
if (ps->type == SENS_PROP_INTERVAL)
1358
uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19,
1359
ps->value, 0, MAX_NAME, 0, 0, "check for min value");
1360
uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19,
1361
ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value");
1363
else if (ps->type == SENS_PROP_CHANGED) {
1367
uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19,
1368
ps->value, 0, MAX_NAME, 0, 0, "check for value");
1378
glRects(xco, yco-ysize, xco+width, yco);
1379
uiEmboss((float)xco, (float)yco-ysize,
1380
(float)xco+width, (float)yco, 1);
1382
draw_default_sensor_header(sens, block, xco, yco, width);
1385
if (ob->type == OB_ARMATURE) {
1386
uiBlockBeginAlign(block);
1387
but = uiDefBut(block, TEX, 1, "Bone: ",
1388
(xco+10), (yco-44), (width-20)/2, 19,
1389
arm->posechannel, 0, MAX_NAME, 0, 0,
1390
"Bone on which you want to check a constraint");
1391
uiButSetFunc(but, check_armature_sensor, but, arm);
1392
but = uiDefBut(block, TEX, 1, "Cons: ",
1393
(xco+10)+(width-20)/2, (yco-44), (width-20)/2, 19,
1394
arm->constraint, 0, MAX_NAME, 0, 0,
1395
"Name of the constraint you want to control");
1396
uiButSetFunc(but, check_armature_sensor, but, arm);
1397
uiBlockEndAlign(block);
1399
str= "Type %t|State changed %x0|Lin error below %x1|Lin error above %x2|Rot error below %x3|Rot error above %x4";
1401
uiDefButI(block, MENU, B_REDR, str, xco+10,yco-66,0.4*(width-20), 19,
1402
&arm->type, 0, 31, 0, 0, "Type");
1404
if (arm->type != SENS_ARM_STATE_CHANGED)
1406
uiDefButF(block, NUM, 1, "Value: ", xco+10+0.4*(width-20),yco-66,0.6*(width-20), 19,
1407
&arm->value, -10000.0, 10000.0, 100, 0, "Test the error against this value");
1417
glRects(xco, yco-ysize, xco+width, yco);
1418
uiEmboss((float)xco, (float)yco-ysize,
1419
(float)xco+width, (float)yco, 1);
1421
draw_default_sensor_header(sens, block, xco, yco, width);
1424
uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19,
1425
as->name, 0, MAX_NAME, 0, 0, "Actuator name, actuator active state modifications will be detected");
1433
glRects(xco, yco-ysize, xco+width, yco);
1434
uiEmboss((float)xco, (float)yco-ysize,
1435
(float)xco+width, (float)yco, 1);
1437
draw_default_sensor_header(sens, block, xco, yco, width);
1440
uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19,
1441
&ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of logic tics before the positive trigger (default 60 per second)");
1442
uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19,
1443
&ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
1444
uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44),
1445
(short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0,
1446
"Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics");
1453
/* Two lines: 48 pixels high. */
1456
glRects(xco, yco-ysize, xco+width, yco);
1457
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1459
/* line 1: header */
1460
draw_default_sensor_header(sens, block, xco, yco, width);
1462
/* Line 2: type selection. The number are a bit mangled to get
1463
* proper compatibility with older .blend files. */
1465
/* Any sensor type default is 0 but the ms enum starts in 1.
1466
* Therefore the mouse sensor is initialized to 1 in sca.c */
1467
str= "Type %t|Left button %x1|Middle button %x2|"
1468
"Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32";
1469
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19,
1470
&ms->type, 0, 31, 0, 0,
1471
"Specify the type of event this mouse sensor should trigger on");
1474
uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44),
1475
(short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0,
1476
"Moving the mouse over a different object generates a pulse");
1486
glRects(xco, yco-ysize, xco+width, yco);
1487
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1489
draw_default_sensor_header(sens, block, xco, yco, width);
1490
randomSensor = sens->data;
1491
/* some files were wrongly written, avoid crash now */
1494
uiDefButI(block, NUM, 1, "Seed: ", xco+10,yco-44,(width-20), 19,
1495
&randomSensor->seed, 0, 1000, 0, 0,
1496
"Initial seed of the generator. (Choose 0 for not random)");
1504
glRects(xco, yco-ysize, xco+width, yco);
1505
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1507
draw_default_sensor_header(sens, block, xco, yco, width);
1508
raySens = sens->data;
1510
/* 1. property or material */
1511
uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",
1512
xco + 10,yco - 44, 0.20 * (width-20), 19,
1513
&raySens->mode, 0.0, 0.0, 0, 0,
1514
"Toggle collision on material or property");
1516
if (raySens->mode & SENS_COLLISION_MATERIAL) {
1517
uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
1518
&raySens->matname, 0, MAX_NAME, 0, 0,
1519
"Only look for Objects with this material");
1522
uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19,
1523
&raySens->propname, 0, MAX_NAME, 0, 0,
1524
"Only look for Objects with this property");
1528
uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X",
1529
xco + 10,yco - 68, 0.10 * (width-20), 19,
1530
&raySens->mode, 0.0, 0.0, 0, 0,
1531
"Toggle X-Ray option (see through objects that don't have the property)");
1532
/* 2. sensing range */
1533
uiDefButF(block, NUM, 1, "Range", xco+10 + 0.10 * (width-20), yco-68, 0.5 * (width-20), 19,
1534
&raySens->range, 0.01, 10000.0, 100, 0,
1535
"Sense objects no farther than this distance");
1537
/* 3. axis choice */
1538
str = "Type %t|+ X axis %x1|+ Y axis %x0|+ Z axis %x2|- X axis %x3|- Y axis %x4|- Z axis %x5";
1539
uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
1540
&raySens->axisflag, 2.0, 31, 0, 0,
1541
"Specify along which axis the ray is cast");
1549
ysize = 2 * 24; /* total number of lines * 24 pixels/line */
1551
glRects(xco, yco-ysize, xco+width, yco);
1552
uiEmboss((float)xco, (float)yco-ysize,
1553
(float)xco+width, (float)yco, 1);
1555
/* line 1: header line */
1556
draw_default_sensor_header(sens, block, xco, yco, width);
1558
/* line 2: Subject filter */
1559
uiDefBut(block, TEX, 1, "Subject: ",
1560
(xco+10), (yco-44), (width-20), 19,
1561
mes->subject, 0, MAX_NAME, 0, 0,
1562
"Optional subject filter: only accept messages with this subject"
1563
", or empty for all");
1573
glRects(xco, yco-ysize, xco+width, yco);
1574
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1576
/* line 1: header */
1577
draw_default_sensor_header(sens, block, xco, yco, width);
1581
uiDefButC(block, NUM, 1, "Index:", xco+10, yco-44, 0.33 * (width-20), 19,
1582
&joy->joyindex, 0, SENS_JOY_MAXINDEX-1, 100, 0,
1583
"Specify which joystick to use");
1585
str= "Type %t|Button %x0|Axis %x1|Single Axis %x3|Hat%x2";
1586
uiDefButC(block, MENU, B_REDR, str, xco+87, yco-44, 0.26 * (width-20), 19,
1587
&joy->type, 0, 31, 0, 0,
1588
"The type of event this joystick sensor is triggered on");
1590
if (joy->type != SENS_JOY_AXIS_SINGLE) {
1591
if (joy->flag & SENS_JOY_ANY_EVENT) {
1592
switch (joy->type) {
1594
str = "All Axis Events";
1596
case SENS_JOY_BUTTON:
1597
str = "All Button Events";
1600
str = "All Hat Events";
1608
uiDefButBitS(block, TOG, SENS_JOY_ANY_EVENT, B_REDR, str,
1609
xco+10 + 0.475 * (width-20), yco-68, ((joy->flag & SENS_JOY_ANY_EVENT) ? 0.525 : 0.12) * (width-20), 19,
1610
&joy->flag, 0, 0, 0, 0,
1611
"Triggered by all events on this joysticks current type (axis/button/hat)");
1613
if (joy->type == SENS_JOY_BUTTON)
1615
if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
1616
uiDefButI(block, NUM, 1, "Number:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
1617
&joy->button, 0, 18, 100, 0,
1618
"Specify which button to use");
1621
else if (joy->type == SENS_JOY_AXIS) {
1622
uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
1623
&joy->axis, 1, 8.0, 100, 0,
1624
"Specify which axis pair to use, 1 is useually the main direction input");
1626
uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
1627
&joy->precision, 0, 32768.0, 100, 0,
1628
"Specify the precision of the axis");
1630
if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
1631
str = "Type %t|Up Axis %x1 |Down Axis %x3|Left Axis %x2|Right Axis %x0";
1632
uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
1633
&joy->axisf, 2.0, 31, 0, 0,
1634
"The direction of the axis, use 'All Events' to receive events on any direction");
1637
else if (joy->type == SENS_JOY_HAT) {
1638
uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
1639
&joy->hat, 1, 4.0, 100, 0,
1640
"Specify which hat to use");
1642
if ((joy->flag & SENS_JOY_ANY_EVENT)==0) {
1643
str = "Direction%t|Up%x1|Down%x4|Left%x8|Right%x2|%l|Up/Right%x3|Down/Left%x12|Up/Left%x9|Down/Right%x6";
1644
uiDefButI(block, MENU, 0, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19,
1645
&joy->hatf, 2.0, 31, 0, 0,
1646
"The direction of the hat, use 'All Events' to receive events on any direction");
1649
else { /* (joy->type == SENS_JOY_AXIS_SINGLE)*/
1650
uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
1651
&joy->axis_single, 1, 16.0, 100, 0,
1652
"Specify a single axis (verticle/horizontal/other) to detect");
1654
uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
1655
&joy->precision, 0, 32768.0, 100, 0,
1656
"Specify the precision of the axis");
1668
static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco, short yco, short width)
1670
bExpressionCont *ec;
1674
switch (cont->type) {
1675
case CONT_EXPRESSION:
1678
UI_ThemeColor(TH_PANEL);
1679
glRects(xco, yco-ysize, xco+width, yco);
1680
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1682
/* uiDefBut(block, LABEL, 1, "Not yet...", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, ""); */
1684
/* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */
1685
uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19,
1686
ec->str, 0, sizeof(ec->str), 0, 0,
1694
if (cont->data==NULL) init_controller(cont);
1697
UI_ThemeColor(TH_PANEL);
1698
glRects(xco, yco-ysize, xco+width, yco);
1699
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1702
uiBlockBeginAlign(block);
1703
uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4,yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)");
1705
uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script");
1707
uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
1708
uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting");
1710
uiBlockEndAlign(block);
1718
UI_ThemeColor(TH_PANEL);
1719
glRects(xco, yco-ysize, xco+width, yco);
1720
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1728
static int get_col_actuator(int type)
1731
case ACT_ACTION: return TH_PANEL;
1732
case ACT_SHAPEACTION: return TH_PANEL;
1733
case ACT_OBJECT: return TH_PANEL;
1734
case ACT_IPO: return TH_PANEL;
1735
case ACT_PROPERTY: return TH_PANEL;
1736
case ACT_SOUND: return TH_PANEL;
1737
case ACT_CAMERA: return TH_PANEL;
1738
case ACT_EDIT_OBJECT: return TH_PANEL;
1739
case ACT_GROUP: return TH_PANEL;
1740
case ACT_RANDOM: return TH_PANEL;
1741
case ACT_SCENE: return TH_PANEL;
1742
case ACT_MESSAGE: return TH_PANEL;
1743
case ACT_GAME: return TH_PANEL;
1744
case ACT_VISIBILITY: return TH_PANEL;
1745
case ACT_CONSTRAINT: return TH_PANEL;
1746
case ACT_STATE: return TH_PANEL;
1747
case ACT_ARMATURE: return TH_PANEL;
1748
case ACT_STEERING: return TH_PANEL;
1749
default: return TH_PANEL;
1752
static void set_col_actuator(int item, int medium)
1754
int col= get_col_actuator(item);
1755
UI_ThemeColorShade(col, medium?30:10);
1759
static void change_object_actuator(bContext *UNUSED(C), void *act, void *UNUSED(arg))
1761
bObjectActuator *oa = act;
1763
if (oa->type != oa->otype) {
1765
case ACT_OBJECT_NORMAL:
1766
memset(oa, 0, sizeof(bObjectActuator));
1767
oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL;
1768
oa->type = ACT_OBJECT_NORMAL;
1771
case ACT_OBJECT_SERVO:
1772
memset(oa, 0, sizeof(bObjectActuator));
1773
oa->flag = ACT_LIN_VEL_LOCAL;
1774
oa->type = ACT_OBJECT_SERVO;
1775
oa->forcerot[0] = 30.0f;
1776
oa->forcerot[1] = 0.5f;
1777
oa->forcerot[2] = 0.0f;
1783
static void change_ipo_actuator(bContext *UNUSED(C), void *arg1_but, void *arg2_ia)
1785
bIpoActuator *ia = arg2_ia;
1786
uiBut *but = arg1_but;
1788
if (but->retval & ACT_IPOFORCE)
1789
ia->flag &= ~ACT_IPOADD;
1790
else if (but->retval & ACT_IPOADD)
1791
ia->flag &= ~ACT_IPOFORCE;
1792
but->retval = B_REDR;
1795
static void update_object_actuator_PID(bContext *UNUSED(C), void *act, void *UNUSED(arg))
1797
bObjectActuator *oa = act;
1798
oa->forcerot[0] = 60.0f*oa->forcerot[1];
1801
static char *get_state_name(Object *ob, short bit)
1807
cont = ob->controllers.first;
1809
if (cont->state_mask & mask) {
1817
static void check_state_mask(bContext *C, void *arg1_but, void *arg2_mask)
1819
wmWindow *win= CTX_wm_window(C);
1820
int shift= win->eventstate->shift;
1821
unsigned int *cont_mask = arg2_mask;
1822
uiBut *but = arg1_but;
1824
if (*cont_mask == 0 || !(shift))
1825
*cont_mask = (1<<but->retval);
1826
but->retval = B_REDR;
1829
static void check_armature_actuator(bContext *C, void *arg1_but, void *arg2_act)
1831
bArmatureActuator *act = arg2_act;
1832
uiBut *but = arg1_but;
1833
Object *ob= CTX_data_active_object(C);
1835
/* check that bone exist in the active object */
1836
but->retval = B_REDR;
1837
check_armature_bone_constraint(ob, act->posechannel, act->constraint);
1841
static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlock *block, short xco, short yco, short width)
1843
bSoundActuator *sa = NULL;
1844
bObjectActuator *oa = NULL;
1845
bIpoActuator *ia = NULL;
1846
bPropertyActuator *pa = NULL;
1847
bCameraActuator *ca = NULL;
1848
bEditObjectActuator *eoa = NULL;
1849
bConstraintActuator *coa = NULL;
1850
bSceneActuator *sca = NULL;
1851
bGroupActuator *ga = NULL;
1852
bRandomActuator *randAct = NULL;
1853
bMessageActuator *ma = NULL;
1854
bActionActuator *aa = NULL;
1855
bGameActuator *gma = NULL;
1856
bVisibilityActuator *visAct = NULL;
1857
bTwoDFilterActuator *tdfa = NULL;
1858
bParentActuator *parAct = NULL;
1859
bStateActuator *staAct = NULL;
1860
bArmatureActuator *armAct = NULL;
1863
short ysize = 0, wval;
1869
/* yco is at the top of the rect, draw downwards */
1870
set_col_actuator(act->type, 0);
1877
wval = (width-100)/3;
1878
if (oa->type == ACT_OBJECT_NORMAL)
1880
if (ob->gameflag & OB_DYNAMIC) {
1887
glRects(xco, yco-ysize, xco+width, yco);
1888
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1890
uiBlockBeginAlign(block);
1891
uiDefBut(block, LABEL, 0, "Loc", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the location");
1892
uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, "");
1893
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, "");
1894
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, "");
1895
uiBlockEndAlign(block);
1897
uiDefBut(block, LABEL, 0, "Rot", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the rotation");
1898
uiBlockBeginAlign(block);
1899
uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, "");
1900
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, "");
1901
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, "");
1902
uiBlockEndAlign(block);
1904
uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
1905
uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
1907
if ( ob->gameflag & OB_DYNAMIC )
1909
uiDefBut(block, LABEL, 0, "Force", xco, yco-87, 55, 19, NULL, 0, 0, 0, 0, "Sets the force");
1910
uiBlockBeginAlign(block);
1911
uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, "");
1912
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, "");
1913
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, "");
1914
uiBlockEndAlign(block);
1916
uiDefBut(block, LABEL, 0, "Torque", xco, yco-106, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque");
1917
uiBlockBeginAlign(block);
1918
uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, "");
1919
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, "");
1920
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, "");
1921
uiBlockEndAlign(block);
1924
if ( ob->gameflag & OB_DYNAMIC )
1926
uiDefBut(block, LABEL, 0, "LinV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity");
1927
uiBlockBeginAlign(block);
1928
uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, "");
1929
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, "");
1930
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, "");
1931
uiBlockEndAlign(block);
1933
uiDefBut(block, LABEL, 0, "AngV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity");
1934
uiBlockBeginAlign(block);
1935
uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, "");
1936
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, "");
1937
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, "");
1938
uiBlockEndAlign(block);
1940
uiDefBut(block, LABEL, 0, "Damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity");
1941
uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, "");
1943
uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
1944
uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
1945
uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
1946
uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
1948
uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "use_additive",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
1951
else if (oa->type == ACT_OBJECT_SERVO)
1955
glRects(xco, yco-ysize, xco+width, yco);
1956
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
1958
uiDefBut(block, LABEL, 0, "Ref", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "");
1959
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+45, yco-45, wval*3, 19, &(oa->reference), "Reference object for velocity calculation, leave empty for world reference");
1960
uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target");
1961
uiBlockBeginAlign(block);
1962
uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, "");
1963
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, "");
1964
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, "");
1965
uiBlockEndAlign(block);
1966
uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-68, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates");
1968
uiDefBut(block, LABEL, 0, "Limit", xco, yco-91, 45, 19, NULL, 0, 0, 0, 0, "Select if the force needs to be limited along certain axis (local or global depending on LinV Local flag)");
1969
uiBlockBeginAlign(block);
1970
uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis");
1971
uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis");
1972
uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis");
1973
uiBlockEndAlign(block);
1974
uiDefBut(block, LABEL, 0, "Max", xco, yco-110, 45, 19, NULL, 0, 0, 0, 0, "Set the upper limit for force");
1975
uiDefBut(block, LABEL, 0, "Min", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Set the lower limit for force");
1976
if (oa->flag & ACT_SERVO_LIMIT_X) {
1977
uiDefButF(block, NUM, 0, "", xco+45, yco-110, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, "");
1978
uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, "");
1980
if (oa->flag & ACT_SERVO_LIMIT_Y) {
1981
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-110, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, "");
1982
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, "");
1984
if (oa->flag & ACT_SERVO_LIMIT_Z) {
1985
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-110, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, "");
1986
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, "");
1988
uiDefBut(block, LABEL, 0, "Servo", xco, yco-152, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller");
1989
uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-152, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient");
1990
uiDefBut(block, LABEL, 0, "Slow", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response");
1991
but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-171, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response");
1992
uiButSetFunc(but, update_object_actuator_PID, oa, NULL);
1993
uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-171, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response");
1994
uiDefButF(block, NUMSLI, B_REDR, "D: ", xco+45, yco-190, wval*3, 19, oa->forcerot+2, -100.0, 100.0, 100, 0, "Derivate coefficient, not required, high values can cause instability");
1996
str= "Motion Type %t|Simple motion %x0|Servo Control %x1";
1997
but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &oa->type, 0.0, 0.0, 0, 0, "");
1998
oa->otype = oa->type;
1999
uiButSetFunc(but, change_object_actuator, oa, NULL);
2004
case ACT_SHAPEACTION:
2007
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
2013
glRects(xco, yco-ysize, xco+width, yco);
2014
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2017
wval = (width-60)/3;
2019
// str= "Action types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
2020
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
2021
str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6|Displacement %x7";
2023
str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
2025
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, width/3, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type");
2026
uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+10+ (width/3), yco-24, ((width/3)*2) - (20 + 60), 19, &aa->act, "Action name");
2028
uiDefButBitS(block, TOGN, 1, 0, "Continue", xco+((width/3)*2)+20, yco-24, 60, 19,
2029
&aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time");
2032
if (aa->type == ACT_ACTION_FROM_PROP) {
2033
uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position");
2036
uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame");
2037
uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame");
2040
uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending");
2041
uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack");
2043
uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property");
2046
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
2047
if (aa->type == ACT_ACTION_MOTION) {
2048
uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action");
2063
glRects(xco, yco-ysize, xco+width, yco);
2064
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2066
str = "Ipo types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
2068
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, (width-20)/2, 19, &ia->type, 0, 0, 0, 0, "");
2070
but = uiDefButBitS(block, TOG, ACT_IPOFORCE, ACT_IPOFORCE,
2071
"Force", xco+10+(width-20)/2, yco-24, (width-20)/4-10, 19,
2072
&ia->flag, 0, 0, 0, 0,
2073
"Apply Ipo as a global or local force depending on the local option (dynamic objects only)");
2074
uiButSetFunc(but, change_ipo_actuator, but, ia);
2076
but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD,
2077
"Add", xco+3*(width-20)/4, yco-24, (width-20)/4-10, 19,
2078
&ia->flag, 0, 0, 0, 0,
2079
"Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag");
2080
uiButSetFunc(but, change_ipo_actuator, but, ia);
2082
/* Only show the do-force-local toggle if force is requested */
2083
if (ia->flag & (ACT_IPOFORCE|ACT_IPOADD)) {
2084
uiDefButBitS(block, TOG, ACT_IPOLOCAL, 0,
2085
"L", xco+width-30, yco-24, 20, 19,
2086
&ia->flag, 0, 0, 0, 0,
2087
"Let the ipo acts in local coordinates, used in Force and Add mode");
2090
if (ia->type==ACT_IPO_FROM_PROP) {
2091
uiDefBut(block, TEX, 0,
2092
"Prop: ", xco+10, yco-44, width-80, 19,
2093
ia->name, 0.0, MAX_NAME, 0, 0,
2094
"Use this property to define the Ipo position");
2097
uiDefButF(block, NUM, 0,
2098
"Sta", xco+10, yco-44, (width-80)/2, 19,
2099
&ia->sta, 1.0, MAXFRAMEF, 0, 0,
2101
uiDefButF(block, NUM, 0,
2102
"End", xco+10+(width-80)/2, yco-44, (width-80)/2, 19,
2103
&ia->end, 1.0, MAXFRAMEF, 0, 0,
2106
uiDefButBitS(block, TOG, ACT_IPOCHILD, B_REDR,
2107
"Child", xco+10+(width-80), yco-44, 60, 19,
2108
&ia->flag, 0, 0, 0, 0,
2109
"Update IPO on all children Objects as well");
2110
uiDefBut(block, TEX, 0,
2111
"FrameProp: ", xco+10, yco-64, width-20, 19,
2112
ia->frameProp, 0.0, MAX_NAME, 0, 0,
2113
"Assign the action's current frame number to this property");
2122
glRects(xco, yco-ysize, xco+width, yco);
2123
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2127
str= "Type%t|Assign%x0|Add %x1|Copy %x2|Toggle (bool/int/float/timer)%x3";
2128
uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type");
2130
uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name");
2133
if (pa->type==ACT_PROP_TOGGLE) {
2137
else if (pa->type==ACT_PROP_COPY) {
2138
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object");
2139
uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, MAX_NAME, 0, 0, "Copy this property");
2142
uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings");
2153
if (sa->flag & ACT_SND_3D_SOUND)
2158
wval = (width-20)/2;
2159
glRects(xco, yco-ysize, xco+width, yco);
2160
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2162
if (bmain->sound.first) {
2163
IDnames_to_pupstring(&str, "Sound files", NULL, &(bmain->sound), (ID *)sa->sound, &(sa->sndnr));
2164
/* reset this value, it is for handling the event */
2166
uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, "");
2167
uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19,
2168
"Load a sound file (remember to set caching on for small sounds that are played often)");
2171
char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|"
2172
"Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
2173
uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19,
2174
((ID *)sa->sound)->name+2, 0.0, MAX_ID_NAME-2, 0, 0, "");
2175
uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19,
2176
&sa->type, 0.0, 0.0, 0, 0, "");
2177
uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume,
2178
0.0, 1.0, 0, 0, "Sets the volume of this sound");
2179
uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0,
2180
12.0, 0, 0, "Sets the pitch of this sound");
2181
uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
2182
&sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
2183
if (sa->flag & ACT_SND_3D_SOUND) {
2184
uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19,
2185
&sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0,
2186
"The minimum gain of the sound, no matter how far it is away");
2187
uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19,
2188
&sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0,
2189
"The maximum gain of the sound, no matter how near it is");
2190
uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19,
2191
&sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0,
2192
"The reference distance is the distance where the sound has a gain of 1.0");
2193
uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19,
2194
&sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0,
2195
"The maximum distance at which you can hear the sound");
2196
uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19,
2197
&sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0,
2198
"The rolloff factor defines the influence factor on volume depending on distance");
2199
uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19,
2200
&sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0,
2201
"The gain outside the outer cone. The gain in the outer cone will be "
2202
"interpolated between this value and the normal gain in the inner cone");
2203
uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval,
2204
19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0,
2205
"The angle of the outer cone");
2206
uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval,
2207
19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0,
2208
"The angle of the inner cone");
2211
MEM_freeN((void *)str);
2214
uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file");
2225
glRects(xco, yco-ysize, xco+width, yco);
2226
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2230
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object");
2231
uiDefButF(block, NUM, 0, "Height:", xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, "");
2233
uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, "");
2235
if (ca->axis==0) ca->axis= 'x';
2236
uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis");
2237
uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis");
2239
uiDefButF(block, NUM, 0, "Max:", xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, "");
2245
case ACT_EDIT_OBJECT:
2249
if (eoa->type==ACT_EDOB_ADD_OBJECT) {
2251
glRects(xco, yco-ysize, xco+width, yco);
2252
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2254
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object and all its children (cant be on an visible layer)");
2255
uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the new Object lives");
2258
uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19,
2260
"Velocity upon creation");
2261
uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19,
2262
eoa->linVelocity, -100.0, 100.0, 10, 0,
2263
"Velocity upon creation, x component");
2264
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19,
2265
eoa->linVelocity+1, -100.0, 100.0, 10, 0,
2266
"Velocity upon creation, y component");
2267
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19,
2268
eoa->linVelocity+2, -100.0, 100.0, 10, 0,
2269
"Velocity upon creation, z component");
2270
uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_LINV, 0, "L", xco+45+3*wval, yco-68, 15, 19,
2271
&eoa->localflag, 0.0, 0.0, 0, 0,
2272
"Apply the transformation locally");
2275
uiDefBut(block, LABEL, 0, "AngV", xco, yco-90, 45, 19,
2277
"Angular velocity upon creation");
2278
uiDefButF(block, NUM, 0, "", xco+45, yco-90, wval, 19,
2279
eoa->angVelocity, -10000.0, 10000.0, 10, 0,
2280
"Angular velocity upon creation, x component");
2281
uiDefButF(block, NUM, 0, "", xco+45+wval, yco-90, wval, 19,
2282
eoa->angVelocity+1, -10000.0, 10000.0, 10, 0,
2283
"Angular velocity upon creation, y component");
2284
uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-90, wval, 19,
2285
eoa->angVelocity+2, -10000.0, 10000.0, 10, 0,
2286
"Angular velocity upon creation, z component");
2287
uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_ANGV, 0, "L", xco+45+3*wval, yco-90, 15, 19,
2288
&eoa->localflag, 0.0, 0.0, 0, 0,
2289
"Apply the rotation locally");
2293
else if (eoa->type==ACT_EDOB_END_OBJECT) {
2295
glRects(xco, yco-ysize, xco+width, yco);
2296
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2298
else if (eoa->type==ACT_EDOB_REPLACE_MESH) {
2300
glRects(xco, yco-ysize, xco+width, yco);
2301
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2303
uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, 1, "ME:", xco+40, yco-44, (width-80)/2, 19, &(eoa->me), "replace the existing, when left blank 'Phys' will remake the existing physics mesh");
2305
uiDefButBitS(block, TOGN, ACT_EDOB_REPLACE_MESH_NOGFX, 0, "Gfx", xco+40 + (width-80)/2, yco-44, (width-80)/4, 19, &eoa->flag, 0, 0, 0, 0, "Replace the display mesh");
2306
uiDefButBitS(block, TOG, ACT_EDOB_REPLACE_MESH_PHYS, 0, "Phys", xco+40 + (width-80)/2 +(width-80)/4, yco-44, (width-80)/4, 19, &eoa->flag, 0, 0, 0, 0, "Replace the physics mesh (triangle bounds only. compound shapes not supported)");
2308
else if (eoa->type==ACT_EDOB_TRACK_TO) {
2310
glRects(xco, yco-ysize, xco+width, yco);
2311
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2313
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Track to this Object");
2314
uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes");
2315
uiDefButS(block, TOG, 0, "3D", xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking");
2317
else if (eoa->type==ACT_EDOB_DYNAMICS) {
2319
glRects(xco, yco-ysize, xco+width, yco);
2320
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2322
str= "Dynamic Operation %t|Restore Dynamics %x0|Suspend Dynamics %x1|Enable Rigid Body %x2|Disable Rigid Body %x3|Set Mass %x4";
2323
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-44, (width-80), 19, &(eoa->dyn_operation), 0.0, 0.0, 0, 0, "");
2324
if (eoa->dyn_operation==4) {
2325
uiDefButF(block, NUM, 0, "", xco+40, yco-63, width-80, 19,
2326
&eoa->mass, 0.0, 10000.0, 10, 0,
2330
str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3|Dynamics %x4";
2331
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &eoa->type, 0.0, 0.0, 0, 0, "");
2337
case ACT_CONSTRAINT:
2340
if (coa->type == ACT_CONST_TYPE_LOC) {
2343
glRects(xco, yco-ysize, xco+width, yco);
2344
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2346
/* str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4|Rot X %x8|Rot Y %x16|Rot Z %x32"; */
2347
/* coa->flag &= ~(63); */
2348
str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4";
2351
uiDefButS(block, MENU, 1, str, xco+10, yco-65, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, "");
2353
uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter");
2354
uiDefBut(block, LABEL, 0, "Min", xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, "");
2355
uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, "");
2357
if (coa->flag & ACT_CONST_LOCX) fp= coa->minloc;
2358
else if (coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1;
2359
else if (coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2;
2360
else if (coa->flag & ACT_CONST_ROTX) fp= coa->minrot;
2361
else if (coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1;
2362
else fp= coa->minrot+2;
2364
uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, "");
2365
uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-65, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, "");
2367
else if (coa->type == ACT_CONST_TYPE_DIST) {
2370
glRects(xco, yco-ysize, xco+width, yco);
2371
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2373
str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32";
2374
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray");
2376
uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter");
2377
uiDefBut(block, LABEL, 0, "Range", xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, "Set the maximum length of ray");
2378
uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, "Dist", xco+80+(width-115)/2, yco-45, (width-115)/2, 19, &coa->flag, 0.0, 0.0, 0, 0, "Force distance of object to point of impact of ray");
2379
uiDefButBitS(block, TOG, ACT_CONST_LOCAL, 0, "L", xco+80+(width-115), yco-45, 25, 19,
2380
&coa->flag, 0.0, 0.0, 0, 0, "Set ray along object's axis or global axis");
2382
if (coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
2383
else if (coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
2384
else fp= coa->minloc+2;
2386
uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray");
2387
if (coa->flag & ACT_CONST_DISTANCE)
2388
uiDefButF(block, NUM, 0, "", xco+80+(width-115)/2, yco-65, (width-115)/2, 19, fp, -2000.0, 2000.0, 10, 0, "Keep this distance to target");
2389
uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19,
2390
&coa->flag, 0.0, 0.0, 0, 0, "Set object axis along (local axis) or parallel (global axis) to the normal at hit position");
2391
uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
2392
&coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
2393
if (coa->flag & ACT_CONST_MATERIAL) {
2394
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
2395
coa->matprop, 0, MAX_NAME, 0, 0,
2396
"Ray detects only Objects with this material");
2399
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
2400
coa->matprop, 0, MAX_NAME, 0, 0,
2401
"Ray detect only Objects with this property");
2403
uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19,
2404
&coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target");
2405
uiDefButS(block, NUM, 0, "time", xco+50, yco-103, (width-60)/2, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
2406
uiDefButS(block, NUM, 0, "rotDamp", xco+50+(width-60)/2, yco-103, (width-60)/2, 19, &(coa->rotdamp), 0.0, 100.0, 0, 0, "Use a different damping for orientation");
2408
else if (coa->type == ACT_CONST_TYPE_ORI) {
2411
glRects(xco, yco-ysize, xco+width, yco);
2412
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2414
str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4";
2415
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Select the axis to be aligned along the reference direction");
2417
uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter");
2418
uiDefBut(block, LABEL, 0, "X", xco+80, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, "");
2419
uiDefBut(block, LABEL, 0, "Y", xco+80+(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, "");
2420
uiDefBut(block, LABEL, 0, "Z", xco+80+2*(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, "");
2422
uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/3, 19, &coa->maxrot[0], -2000.0, 2000.0, 10, 0, "X component of reference direction");
2423
uiDefButF(block, NUM, 0, "", xco+80+(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[1], -2000.0, 2000.0, 10, 0, "Y component of reference direction");
2424
uiDefButF(block, NUM, 0, "", xco+80+2*(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[2], -2000.0, 2000.0, 10, 0, "Z component of reference direction");
2426
uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
2427
uiDefButF(block, NUM, 0, "min", xco+80, yco-84, (width-115)/2, 19, &(coa->minloc[0]), 0.0, 180.0, 10, 1, "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max");
2428
uiDefButF(block, NUM, 0, "max", xco+80+(width-115)/2, yco-84, (width-115)/2, 19, &(coa->maxloc[0]), 0.0, 180.0, 10, 1, "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max");
2430
else if (coa->type == ACT_CONST_TYPE_FH) {
2433
glRects(xco, yco-ysize, xco+width, yco);
2434
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2436
str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32";
2437
uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray (in world coordinate)");
2439
if (coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc;
2440
else if (coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1;
2441
else fp= coa->minloc+2;
2443
uiDefButF(block, NUM, 0, "damp", xco+10, yco-45, (width-70)/2, 19, &coa->maxrot[0], 0.0, 1.0, 1, 0, "Damping factor of the Fh spring force");
2444
uiDefButF(block, NUM, 0, "dist", xco+10+(width-70)/2, yco-45, (width-70)/2, 19, fp, 0.010, 2000.0, 10, 0, "Height of the Fh area");
2445
uiDefButBitS(block, TOG, ACT_CONST_DOROTFH, 0, "Rot Fh", xco+10+(width-70), yco-45, 50, 19, &coa->flag, 0.0, 0.0, 0, 0, "Keep object axis parallel to normal");
2447
uiDefButF(block, NUMSLI, 0, "Fh ", xco+80, yco-65, (width-115), 19, fp+3, 0.0, 1.0, 0, 0, "Spring force within the Fh area");
2448
uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19,
2449
&coa->flag, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
2450
uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19,
2451
&coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property");
2452
if (coa->flag & ACT_CONST_MATERIAL) {
2453
uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19,
2454
coa->matprop, 0, MAX_NAME, 0, 0,
2455
"Ray detects only Objects with this material");
2458
uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19,
2459
coa->matprop, 0, MAX_NAME, 0, 0,
2460
"Ray detect only Objects with this property");
2462
uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19,
2463
&coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target");
2464
uiDefButS(block, NUM, 0, "time", xco+50, yco-103, 90, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited");
2465
uiDefButF(block, NUM, 0, "rotDamp", xco+140, yco-103, (width-150), 19, &coa->maxrot[1], 0.0, 1.0, 1, 0, "Use a different damping for rotation");
2467
str= "Constraint Type %t|Location %x0|Distance %x1|Orientation %x2|Force field %x3";
2468
but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &coa->type, 0.0, 0.0, 0, 0, "");
2475
if (sca->type==ACT_SCENE_RESTART) {
2477
glRects(xco, yco-ysize, xco+width, yco);
2478
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2480
else if (sca->type==ACT_SCENE_CAMERA) {
2483
glRects(xco, yco-ysize, xco+width, yco);
2484
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2486
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object");
2488
else if (sca->type==ACT_SCENE_SET) {
2491
glRects(xco, yco-ysize, xco+width, yco);
2492
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2494
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene");
2496
else if (sca->type==ACT_SCENE_ADD_FRONT) {
2499
glRects(xco, yco-ysize, xco+width, yco);
2500
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2502
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene");
2504
else if (sca->type==ACT_SCENE_ADD_BACK) {
2507
glRects(xco, yco-ysize, xco+width, yco);
2508
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2510
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene");
2512
else if (sca->type==ACT_SCENE_REMOVE) {
2515
glRects(xco, yco-ysize, xco+width, yco);
2516
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2518
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene");
2520
else if (sca->type==ACT_SCENE_SUSPEND) {
2523
glRects(xco, yco-ysize, xco+width, yco);
2524
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2526
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene");
2528
else if (sca->type==ACT_SCENE_RESUME) {
2531
glRects(xco, yco-ysize, xco+width, yco);
2532
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2534
uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene");
2537
str= "Scene %t|Restart %x0|Set Scene %x1|Set Camera %x2|Add OverlayScene %x3|Add BackgroundScene %x4|Remove Scene %x5|Suspend Scene %x6|Resume Scene %x7";
2538
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &sca->type, 0.0, 0.0, 0, 0, "");
2545
if (gma->type == ACT_GAME_LOAD) {
2548
glRects(xco, yco-ysize, xco+width, yco);
2549
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2550
uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file");
2551
// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
2554
else if (gma->type == ACT_GAME_START) {
2556
glRects(xco, yco-ysize, xco+width, yco);
2557
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2559
uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file");
2560
uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation");
2563
else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) {
2565
glRects(xco, yco-ysize, xco+width, yco);
2566
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2569
//str = "Scene %t|Load game%x0|Start loaded game%x1|Restart this game%x2|Quit this game %x3";
2570
str = "Scene %t|Start new game%x0|Restart this game%x2|Quit this game %x3|Save bge.logic.globalDict %x4|Load bge.logic.globalDict %x5";
2571
uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &gma->type, 0.0, 0.0, 0, 0, "");
2581
glRects(xco, yco-ysize, xco+width, yco);
2582
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2584
str= "GroupKey types %t|Set Key %x6|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x5";
2586
uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, "");
2587
if (ga->type==ACT_GROUP_SET) {
2588
uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, MAX_NAME, 0, 0, "This name defines groupkey to be set");
2589
uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame");
2591
else if (ga->type==ACT_GROUP_FROM_PROP) {
2592
uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Group position");
2595
uiDefButI(block, NUM, 0, "State", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame");
2596
uiDefButI(block, NUM, 0, "End", xco+20+(width-40)/2, yco-44, (width-40)/2, 19, &ga->end, 0.0, 2500.0, 0, 0, "End frame");
2601
case ACT_VISIBILITY:
2604
glRects(xco, yco-ysize, xco+width, yco);
2605
uiEmboss((float)xco,
2606
(float)yco-ysize, (float)xco+width, (float)yco, 1);
2610
uiBlockBeginAlign(block);
2611
uiDefButBitI(block, TOGN, ACT_VISIBILITY_INVISIBLE, B_REDR,
2613
xco + 10, yco - 20, (width - 20)/3, 19, &visAct->flag,
2615
"Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)");
2616
uiDefButBitI(block, TOG, ACT_VISIBILITY_OCCLUSION, B_REDR,
2618
xco + 10 + ((width - 20)/3), yco - 20, (width - 20)/3, 19, &visAct->flag,
2620
"Set the object to occlude objects behind it. Initialized from the object type in physics button");
2621
uiBlockEndAlign(block);
2623
uiDefButBitI(block, TOG, ACT_VISIBILITY_RECURSIVE, 0,
2625
xco + 10 + (((width - 20)/3)*2)+10, yco - 20, ((width - 20)/3)-10, 19, &visAct->flag,
2627
"Sets all the children of this object to the same visibility/occlusion recursively");
2636
glRects(xco, yco-ysize, xco+width, yco);
2637
uiEmboss((float)xco,
2638
(float)yco-ysize, (float)xco+width, (float)yco, 1);
2642
str= "Operation %t|Cpy %x0|Add %x1|Sub %x2|Inv %x3";
2644
uiDefButI(block, MENU, B_REDR, str,
2645
xco + 10, yco - 24, 65, 19, &staAct->type,
2647
"Select the bit operation on object state mask");
2649
for (wval=0; wval<15; wval+=5) {
2650
uiBlockBeginAlign(block);
2651
for (stbit=0; stbit<5; stbit++) {
2652
but = uiDefButBitI(block, TOG, 1<<(stbit+wval), stbit+wval, "", (short)(xco+85+12*stbit+13*wval), yco-17, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval)));
2653
uiButSetFunc(but, check_state_mask, but, &(staAct->mask));
2655
for (stbit=0; stbit<5; stbit++) {
2656
but = uiDefButBitI(block, TOG, 1<<(stbit+wval+15), stbit+wval+15, "", (short)(xco+85+12*stbit+13*wval), yco-29, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval+15)));
2657
uiButSetFunc(but, check_state_mask, but, &(staAct->mask));
2660
uiBlockEndAlign(block);
2669
glRects(xco, yco-ysize, xco+width, yco);
2670
uiEmboss((float)xco,
2671
(float)yco-ysize, (float)xco+width, (float)yco, 1);
2673
randAct = act->data;
2676
uiDefButI(block, NUM, 1, "Seed: ", (xco+10),yco-24, 0.4 *(width-20), 19,
2677
&randAct->seed, 0, 1000, 0, 0,
2678
"Initial seed of the random generator. Use Python for more freedom. "
2679
" (Choose 0 for not random)");
2681
/* 2. distribution type */
2682
/* One pick per distribution. These numbers MUST match the #defines */
2684
str= "Distribution %t|Bool Constant %x0|Bool Uniform %x1"
2685
"|Bool Bernoulli %x2|Int Constant %x3|Int Uniform %x4"
2686
"|Int Poisson %x5|Float Constant %x6|Float Uniform %x7"
2687
"|Float Normal %x8|Float Neg. Exp. %x9";
2688
uiDefButI(block, MENU, B_REDR, str, (xco+10) + 0.4 * (width-20), yco-24, 0.6 * (width-20), 19,
2689
&randAct->distribution, 0.0, 0.0, 0, 0,
2690
"Choose the type of distribution");
2693
uiDefBut(block, TEX, 1, "Property:", (xco+10), yco-44, (width-20), 19,
2694
&randAct->propname, 0, MAX_NAME, 0, 0,
2695
"Assign the random value to this property");
2697
/*4. and 5. arguments for the distribution*/
2698
switch (randAct->distribution) {
2699
case ACT_RANDOM_BOOL_CONST:
2700
uiDefButBitI(block, TOG, 1, 1, "Always true", (xco+10), yco-64, (width-20), 19,
2701
&randAct->int_arg_1, 2.0, 1, 0, 0,
2702
"Always false or always true");
2704
case ACT_RANDOM_BOOL_UNIFORM:
2705
uiDefBut(block, LABEL, 0, " Do a 50-50 pick", (xco+10), yco-64, (width-20), 19,
2707
"Choose between true and false, 50% chance each");
2709
case ACT_RANDOM_BOOL_BERNOUILLI:
2710
uiDefButF(block, NUM, 1, "Chance", (xco+10), yco-64, (width-20), 19,
2711
&randAct->float_arg_1, 0.0, 1.0, 0, 0,
2712
"Pick a number between 0 and 1. Success if you stay "
2713
"below this value");
2715
case ACT_RANDOM_INT_CONST:
2716
uiDefButI(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19,
2717
&randAct->int_arg_1, -1000, 1000, 0, 0,
2718
"Always return this number");
2720
case ACT_RANDOM_INT_UNIFORM:
2721
uiDefButI(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19,
2722
&randAct->int_arg_1, -1000, 1000, 0, 0,
2723
"Choose a number from a range. "
2724
"Lower boundary of the range");
2725
uiDefButI(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19,
2726
&randAct->int_arg_2, -1000, 1000, 0, 0,
2727
"Choose a number from a range. "
2728
"Upper boundary of the range");
2730
case ACT_RANDOM_INT_POISSON:
2731
uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20), 19,
2732
&randAct->float_arg_1, 0.01, 100.0, 0, 0,
2733
"Expected mean value of the distribution");
2735
case ACT_RANDOM_FLOAT_CONST:
2736
uiDefButF(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19,
2737
&randAct->float_arg_1, 0.0, 1.0, 0, 0,
2738
"Always return this number");
2740
case ACT_RANDOM_FLOAT_UNIFORM:
2741
uiDefButF(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19,
2742
&randAct->float_arg_1, -10000.0, 10000.0, 0, 0,
2743
"Choose a number from a range"
2744
"Lower boundary of the range");
2745
uiDefButF(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19,
2746
&randAct->float_arg_2, -10000.0, 10000.0, 0, 0,
2747
"Choose a number from a range"
2748
"Upper boundary of the range");
2750
case ACT_RANDOM_FLOAT_NORMAL:
2751
uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20)/2, 19,
2752
&randAct->float_arg_1, -10000.0, 10000.0, 0, 0,
2753
"A normal distribution. Mean of the distribution");
2754
uiDefButF(block, NUM, 1, "SD: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19,
2755
&randAct->float_arg_2, 0.0, 10000.0, 0, 0,
2756
"A normal distribution. Standard deviation of the "
2759
case ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL:
2760
uiDefButF(block, NUM, 1, "Half-life time: ", (xco+10), yco-64, (width-20), 19,
2761
&randAct->float_arg_1, 0.001, 10000.0, 0, 0,
2762
"Negative exponential dropoff");
2765
; /* don't know what this distro is... can be useful for testing */
2774
ysize = 4 + (3 * 24); /* footer + number of lines * 24 pixels/line */
2776
glRects(xco, yco-ysize, xco+width, yco);
2777
uiEmboss((float)xco, (float)yco-ysize,
2778
(float)xco+width, (float)yco, 1);
2783
uiDefBut(block, TEX, 1, "To: ",
2784
(xco+10), (yco-(myline++*24)), (width-20), 19,
2785
&ma->toPropName, 0, MAX_NAME, 0, 0,
2786
"Optional send message to objects with this name only, or empty to broadcast");
2788
/* line 2: Message Subject */
2789
uiDefBut(block, TEX, 1, "Subject: ",
2790
(xco+10), (yco-(myline++*24)), (width-20), 19,
2791
&ma->subject, 0, MAX_NAME, 0, 0,
2792
"Optional message subject. This is what can be filtered on");
2794
/* line 3: Text/Property */
2795
uiDefButBitS(block, TOG, 1, B_REDR, "T/P",
2796
(xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19,
2797
&ma->bodyType, 0.0, 0.0, 0, 0,
2798
"Toggle message type: either Text or a PropertyName");
2800
if (ma->bodyType == ACT_MESG_MESG) {
2801
/* line 3: Message Body */
2802
uiDefBut(block, TEX, 1, "Body: ",
2803
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
2804
&ma->body, 0, MAX_NAME, 0, 0,
2805
"Optional message body Text");
2808
/* line 3: Property body (set by property) */
2809
uiDefBut(block, TEX, 1, "Propname: ",
2810
(xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19,
2811
&ma->body, 0, MAX_NAME, 0, 0,
2812
"The message body will be set by the Property Value");
2821
if (tdfa->type == ACT_2DFILTER_CUSTOMFILTER) {
2824
glRects( xco, yco-ysize, xco+width, yco );
2825
uiEmboss( (float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1 );
2829
case ACT_2DFILTER_MOTIONBLUR:
2831
uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur");
2832
uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value");
2835
uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur");
2838
case ACT_2DFILTER_BLUR:
2839
case ACT_2DFILTER_SHARPEN:
2840
case ACT_2DFILTER_DILATION:
2841
case ACT_2DFILTER_EROSION:
2842
case ACT_2DFILTER_LAPLACIAN:
2843
case ACT_2DFILTER_SOBEL:
2844
case ACT_2DFILTER_PREWITT:
2845
case ACT_2DFILTER_GRAYSCALE:
2846
case ACT_2DFILTER_SEPIA:
2847
case ACT_2DFILTER_INVERT:
2848
case ACT_2DFILTER_NOFILTER:
2849
case ACT_2DFILTER_DISABLED:
2850
case ACT_2DFILTER_ENABLED:
2851
uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set filter order");
2853
case ACT_2DFILTER_CUSTOMFILTER:
2854
uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set filter order");
2855
uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, "");
2859
str= "2D Filter %t|Motion Blur %x1|Blur %x2|Sharpen %x3|Dilation %x4|Erosion %x5|"
2860
"Laplacian %x6|Sobel %x7|Prewitt %x8|Gray Scale %x9|Sepia %x10|Invert %x11|Custom Filter %x12|"
2861
"Enable Filter %x-2|Disable Filter %x-1|Remove Filter %x0|";
2862
uiDefButS(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type");
2869
if (parAct->type==ACT_PARENT_SET) {
2872
glRects(xco, yco-ysize, xco+width, yco);
2873
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2874
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent");
2875
uiBlockBeginAlign(block);
2876
uiDefButBitS(block, TOGN, ACT_PARENT_COMPOUND, B_REDR,
2878
xco + 5, yco - 44, (width - 10)/2, 19, &parAct->flag,
2880
"Add this object shape to the parent shape (only if the parent shape is already compound)");
2881
uiDefButBitS(block, TOGN, ACT_PARENT_GHOST, B_REDR,
2883
xco + 5 + ((width - 10)/2), yco - 44, (width - 10)/2, 19, &parAct->flag,
2885
"Make this object ghost while parented (only if not compound)");
2886
uiBlockEndAlign(block);
2888
else if (parAct->type==ACT_PARENT_REMOVE) {
2891
glRects(xco, yco-ysize, xco+width, yco);
2892
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2895
str= "Parent %t|Set Parent %x0|Remove Parent %x1";
2896
uiDefButI(block, MENU, B_REDR, str, xco+5, yco-24, parAct->type==1?(width-80):90, 19, &parAct->type, 0.0, 0.0, 0, 0, "");
2903
if (ob->type == OB_ARMATURE) {
2904
str= "Constraint %t|Run armature %x0|Enable %x1|Disable %x2|Set target %x3|Set weight %x4";
2905
uiDefButI(block, MENU, B_REDR, str, xco+5, yco-24, (width-10)*0.35, 19, &armAct->type, 0.0, 0.0, 0, 0, "");
2907
switch (armAct->type) {
2912
uiBlockBeginAlign(block);
2913
but = uiDefBut(block, TEX, 1, "Bone: ",
2914
(xco+5), (yco-44), (width-10)/2, 19,
2915
armAct->posechannel, 0, MAX_NAME, 0, 0,
2916
"Bone on which the constraint is defined");
2917
uiButSetFunc(but, check_armature_actuator, but, armAct);
2918
but = uiDefBut(block, TEX, 1, "Cons: ",
2919
(xco+5)+(width-10)/2, (yco-44), (width-10)/2, 19,
2920
armAct->constraint, 0, MAX_NAME, 0, 0,
2921
"Name of the constraint you want to control");
2922
uiButSetFunc(but, check_armature_actuator, but, armAct);
2923
uiBlockEndAlign(block);
2925
switch (armAct->type) {
2926
case ACT_ARM_SETTARGET:
2927
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "Target: ", xco+5, yco-64, (width-10), 19, &(armAct->target), "Set this object as the target of the constraint");
2928
uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "Secondary Target: ", xco+5, yco-84, (width-10), 19, &(armAct->subtarget), "Set this object as the secondary target of the constraint (only IK polar target at the moment)");
2931
case ACT_ARM_SETWEIGHT:
2932
uiDefButF(block, NUM, B_REDR, "Weight:", xco+5+(width-10)*0.35,yco-24,(width-10)*0.65,19,&armAct->weight,0.0,1.0,0.0,0.0,"Set weight of this constraint");
2937
glRects(xco, yco-ysize, xco+width, yco);
2938
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2945
glRects(xco, yco-ysize, xco+width, yco);
2946
uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
2952
uiBlockSetEmboss(block, UI_EMBOSS);
2957
738
static void do_sensor_menu(bContext *C, void *UNUSED(arg), int event)
4777
2536
uiBlockLayoutResolve(block, NULL, &yco); /* stores final height in yco */
4780
uiComposeLinks(block);
4782
uiEndBlock(C, block);
4783
uiDrawBlock(C, block);
4785
if (idar) MEM_freeN(idar);
4788
void logic_buttons(bContext *C, ARegion *ar)
4790
Main *bmain= CTX_data_main(C);
4791
SpaceLogic *slogic= CTX_wm_space_logic(C);
4792
Object *ob= CTX_data_active_object(C);
4799
PointerRNA logic_ptr;
4800
int a, iact, stbit, offset;
4801
int xco, yco, width, ycoo;
4804
/* pin is a bool used for actuator and sensor drawing with states
4805
* pin so changing states dosnt hide the logic brick */
4809
logic_buttons_new(C, ar);
4813
if (ob==NULL) return;
4814
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
4816
BLI_snprintf(numstr, sizeof(numstr), "buttonswin %p", (void *)ar);
4817
block= uiBeginBlock(C, ar, numstr, UI_EMBOSS);
4818
uiBlockSetHandleFunc(block, do_logic_buts, NULL);
4820
RNA_pointer_create(NULL, &RNA_SpaceLogicEditor, slogic, &logic_ptr);
4822
idar= get_selected_and_linked_obs(C, &count, slogic->scaflag);
4824
/* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that
4825
* we can determine which is actually linked/visible */
4826
for (a=0; a<count; a++) {
4827
ob= (Object *)idar[a];
4828
act= ob->actuators.first;
4830
act->flag &= ~(ACT_LINKED|ACT_VISIBLE);
4833
/* same for sensors */
4834
sens= ob->sensors.first;
4836
sens->flag &= ~(SENS_VISIBLE);
4841
/* start with the controller because we need to know which one is visible */
4842
/* ******************************* */
4843
xco= 400; yco= 170; width= 300;
4845
uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, UI_UNIT_Y, "");
4847
uiBlockBeginAlign(block);
4848
uiDefButBitS(block, TOG, BUTS_CONT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects");
4849
uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show active Object");
4850
uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator");
4851
uiBlockEndAlign(block);
4853
for (a=0; a<count; a++) {
4854
unsigned int controller_state_mask = 0; /* store a bitmask for states that are used */
4856
ob= (Object *)idar[a];
4857
// uiClearButLock();
4858
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
4859
if ( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
4861
/* presume it is only objects for now */
4862
uiBlockBeginAlign(block);
4863
// if (ob->controllers.first) uiSetCurFont(block, UI_HELVB);
4864
uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name");
4865
// if (ob->controllers.first) uiSetCurFont(block, UI_HELV);
4866
uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
4867
uiBlockEndAlign(block);
4870
/* mark all actuators linked to these controllers */
4871
/* note that some of these actuators could be from objects that are not in the display list.
4872
* It's ok because those actuators will not be displayed here */
4873
cont= ob->controllers.first;
4875
for (iact=0; iact<cont->totlinks; iact++) {
4876
act = cont->links[iact];
4878
act->flag |= ACT_LINKED;
4880
controller_state_mask |= cont->state_mask;
4884
if (ob->scaflag & OB_SHOWCONT) {
4886
/* first show the state */
4887
uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, UI_UNIT_Y, "Object state menu: store and retrieve initial state");
4891
for (offset=0; offset<15; offset+=5) {
4892
uiBlockBeginAlign(block);
4893
for (stbit=0; stbit<5; stbit++) {
4894
but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+31+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset)));
4895
uiButSetFunc(but, check_state_mask, but, &(ob->state));
4897
for (stbit=0; stbit<5; stbit++) {
4898
but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+31+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15)));
4899
uiButSetFunc(but, check_state_mask, but, &(ob->state));
4902
uiBlockBeginAlign(block);
4903
uiDefButBitS(block, TOG, OB_ALLSTATE, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits");
4904
uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state");
4905
uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info");
4906
uiBlockEndAlign(block);
4910
/* display only the controllers that match the current state */
4912
for (stbit=0; stbit<32; stbit++) {
4913
if (!(ob->state & (1<<stbit)))
4915
/* add a separation between controllers of different states */
4920
cont= ob->controllers.first;
4922
if (cont->state_mask & (1<<stbit)) {
4923
/* this controller is visible, mark all its actuator */
4924
for (iact=0; iact<cont->totlinks; iact++) {
4925
act = cont->links[iact];
4927
act->flag |= ACT_VISIBLE;
4929
uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Delete Controller");
4930
uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Controller settings");
4931
uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)");
4933
sprintf(numstr, "%d", first_bit(cont->state_mask)+1);
4934
uiDefBlockBut(block, controller_state_mask_menu, cont, numstr, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)");
4936
if (cont->flag & CONT_SHOW) {
4937
cont->otype= cont->type;
4938
uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type");
4939
but = uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name");
4940
uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0);
4943
yco= draw_controllerbuttons(cont, block, xco, yco, width);
4944
if (yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
4948
glRecti(xco+22, yco, xco+width-22,yco+19);
4949
but = uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type");
4950
//uiButSetFunc(but, old_sca_move_controller, cont, NULL);
4951
but = uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name");
4952
//uiButSetFunc(but, old_sca_move_controller, cont, NULL);
4954
uiBlockBeginAlign(block);
4955
but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
4956
uiButSetFunc(but, old_sca_move_controller, cont, (void *)TRUE);
4957
but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
4958
uiButSetFunc(but, old_sca_move_controller, cont, (void *)FALSE);
4959
uiBlockEndAlign(block);
4964
but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
4965
uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR);
4967
uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, "");
4968
/* offset is >0 if at least one controller was displayed */
4980
/* ******************************* */
4981
xco= 10; yco= 170; width= 300;
4983
uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, UI_UNIT_Y, "");
4985
uiBlockBeginAlign(block);
4986
uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects");
4987
uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show active Object");
4988
uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
4989
uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states");
4990
uiBlockEndAlign(block);
4992
for (a=0; a<count; a++) {
4993
ob= (Object *)idar[a];
4994
// uiClearButLock();
4995
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
4997
if ( (ob->scavisflag & OB_VIS_SENS) == 0) continue;
4999
/* presume it is only objects for now */
5000
uiBlockBeginAlign(block);
5001
// if (ob->sensors.first) uiSetCurFont(block, UI_HELVB);
5002
uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
5003
// if (ob->sensors.first) uiSetCurFont(block, UI_HELV);
5004
uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor");
5005
uiBlockEndAlign(block);
5008
if (ob->scaflag & OB_SHOWSENS) {
5010
sens= ob->sensors.first;
5012
if (!(slogic->scaflag & BUTS_SENS_STATE) ||
5013
(sens->totlinks == 0) || /* always display sensor without links so that is can be edited */
5014
(sens->flag & SENS_PIN && slogic->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */
5015
(is_sensor_linked(block, sens))
5017
/* should we draw the pin? - for now always draw when there is a state */
5018
pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1 : 0;
5020
sens->flag |= SENS_VISIBLE;
5021
uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Delete Sensor");
5023
uiDefIconButBitS(block, ICONTOG, SENS_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
5025
uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Sensor settings");
5028
if (sens->flag & SENS_SHOW) {
5029
uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type");
5030
but = uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name");
5031
uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
5033
sens->otype= sens->type;
5034
yco= draw_sensorbuttons(ob, sens, block, xco, yco, width);
5035
if (yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
5038
set_col_sensor(sens->type, 1);
5039
glRecti(xco+22, yco, xco+width-22,yco+19);
5040
but = uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, "");
5041
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
5042
but = uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, "");
5043
//uiButSetFunc(but, old_sca_move_sensor, sens, NULL);
5045
uiBlockBeginAlign(block);
5046
but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
5047
uiButSetFunc(but, old_sca_move_sensor, sens, (void *)TRUE);
5048
but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
5049
uiButSetFunc(but, old_sca_move_sensor, sens, (void *)FALSE);
5050
uiBlockEndAlign(block);
5053
but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
5054
uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER);
5063
/* ******************************* */
5064
xco= 800; yco= 170; width= 300;
5065
uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, UI_UNIT_Y, "");
5067
uiBlockBeginAlign(block);
5068
uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects");
5069
uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show active Object");
5070
uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
5071
uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states");
5072
uiBlockEndAlign(block);
5073
for (a=0; a<count; a++) {
5074
ob= (Object *)idar[a];
5075
// uiClearButLock();
5076
// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
5077
if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
5079
/* presume it is only objects for now */
5080
uiBlockBeginAlign(block);
5081
// if (ob->actuators.first) uiSetCurFont(block, UI_HELVB);
5082
uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
5083
// if (ob->actuators.first) uiSetCurFont(block, UI_HELV);
5084
uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator");
5085
uiBlockEndAlign(block);
5088
if (ob->scaflag & OB_SHOWACT) {
5090
act= ob->actuators.first;
5092
if (!(slogic->scaflag & BUTS_ACT_STATE) ||
5093
!(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */
5094
(act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */
5095
(act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE)) {
5097
pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1 : 0;
5099
act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */
5100
uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Delete Actuator");
5102
uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller");
5103
uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Display the actuator");
5105
if (act->flag & ACT_SHOW) {
5106
act->otype= act->type;
5107
uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, UI_UNIT_Y, &act->type, 0, 0, 0, 0, "Actuator type");
5108
but = uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name");
5109
uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
5112
yco= draw_actuatorbuttons(bmain, ob, act, block, xco, yco, width);
5113
if (yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
5116
set_col_actuator(act->type, 1);
5117
glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19));
5118
/* but= */ uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator type");
5119
// uiButSetFunc(but, old_sca_move_actuator, act, NULL);
5120
/* but= */ uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator name");
5121
// uiButSetFunc(but, old_sca_move_actuator, act, NULL);
5123
uiBlockBeginAlign(block);
5124
but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up");
5125
uiButSetFunc(but, old_sca_move_actuator, act, (void *)TRUE);
5126
but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down");
5127
uiButSetFunc(but, old_sca_move_actuator, act, (void *)FALSE);
5128
uiBlockEndAlign(block);
5133
uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, act, LINK_ACTUATOR, 0, 0, 0, "");
5143
uiComposeLinks(block);
5145
uiEndBlock(C, block);
5146
uiDrawBlock(C, block);
5148
if (idar) MEM_freeN(idar);
2537
height = MIN2(height, yco);
2539
UI_view2d_totRect_set(&ar->v2d, 57.5f * U.widget_unit, height - U.widget_unit);
2542
UI_view2d_view_ortho(&ar->v2d);
2544
uiComposeLinks(block);
2546
uiEndBlock(C, block);
2547
uiDrawBlock(C, block);
2549
/* restore view matrix */
2550
UI_view2d_view_restore(C);
2552
if (idar) MEM_freeN(idar);