mikedh/trimesh

Set material of a Scene to eliminate of effect of direction

Opened this issue · 0 comments

Hey,
I'm doing similar thing as in #193

I want to have a mesh rendered without the effect of lights, that is, same color in all directions.
Sofar I have tried set the materal only ambient to 1or only diffuse to 1, and the light intensity to zero but none of then seems to work.

            for geom in scene.geometry.values():
                geom.visual.material = trimesh.visual.material.SimpleMaterial(
                    ambient=[1,1, 1, 1],
                    diffuse=[0, 0, 0, 0],
                    specular=[0, 0, 0, 0],
                    shininess=0  # No shininess
                )
            for l in scene.lights:
                l.intensity = 0.0
            background_color = [0, 0, 0, 255]  # Black background for mask
        png = scene.save_image(resolution=self.output_resolution,
                               visible=True,
                               background=background_color)

Am I doing something wrong here? Or it's just not supported? >
semantic_mask_0
Thanks!