LogicReinc / LogicReinc.BlendFarm

A stand-alone Blender Network Renderer
GNU General Public License v3.0
412 stars 35 forks source link

Read rendering settings from a file #71

Closed SuLiu99 closed 11 months ago

SuLiu99 commented 1 year ago

The ability to read the rendering settings from the ".blend" file instead of customizing them, which would become cumbersome when rendering multiple different files.

LogicReinc commented 1 year ago

This is planned when some other systems get implemented, timeline for it is still a bit unclear due to being busy with work.

I hope to look into it this month though.

SuLiu99 commented 1 year ago

This is planned when some other systems get implemented, timeline for it is still a bit unclear due to being busy with work.

I hope to look into it this month though.

Thank you for your reply and I am looking forward to the subsequent updates of your project!

atoav commented 11 months ago

I did such a thing before in a different project by executing blender -b --python-expr <some-code-that-prints-the-relevant-settings> and reading the printed output.

E.g. something like this:

import bpy
scene = bpy.context.scene
print(f'DATA.CYCLES.SAMPLES: {scene.cycles.samples}')
print(f'DATA.RENDER.RESOLUTION_X: {scene.render.resolution_x}')
print(f'DATA.RENDER.RESOLUTION_Y: {scene.render.resolution_y}')
print(f'DATA.RENDER.RESOLUTION_PERCENTAGE: {scene.render.resolution_percentage}')
print(f'DATA.FRAME_START: {scene.frame_start}')
print(f'DATA.FRAME_END: {scene.frame_end}')
print(f'DATA.FRAME_STEP: {scene.frame_step}')
print(f'DATA.RENDER.FILEPATH: {scene.render.filepath}')

and then I parsed the stdout for everything starting with DATA.

A minor fix for usabilty would be to persist the last settings people chose in cases where it makes sense (e.g. samples, resolution, frame range).

LogicReinc commented 11 months ago

This is already implemented for the upcoming build. Its a bit more complex since we can't assume Blender even exists on the local machine. So it involves routing everything over the network. But yea, this should be mostly already done @atoav .

Solved in upcoming 1.1.5