Skip to content

Commit

Permalink
Merge branch 'improve-deformers-selection'
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudofoz committed Dec 17, 2024
2 parents 6cda2df + 4a19241 commit 2e9fcee
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions addons/deformablemesh/dm_deformable_mesh.gd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Deformer = preload("dm_deformer.gd")
dm_init_surfaces()

## Array of deformer node paths that affects this mesh.
@onready @export var deformers: Array[NodePath]:
@onready @export var deformers: Array[Deformer]:
set(value):
deformers = value
dm_find_deformers()
Expand Down Expand Up @@ -128,15 +128,12 @@ func dm_rem_deformer(deformer: Deformer) -> void:
func dm_find_deformers():
if(!is_inside_tree()): return
dm_clean_deformers()
for path in deformers:
var n = get_node_or_null(path)
if(!n): continue
var d = n as Deformer
for d in deformers:
if(d && !dm_deformers.has(d)):
dm_add_deformer(d)
else:
var didx = deformers.find(path)
deformers[didx] = NodePath()
var didx = deformers.find(d)
deformers[didx] = null
notify_property_list_changed()
dm_need_update = true

Expand Down

0 comments on commit 2e9fcee

Please sign in to comment.