2021-02-16 08:21:20 +01:00
extends Node
2021-02-23 19:12:20 +01:00
var function_exceptions : Array = [
2021-02-16 08:21:20 +01:00
# They exists without assigment like Class.method, because they may be a parent of other objects and children also should have disabled child.method, its children also etc. which is too much to do
" align " , # GH 45976
" _screen_pick_pressed " , # GH 45977
" debug_bake " , # GH 45978
" bake " , # GH 45978
" _editor_settings_changed " , # GH 45979
" _mesh_changed " , # GH 45980
" _submenu_timeout " , # GH 45981
" set_data " , # GH 45995 - probably this will cause a lot of different errors in other classes
" _set_user_data " , # GH 45996
" set_config_file " , # GH 45997
" _gui_input " , # GH 45998
" _unhandled_key_input " , # GH 45998
" navpoly_add " , #GH 43288
" create_from_mesh " , #GH 45999
" _thread_done " , #GH 46000
" generate " , #GH 46001
" _proximity_group_broadcast " , #GH 46002
" _direct_state_changed " , #GH 46003
" create_from " , #GH 46004
" create_from_blend_shape " , #GH 46004
" append_from " , #GH 46004
" get_column_width " , #GH 46005
" _unhandled_input " , # TODO
" _input " , # TODO
" lightmap_unwrap " , #GH 46007 - memory leak
" _input_type_changed " , #GH 46011
" add_node " , #GH 46012
" play " , #GH 46013
" connect_nodes_forced " , #GH 46014
" _set_tile_data " , #GH 46015
" add_image " , #GH 46016
" _edit_set_state " , #GH 46017
" _edit_set_position " , #GH 46018
" _edit_set_rect " , #GH 46018
" get " , #GH 46019
2021-02-23 19:12:20 +01:00
" instance_has " , #GH 46020
" _update_shader " , #GH 46062
" generate_tangents " , #GH 46059
" get_var " , #GH 46096
" force_drag " , #GH 46114
" set_script " , #GH 46120
" getvar " , #GH 46019
" get_available_chars " , #GH 46118
" set_primary_interface " , #GH 46180
" add_feed " , #GH 46181
" open_midi_inputs " , #GH 46183
" get_unix_time_from_datetime " , #GH 46188
" set_icon " , #GH 46189
" set_window_size " , #GH 46187
" get_screen_size " , #GH 46186
" get_screen_position " , #GH 46185
" set_current_screen " , #GH 46184
" build_capsule_planes " , #GH
" build_cylinder_planes " , #GH
" get_latin_keyboard_variant " , #GH TODO Memory Leak
" add_feed " , #GH
" poll " , #GH - HTTP CLIENT
" make_atlas " , #GH
" set_editor_hint " , #GH
2021-02-16 08:21:20 +01:00
" " , #GH
2021-02-23 19:12:20 +01:00
" collide " , #GH 46137
" collide_and_get_contacts " , #GH 46137
" collide_with_motion " , #GH 46137
" collide_with_motion_and_get_contacts " , #GH 46137
# TODO Check this later
" propagate_notification " ,
" notification " ,
2021-02-16 08:21:20 +01:00
2021-02-23 19:12:20 +01:00
# TODO Adds big spam when i>100 - look for possiblity to
2021-02-16 08:21:20 +01:00
" add_sphere " ,
2021-02-23 19:12:20 +01:00
# Spam when i~1000 - change to specific
" update_bitmask_region " ,
# Slow Function
" _update_sky " ,
# Undo/Redo function which doesn't provide enough information about types of objects, probably due vararg(variable size argument)
" add_do_method " ,
" add_undo_method " ,
2021-02-16 08:21:20 +01:00
# Do not save files and create files and folders
2021-02-23 19:12:20 +01:00
" pck_start " ,
2021-02-16 08:21:20 +01:00
" save " ,
" save_png " ,
" save_to_wav " ,
" save_to_file " ,
" make_dir " ,
" make_dir_recursive " ,
2021-02-23 19:12:20 +01:00
" save_encrypted " ,
" save_encrypted_pass " ,
" dump_resources_to_file " ,
" dump_memory_to_file " ,
# This also allow to save files
" open " ,
" open_encrypted " ,
" open_encrypted_with_pass " ,
" open_compressed " ,
2021-02-16 08:21:20 +01:00
# Do not warp mouse
" warp_mouse " ,
" warp_mouse_position " ,
2021-02-23 19:12:20 +01:00
# OS
" kill " ,
" shell_open " ,
" execute " ,
" delay_usec " ,
" delay_msec " ,
" alert " , # Stupid alert window opens
2021-02-16 08:21:20 +01:00
# Godot Freeze
2021-02-23 19:12:20 +01:00
" wait_to_finish " ,
" accept_stream " ,
" connect_to_stream " ,
2021-02-16 08:21:20 +01:00
" discover " ,
" wait " ,
2021-02-23 19:12:20 +01:00
" _create " , # TODO Check
" set_gizmo " , # Stupid function, needs as parameter an object which can't be instanced # TODO, create issue to hide it
# Spams Output
" print_tree " ,
" print_stray_nodes " ,
" print_tree_pretty " ,
" print_all_textures_by_size " ,
" print_all_resources " ,
" print_resources_in_use " ,
2021-02-16 08:21:20 +01:00
# Do not call other functions
" _call_function " ,
" call " ,
" call_deferred " ,
2021-02-23 19:12:20 +01:00
" callv " ,
# Looks like a bug in FuncRef, probably but not needed, because it call other functions
" call_func " ,
2021-02-16 08:21:20 +01:00
# Too dangerous, because add, mix and remove randomly nodes and objects
2021-02-23 19:12:20 +01:00
" replace_by " ,
" create_instance " ,
" set_owner " ,
" set_root_node " ,
" instance " ,
2021-02-16 08:21:20 +01:00
" init_ref " ,
" reference " ,
" unreference " ,
" new " ,
" duplicate " ,
" queue_free " ,
" free " ,
" remove_and_skip " ,
" remove_child " ,
" move_child " ,
" raise " ,
" add_child " ,
" add_child_below_node " ,
2021-02-23 19:12:20 +01:00
]
# List of slow functions, which may frooze project
var slow_functions : Array = [
" interpolate_baked " ,
" get_baked_length " ,
" get_baked_points " ,
" get_closest_offset " ,
" get_closest_point " , # Only Curve, but looks that a lot of other classes uses this
" get_baked_up_vectors " ,
" interpolate_baked_up_vector " ,
" tessellate " ,
" get_baked_tilts " ,
" set_enabled_inputs " ,
" grow_mask " ,
" force_update_transform " ,
# In 3d view some options are really slow, needs to be limited
" set_rings " ,
" set_amount " , # Particles
# Just a little slow functions
" is_enabler_enabled " ,
" set_enabler " ,
" get_aabb " ,
" set_aabb " ,
" is_on_screen "
]
# Specific classes which are initialized in specific way e.g. var undo_redo = get_undo_redo() instead var undo_redo = UndoRedo.new()
var only_instance : Array = [
" UndoRedo " ,
" Object " ,
" JSONRPC " ,
" MainLoop " ,
" SceneTree " ,
" ARVRPositionalTracker " ,
]
var invalid_signals : Array = [
" multi_selected " ,
" item_collapsed " ,
" button_pressed " ,
" " ,
" " ,
" " ,
# Probably Vararg
" tween_step " ,
" tween_completed " ,
" tween_started " ,
" data_channel_received " ,
" " ,
]
var disabled_classes : Array = [
" ProjectSettings " , # Don't mess with project settings, because they can broke entire your workflow
" EditorSettings " , # Also don't mess with editor settings
" SceneTree " , # Broke camera visibility
2021-02-16 08:21:20 +01:00
]
# Return all available classes to instance and test
func get_list_of_available_classes ( ) - > Array :
var full_class_list : Array = Array ( ClassDB . get_class_list ( ) )
var classes : Array = [ ]
full_class_list . sort ( )
var c = 0
2021-02-23 19:12:20 +01:00
var rr = 0
2021-02-16 08:21:20 +01:00
for name_of_class in full_class_list :
2021-02-23 19:12:20 +01:00
rr += 1
if name_of_class in disabled_classes :
2021-02-16 08:21:20 +01:00
continue
2021-02-23 19:12:20 +01:00
if name_of_class . find ( " Server " ) != - 1 :
2021-02-16 08:21:20 +01:00
continue
2021-02-23 19:12:20 +01:00
if ! ClassDB . is_parent_class ( name_of_class , " Node " ) && ! ClassDB . is_parent_class ( name_of_class , " Reference " ) :
continue
if ClassDB . can_instance ( name_of_class ) :
classes . push_back ( name_of_class )
c += 1
2021-02-16 08:21:20 +01:00
print ( str ( c ) + " choosen classes from all " + str ( full_class_list . size ( ) ) + " classes. " )
return classes