Git Product home page Git Product logo

Comments (6)

SpyrexDE avatar SpyrexDE commented on May 30, 2024

This issue is probably related to godotengine/godot#78642. I tried adding the ScrollDamper as a custom type in the last commit but I am not sure if it helps with this issue. One thing you could try is deleting the .godot directory.

from smoothscroll.

ReikaKalseki avatar ReikaKalseki commented on May 30, 2024

One thing you could try is deleting the .godot directory.

Would that not brick my own project?

from smoothscroll.

SpyrexDE avatar SpyrexDE commented on May 30, 2024

Would that not brick my own project?

No, the .godot directory only contains cache data. (docs)

from smoothscroll.

ReikaKalseki avatar ReikaKalseki commented on May 30, 2024

Would that not brick my own project?

No, the .godot directory only contains cache data. (docs)

In fact it did, due to some straggling cached files, but I was able to fix it.

However, this did not fix the issue on initialization.

from smoothscroll.

HaroldLever avatar HaroldLever commented on May 30, 2024

There is a temporary solution. Open any script file (not built-in script) in Godot script editor, press "File-Save" or "File-Save all". It will force update all class cache.

from smoothscroll.

HaroldLever avatar HaroldLever commented on May 30, 2024

This might be a bug of Godot engine, for lots of users have raised issues of missing classes, especially for those classes in plugin.

You can try the code below which might fix your problem temporarily.

@tool

extends EditorScript

const cache_file_path := "res://.godot/global_script_class_cache.cfg"

const class_cache := [
	{
	"base": &"ScrollDamper",
	"class": &"CubicScrollDamper",
	"icon": "",
	"language": &"GDScript",
	"path": "res://addons/SmoothScroll/scroll_damper/cubic_scroll_damper.gd"
	}, {
	"base": &"ScrollDamper",
	"class": &"ExpoScrollDamper",
	"icon": "",
	"language": &"GDScript",
	"path": "res://addons/SmoothScroll/scroll_damper/expo_scroll_damper.gd"
	}, {
	"base": &"ScrollDamper",
	"class": &"LinearScrollDamper",
	"icon": "",
	"language": &"GDScript",
	"path": "res://addons/SmoothScroll/scroll_damper/linear_scroll_damper.gd"
	}, {
	"base": &"ScrollDamper",
	"class": &"QuadScrollDamper",
	"icon": "",
	"language": &"GDScript",
	"path": "res://addons/SmoothScroll/scroll_damper/quad_scroll_damper.gd"
	}, {
	"base": &"Resource",
	"class": &"ScrollDamper",
	"icon": "res://addons/SmoothScroll/scroll_damper/icon.svg",
	"language": &"GDScript",
	"path": "res://addons/SmoothScroll/scroll_damper/scroll_damper.gd"
	},
]

func _run() -> void:
	refresh()

func refresh():
	if not Engine.is_editor_hint(): return
	
	var global_class_list = ProjectSettings.get_global_class_list()
	var cache_file = ConfigFile.new()
	cache_file.load(cache_file_path)
	
	for item in class_cache:
		global_class_list.append(item)
	
	cache_file.set_value("", "list", global_class_list)
	cache_file.save(cache_file_path)

Please create a new GDScript file in your project and paste the code above, then run the editor script. Tutorial

If you had moved this plugin to another path, please modify path in class_cache to ensure script files' path are correct.

from smoothscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.