@@ -428,12 +428,12 @@ def monitor_initBuffers(scene):
428
428
429
429
objA = objs [pair [0 ]]
430
430
objB = objs [pair [1 ]]
431
- if objA != None and objB != None :
431
+ elemGrpA = objsEGrp [pair [0 ]]
432
+ elemGrpB = objsEGrp [pair [1 ]]
433
+ if objA != None and objB != None and elemGrpA != - 1 and elemGrpB != - 1 :
432
434
tol = next (connectsTol_iter )
433
435
geo = next (connectsGeo_iter )
434
436
geoContactArea = geo [0 ]
435
- elemGrpA = objsEGrp [pair [0 ]]
436
- elemGrpB = objsEGrp [pair [1 ]]
437
437
elemGrps_elemGrpA = elemGrps [elemGrpA ]
438
438
elemGrps_elemGrpB = elemGrps [elemGrpB ]
439
439
Prio_A = elemGrps_elemGrpA [EGSidxPrio ]
@@ -498,7 +498,8 @@ def monitor_checkForChange(scene):
498
498
499
499
props = bpy .context .window_manager .bcb
500
500
connects = bpy .app .driver_namespace ["bcb_monitor" ]
501
- progrWeakVar = 1 - bpy .app .driver_namespace ["bcb_progrWeakTmp" ]
501
+ try : progrWeakVar = 1 - bpy .app .driver_namespace ["bcb_progrWeakTmp" ]
502
+ except : progrWeakVar = 1
502
503
rbw_steps_per_second = scene .rigidbody_world .steps_per_second
503
504
rbw_time_scale = scene .rigidbody_world .time_scale
504
505
@@ -679,7 +680,7 @@ def monitor_checkForChange(scene):
679
680
cntB += 1
680
681
681
682
# Progressive Weakening
682
- if qProgrWeak :
683
+ if qProgrWeak and progrWeakVar != 1 :
683
684
for const in consts :
684
685
const .rigid_body_constraint .breaking_threshold *= progrWeakVar
685
686
@@ -766,11 +767,11 @@ def monitor_initBuffers_fm(scene):
766
767
767
768
objA = objs [pair [0 ]]
768
769
objB = objs [pair [1 ]]
769
- if objA != None and objB != None :
770
+ elemGrpA = objsEGrp [pair [0 ]]
771
+ elemGrpB = objsEGrp [pair [1 ]]
772
+ if objA != None and objB != None and elemGrpA != - 1 and elemGrpB != - 1 :
770
773
geo = next (connectsGeo_iter )
771
774
geoContactArea = geo [0 ]
772
- elemGrpA = objsEGrp [pair [0 ]]
773
- elemGrpB = objsEGrp [pair [1 ]]
774
775
elemGrps_elemGrpA = elemGrps [elemGrpA ]
775
776
elemGrps_elemGrpB = elemGrps [elemGrpB ]
776
777
Prio_A = elemGrps_elemGrpA [EGSidxPrio ]
@@ -821,7 +822,8 @@ def monitor_checkForChange_fm(scene):
821
822
props = bpy .context .window_manager .bcb
822
823
elemGrps = global_vars .elemGrps
823
824
connects = bpy .app .driver_namespace ["bcb_monitor" ]
824
- progrWeakVar = 1 - bpy .app .driver_namespace ["bcb_progrWeakTmp" ]
825
+ try : progrWeakVar = 1 - bpy .app .driver_namespace ["bcb_progrWeakTmp" ]
826
+ except : progrWeakVar = 1
825
827
rbw_steps_per_second = scene .rigidbody_world .steps_per_second
826
828
rbw_time_scale = scene .rigidbody_world .time_scale
827
829
@@ -938,7 +940,7 @@ def monitor_checkForChange_fm(scene):
938
940
con .breaking_threshold = constsBrkThres [i ] + (brkThresInc * rbw_time_scale / rbw_steps_per_second )
939
941
940
942
# Progressive Weakening
941
- if qProgrWeak :
943
+ if qProgrWeak and progrWeakVar != 1 :
942
944
for const in consts :
943
945
const .breaking_threshold *= progrWeakVar
944
946
@@ -1010,8 +1012,10 @@ def monitor_initTriggers(scene):
1010
1012
grpName = elemGrp [EGSidxName ]
1011
1013
grpObjs = []
1012
1014
for obj in objs :
1013
- if elemGrp == elemGrps [objsEGrp [objsDict [obj ]]]:
1014
- grpObjs .append (obj )
1015
+ elemGrpIdx = objsEGrp [objsDict [obj ]]
1016
+ if elemGrpIdx != - 1 :
1017
+ if elemGrp == elemGrps [elemGrpIdx ]:
1018
+ grpObjs .append (obj )
1015
1019
grpsObjs [grpName ] = grpObjs
1016
1020
1017
1021
### Get trigger data from text file
@@ -1278,8 +1282,10 @@ def monitor_dampingRegion(scene):
1278
1282
grpName = elemGrp [EGSidxName ]
1279
1283
grpObjs = []
1280
1284
for obj in objs :
1281
- if elemGrp == elemGrps [objsEGrp [objsDict [obj ]]]:
1282
- grpObjs .append (obj )
1285
+ elemGrpIdx = objsEGrp [objsDict [obj ]]
1286
+ if elemGrpIdx != - 1 :
1287
+ if elemGrp == elemGrps [elemGrpIdx ]:
1288
+ grpObjs .append (obj )
1283
1289
grpsObjs [grpName ] = grpObjs
1284
1290
1285
1291
### On start frame backup data
@@ -1387,8 +1393,10 @@ def monitor_dampingRegion_fm(scene):
1387
1393
grpName = elemGrp [EGSidxName ]
1388
1394
grpObjs = []
1389
1395
for obj in objs :
1390
- if elemGrp == elemGrps [objsEGrp [objsDict [obj ]]]:
1391
- grpObjs .append (obj )
1396
+ elemGrpIdx = objsEGrp [objsDict [obj ]]
1397
+ if elemGrpIdx != - 1 :
1398
+ if elemGrp == elemGrps [elemGrpIdx ]:
1399
+ grpObjs .append (obj )
1392
1400
grpsObjs [grpName ] = grpObjs
1393
1401
1394
1402
### On start frame backup data
@@ -1482,8 +1490,10 @@ def monitor_displCorrectDiffExport(scene):
1482
1490
grpName = elemGrp [EGSidxName ]
1483
1491
grpObjs = []
1484
1492
for obj in objs :
1485
- if elemGrp == elemGrps [objsEGrp [objsDict [obj ]]]:
1486
- grpObjs .append (obj )
1493
+ elemGrpIdx = objsEGrp [objsDict [obj ]]
1494
+ if elemGrpIdx != - 1 :
1495
+ if elemGrp == elemGrps [elemGrpIdx ]:
1496
+ grpObjs .append (obj )
1487
1497
grpsObjs [grpName ] = grpObjs
1488
1498
1489
1499
if "bcb_vLocs" not in bpy .app .driver_namespace :
@@ -1555,8 +1565,10 @@ def monitor_freeBuffers(scene):
1555
1565
grpName = elemGrp [EGSidxName ]
1556
1566
grpObjs = []
1557
1567
for obj in objs :
1558
- if elemGrp == elemGrps [objsEGrp [objsDict [obj ]]]:
1559
- grpObjs .append (obj )
1568
+ elemGrpIdx = objsEGrp [objsDict [obj ]]
1569
+ if elemGrpIdx != - 1 :
1570
+ if elemGrp == elemGrps [elemGrpIdx ]:
1571
+ grpObjs .append (obj )
1560
1572
grpsObjs [grpName ] = grpObjs
1561
1573
1562
1574
if connects != None :
@@ -1644,8 +1656,10 @@ def monitor_freeBuffers_fm(scene):
1644
1656
grpName = elemGrp [EGSidxName ]
1645
1657
grpObjs = []
1646
1658
for obj in objs :
1647
- if elemGrp == elemGrps [objsEGrp [objsDict [obj ]]]:
1648
- grpObjs .append (obj )
1659
+ elemGrpIdx = objsEGrp [objsDict [obj ]]
1660
+ if elemGrpIdx != - 1 :
1661
+ if elemGrp == elemGrps [elemGrpIdx ]:
1662
+ grpObjs .append (obj )
1649
1663
grpsObjs [grpName ] = grpObjs
1650
1664
1651
1665
if connects != None :
0 commit comments