Skip to content

Commit

Permalink
Use lock instead of visible false.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu committed Nov 3, 2023
1 parent c3840e3 commit b170398
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/softbody2d/softbody2d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ func _create_rigid_body(skeleton: Skeleton2D, bone: Bone2D, mass, is_center: boo
rigid_body = RigidBody2D.new()
rigid_body.name = bone.name
var collision_shape = CollisionShape2D.new()
collision_shape.visible = false
collision_shape.set_meta("_edit_lock_", true)
collision_shape.shape = shape
collision_shape.name = shape_type + "Shape2D"
rigid_body.mass = mass
Expand All @@ -827,7 +827,7 @@ func _create_rigid_body(skeleton: Skeleton2D, bone: Bone2D, mass, is_center: boo
rigid_body.collision_layer = collision_layer
rigid_body.collision_mask = collision_mask
var remote_transform = RemoteTransform2D.new()
remote_transform.visible = false
remote_transform.set_meta("_edit_lock_", true)
remote_transform.name = "RemoteTransform2D"
rigid_body.add_child(remote_transform)
remote_transform.remote_path = "../../" + skeleton.name + "/" + bone.name
Expand Down Expand Up @@ -868,7 +868,7 @@ func _generate_joints(rigid_bodies: Array[RigidBody2D]):
connected_nodes[idx_a].append(node_b)
if joint_type == "pin":
var joint = PinJoint2D.new()
joint.visible = false
joint.set_meta("_edit_lock_", true)
joint.name = "Joint2D-"+node_a.name+"-"+node_b.name
joint.node_a = ".."
joint.node_b = "../../" + node_b.name
Expand All @@ -888,7 +888,7 @@ func _generate_joints(rigid_bodies: Array[RigidBody2D]):
else:
var joint = DampedSpringJoint2D.new()
joint.name = "Joint2D-"+node_a.name+"-"+node_b.name
joint.visible = false
joint.set_meta("_edit_lock_", true)
joint.node_a = ".."
joint.node_b = "../../" + node_b.name
joint.stiffness = stiffness
Expand All @@ -906,7 +906,7 @@ func _generate_joints(rigid_bodies: Array[RigidBody2D]):
if Engine.is_editor_hint():
joint.set_owner(get_tree().get_edited_scene_root())
var skeleton_node: Skeleton2D = get_node_or_null(skeleton)
skeleton_node.visible = false
skeleton_node.set_meta("_edit_lock_", true)
var skeleton_modification_stack:=SkeletonModificationStack2D.new()
for i in bones.size():
var skeleton_modification :=SkeletonModification2DLookAt.new()
Expand Down

0 comments on commit b170398

Please sign in to comment.