Getting access to submesh

magarcanmagarcan Posts: 14Member
edited January 30 in 3D

I've imported a mesh which has some submeses. Are there any way to access this submeshes?
Jus as example. Imagine I've imported a helicopter model and I want to access to the blades submesh in order to animate it. Or a car model and I want to rotate the wheels.

I've been able to view in the inspector the different surfaces but I have no idea how to access them.

Answers

  • MegalomaniakMegalomaniak Posts: 1,086Admin
    edited January 31

    By surfaces I suppose you mean material slots:

    I've Included numbers, 1 to 5 would be the items and order to click to get from example 0 to example 6, hope that makes sense.

    Edit: Ah, missed the part about the car wheels, so you don't mean material surfaces. Unless they are a separate object parented to the car you'd have to rig the wheels up with bones.

    Chances are you can't access your meshes individually since you didn't load/open the object as a new inherited scene.

  • wombatstampedewombatstampede Posts: 65Member

    Normally, you'll have an object structure in the 3D editor. (At least on DAE/Collada) these objects should translate into individual MeshInstance nodes in the resulting scene. You can then access & animate these individual nodes. Normally you would instance the imported mesh into another scene where you do the coding & animating.
    Here's an example structure in Blender (this is for a custom import script in godot 2.x so some names objects seem a bit odd):

  • magarcanmagarcan Posts: 14Member
    edited January 31

    @Megalomaniak said:
    By surfaces I suppose you mean material slots:

    I've Included numbers, 1 to 5 would be the items and order to click to get from example 0 to example 6, hope that makes sense.

    Edit: Ah, missed the part about the car wheels, so you don't mean material surfaces. Unless they are a separate object parented to the car you'd have to rig the wheels up with bones.

    Chances are you can't access your meshes individually since you didn't load/open the object as a new inherited scene.

    This is what I was talking about:

    @wombatstampede said:
    Normally, you'll have an object structure in the 3D editor. (At least on DAE/Collada) these objects should translate into individual MeshInstance nodes in the resulting scene. You can then access & animate these individual nodes. Normally you would instance the imported mesh into another scene where you do the coding & animating.
    Here's an example structure in Blender (this is for a custom import script in godot 2.x so some names objects seem a bit odd):

    At least in my model which was imported as .OBJ all individual meshes where instanced in the same node, not different nodes whith hierarchy.

  • wombatstampedewombatstampede Posts: 65Member
    edited January 31

    I see only one mesh in the subresources of that meshinstance. But multiple materials (& surfaces).
    I see no way of easily separately animating the different surfaces of the obj.

    The normal way would be to open the model in its original format in a 3D editor. If the mesh parts are already separated according to your needs then exporting it to i.e. DAE/Collada would be the way to go.

    If you only got the OBJ from some external source, or the original 3D model doesn't have any structure then you could import and split it in a 3D editor of your choice. In Blender I would either select the surfaces by material or/and via the select tools and then split the mesh into parts.

  • magarcanmagarcan Posts: 14Member
    edited January 31

    @wombatstampede said:
    I see only one mesh in the subresources of that meshinstance. But multiple materials (& surfaces).
    I see no way of easily separately animating the different surfaces of the obj.

    The normal way would be to open the model in its original format in a 3D editor. If the mesh parts are already separated according to your needs then exporting it to i.e. DAE/Collada would be the way to go.

    If you only got the OBJ from some external source, or the original 3D model doesn't have any structure then you could import and split it in a 3D editor of your choice. In Blender I would either select the surfaces by material or/and via the select tools and then split the mesh into parts.

    That's exactly what I'm going to try. I'm gonna import the .OBJ file into Blender and export it as .DAE, then import to GODOT and see what appens.

  • MegalomaniakMegalomaniak Posts: 1,086Admin
    Answer ✓

    Obj file format(old as it is) has one major downside, it doesn't support multiple objects in the truest sense. Every mesh you export into it will share the same basis. I'm saying this since you definitely will have to tweak it in blender, give each rotor it's own origin point at where you want it to rotate around.

Sign In or Register to comment.