1

I'm very new to blender, I have imported a mesh into blender with vertex colors and I can see the colors appear in the blender screen and the camera view, however when i save the image it appears to have lost all color information.

The code I'm using to capture images is

 bpy.context.scene.render.filepath = "/home/josyula/Programs/blender/img.jpg"
 bpy.context.scene.render.image_settings.file_format='JPEG'
 bpy.ops.render.render(use_viewport = True, write_still=True)

enter image description here

I have attached the images of rendering screen and the saved image enter image description here

Link to the blender file https://drive.google.com/file/d/1asN-aypVgeKlIknQs20ApAJ0clVc-TSR/view?usp=sharing

  • thumbs up for your beginner question! you told us you are beginner (which makes the search for errors for us much quicker), you inserted images and provided a blend file -> top! – Chris Oct 11 '22 at 05:36

2 Answers2

1

It is because your object has simply no material at all.

enter image description here

so press new, change the color and voila - you have a color.

The color you see in the viewport is just a vertex color, which won't be rendered if it isn't used by nodes in the material.

Chris
  • 59,454
  • 6
  • 30
  • 84
0

I had to add vertex colors from the material properties as Chris pointed out.

The answer that really helped me is How can vertex paint be rendered?

enter image description here