TylerGubala / blenderpy

Blender as a python module with easy-install
GNU General Public License v3.0
314 stars 30 forks source link

Make bpy silent #64

Open caniko opened 3 years ago

caniko commented 3 years ago

Is your feature request related to a problem? Please describe. I am running export as obj function (bpy.ops.export_scene.obj) in bpy. I don't want to get the logs of the function printed to the terminal. Would be nice to have a silencing method in bpy.

Describe the solution you'd like An environment variable to turn of logging.

Describe alternatives you've considered None

TylerGubala commented 3 years ago

Hi,

I don't have much say as to what features get added into Blender.

Furthermore, the Blender Developers are far more concerned with the main application, and the recommendation for silencing output from the main application is to redirect to /dev/null or something alike.

I think this is a great idea, and I wholeheartedly agree, but this is a better question asked on the Blender Dev Talk.

I'll keep it open for now, as more discussion is welcome here.

You may also be interested in temporarily rerouting stdout. See this stackoverflow post:

https://blender.stackexchange.com/a/34221

caniko commented 3 years ago

Thanks for the tip! Very helpful.

ldo commented 3 years ago

Rerouting stdout seems like the way to go. That’s what I do in my batch-mode scripts (which could be rewritten more easily with Blender built as a Python module, but there you go...).