Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if "string" in ArrayMesh—Always returns true #84041

Closed
donn-xx opened this issue Oct 27, 2023 · 4 comments · Fixed by #84054
Closed

if "string" in ArrayMesh—Always returns true #84041

donn-xx opened this issue Oct 27, 2023 · 4 comments · Fixed by #84054

Comments

@donn-xx
Copy link

donn-xx commented Oct 27, 2023

Godot version

v4.2.beta3.official [e8d57af]

System information

Godot v4.2.beta3 - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (nvidia; 535.113.01) - Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz (6 Threads)

Issue description

I hope the code explains it.

@tool
extends Node2D

@export var tog:bool:
	set(b):
		test()

var r = load("res://suzanne.res")

func test():
	print("random_string" in r) # Why does this print true?

	# Some more sleuthing:
	#$ grep random_string suzanne.res
	# <no output>
	#$ strings suzanne.res | grep random_string
	# <no output>

I get that suzanne.res is a binary file, but perhaps the return should rather be false?

Steps to reproduce

I have made a small repo for this too.

Minimal reproduction project

Made a repo here:
https://gitlab.com/dbat/godot-res-property-in-issue

@AThousandShips
Copy link
Member

The in operator on Object returns true if there's a property with that name

@AThousandShips
Copy link
Member

This is an error in the ArrayMesh code, investigating

@donn-xx
Copy link
Author

donn-xx commented Oct 30, 2023

Just in case this might help, I did a loop over all resources:

@tool
extends Node2D

@export var tog:bool:
	set(b):
		test()

func test() -> void:

	var erp = EditorResourcePicker.new()
	erp.base_type="Resource"

	var names:Array = erp.get_allowed_types()

	names = names.filter(func(i):
		return ClassDB.can_instantiate(i) and i != "Resource")

	for classname in names:
		var inst = ClassDB.instantiate(classname)
		if inst:
			if "Judge Dredd Is The Law" in inst:
				print(classname, " has issues")

Result — Some more to have a look at!

SkeletonModificationStack2D has issues
SkeletonModification2DLookAt has issues
SkeletonModification2DCCDIK has issues
SkeletonModification2DFABRIK has issues
SkeletonModification2DJiggle has issues
SkeletonModification2DTwoBoneIK has issues
SkeletonModification2DStackHolder has issues
SkeletonModification2DPhysicalBones has issues
ArrayMesh has issues (fixed now)
SkeletonProfile has issues
SkeletonProfileHumanoid has issues
BoneMap has issues

HTH

@AThousandShips
Copy link
Member

Most of these are addressed in:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants