Giter Club home page Giter Club logo

Comments (8)

andreas-volz avatar andreas-volz commented on September 7, 2024 2

Thanks, I created a new ticket in #96043

from godot.

AThousandShips avatar AThousandShips commented on September 7, 2024 1

Please edit your earlier comments instead of commenting several times in a row, it creates a lot of unnecessary notifications

from godot.

Naming-things-is-hard-btw avatar Naming-things-is-hard-btw commented on September 7, 2024 1

Please edit your earlier comments instead of commenting several times in a row, it creates a lot of unnecessary notifications

thanks i will do that

from godot.

Naming-things-is-hard-btw avatar Naming-things-is-hard-btw commented on September 7, 2024

update:
it looks like it imports mesh instances as importer mesh instances and it doesn't convert it back into a normal mesh via inportermesh::get_mesh()

update2:
i will dig a bit more
btw why does this importer use importer mesh instance class while gltf doesn't?
edit: okay gltf also uses that.... but somehow converts it to a normal mesh instance hmmmm...
maybe looping through the entire tree to convert importer mesh instance to a normal mesh instance might work?
im fully open for any better ideas.

update3:
actually this can be as simple as adding in fbxdocument::generate_scene()
meshinst.mesh = importermesh.mesh.get_mesh();
in a recursive loop right???

from godot.

andreas-volz avatar andreas-volz commented on September 7, 2024

My application could also load gltf with gdscript at runtime but if I just try the same with FBXDocument/FBXState I get this error:

E 0:00:28:0463 Viewer.gd:265 @ _load_gltf_or_fbx(): No loader found for resource: /home/andreas/Games/Assets/3d/kaykit/KayKit_Adventurers_1.0_SOURCE/Assets/fbx/rogue_texture.png (expected type: Texture2D)
<C++-Fehler> Method/function failed. Returning: Ref()
<C++-Quelle> core/io/resource_loader.cpp:291 @ _load()
Viewer.gd:265 @ _load_gltf_or_fbx()
Viewer.gd:253 @ load_fbx()
Viewer.gd:350 @ _on_files_dropped()

But the texture png exist at this path. I assume it's the same problem as it seems to be imported correct (e.g. animations are correctly read in) but the mesh is not available. My application is opensource. So in case the bug authors code isn't enough to analyze the problem I could link my code here.

from godot.

Naming-things-is-hard-btw avatar Naming-things-is-hard-btw commented on September 7, 2024

My application could also load gltf with gdscript at runtime but if I just try the same with FBXDocument/FBXState I get this error:

E 0:00:28:0463 Viewer.gd:265 @ _load_gltf_or_fbx(): No loader found for resource: /home/andreas/Games/Assets/3d/kaykit/KayKit_Adventurers_1.0_SOURCE/Assets/fbx/rogue_texture.png (expected type: Texture2D)
<C++-Fehler> Method/function failed. Returning: Ref()
<C++-Quelle> core/io/resource_loader.cpp:291 @ _load()
Viewer.gd:265 @ _load_gltf_or_fbx()
Viewer.gd:253 @ load_fbx()
Viewer.gd:350 @ _on_files_dropped()

But the texture png exist at this path. I assume it's the same problem as it seems to be imported correct (e.g. animations are correctly read in) but the mesh is not available. My application is opensource. So in case the bug authors code isn't enough to analyze the problem I could link my code here.

this seems off topic u should create a separate issue for that with a Minimal reproduction project (MRP)
ill try to look into that too
what version do you use
i tried what u've said and gltf importer works flawlessly

edit: sorry i misunderstood ur comment ur issue is relevant to this topic

from godot.

Naming-things-is-hard-btw avatar Naming-things-is-hard-btw commented on September 7, 2024

i was able to fix the issue [finally] but the "fix" is more of a flex tape rather than a real solution
i added this at line 2144 in fbx_document.cpp file, almost exactly at the end of the generate_scene function

	_convert_meshimporters_recursive(root);
	return root;
}

void FBXDocument::_convert_meshimporters_recursive(Node *parent) {
	TypedArray<Node> children = parent->get_children();
	for (int i = 0; i < children.size(); i++) {
		_convert_meshimporters_recursive(cast_to<Node>(children[i]));
		ImporterMeshInstance3D *child = cast_to<ImporterMeshInstance3D>(children[i]);
		if (child == nullptr) {
			continue;
		}
		Ref<Mesh> imported_mesh = cast_to<ImporterMeshInstance3D>(child)->get_mesh()->get_mesh();
		MeshInstance3D *meshinst = memnew(MeshInstance3D);
		child->replace_by(meshinst);
		meshinst->set_name(child->get_name());
		meshinst->set_transform(child->get_transform());
		meshinst->set_mesh(imported_mesh);
		meshinst->set_skin(child->get_skin());
		meshinst->set_skeleton_path(child->get_skeleton_path());
		memfree(child);
	}
}


and in fbx_document.hpp at line 68 i added

void _convert_meshimporters_recursive(Node *parent);

and now it looks good but i will test it more first i still have to duplicate transforms and other variables too
btw i only know gdscript this is the first time i do anything in c++ so please if u can help i will appreciate it
and still we need to find the real problem cus this might create more problems than it fixes idk

from godot.

Naming-things-is-hard-btw avatar Naming-things-is-hard-btw commented on September 7, 2024

Screenshot_20240824_223728
it works now
all meshes are converted (the fix)
all animations and transforms and materials imported (so it didn't break... cool)
now i have no idea what to do hehe
should i wait for review or pull or what exactly

from godot.

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.