DIYer22 / bpycv

Computer vision utils for Blender (generate instance annoatation, depth and 6D pose by one line code)
MIT License
470 stars 58 forks source link

change/add color/texture on the box generated via add_environment_box #28

Closed shadowwkl closed 2 years ago

shadowwkl commented 2 years ago

Hi authors,

I wonder if there is a way to add or change the color or texture for the box generated via add_environment_box method? Currently, it looks white/milk. I didn't find any information in the source code regarding the color/appearance.

Thanks!

DIYer22 commented 2 years ago

You can cread material add ShaderNodeBsdfDiffuse Node, and set bsdf_node.Color with color or image, like this: https://github.com/DIYer22/bpycv/blob/master/bpycv/scene_setting.py#L85

shadowwkl commented 2 years ago

You can cread material add ShaderNodeBsdfDiffuse Node, and set bsdf_node.Color with color or image, like this: https://github.com/DIYer22/bpycv/blob/master/bpycv/scene_setting.py#L85

Thanks! I manage to do it. For clarification, what I do is following https://github.com/DIYer22/bpycv/blob/3768e3efdedb328b64df84f7edb4e5cf6fb7e0b4/bpycv/scene_setting.py#L75-L95 , except https://github.com/DIYer22/bpycv/blob/3768e3efdedb328b64df84f7edb4e5cf6fb7e0b4/bpycv/scene_setting.py#L87-L94