3
$\begingroup$

Was looking around for how to have properties from blender in the notes for the render stamp. I found a solution although with many properties I would like to add a newline or carriage return to format the output so that I can have a block on the side of the frame rather than running the length of the frame.

Found this: How to show render-stamp for arbitrary values?

The sample script in the answers Works great! A little further on the answer refers to:

New Lines

As of 2.77 the note will be wrapped onto new lines, you can also add in explicit \n newline characters to format the text yourself.

I just can't understand where and how to put that /n.

$\endgroup$

1 Answer 1

3
$\begingroup$

Newline using \n

\n in Python is the newline character.

Execute the lines in python.

import bpy
bpy.context.scene.render.stamp_note_text = "Line 1.\nLine2."

You will see a nondisplayable character show up in the note field of the stamp. (It is a newline character, which can't display in a single line textbox.) Rendering it, properly display the newline.

enter image description here


Automatic wrapping

As of 2.77 the note will be wrapped onto new lines [...]

This refers to too long text snippes being automatically wrapped. A test seems to show a limit in characters though.

enter image description here

$\endgroup$
4
  • $\begingroup$ In the line note = "Samples: " + str(scene.cycles.samples) I added a /n in the quotes after "Samples:/n" and I don't get a newline, just a /n. $\endgroup$
    – eh-five
    Commented Nov 26, 2017 at 14:43
  • $\begingroup$ Use a backslash! '\n' not '/n'. $\endgroup$
    – Leander
    Commented Nov 26, 2017 at 16:08
  • $\begingroup$ works! Thank You very much, sorry for my denseness. $\endgroup$
    – eh-five
    Commented Nov 26, 2017 at 16:20
  • $\begingroup$ @eh-five No problem, if this answer solved your problem, please mark it as accepted. $\endgroup$
    – Leander
    Commented Nov 28, 2017 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .