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

Why does Asset Placer rename my instanced scenes? #21

Open
r-nonini opened this issue Jun 2, 2024 · 1 comment
Open

Why does Asset Placer rename my instanced scenes? #21

r-nonini opened this issue Jun 2, 2024 · 1 comment

Comments

@r-nonini
Copy link

r-nonini commented Jun 2, 2024

Generally I really like the plugin but this is really bugging me.

If I add a scene by "Instantiate Child Scene" it uses the name of the root node, for example "Door".
If I add a scene by Asset Placer it uses the filename plus extension seperated by an underscore, for example "door_tscn".

Why this different naming convention? This is causing me a headache. I don't understand it.

@brohd11
Copy link

brohd11 commented Oct 4, 2024

It uses the PackedScene resource path to get the name. If you want to change it so the extension doesnt show up you can do this:

Line 436 of AssettPallette.cs

    private void OnSelectAsset(string path, string name)
	{
		if (path == _selectedAsset?.path) return;
		var pathNull = string.IsNullOrEmpty(path);
		_selectedAsset = pathNull ? null : CurrentLibraryData.GetAsset(path);
		//SelectedAssetName = name; OLD LINE CHANGE TO BELOW
		SelectedAssetName = path.GetFile().GetBaseName();
		ClearHologram();

If you want it to access the root node, gonna have to some how access the packed scene instance or just instance and queue free one right here. I am not a C# guy so this is all I managed above. Seems to be working fine for me

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

No branches or pull requests

2 participants