Godot Version
Godot 4.6
Question
the editor crashes when I add the data in the array via inspector, two days ago before passing between 4.5 to 4.6 it work fine, the editor simply freeze and doesnt send any error message, i have two codes of @tool resources, the error is only in line Backlog = aux
@tool
extends Resource
class_name LoopTimeKeyClass
@export var is_persistent : bool
@export var Backlog : Array[Resource] = []
@export var Forwardlog : Array[Resource] = []
func AddToBackLog(value : Resource):
var aux = Backlog.duplicate()
aux.append(value)
#error line
#################################################
#################################################
Backlog = aux
#################################################
#################################################
print("entro")
#the rest are the same function with little changes
-------------second code--------------------------------
@tool
class_name EventTimeLoopResource
extends Resource
@export var id : String
@export var description : String
@export var node_container_name : String
@export var ActivatorsKeys : Array[LoopTimeKeyClass]= [] :
set(value):
Change_activators_key(value,ActivatorsKeys,"BackLog")
ActivatorsKeys = value
notify_property_list_changed()
@export var OutputsKeys : Array[LoopTimeKeyClass]= [] :
set(value):
Change_activators_key(value,ActivatorsKeys,"ForwardLog")
ActivatorsKeys = value
notify_property_list_changed()
@export var is_active : bool = false
func Change_activators_key(new_key :Array[LoopTimeKeyClass] ,previous_key :Array[LoopTimeKeyClass],ListToChange : String):
var Added_keys:Array[LoopTimeKeyClass] = new_key.filter(func(item): return not previous_key.has(item))
UpdateKey(Added_keys,"AddTo"+ListToChange)
var deleted_keys :Array[LoopTimeKeyClass] = previous_key.filter(func(item): return not new_key.has(item))
UpdateKey(deleted_keys,"EraseFrom"+ListToChange)
func UpdateKey(keys_to_modify : Array[LoopTimeKeyClass], name_function_to_use : String):
if(keys_to_modify.size() > 0):
print("las keys para son" +str(keys_to_modify))
for i in keys_to_modify:
if i and i.has_method(name_function_to_use):
i.call(name_function_to_use,self)
else:
push_warning("El recurso no está cargado completamente o falta el método: " + str(i)+"de la funcion"+name_function_to_use)