Is it possible to get which node/object has invoked the setter function?
why am I asking this?
atm I have custom animation player:
tool
extends Animation
func track_insert_key(track_idx : int, time : float, key, transition : float = 1) -> void:
var track_path=track_get_path(track_idx)
var key_node=<some_function>.get_node(track_path)
if(key_node.get_class()=="some_node"):
# do something before setting keyframe
.track_insert_key(track_idx, time, key, transition)
but I can eliminate the need of a custom animation player if I could intercept who called the getter function, maybe something like this:
tool
extends Node2D
var custom_variable=0 setget ,get_custom_variable
func get_custom_variable(by):
print("called by=",by)
if(by.get_class()=="Animation"):
# do something before setting keyframe
so is anything like this possible? or some similar approach which eliminates the need of a custom AnimationPlayer
?