1
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ 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! $\endgroup$
    – Chris
    Commented Oct 11, 2022 at 5:36

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ Thank you, Chris, i had to add vertex colors from shading to the material properties. $\endgroup$ Commented Oct 12, 2022 at 2:55
0
$\begingroup$

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

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .