@@ -482,15 +482,18 @@ def add_virtual_springs(remove=False):
482
482
return
483
483
484
484
existing = np .append (cloth .eidx , cloth .virtual_springs , axis = 0 )
485
+ flip = existing [:, ::- 1 ]
486
+ existing = np .append (existing , flip , axis = 0 )
485
487
ls = existing [:,0 ]
488
+
486
489
springs = []
487
490
for i in idxer [sel ]:
488
491
489
492
# to avoid duplicates:
490
493
# where this vert occurs on the left side of the existing spring list
491
494
v_in = existing [i == ls ]
492
495
v_in_r = v_in [:,1 ]
493
- not_in = selected [- np .in1d (selected , v_in_r )]
496
+ not_in = selected [~ np .in1d (selected , v_in_r )]
494
497
idx_set = not_in [not_in != i ]
495
498
for sv in idx_set :
496
499
springs .append ([i , sv ])
@@ -755,15 +758,13 @@ def create_instance(new=True):
755
758
cloth .waiting = False
756
759
cloth .clicked = False # for the grab tool
757
760
758
- #print(cloth.eidx_tiler.shape, 'this is my tiler')
759
-
760
761
uni = np .unique (cloth .eidx_tiler , return_inverse = True , return_counts = True )
761
762
762
763
#cloth.mix = (1/uni[2][uni[1]])[:, nax].astype(np.float32) # force gets divided by number of springs
763
764
764
765
# this helps with extra springs behaving as if they had more mass---->>>
765
766
cloth .mix = mixology [unpinned ][:, nax ]
766
- cloth .mix = (cloth .mix ** .87 ) * 0.35
767
+ # cloth.mix = (cloth.mix ** .87) * 0.35
767
768
# -------------->>>
768
769
769
770
# new self collisions:
@@ -839,6 +840,9 @@ def run_handler(cloth):
839
840
co [cloth .pindexer ] += cloth .noise [cloth .pindexer ]
840
841
cloth .noise *= cloth .ob .modeling_cloth_noise_decay
841
842
843
+ # mix in vel before collisions and sewing
844
+ co [cloth .pindexer ] += cloth .vel [cloth .pindexer ]
845
+
842
846
cloth .vel_start [:] = co
843
847
force = cloth .ob .modeling_cloth_spring_force
844
848
mix = cloth .mix * force
@@ -883,7 +887,7 @@ def run_handler(cloth):
883
887
# grab inside spring iterations
884
888
if cloth .clicked : # for the grab tool
885
889
cloth .co [extra_data ['vidx' ]] = np .array (extra_data ['stored_vidx' ]) + np .array (+ extra_data ['move' ])
886
-
890
+
887
891
spring_dif = cloth .co - cloth .vel_start
888
892
grav = cloth .ob .modeling_cloth_gravity * (.01 / cloth .ob .modeling_cloth_iterations )
889
893
cloth .vel += revert_rotation (cloth .ob , np .array ([0 , 0 , grav ]))
@@ -922,9 +926,6 @@ def run_handler(cloth):
922
926
squared_move_dist += 1
923
927
cloth .vel *= (1 / (squared_move_dist / cloth .ob .modeling_cloth_velocity ))[:, nax ]
924
928
925
- # mix in vel before collisions and sewing
926
- co [cloth .pindexer ] += cloth .vel [cloth .pindexer ]
927
-
928
929
# old self collisions
929
930
self_col = cloth .ob .modeling_cloth_self_collision
930
931
@@ -2024,20 +2025,20 @@ def create_properties():
2024
2025
# spring forces ------------>>>
2025
2026
bpy .types .Object .modeling_cloth_spring_force = bpy .props .FloatProperty (name = "Modeling Cloth Spring Force" ,
2026
2027
description = "Set the spring force" ,
2027
- default = 3 , precision = 4 , min = 0 , max = 10 )#, update=refresh_noise)
2028
+ default = 1 , precision = 4 , min = 0 , max = 1.5 )#, update=refresh_noise)
2028
2029
2029
2030
bpy .types .Object .modeling_cloth_push_springs = bpy .props .FloatProperty (name = "Modeling Cloth Spring Force" ,
2030
2031
description = "Set the spring force" ,
2031
- default = 0.2 , precision = 4 , min = 0 , max = 2 )#, update=refresh_noise)
2032
+ default = 0.2 , precision = 4 , min = 0 , max = 1.5 )#, update=refresh_noise)
2032
2033
# -------------------------->>>
2033
2034
2034
2035
bpy .types .Object .modeling_cloth_gravity = bpy .props .FloatProperty (name = "Modeling Cloth Gravity" ,
2035
2036
description = "Modeling cloth gravity" ,
2036
- default = 0.0 , precision = 4 , min = - 1 , max = 1 )#, update=refresh_noise_decay)
2037
+ default = 0.0 , precision = 4 , min = - 10 , max = 10 )#, update=refresh_noise_decay)
2037
2038
2038
2039
bpy .types .Object .modeling_cloth_iterations = bpy .props .IntProperty (name = "Stiffness" ,
2039
2040
description = "How stiff the cloth is" ,
2040
- default = 4 , min = 1 , max = 500 )#, update=refresh_noise_decay)
2041
+ default = 2 , min = 1 , max = 500 )#, update=refresh_noise_decay)
2041
2042
2042
2043
bpy .types .Object .modeling_cloth_velocity = bpy .props .FloatProperty (name = "Velocity" ,
2043
2044
description = "Cloth keeps moving" ,
0 commit comments