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

"Export Selected Scenes" ignores "class_name" dependencies #51717

Open
Valeryn4 opened this issue Aug 16, 2021 · 6 comments · May be fixed by #89231
Open

"Export Selected Scenes" ignores "class_name" dependencies #51717

Valeryn4 opened this issue Aug 16, 2021 · 6 comments · May be fixed by #89231

Comments

@Valeryn4
Copy link
Contributor

Godot version

3.3.2-stable

System information

Windows 10, GTX 1050ti, GLES3

Issue description

"Export Selected Scenes" ignores dependencies.
Doesn't export class_name scripts.
Doesn't export ENV.
Doesn't export bus_layout

My export:
Screenshot_95

Open PCK/ZIP:
Screenshot_93

Missing resources preload:
Screenshot_94

code in image_object.gd

extends Node2D

export(DependenceScript.ImageType) var type_img #DependenceScript - dependence_script.gd

func _update_img() -> void :
	$Sprite.texture = DependenceScript.IMAGES[type_img] #preload all IMAGES

func _ready() -> void:
	_update_img()

code in dependence_script.gd

class_name DependenceScript
extends Node


enum ImageType {
	A,
	B,
	C,
	D,
	E,
}


const IMAGES := {
	ImageType.A : preload("res://img/heron_A.png"),
	ImageType.B : preload("res://img/cat_B.png"),
	ImageType.C : preload("res://img/panda_C.png"),
	ImageType.D : preload("res://img/hairy_ball_D.png"),
	ImageType.E : preload("res://img/cat_E.png"),
}

This issue created big problems for us when submitting to android

Steps to reproduce

  • create script "class_name TEST"
  • preload resources in script TEST
  • сall "TEST.my_resource_var" in the main scene or sub-scenes
  • export project from "export selected scenes"

Minimal reproduction project

Test project:
export to ./.export/
TestDependence.zip

@jbromberg

This comment was marked as off-topic.

@AThousandShips
Copy link
Member

AThousandShips commented Feb 9, 2024

@jbromberg Please don't bump without contributing significant new information. Use the 👍 reaction button on the first post instead.

If you can add some relevant information to this that's be very welcome though, but otherwise this doesn't help :)

So please provide a minimal project to display this issue clearly:

  • A small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the .godot folder in the archive (but keep project.godot).
  • Having an MRP is very important for contributors to be able to reproduce the bug in the same way that you are experiencing it. When testing a potential fix for the issue, contributors will use the MRP to validate that the fix is working as intended.
  • Drag and drop a ZIP archive to upload it (max 10 MB). Do not select another field until the project is done uploading.
  • Note for C# users: If your issue is not C#-specific, please upload a minimal reproduction project written in GDScript. This will make it easier for contributors to reproduce the issue locally as not everyone has a .NET setup available.

@jbromberg
Copy link

jbromberg commented Feb 9, 2024

@AThousandShips I provided new information on this related issue that has an MRP attached: #61556

@jbromberg
Copy link

I think they're slightly different, as this one refers specifically to when using "Export selected scenes" whereas the other issue refers to just using class_name when exporting a pck in general. With this issue, it seems like the exporter is missing dependencies. With the other, it seems like custom classes aren't properly registering.

@AThousandShips
Copy link
Member

AThousandShips commented Feb 9, 2024

That's a different issue, so please provide more info here, that's not the same

Please add a MRP to make this easier to test, the other issue isn't related so this needs a specific MRP :)

@jbromberg
Copy link

MRP is below. To reproduce, export main.tscn as a pck or zip and then load it in a separate project. The main.gd script will encounter an error as it's missing the dependency.gd script.

missing-deps-godot-mrp.zip

nfranck-toonboom added a commit to nfranck-toonboom/godot that referenced this issue Mar 6, 2024
Remove stub code from GDScripts' get_dependencies implementation, add working code for finding dependencies from parent classes and constant declarations

Fixes godotengine#51717
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.

4 participants