0

I am trying to render a set of lines through an OBJ file and the matching MTL file. The import does not give an error and the MTL seem to be correctly imported. But the render image is empty. I am a noob to blender and any help is highly appreciated. I have attached the links to the files below. Thanks.

MTL: https://drive.google.com/open?id=0B-TWCTRv7UM1VTl4SWo2Zy1ZYmM

OBJ: https://drive.google.com/open?id=0B-TWCTRv7UM1TWdJREQzWnE2NFU

ssm
  • 101
  • You have to create proper materials for the imported objects, MTL materials are temporary stubs for placeholder basic texturing, not final materials. You can't rely on them for actual production images. Also what do you mean "render a set of lines through an OBJ" you can't really render just lines, there has to be actual renderable geometry to be able to produce images. – Duarte Farrajota Ramos Oct 25 '16 at 22:42
  • See http://blender.stackexchange.com/questions/53036/issue-with-importing-3d-models-into-blender/53037#53037 or http://blender.stackexchange.com/questions/57531/fbx-export-why-there-are-no-materials-or-textures/57541#57541 about materials – Duarte Farrajota Ramos Oct 25 '16 at 22:44

2 Answers2

1

Your object only consists of connected vertices, it does not have any faces.

Blender needs faces to render an image.

no faces no image

metaphor_set
  • 6,625
  • 2
  • 22
  • 35
  • The object is a set of lines. If I delete the MTL file links from the OBJ file, I can add a single color to the whole object and render that. Also, if I put a environment light, will it help? – ssm Oct 25 '16 at 22:57
  • As I said, you need faces to get something to render. Vertices and lines aren't enough. Try it. Take the cube of the default scene, go to edit mode, hit "A" to select everything, then "X" and select "only Faces". Add a material and try to render that. Nothing will appear. No faces, no geometry to get light bounces from, no image. – metaphor_set Oct 26 '16 at 00:37
  • Hi, I can get something to bounce light if I select the material as wire. Am I wrong? And I can render that and get a color. – ssm Oct 26 '16 at 13:08
0

I was able to get a render out of the OBJ and MTL file finally by following the folowing steps. Granted I had to modify the OBJ file tool. OBJ modification: Add g mtl_i above each usemtl mtl_i line.

I also used the following script in blender to change material properties.

for i in D.objects:
    if i.name.startswith('mtl'):
        i.active_material.type='WIRE'
        i.active_material.use_transparency=True
        i.active_material.alpha=0.4
        i.active_material.transparency_method='Z_TRANSPARENCY'
        i.active_material.use_shadows=False
        i.active_material.use_cast_shadows=False 
ssm
  • 101