render_pre callback doesn't fully work for render.border settings #47791

Closed
opened 2016-03-14 13:28:35 +01:00 by Dalai Felinto · 8 comments

System Information
Windows 10 and OSX 10.11.2

Blender Version
Broken: 2.77 (ec99778)

Short description of error

If I set the render border in the render_pre callback, the value is not valid for this render. Instead I have to render once again to have it being used.

Exact steps for others to reproduce the error

Open this file and render: render_pre.blend, the border will only be "used" the second time you render it

The file simply has the following script (make sure the script runs):

import bpy

@bpy.app.handlers.persistent
def render_pre(scene):
    scene.render.use_border = True

def main():
    scene = bpy.context.scene
    scene.render.use_border = False
    scene.render.border_min_x = 0.5
    bpy.app.handlers.render_pre.append(render_pre)

main()
**System Information** Windows 10 and OSX 10.11.2 **Blender Version** Broken: 2.77 (ec99778) **Short description of error** If I set the render border in the `render_pre` callback, the value is not valid for this render. Instead I have to render once again to have it being used. **Exact steps for others to reproduce the error** Open this file and render: [render_pre.blend](https://archive.blender.org/developer/F290651/render_pre.blend), the border will only be "used" the second time you render it The file simply has the following script (make sure the script runs): ``` import bpy @bpy.app.handlers.persistent def render_pre(scene): scene.render.use_border = True def main(): scene = bpy.context.scene scene.render.use_border = False scene.render.border_min_x = 0.5 bpy.app.handlers.render_pre.append(render_pre) main() ```
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @dfelinto

Added subscriber: @dfelinto
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Author
Owner

@ideasman42 is this by design?

@ideasman42 is this by design?

Added subscriber: @Sergey

Added subscriber: @Sergey

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sergey Sharybin self-assigned this 2016-03-15 10:01:35 +01:00

@dfelinto, render_pre handler is called after the main render database is filled in. In order to achieve your goal you should be using render_init handler which is called before the main database is filled in.

Thanks for the report, but it's not a bug as far as i concerned.

@dfelinto, `render_pre` handler is called after the main render database is filled in. In order to achieve your goal you should be using `render_init` handler which is called before the main database is filled in. Thanks for the report, but it's not a bug as far as i concerned.

We could support it, discussion on this patch D1566 covers issues here.

Could you try using the render_init callback (this runs before the render border is read from the scene).


edit - i see @Sergey replied :), note - that there are multiple settings you might want to edit for rendering and there is some remaining order-of-initialization things going on (why I linked to the diff above).
However seems border-render can be made to work.

We could support it, discussion on this patch [D1566](https://archive.blender.org/developer/D1566) covers issues here. Could you try using the `render_init` callback (this runs before the render border is read from the scene). ---- edit - i see @Sergey replied :), note - that there are multiple settings you might want to edit for rendering and there is some remaining order-of-initialization things going on (why I linked to the diff above). However seems border-render can be made to work.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#47791
No description provided.