54

Situation

I have obtained some blender files & licences for 3d models of transit vans and some trucks. Currently, when I export these objects to .obj files they are rather large, take a while to render and look to have been built in segments.

Problem

These models need to be used on Android devices and they need to be observable through one .obj file. What is happening is when I open the .obj I am not seeing the same model as I do in Blender. The doors and wheels of the vans for instance don't appear.

End Product

I need to find a way of reducing these models to be just one single object. Items on the interior of the van don't matter, seats for example. The file would ideally also be around 200kb, and exportable in a single .obj file. Can anybody shed some light on how I would go about doing this?

Alec.
  • 643
  • 1
  • 6
  • 7
  • 1
    Related: http://gamedev.stackexchange.com/questions/33843/how-to-merge-two-objects-in-blender – House Aug 28 '13 at 16:06
  • Please don't cross post questions. Post only on the site where the question fits best. – House Aug 28 '13 at 16:28

3 Answers3

78

Remove the objects you no longer want in your model, like the interior objects. Then select all of your objects that you want in a single model and hit Ctrl + J then click Join selected meshes. The multiple objects will now be one model you can export.

For further reducing the complexity of the model for better performance, you'll need to either remove more objects before joining them or you need to remove details from the objects you want to keep.

Polosson
  • 6,544
  • 8
  • 33
  • 61
House
  • 1,476
  • 1
  • 14
  • 16
  • 1
    To further aid anybody who stumbles across this. I found the decimator modifier very good for reducing the overall size of the exported .obj file. – Alec. Sep 13 '13 at 09:43
  • For also future use... use the Select Linked command to select the individual meshes inside the object! – 835 Jun 05 '15 at 15:31
  • 2
    How do I select all of the part that I want to? I clicked on all of them and they were a light blue,does that mean they are all selected? I could still not combine them into one whole,I did ctrl + J. –  Sep 03 '15 at 22:26
  • 2
    I use "B" for box-selecting, but I can not get Ctrl+J to join the meshes either. – tmighty Sep 20 '15 at 18:57
  • 1
    At least in some cases, it appears to help if you clear parents of the objects being joined. – Samuli Pahaoja Nov 28 '15 at 11:30
  • @TNTman20002: Select one vertex/edge/face from the group that you want to select then press Ctrl + L to select all connected. – Andrei B. Jan 22 '16 at 12:04
  • FYI for this to work, the objects are to be visible. – Zéiksz Nov 18 '17 at 19:58
  • In the current versions of Blender only pressing Ctrl+J is enough, objects will be joined right after that – Mr Zak May 12 '18 at 12:47
  • In my case, it worked only in object mode. – Skoua Jan 12 '21 at 22:17
  • after doing this and exporting as a gltf, there still seem to be 'children' objects with separate meshes and geometry, any idea if is there something else needed to be done in order to combine for gltf export and import too? – timhc22 Jan 04 '22 at 16:50
9

As you have stated that you want to also make the objects "lighter", I have a suggestion for you.

The models that are not optimized for games usually have a lot of unnecessary edge loops which add extra triangles. While they can be removed using the Decimator modifier, the more proper way to do it is to use the Limited Dissolve command.

After combining the objects into one, just TAB into edit mode, press A two times to select all faces and then press X and select Limited Dissolve.

This will combine all the planar connected faces into one face and thus reducing the number of triangles.

Andrei B.
  • 191
  • 1
  • 2
  • Thanks, this made the biggest difference for me. After exporting MagicaVoxel > .obj and joining meshes, the Limited Dissolve command reduced .obj filesize 80mb to 5mb. – Mr. JavaScript Mar 09 '22 at 06:00
2

If you want to join meshes through Blender's Python API:

item='MESH'
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_by_type(type=item)
bpy.ops.object.join()

where item can take any of the following values according to this documentation:

[‘MESH’, ‘CURVE’, ‘SURFACE’, ‘META’, ‘FONT’, ‘ARMATURE’, ‘LATTICE’, ‘EMPTY’, ‘CAMERA’, ‘LAMP’, ‘SPEAKER’]
Amir
  • 3,074
  • 2
  • 29
  • 55